/**
 * Frontend styles for NRNA Institution Registry
 */

/* Institution Registration Form Wrapper */
.nrna-institution-form-wrapper {
    max-width: 900px;
    margin: 0 auto;
    padding: 20px;
}

.nrna-form-title {
    text-align: center;
    color: #333;
    margin-bottom: 30px;
    font-size: 28px;
    font-weight: 600;
}

/* Institution Registration Form */
.nrna-institution-form {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    padding: 30px;
    margin-bottom: 30px;
}

/* Form Sections */
.nrna-form-section {
    margin-bottom: 40px;
    padding-bottom: 30px;
    border-bottom: 1px solid #eee;
}

.nrna-form-section:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

.nrna-form-section h3 {
    color: #333;
    margin: 0 0 20px 0;
    font-size: 20px;
    font-weight: 600;
    border-left: 4px solid #0073aa;
    padding-left: 15px;
}

.section-description {
    margin-bottom: 20px;
    color: #666;
    font-style: italic;
}

.nrna-form-row {
    margin-bottom: 20px;
}

.nrna-form-row label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
    color: #333;
}

.nrna-form-row input[type="text"],
.nrna-form-row input[type="email"],
.nrna-form-row input[type="tel"],
.nrna-form-row input[type="url"],
.nrna-form-row input[type="date"],
.nrna-form-row input[type="file"],
.nrna-form-row textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    transition: border-color 0.3s;
    box-sizing: border-box;
}

.nrna-form-row input.error,
.nrna-form-row textarea.error {
    border-color: #e74c3c;
    box-shadow: 0 0 0 2px rgba(231, 76, 60, 0.1);
}

.nrna-form-row input:focus,
.nrna-form-row textarea:focus {
    outline: none;
    border-color: #0073aa;
    box-shadow: 0 0 0 2px rgba(0,115,170,0.1);
}

.nrna-form-row.required label:after {
    content: " *";
    color: #e74c3c;
}

.nrna-form-row .field-description {
    font-size: 12px;
    color: #666;
    margin-top: 5px;
}

/* Officials Section */
.nrna-officials-section {
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 15px;
    margin: 15px 0;
}

.nrna-officials-section h4 {
    margin: 0 0 15px 0;
    color: #333;
}

.nrna-official-item {
    background: #f9f9f9;
    padding: 15px;
    margin-bottom: 10px;
    border-radius: 4px;
    border: 1px solid #eee;
}

.nrna-official-row {
    display: flex;
    gap: 15px;
    margin-bottom: 10px;
}

.nrna-official-row .form-field {
    flex: 1;
}

.nrna-official-row label {
    display: block;
    margin-bottom: 3px;
    font-size: 13px;
    font-weight: 500;
}

.nrna-official-row input {
    width: 100%;
    padding: 8px;
    border: 1px solid #ccc;
    border-radius: 3px;
    font-size: 14px;
}

.nrna-remove-official {
    background: #e74c3c;
    color: white;
    border: none;
    padding: 5px 10px;
    border-radius: 3px;
    cursor: pointer;
    font-size: 12px;
    margin-top: 20px;
}

.nrna-remove-official:hover {
    background: #c0392b;
}

.nrna-add-official {
    background: #27ae60;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    margin-top: 10px;
}

.nrna-add-official:hover {
    background: #229954;
}

/* Checkbox Labels */
.checkbox-label {
    display: flex !important;
    align-items: flex-start;
    gap: 10px;
    font-weight: normal !important;
    cursor: pointer;
}

.checkbox-label input[type="checkbox"] {
    width: auto !important;
    margin: 0;
    margin-top: 2px;
}

/* Form Instructions */
.nrna-form-instructions {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 20px;
    margin-top: 20px;
}

.nrna-form-instructions h4 {
    color: #333;
    margin: 0 0 15px 0;
    font-size: 16px;
}

.nrna-form-instructions ul {
    margin: 0;
    padding-left: 20px;
}

.nrna-form-instructions li {
    margin-bottom: 8px;
    color: #666;
}

/* File Upload */
.nrna-file-upload {
    border: 2px dashed #ddd;
    border-radius: 4px;
    padding: 20px;
    text-align: center;
    transition: border-color 0.3s;
    position: relative;
}

.upload-instructions {
    font-size: 12px;
    color: #666;
    margin-top: 10px;
}

.nrna-file-upload:hover {
    border-color: #0073aa;
}

.nrna-file-upload input[type="file"] {
    margin-bottom: 10px;
}

.nrna-file-preview {
    margin-top: 10px;
}

.nrna-file-preview img {
    max-width: 200px;
    height: auto;
    border: 1px solid #ddd;
    border-radius: 4px;
}

/* Submit Button */
.nrna-submit-btn {
    background: #0073aa;
    color: white;
    border: none;
    padding: 15px 30px;
    border-radius: 4px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.3s;
    width: 100%;
    margin-top: 20px;
}

.nrna-submit-btn:hover {
    background: #005a87;
}

.nrna-submit-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
}

/* Messages */
.nrna-message {
    padding: 15px;
    border-radius: 4px;
    margin: 20px 0;
}

.nrna-message.success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.nrna-message.error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* Institution List */
.nrna-institutions-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin: 20px 0;
}

.nrna-institution-card {
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    transition: transform 0.2s, box-shadow 0.2s;
}

.nrna-institution-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0,0,0,0.15);
}

.nrna-institution-logo {
    text-align: center;
    margin-bottom: 15px;
}

.nrna-institution-logo img {
    max-width: 80px;
    height: 80px;
    object-fit: contain;
    border-radius: 4px;
}

.nrna-institution-name {
    font-size: 18px;
    font-weight: 600;
    color: #333;
    margin-bottom: 10px;
    text-align: center;
}

.nrna-institution-details {
    font-size: 14px;
    color: #666;
    line-height: 1.5;
}

.nrna-institution-details .detail-row {
    margin-bottom: 5px;
}

.nrna-institution-details strong {
    color: #333;
}

/* Pagination */
.nrna-pagination {
    text-align: center;
    margin: 30px 0;
}

.nrna-pagination .page-numbers {
    display: inline-block;
    padding: 8px 12px;
    margin: 0 2px;
    border: 1px solid #ddd;
    border-radius: 4px;
    text-decoration: none;
    color: #333;
    transition: background 0.2s;
}

.nrna-pagination .page-numbers:hover,
.nrna-pagination .page-numbers.current {
    background: #0073aa;
    color: white;
    border-color: #0073aa;
}

/* Loading States */
.nrna-loading {
    opacity: 0.6;
    pointer-events: none;
}

.nrna-spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #0073aa;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-right: 10px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Responsive Design */
@media (max-width: 768px) {
    .nrna-institution-form {
        margin: 10px;
        padding: 15px;
    }

    .nrna-official-row {
        flex-direction: column;
        gap: 10px;
    }

    .nrna-institutions-grid {
        grid-template-columns: 1fr;
        gap: 15px;
        margin: 15px;
    }
}

/* Accessibility */
.screen-reader-text {
    clip: rect(1px, 1px, 1px, 1px);
    position: absolute !important;
    height: 1px;
    width: 1px;
    overflow: hidden;
}

/* Focus styles for better accessibility */
.nrna-institution-form input:focus,
.nrna-institution-form textarea:focus,
.nrna-institution-form button:focus {
    outline: 2px solid #0073aa;
    outline-offset: 2px;
}