/* ReferralInformationModal.css */

.referral-info-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10002;
}

.referral-info-modal {
    background: white;
    border-radius: 12px;
    width: 95%;
    max-width: 900px;
    max-height: 92vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    overflow: hidden;
}

.referral-info-modal .modal-header {
    background: linear-gradient(135deg, #ec5f59 0%, #D4605A 100%);
    color: white;
    padding: 1rem 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
}

.referral-info-modal .modal-header h2 {
    margin: 0;
    font-size: 1.2rem;
    font-family: 'Baloo 2', 'Quicksand', sans-serif;
}

.referral-info-modal .close-btn {
    background: rgba(255,255,255,0.2);
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.referral-info-modal .close-btn:hover {
    background: rgba(255,255,255,0.3);
}

.referral-info-modal .modal-body {
    padding: 1.5rem;
    overflow-y: auto;
    flex: 1;
}

.referral-info-modal .modal-footer {
    padding: 1rem 1.5rem;
    background: #f8f9fa;
    border-top: 1px solid #e1e5e9;
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    flex-shrink: 0;
}

/* Section styling */
.referral-section {
    margin-bottom: 1.5rem;
    border: 1px solid #e1e5e9;
    border-radius: 8px;
    overflow: hidden;
}

.referral-section-header {
    background: linear-gradient(135deg, #ec5f59 0%, #D4605A 100%);
    padding: 0.75rem 1rem;
    border-bottom: 1px solid #e1e5e9;
}

.referral-section-header h3 {
    margin: 0;
    font-size: 1rem;
    color: white;
    font-family: 'Baloo 2', 'Quicksand', sans-serif;
}

.referral-section-header p {
    margin: 0.25rem 0 0;
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.85);
}

.referral-section-body {
    padding: 1rem;
}

/* Form rows */
.referral-form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 0.75rem;
}

.referral-form-row.three-col {
    grid-template-columns: 1fr 1fr 1fr;
}

.referral-form-row.single {
    grid-template-columns: 1fr;
}

.referral-form-group {
    display: flex;
    flex-direction: column;
}

.referral-form-group label {
    font-size: 0.85rem;
    font-weight: 600;
    color: #372562;
    margin-bottom: 0.3rem;
}

.referral-form-group input,
.referral-form-group select,
.referral-form-group textarea {
    padding: 0.5rem 0.75rem;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 0.9rem;
    font-family: inherit;
    color: #372562;
    transition: border-color 0.2s;
}

.referral-form-group input:focus,
.referral-form-group select:focus,
.referral-form-group textarea:focus {
    outline: none;
    border-color: #ec5f59;
    box-shadow: 0 0 0 2px rgba(232, 114, 106, 0.15);
}

.referral-form-group textarea {
    resize: vertical;
    min-height: 80px;
}

/* Checkbox grid for areas of difficulty */
.checkbox-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
}

.checkbox-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
}

.checkbox-item input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: #ec5f59;
    cursor: pointer;
}

.checkbox-item span {
    font-size: 0.9rem;
    color: #372562;
}

/* Rating table */
.rating-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
}

.rating-table th {
    padding: 0.5rem;
    text-align: center;
    font-weight: 600;
    font-size: 0.8rem;
}

.rating-table th.question-col {
    text-align: left;
    width: 55%;
}

.rating-table th.rarely-col {
    background: #fde8e8;
    color: #c53030;
    border-radius: 4px 4px 0 0;
    width: 15%;
}

.rating-table th.sometimes-col {
    background: #fff3cd;
    color: #856404;
    border-radius: 4px 4px 0 0;
    width: 15%;
}

.rating-table th.often-col {
    background: #d4edda;
    color: #155724;
    border-radius: 4px 4px 0 0;
    width: 15%;
}

/* Other Areas concern columns */
.rating-table th.significant-col {
    background: #fde8e8;
    color: #c53030;
    border-radius: 4px 4px 0 0;
    width: 15%;
}

.rating-table th.some-col {
    background: #fff3cd;
    color: #856404;
    border-radius: 4px 4px 0 0;
    width: 15%;
}

.rating-table th.no-real-col {
    background: #d4edda;
    color: #155724;
    border-radius: 4px 4px 0 0;
    width: 15%;
}

.rating-table td {
    padding: 0.5rem;
    border-bottom: 1px solid #eee;
    color: #372562;
}

.rating-table td:not(:first-child) {
    text-align: center;
}

.rating-table td input[type="radio"] {
    width: 18px;
    height: 18px;
    accent-color: #ec5f59;
    cursor: pointer;
}

.rating-table .comments-row td {
    padding-top: 0.5rem;
}

.rating-table .comments-row textarea {
    width: 100%;
    padding: 0.5rem;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 0.85rem;
    font-family: inherit;
    color: #372562;
    resize: vertical;
    min-height: 50px;
}

/* Yes/No radio group */
.yes-no-group {
    display: flex;
    gap: 1.5rem;
    align-items: center;
}

.yes-no-group label {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    cursor: pointer;
    font-weight: normal !important;
    font-size: 0.9rem;
    color: #372562;
}

.yes-no-group input[type="radio"] {
    width: 16px;
    height: 16px;
    accent-color: #ec5f59;
}

/* NHS referral conditional fields */
.nhs-conditional {
    margin-top: 0.75rem;
    padding: 0.75rem;
    background: #f8f5ff;
    border-radius: 6px;
    border: 1px solid #C8DDD8;
}

/* File upload area */
.file-upload-area {
    border: 2px dashed #d1d5db;
    border-radius: 8px;
    padding: 1rem;
    text-align: center;
    background: #fafafa;
    transition: border-color 0.2s;
}

.file-upload-area:hover {
    border-color: #ec5f59;
}

.file-upload-area input[type="file"] {
    margin-top: 0.5rem;
}

.uploaded-files-list {
    margin-top: 0.75rem;
}

.uploaded-file-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.4rem 0.75rem;
    background: #d4edda;
    border-radius: 4px;
    margin-bottom: 0.3rem;
    font-size: 0.85rem;
}

.uploaded-file-item .file-name {
    color: #155724;
}

.uploaded-file-item .remove-file {
    background: none;
    border: none;
    color: #c53030;
    cursor: pointer;
    font-size: 1.1rem;
    padding: 0 0.25rem;
}

/* Buttons */
.referral-info-modal .btn {
    padding: 0.6rem 1.5rem;
    border: none;
    border-radius: 6px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.referral-info-modal .btn-primary {
    background: linear-gradient(135deg, #ec5f59 0%, #D4605A 100%);
    color: white;
}

.referral-info-modal .btn-primary:hover {
    opacity: 0.9;
}

.referral-info-modal .btn-primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.referral-info-modal .btn-secondary {
    background: #e1e5e9;
    color: #333;
}

.referral-info-modal .btn-secondary:hover {
    background: #d1d5d9;
}

/* Completion indicator */
.completion-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.2rem 0.6rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
}

.completion-badge.complete {
    background: #d4edda;
    color: #155724;
}

.completion-badge.incomplete {
    background: #fff3cd;
    color: #856404;
}

/* Validation error */
.field-error {
    border-color: #feb2b2 !important;
}

.error-text {
    color: #c53030;
    font-size: 0.8rem;
    margin-top: 0.2rem;
}

/* Responsive */
@media (max-width: 768px) {
    .referral-form-row {
        grid-template-columns: 1fr;
    }
    .referral-form-row.three-col {
        grid-template-columns: 1fr;
    }
    .checkbox-grid {
        grid-template-columns: 1fr;
    }
}

/* Inline mode - no overlay, no modal chrome */
.referral-info-inline {
    width: 100%;
}

.referral-info-inline .referral-section {
    margin-bottom: 1rem;
}

/* Referral Info Tabs */
.referral-tabs {
    display: flex;
    gap: 0.25rem;
    padding: 0 1.5rem;
    margin-bottom: 1rem;
    border-bottom: 2px solid #e5e7eb;
    background: #f8f9fa;
    overflow-x: auto;
}

.referral-tab-btn {
    padding: 0.6rem 1rem;
    font-size: 0.82rem;
    font-weight: 500;
    color: #6b7280;
    background: transparent;
    border: none;
    border-bottom: 3px solid transparent;
    cursor: pointer;
    white-space: nowrap;
    transition: color 0.2s, border-color 0.2s;
    margin-bottom: -2px;
}

.referral-tab-btn:hover {
    color: #372562;
}

.referral-tab-btn.active {
    color: #ec5f59;
    font-weight: 600;
    border-bottom-color: #ec5f59;
}
