/**
 * Exam Session Manager Styles - Professional Medical UI
 * Thiết kế hiện đại, tinh tế cho phần mềm y khoa chuyên nghiệp
 * Color Palette: Medical Blue (#2563eb), Teal (#0d9488), Clean Grays
 */

/* ===== CSS CUSTOM PROPERTIES ===== */
:root {
    --exam-primary: #2563eb;
    --primary-hover: #1d4ed8;
    --primary-light: #eff6ff;
    
    --exam-danger: #dc2626;
    --danger-hover: #b91c1c;
    --danger-light: #fef2f2;
    
    --exam-success: #059669;
    --success-hover: #047857;
    --success-light: #ecfdf5;
    
    --exam-teal: #0d9488;
    --teal-hover: #0f766e;
    --teal-light: #f0fdfa;
    
    --exam-warning: #d97706;
    --warning-light: #fffbeb;
    
    --gray-50: #f9fafb;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-300: #d1d5db;
    --gray-400: #9ca3af;
    --gray-500: #6b7280;
    --gray-600: #4b5563;
    --gray-700: #374151;
    --gray-800: #1f2937;
    --gray-900: #111827;
    
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
    --shadow-glow: 0 0 20px rgba(37, 99, 235, 0.15);
    
    --radius-sm: 6px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;
    
    --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-base: 200ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 300ms cubic-bezier(0.4, 0, 0.2, 1);
}

/* ===== EXAM SESSION CONTAINER IN NAVBAR ===== */
.exam-session-container {
    display: flex;
    align-items: center;
    margin-right: 12px;
    gap: 10px;
    padding: 4px 8px;
    background: linear-gradient(135deg, var(--gray-50) 0%, var(--gray-100) 100%);
    border-radius: var(--radius-lg);
    border: 1px solid var(--gray-200);
    box-shadow: var(--shadow-sm);
}

.exam-status-container {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 14px;
    background: linear-gradient(135deg, var(--primary-light) 0%, #dbeafe 100%);
    border-radius: var(--radius-md);
    border: 1px solid #bfdbfe;
    box-shadow: inset 0 1px 2px rgba(37, 99, 235, 0.05);
}

.exam-status-text {
    font-size: 13px;
    color: var(--gray-800);
    font-weight: 600;
    white-space: nowrap;
    letter-spacing: 0.01em;
}

/* ===== BUTTONS ===== */
.exam-btn {
    padding: 9px 18px;
    border: none;
    border-radius: var(--radius-md);
    font-size: 13.5px;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-base);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', sans-serif;
    letter-spacing: 0.015em;
    position: relative;
    overflow: hidden;
}

.exam-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(180deg, rgba(255,255,255,0.15) 0%, rgba(255,255,255,0) 100%);
    opacity: 0;
    transition: opacity var(--transition-fast);
}

.exam-btn:hover::before {
    opacity: 1;
}

.exam-btn:hover {
    transform: translateY(-1px);
}

.exam-btn:active {
    transform: translateY(0);
}

.exam-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none !important;
}

/* Start Exam Button - Primary Blue */
.start-exam-btn {
    background: linear-gradient(135deg, var(--exam-primary) 0%, #3b82f6 100%);
    color: white;
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.3), var(--shadow-sm);
}

.start-exam-btn:hover {
    background: linear-gradient(135deg, var(--primary-hover) 0%, var(--exam-primary) 100%);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.4), var(--shadow-md);
}

/* End Exam Button - Danger Red */
.end-exam-btn {
    background: linear-gradient(135deg, var(--exam-danger) 0%, #ef4444 100%);
    color: white;
    padding: 6px 14px;
    font-size: 12.5px;
    box-shadow: 0 2px 6px rgba(220, 38, 38, 0.25), var(--shadow-sm);
}

.end-exam-btn:hover {
    background: linear-gradient(135deg, var(--danger-hover) 0%, var(--exam-danger) 100%);
    box-shadow: 0 4px 10px rgba(220, 38, 38, 0.35), var(--shadow-md);
}

/* Submit Button */
.submit-btn {
    background: linear-gradient(135deg, var(--exam-primary) 0%, #3b82f6 100%);
    color: white;
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.3), var(--shadow-sm);
}

.submit-btn:hover {
    background: linear-gradient(135deg, var(--primary-hover) 0%, var(--exam-primary) 100%);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.4), var(--shadow-md);
}

/* Cancel Button - Gray */
.cancel-btn {
    background: linear-gradient(135deg, var(--gray-500) 0%, var(--gray-400) 100%);
    color: white;
    box-shadow: var(--shadow-sm);
}

.cancel-btn:hover {
    background: linear-gradient(135deg, var(--gray-600) 0%, var(--gray-500) 100%);
    box-shadow: var(--shadow-md);
}

/* Print Button - Green */
.print-btn {
    background: linear-gradient(135deg, var(--exam-success) 0%, #10b981 100%);
    color: white;
    box-shadow: 0 2px 8px rgba(5, 150, 105, 0.3), var(--shadow-sm);
}

.print-btn:hover {
    background: linear-gradient(135deg, var(--success-hover) 0%, var(--exam-success) 100%);
    box-shadow: 0 4px 12px rgba(5, 150, 105, 0.4), var(--shadow-md);
}

/* Export PDF Button - Teal */
.export-pdf-btn {
    background: linear-gradient(135deg, var(--exam-teal) 0%, #14b8a6 100%);
    color: white;
    box-shadow: 0 2px 8px rgba(13, 148, 136, 0.3), var(--shadow-sm);
}

.export-pdf-btn:hover {
    background: linear-gradient(135deg, var(--teal-hover) 0%, var(--exam-teal) 100%);
    box-shadow: 0 4px 12px rgba(13, 148, 136, 0.4), var(--shadow-md);
}

/* View Results Button - Indigo */
.view-btn {
    background: linear-gradient(135deg, #6366f1 0%, #818cf8 100%);
    color: white;
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.3), var(--shadow-sm);
}

.view-btn:hover {
    background: linear-gradient(135deg, #4f46e5 0%, #6366f1 100%);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.4), var(--shadow-md);
}

/* Reset Button */
.reset-btn {
    background: linear-gradient(135deg, var(--exam-primary) 0%, #3b82f6 100%);
    color: white;
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.3), var(--shadow-sm);
}

.reset-btn:hover {
    background: linear-gradient(135deg, var(--primary-hover) 0%, var(--exam-primary) 100%);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.4), var(--shadow-md);
}

/* ===== MODAL STYLES ===== */
.exam-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(17, 24, 39, 0.6);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 9999;
    justify-content: center;
    align-items: center;
    animation: fadeIn 0.25s ease-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.exam-modal-content {
    background: linear-gradient(180deg, #ffffff 0%, var(--gray-50) 100%);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-xl), 0 0 0 1px rgba(0, 0, 0, 0.03);
    max-width: 520px;
    width: 92%;
    max-height: 90vh;
    overflow-y: auto;
    animation: slideInUp 0.35s cubic-bezier(0.16, 1, 0.3, 1);
    border: 1px solid var(--gray-200);
}

.exam-modal-content::-webkit-scrollbar {
    width: 6px;
}

.exam-modal-content::-webkit-scrollbar-track {
    background: transparent;
}

.exam-modal-content::-webkit-scrollbar-thumb {
    background: var(--gray-300);
    border-radius: 3px;
}

.exam-modal-content::-webkit-scrollbar-thumb:hover {
    background: var(--gray-400);
}

@keyframes slideInUp {
    from {
        transform: translateY(40px) scale(0.97);
        opacity: 0;
    }
    to {
        transform: translateY(0) scale(1);
        opacity: 1;
    }
}

.report-modal-content {
    max-width: 750px;
}

/* Modal Header */
.exam-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 22px 28px;
    border-bottom: 1px solid var(--gray-200);
    background: linear-gradient(180deg, var(--gray-50) 0%, #ffffff 100%);
    border-radius: var(--radius-xl) var(--radius-xl) 0 0;
}

.exam-modal-header h3 {
    margin: 0;
    font-size: 18px;
    color: var(--gray-900);
    font-weight: 700;
    letter-spacing: -0.01em;
    display: flex;
    align-items: center;
    gap: 10px;
}

.exam-modal-header h3::before {
    content: '';
    display: inline-block;
    width: 4px;
    height: 20px;
    background: linear-gradient(180deg, var(--exam-primary) 0%, #3b82f6 100%);
    border-radius: 2px;
}

/* Modal Close Button */
.exam-modal-close {
    background: var(--gray-100);
    border: 1px solid var(--gray-200);
    font-size: 22px;
    color: var(--gray-500);
    cursor: pointer;
    padding: 0;
    width: 34px;
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-md);
    transition: all var(--transition-fast);
    line-height: 1;
}

.exam-modal-close:hover {
    color: var(--gray-700);
    background: var(--gray-200);
    border-color: var(--gray-300);
}

/* Modal Body */
.exam-modal-body {
    padding: 28px;
}

/* ===== FORM STYLES ===== */
.form-group {
    margin-bottom: 22px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: var(--gray-700);
    font-size: 13.5px;
    font-weight: 600;
    letter-spacing: 0.02em;
}

.form-group input[type="text"],
.form-group input[type="number"] {
    width: 100%;
    padding: 11px 14px;
    border: 1.5px solid var(--gray-300);
    border-radius: var(--radius-md);
    font-size: 14px;
    transition: all var(--transition-base);
    box-sizing: border-box;
    font-family: inherit;
    background: #ffffff;
    color: var(--gray-900);
}

.form-group input[type="text"]:hover,
.form-group input[type="number"]:hover {
    border-color: var(--gray-400);
}

.form-group input[type="text"]:focus,
.form-group input[type="number"]:focus {
    outline: none;
    border-color: var(--exam-primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12), var(--shadow-sm);
}

.form-group input:disabled {
    background: var(--gray-100);
    color: var(--gray-400);
    cursor: not-allowed;
    border-color: var(--gray-200);
}

.form-group input::placeholder {
    color: var(--gray-400);
}

/* Checkbox Group */
.checkbox-group label {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    font-weight: 500;
    color: var(--gray-700);
    padding: 10px 14px;
    background: var(--gray-50);
    border-radius: var(--radius-md);
    border: 1px solid var(--gray-200);
    transition: all var(--transition-fast);
}

.checkbox-group label:hover {
    background: var(--gray-100);
    border-color: var(--gray-300);
}

.checkbox-group input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: var(--exam-primary);
    border-radius: 4px;
}

.checkbox-group label span {
    font-size: 14px;
    color: var(--gray-700);
}

/* Form Actions */
.form-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 28px;
    padding-top: 24px;
    border-top: 1px solid var(--gray-100);
}

/* ===== REPORT STYLES ===== */
.report-patient-info,
.report-results {
    margin-bottom: 28px;
}

.report-patient-info h4,
.report-results h4 {
    color: var(--gray-800);
    font-size: 15px;
    font-weight: 700;
    margin: 0 0 16px 0;
    padding-bottom: 10px;
    letter-spacing: 0.01em;
    position: relative;
    padding-left: 14px;
}

.report-patient-info h4::before,
.report-results h4::before {
    content: '';
    position: absolute;
    left: 0;
    top: 2px;
    bottom: 2px;
    width: 3px;
    background: linear-gradient(180deg, var(--exam-primary) 0%, #3b82f6 100%);
    border-radius: 2px;
}

/* Report Tables */
.report-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 13.5px;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

.report-table td {
    padding: 12px 14px;
    border-bottom: 1px solid var(--gray-100);
    color: var(--gray-700);
}

.report-table tr:last-child td {
    border-bottom: none;
}

.report-table td.label {
    font-weight: 600;
    color: var(--gray-600);
    width: 130px;
    background: linear-gradient(180deg, var(--gray-50) 0%, #f8fafc 100%);
    border-right: 1px solid var(--gray-100);
}

/* Results Table */
.results-table {
    margin-top: 14px;
    box-shadow: var(--shadow-md);
}

.results-table thead {
    background: linear-gradient(180deg, var(--exam-primary) 0%, #1d4ed8 100%);
}

.results-table th {
    background: transparent !important;
    color: white;
    padding: 13px 14px;
    text-align: left;
    font-weight: 600;
    font-size: 12.5px;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    border: none;
}

.results-table th:first-child {
    border-radius: 0;
}

.results-table th:last-child {
    border-radius: 0;
}

.results-table tbody tr {
    transition: background var(--transition-fast);
}

.results-table tbody tr:nth-child(even) {
    background: var(--gray-50);
}

.results-table tbody tr:hover {
    background: var(--primary-light);
}

.results-table td {
    padding: 11px 14px;
    border-bottom: 1px solid var(--gray-100);
}

.results-table td:last-child {
    color: var(--gray-500);
    font-size: 12.5px;
}

/* Empty State */
.report-patient-info p,
.report-results p {
    color: var(--gray-400);
    font-style: italic;
    text-align: center;
    padding: 24px;
    background: var(--gray-50);
    border-radius: var(--radius-md);
    border: 1px dashed var(--gray-200);
}

/* ===== TOAST NOTIFICATION ===== */
.toast-container {
    position: fixed;
    bottom: 28px;
    right: 28px;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.toast-notification {
    background: linear-gradient(135deg, rgba(31, 41, 55, 0.95) 0%, rgba(55, 65, 81, 0.95) 100%);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    color: white;
    padding: 13px 20px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl), 0 0 0 1px rgba(255, 255, 255, 0.1);
    font-size: 13.5px;
    font-weight: 500;
    animation: slideInRight 0.35s cubic-bezier(0.16, 1, 0.3, 1);
    opacity: 0;
    transform: translateX(120px);
    transition: all var(--transition-slow);
    border: 1px solid rgba(255, 255, 255, 0.1);
    max-width: 320px;
    letter-spacing: 0.01em;
}

.toast-notification.show {
    opacity: 1;
    transform: translateX(0);
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(120px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* ===== PRINT STYLES ===== */
@media print {
    /* Ẩn toàn bộ ứng dụng nhưng giải phóng không gian (KHÔNG dùng visibility: hidden) */
    body > *:not(.print-report-container) {
        display: none !important;
    }
    
    /* Reset background mặc định của trình duyệt để in */
    body {
        background: #fff !important;
        margin: 0;
        padding: 0;
    }

    .print-report-container {
        display: block !important;
        position: relative;
        width: 100%;
        color: #000;
        font-family: 'Times New Roman', serif;
    }

    /* Ràng buộc bảng in không bị vỡ trang */
    table { page-break-inside: auto; width: 100%; border-collapse: collapse; }
    tr { page-break-inside: avoid; page-break-after: auto; }
    th, td { border: 1px solid #000; padding: 8px; text-align: left; }
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
    .exam-session-container {
        margin-right: 6px;
        padding: 3px 6px;
    }

    .exam-status-text {
        font-size: 11px;
        max-width: 140px;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .exam-modal-content {
        width: 96%;
        margin: 12px;
        border-radius: var(--radius-lg);
    }

    .exam-modal-header {
        padding: 18px 20px;
    }

    .exam-modal-body {
        padding: 20px;
    }

    .form-actions {
        flex-direction: column-reverse;
    }

    .form-actions .exam-btn {
        width: 100%;
    }

    .toast-container {
        bottom: 16px;
        right: 16px;
        left: 16px;
    }

    .toast-notification {
        max-width: 100%;
    }
}

/* ===== ACCESSIBILITY ===== */
@media (prefers-reduced-motion: reduce) {
    .exam-modal,
    .exam-modal-content,
    .toast-notification {
        animation: none;
        transition: none;
    }
}

/* Focus visible for keyboard navigation */
.exam-btn:focus-visible,
.exam-modal-close:focus-visible,
.form-group input:focus-visible {
    outline: 2px solid var(--exam-primary);
    outline-offset: 2px;
}

/* ===== FLOATING ACTION BUTTON (FAB) ===== */
.manual-save-fab {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 9998;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 14px 20px;
    background: rgba(17, 24, 39, 0.75);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 14px;
    color: #ffffff;
    font-size: 14px;
    font-weight: 600;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', sans-serif;
    cursor: pointer;
    opacity: 0.4;
    transform: scale(1);
    transition: all var(--transition-base);
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);
    letter-spacing: 0.02em;
}

.manual-save-fab:hover {
    opacity: 1;
    transform: scale(1.05);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.35);
}

.manual-save-fab:active {
    transform: scale(0.98);
}

.manual-save-fab .fab-icon {
    font-size: 18px;
    line-height: 1;
}

.manual-save-fab .fab-text {
    white-space: nowrap;
}

/* ===== MANUAL ENTRY MODAL EXTRA STYLES ===== */
.manual-entry-modal-content {
    max-width: 600px;
}

.manual-entry-form .form-row {
    display: flex;
    gap: 16px;
    margin-bottom: 22px;
}

.manual-entry-form .form-col {
    flex: 1;
    min-width: 0;
}

.manual-entry-form .form-col.full-width {
    flex: none;
    width: 100%;
}

.manual-entry-form .result-input-group {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.manual-entry-form .result-input-row {
    display: flex;
    align-items: center;
    gap: 10px;
}

.manual-entry-form .result-input-row .eye-label {
    min-width: 80px;
    font-size: 13px;
    font-weight: 600;
    color: var(--gray-600);
    letter-spacing: 0.02em;
}

.manual-entry-form .result-input-row textarea,
.manual-entry-form .result-input-row input[type="text"] {
    flex: 1;
    min-height: 42px;
    padding: 10px 12px;
    border: 1.5px solid var(--gray-300);
    border-radius: var(--radius-md);
    font-size: 14px;
    font-family: inherit;
    background: #ffffff;
    color: var(--gray-900);
    transition: all var(--transition-base);
    resize: vertical;
}

.manual-entry-form .result-input-row textarea:focus,
.manual-entry-form .result-input-row input[type="text"]:focus {
    outline: none;
    border-color: var(--exam-primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12), var(--shadow-sm);
}

.manual-entry-form .result-input-row textarea:disabled,
.manual-entry-form .result-input-row input[type="text"]:disabled {
    background: var(--gray-100);
    color: var(--gray-400);
    cursor: not-allowed;
}

.manual-entry-form .submit-btn-gradient {
    background: linear-gradient(135deg, var(--exam-primary) 0%, #10b981 100%);
    color: white;
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.3), var(--shadow-sm);
}

.manual-entry-form .submit-btn-gradient:hover {
    background: linear-gradient(135deg, var(--primary-hover) 0%, var(--exam-success) 100%);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.4), var(--shadow-md);
}

/* Responsive: stack columns on narrow screens */
@media (max-width: 540px) {
    .manual-entry-form .form-row {
        flex-direction: column;
        gap: 0;
    }

    .manual-save-fab {
        bottom: 12px;
        right: 12px;
        padding: 12px 16px;
        font-size: 13px;
    }

    .manual-save-fab .fab-text {
        display: none;
    }
}

/* Print: hide FAB */
@media print {
    .manual-save-fab {
        display: none !important;
    }
}

/* ===== CLINIC SETTINGS BUTTON ===== */
.settings-btn {
    background: linear-gradient(135deg, var(--gray-600) 0%, var(--gray-500) 100%);
    color: white;
    padding: 8px 12px;
    font-size: 16px;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    line-height: 1;
}

.settings-btn:hover {
    background: linear-gradient(135deg, var(--gray-700) 0%, var(--gray-600) 100%);
    box-shadow: var(--shadow-md);
    transform: rotate(30deg);
}

/* ===== CLINIC SETTINGS MODAL ===== */
.clinic-settings-modal-content {
    max-width: 550px;
}

/* Logo Upload Group */
.form-group input[type="file"] {
    width: 100%;
    padding: 10px;
    border: 1.5px dashed var(--gray-300);
    border-radius: var(--radius-md);
    font-size: 13px;
    color: var(--gray-500);
    cursor: pointer;
    transition: all var(--transition-base);
    background: var(--gray-50);
}

.form-group input[type="file"]:hover {
    border-color: var(--exam-primary);
    background: var(--primary-light);
}

/* Logo Preview */
.logo-preview-group {
    margin-top: 16px;
    padding: 16px;
    background: var(--gray-50);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-md);
    text-align: center;
}

.logo-preview-label {
    display: block;
    font-size: 13px;
    color: var(--gray-600);
    font-weight: 600;
    margin-bottom: 10px;
}

.logo-preview {
    max-height: 80px;
    max-width: 200px;
    object-fit: contain;
    border-radius: var(--radius-sm);
    border: 1px solid var(--gray-200);
    padding: 4px;
    background: white;
}

/* Save Settings Button - Gradient Blue/Green */
.save-settings-btn {
    background: linear-gradient(135deg, var(--exam-primary) 0%, #10b981 100%);
    color: white;
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.3), var(--shadow-sm);
}

.save-settings-btn:hover {
    background: linear-gradient(135deg, var(--primary-hover) 0%, var(--exam-success) 100%);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.4), var(--shadow-md);
}

/* ===== CLINIC REPORT HEADER ===== */
.clinic-report-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 2px solid #2563eb;
    padding-bottom: 15px;
    margin-bottom: 20px;
}

.clinic-header-left {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
}

.clinic-logo-img {
    max-height: 70px;
    max-width: 150px;
    object-fit: contain;
}

.clinic-header-right {
    flex: 0 0 auto;
    text-align: right;
}

.clinic-name {
    font-size: 18px;
    font-weight: 700;
    color: #1f2937;
    margin-bottom: 4px;
    letter-spacing: 0.02em;
}

.clinic-address {
    font-size: 13px;
    color: #6b7280;
    margin-bottom: 3px;
}

.clinic-doctor {
    font-size: 14px;
    color: #374151;
    font-weight: 600;
    margin-top: 6px;
}

/* Wrapper for modal view clinic header */
.clinic-report-header-wrapper {
    margin-bottom: 24px;
}

/* ===== PRINT STYLES FOR CLINIC HEADER ===== */
@media print {
    .clinic-report-header {
        page-break-inside: avoid;
        margin-bottom: 16px;
        padding-bottom: 12px;
    }

    .clinic-name {
        font-size: 16px;
    }

    .clinic-address {
        font-size: 12px;
    }

    .clinic-doctor {
        font-size: 13px;
    }
}

/* ===== RESPONSIVE FOR CLINIC SETTINGS ===== */
@media (max-width: 540px) {
    .clinic-report-header {
        flex-direction: column;
        gap: 12px;
        text-align: center;
    }

    .clinic-header-right {
        text-align: center;
    }

    .clinic-settings-modal-content {
        width: 96%;
    }

    .logo-preview {
        max-width: 150px;
    }
}


/* ===== EMR HISTORY VIEWER STYLES ===== */

/* Search Export Wrapper */
.search-export-wrapper {
    display: flex;
    gap: 10px;
    align-items: center;
    margin-bottom: 8px;
}

.search-export-wrapper .history-search-container {
    flex: 1;
}

/* Export CSV Button */
.export-csv-btn {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    padding: 10px 18px;
    font-size: 13.5px;
    font-weight: 600;
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition-base);
    font-family: inherit;
    letter-spacing: 0.015em;
    position: relative;
    overflow: hidden;
    white-space: nowrap;
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.3), var(--shadow-sm);
    flex-shrink: 0;
}

.export-csv-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(180deg, rgba(255,255,255,0.2) 0%, rgba(255,255,255,0) 100%);
    opacity: 0;
    transition: opacity var(--transition-fast);
}

.export-csv-btn:hover {
    background: linear-gradient(135deg, #059669 0%, #047857 100%);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.4), var(--shadow-md);
    transform: translateY(-1px);
}

.export-csv-btn:hover::before {
    opacity: 1;
}

.export-csv-btn:active {
    transform: translateY(0);
}

/* History Button in Navbar */
.history-btn {
    background: linear-gradient(135deg, var(--exam-teal) 0%, #14b8a6 100%);
    color: white;
    padding: 8px 12px;
    font-size: 16px;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    line-height: 1;
}

.history-btn:hover {
    background: linear-gradient(135deg, var(--teal-hover) 0%, var(--exam-teal) 100%);
    box-shadow: var(--shadow-md);
    transform: scale(1.1);
}

/* History Modal Content */
.history-modal-content {
    max-width: 900px;
    width: 94%;
}

/* Search Container */
.history-search-container input#history-search {
    width: 100%;
    padding: 12px 16px;
    border: 1.5px solid var(--gray-300);
    border-radius: var(--radius-md);
    font-size: 14px;
    font-family: inherit;
    background: #ffffff;
    color: var(--gray-900);
    transition: all var(--transition-base);
    box-sizing: border-box;
}

.history-search-container input#history-search:hover {
    border-color: var(--gray-400);
}

.history-search-container input#history-search:focus {
    outline: none;
    border-color: var(--exam-primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12), var(--shadow-sm);
}

.history-search-container input#history-search::placeholder {
    color: var(--gray-400);
}

/* History Table Container */
.history-table-container {
    margin-top: 16px;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-md);
    overflow: auto;
    max-height: 500px;
    box-shadow: var(--shadow-sm);
}

/* History Table */
.history-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13.5px;
}

.history-table thead tr {
    background: linear-gradient(180deg, var(--exam-primary) 0%, #1d4ed8 100%);
}

.history-table thead th {
    padding: 12px 14px;
    text-align: left;
    font-weight: 600;
    font-size: 12.5px;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: white;
    border: none;
    position: sticky;
    top: 0;
    z-index: 10;
}

.history-table tbody {
    background: white;
}

.history-table tbody tr {
    transition: background var(--transition-fast);
}

.history-table tbody tr:nth-child(even) {
    background: var(--gray-50);
}

.history-table tbody tr:hover {
    background: var(--primary-light);
}

.history-table tbody td {
    padding: 11px 14px;
    border-bottom: 1px solid var(--gray-100);
    color: var(--gray-700);
}

/* History Action Buttons */
.history-action-btn {
    padding: 6px 12px;
    border: 1px solid var(--gray-300);
    border-radius: var(--radius-sm);
    background: white;
    color: var(--gray-700);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
    font-family: inherit;
}

.history-action-btn:hover {
    background: var(--primary-light);
    border-color: var(--exam-primary);
    color: var(--exam-primary);
}

.history-action-btn.pdf-history-btn:hover {
    background: var(--teal-light);
    border-color: var(--exam-teal);
    color: var(--exam-teal);
}

/* Empty State */
#history-empty-state {
    text-align: center;
    padding: 40px 20px;
    color: var(--gray-400);
    font-style: italic;
}

/* Results Count */
#history-results-count {
    font-size: 13px;
    color: var(--gray-500);
    margin-top: 8px;
    font-weight: 500;
}

/* Responsive for History Modal */
@media (max-width: 768px) {
    .history-modal-content {
        width: 98%;
        max-height: 85vh;
    }

    .history-table-container {
        max-height: 400px;
    }

    .history-action-btn {
        padding: 5px 10px;
        font-size: 11px;
    }
}

/* ===== ANAGLYPH COLOR CALIBRATION STYLES ===== */
.calibration-section {
    margin-top: 20px;
    border-top: 1px solid #ddd;
    padding-top: 15px;
}

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

.color-swatch {
    width: 40px;
    height: 40px;
    border-radius: 4px;
    cursor: pointer;
    transition: transform 0.2s;
    border: 1px solid #ccc;
}

.color-swatch:hover {
    transform: scale(1.1);
}

.color-swatch.active {
    transform: scale(1.1);
    border: 3px solid #000;
    box-shadow: 0 0 8px rgba(0,0,0,0.3);
}
