/* ============================================
   EGE/OGE Calculator - Mobile-First Responsive CSS
   Breakpoints:
   - Base: 320px+ (small smartphones)
   - sm: 480px+ (large smartphones)
   - md: 768px+ (tablets)
   - lg: 1024px+ (small desktops)
   - xl: 1440px+ (large desktops)
   ============================================ */

:root {
    /* Modern color palette */
    --primary: #6366f1;
    --primary-light: #818cf8;
    --primary-dark: #4f46e5;
    --secondary: #8b5cf6;
    --success: #10b981;
    --success-light: #34d399;
    --danger: #ef4444;
    --warning: #f59e0b;
    --info: #3b82f6;
    --dark: #1e293b;
    --dark-light: #334155;
    --light: #f8fafc;
    --gray-100: #f1f5f9;
    --gray-200: #e2e8f0;
    --gray-300: #cbd5e1;

    /* Shadows */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-md: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-lg: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    --shadow-xl: 0 25px 50px -12px rgba(0, 0, 0, 0.25);

    /* Spacing and sizing */
    --radius: 12px;
    --radius-sm: 8px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-fast: all 0.15s ease;

    /* Touch target minimum size (44px recommended, 24px absolute minimum) */
    --touch-target-min: 44px;
}

/* ============================================
   Reset & Base Styles (Mobile-First)
   ============================================ */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

html {
    /* Prevent horizontal overflow */
    overflow-x: hidden;
    /* Improve touch scrolling on iOS */
    -webkit-overflow-scrolling: touch;
}

body {
    background: #f0f4f8;
    background-attachment: fixed;
    color: var(--dark);
    line-height: 1.6;
    min-height: 100vh;
    /* Prevent horizontal overflow */
    overflow-x: hidden;
    /* Better text rendering on mobile */
    text-size-adjust: 100%;
    -webkit-text-size-adjust: 100%;
}

/* ============================================
   Container (Mobile-First)
   ============================================ */

.container {
    width: 100%;
    max-width: 100%;
    margin: 0 auto;
    padding: 12px;
    animation: fadeIn 0.5s ease-in;
    /* Prevent overflow */
    overflow-x: hidden;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* sm: 480px+ */
@media (min-width: 480px) {
    .container {
        padding: 16px;
    }
}

/* md: 768px+ */
@media (min-width: 768px) {
    .container {
        padding: 20px;
        max-width: 1200px;
    }
}

/* lg: 1024px+ */
@media (min-width: 1024px) {
    .container {
        padding: 24px;
    }
}

/* xl: 1440px+ */
@media (min-width: 1440px) {
    .container {
        padding: 30px;
        max-width: 1400px;
    }
}

/* ============================================
   Header (Mobile-First)
   ============================================ */

header {
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 50%, #a855f7 100%);
    box-shadow: 0 10px 40px rgba(99, 102, 241, 0.3);
    margin-bottom: 20px;
    border-radius: var(--radius);
    padding: 60px 16px 30px; /* Extra top padding for lang switcher */
    text-align: center;
    position: relative;
    overflow: hidden;
}

header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.1) 0%, rgba(255, 255, 255, 0) 100%);
    pointer-events: none;
}

header h1 {
    color: white;
    margin-bottom: 8px;
    font-size: 1.5rem;
    font-weight: 700;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
    position: relative;
    z-index: 1;
    /* Prevent text overflow */
    word-wrap: break-word;
    overflow-wrap: break-word;
    hyphens: auto;
}

header p {
    color: rgba(255, 255, 255, 0.95);
    font-size: 0.9rem;
    font-weight: 400;
    position: relative;
    z-index: 1;
    padding: 0 10px;
}

/* sm: 480px+ */
@media (min-width: 480px) {
    header {
        padding: 60px 20px 35px;
    }

    header h1 {
        font-size: 1.75rem;
    }

    header p {
        font-size: 1rem;
    }
}

/* md: 768px+ */
@media (min-width: 768px) {
    header {
        padding: 45px 25px;
        margin-bottom: 30px;
    }

    header h1 {
        font-size: 2.25rem;
    }

    header p {
        font-size: 1.1rem;
    }
}

/* lg: 1024px+ */
@media (min-width: 1024px) {
    header h1 {
        font-size: 2.5rem;
    }
}

/* ============================================
   Main Content Grid (Mobile-First)
   ============================================ */

.main-content {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
}

/* md: 768px+ - Two column layout */
@media (min-width: 768px) {
    .main-content {
        grid-template-columns: 350px 1fr;
        gap: 20px;
    }
}

/* lg: 1024px+ */
@media (min-width: 1024px) {
    .main-content {
        grid-template-columns: 380px 1fr;
        gap: 24px;
    }
}

/* xl: 1440px+ */
@media (min-width: 1440px) {
    .main-content {
        grid-template-columns: 420px 1fr;
        gap: 30px;
    }
}

/* ============================================
   Card Component (Mobile-First)
   ============================================ */

.card {
    background: white;
    padding: 16px;
    border-radius: var(--radius);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    border: 1px solid var(--gray-200);
    transition: var(--transition);
    /* Prevent overflow */
    overflow: hidden;
}

.card:hover {
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
}

/* sm: 480px+ */
@media (min-width: 480px) {
    .card {
        padding: 20px;
    }
}

/* md: 768px+ */
@media (min-width: 768px) {
    .card {
        padding: 25px;
    }
}

/* ============================================
   Control Panel (Mobile-First)
   ============================================ */

.control-panel {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* md: 768px+ */
@media (min-width: 768px) {
    .control-panel {
        gap: 20px;
    }
}

/* ============================================
   Form Elements (Mobile-First)
   ============================================ */

.form-group {
    margin-bottom: 12px;
}

/* md: 768px+ */
@media (min-width: 768px) {
    .form-group {
        margin-bottom: 15px;
    }
}

label {
    display: block;
    margin-bottom: 6px;
    font-weight: 600;
    color: var(--dark);
    font-size: 0.9rem;
}

/* md: 768px+ */
@media (min-width: 768px) {
    label {
        margin-bottom: 5px;
        font-size: 1rem;
    }
}

select, input {
    width: 100%;
    padding: 14px 16px; /* Touch-friendly padding */
    border: 2px solid var(--gray-200);
    border-radius: var(--radius-sm);
    font-size: 16px; /* Prevents iOS zoom on focus */
    transition: var(--transition);
    background-color: white;
    /* Ensure minimum touch target height */
    min-height: var(--touch-target-min);
}

select:hover, input:hover {
    border-color: var(--gray-300);
}

select:focus, input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.1);
}

/* md: 768px+ - Can reduce focus effect on desktop */
@media (min-width: 768px) {
    select:focus, input:focus {
        transform: translateY(-1px);
    }
}

/* ============================================
   Exam Type Switch (Mobile-First)
   ============================================ */

.exam-type-switch {
    display: inline-flex;
    background: var(--gray-200);
    border-radius: var(--radius-sm);
    padding: 4px;
    gap: 4px;
    width: 100%;
    max-width: 100%;
    border: 1px solid var(--gray-300);
}

.exam-type-switch input[type="radio"] {
    display: none;
}

.exam-type-label {
    flex: 1;
    padding: 14px 16px; /* Touch-friendly */
    text-align: center;
    font-weight: 600;
    font-size: 14px;
    color: var(--dark-light);
    background: transparent;
    border-radius: 6px;
    cursor: pointer;
    transition: var(--transition);
    user-select: none;
    margin-bottom: 0;
    /* Ensure minimum touch target */
    min-height: var(--touch-target-min);
    display: flex;
    align-items: center;
    justify-content: center;
}

.exam-type-label:hover {
    color: var(--primary);
    background: rgba(255, 255, 255, 0.5);
}

.exam-type-switch input[type="radio"]:checked + .exam-type-label {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
    box-shadow: var(--shadow);
    font-weight: 700;
}

/* sm: 480px+ */
@media (min-width: 480px) {
    .exam-type-switch {
        max-width: 300px;
    }

    .exam-type-label {
        padding: 12px 20px;
        font-size: 15px;
    }
}

/* ============================================
   Buttons (Mobile-First with Touch Targets)
   ============================================ */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    /* Touch-friendly size */
    min-height: var(--touch-target-min);
    padding: 14px 20px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    text-align: center;
    box-shadow: 0 4px 6px rgba(99, 102, 241, 0.25);
    position: relative;
    overflow: hidden;
    /* Prevent text selection on tap */
    user-select: none;
    -webkit-user-select: none;
    /* Remove tap highlight on mobile */
    -webkit-tap-highlight-color: transparent;
}

.btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

.btn:hover::before {
    left: 100%;
}

.btn:hover {
    background: linear-gradient(135deg, var(--primary-dark) 0%, var(--secondary) 100%);
    box-shadow: 0 6px 12px rgba(99, 102, 241, 0.35);
}

/* Only transform on non-touch devices */
@media (hover: hover) {
    .btn:hover {
        transform: translateY(-2px);
    }
}

.btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(99, 102, 241, 0.25);
}

/* md: 768px+ */
@media (min-width: 768px) {
    .btn {
        padding: 12px 24px;
    }
}

.btn-block {
    display: flex;
    width: 100%;
}

.btn-secondary {
    background-color: var(--light);
    color: var(--dark);
    border: 1px solid #ddd;
}

.btn-secondary:hover {
    background-color: #e9ecef;
}

.btn-reset {
    background: var(--gray-100);
    color: var(--dark-light);
    box-shadow: none;
    margin-top: 12px;
    width: 100%;
    border: 1px solid var(--gray-300);
}

.btn-reset:hover {
    background: var(--danger);
    color: white;
    border-color: var(--danger);
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
}

/* md: 768px+ */
@media (min-width: 768px) {
    .btn-reset {
        margin-top: 15px;
    }
}

/* ============================================
   Results Section (Mobile-First)
   ============================================ */

.results {
    margin-top: 16px;
    padding: 16px;
    background: linear-gradient(135deg, #f0f9ff 0%, #ede9fe 100%);
    border-radius: var(--radius);
    border: 1px solid var(--gray-200);
}

.results h3 {
    margin-bottom: 12px;
    color: var(--dark);
    font-size: 1rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 8px;
}

.results h3::before {
    content: '';
    width: 4px;
    height: 18px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    border-radius: 2px;
    flex-shrink: 0;
}

.results p {
    margin: 8px 0;
    font-size: 0.9rem;
    color: var(--dark-light);
}

.results span {
    font-weight: 700;
    color: var(--primary);
    font-size: 1.1rem;
}

/* sm: 480px+ */
@media (min-width: 480px) {
    .results {
        padding: 18px;
    }

    .results h3 {
        font-size: 1.05rem;
    }

    .results p {
        font-size: 0.95rem;
    }
}

/* md: 768px+ */
@media (min-width: 768px) {
    .results {
        margin-top: 20px;
        padding: 20px;
    }

    .results h3 {
        margin-bottom: 15px;
        font-size: 1.1rem;
    }

    .results h3::before {
        height: 20px;
    }

    .results p {
        margin: 10px 0;
        font-size: 1rem;
    }

    .results span {
        font-size: 1.2rem;
    }
}

/* ============================================
   Graph Container (Mobile-First)
   ============================================ */

.graph-container {
    width: 100%;
    height: 350px;
    position: relative;
    background: var(--gray-100);
    border-radius: var(--radius-sm);
    padding: 12px;
    border: 1px solid var(--gray-200);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.chart-wrapper {
    position: relative;
    flex: 1;
    min-height: 200px;
}

.chart-wrapper canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100% !important;
    height: 100% !important;
}

.graph-card h2 {
    color: var(--dark);
    font-size: 1.1rem;
    margin-bottom: 16px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 10px;
}

.graph-card h2::before {
    content: '';
    width: 4px;
    height: 20px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    border-radius: 2px;
    flex-shrink: 0;
}

/* sm: 480px+ */
@media (min-width: 480px) {
    .graph-container {
        height: 400px;
        padding: 16px;
    }

    .graph-card h2 {
        font-size: 1.2rem;
    }
}

/* md: 768px+ */
@media (min-width: 768px) {
    .graph-container {
        height: 500px;
        padding: 20px;
    }

    .chart-wrapper {
        min-height: 220px;
    }

    .graph-card {
        position: sticky;
        top: 20px;
        align-self: start;
    }

    .graph-card h2 {
        font-size: 1.3rem;
        margin-bottom: 20px;
    }

    .graph-card h2::before {
        height: 24px;
    }
}

/* lg: 1024px+ */
@media (min-width: 1024px) {
    .graph-container {
        height: 550px;
    }
}

/* ============================================
   Tasks Section (Mobile-First)
   ============================================ */

.tasks-section {
    margin-top: 16px;
}

.tasks-section h3 {
    color: var(--dark);
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 12px;
}

.tasks-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(65px, 1fr));
    gap: 8px;
    margin-top: 12px;
}

.task-item {
    padding: 12px 8px;
    border-radius: var(--radius-sm);
    background: white;
    text-align: center;
    border: 2px solid var(--gray-300);
    cursor: pointer;
    transition: var(--transition);
    position: relative;
    font-weight: 600;
    font-size: 1rem;
    /* Ensure touch target - at least 44x44 */
    min-height: var(--touch-target-min);
    min-width: var(--touch-target-min);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--dark);
    box-shadow: var(--shadow-sm);
    /* Remove tap highlight */
    -webkit-tap-highlight-color: transparent;
    user-select: none;
}

/* Only apply hover effects on devices that support hover */
@media (hover: hover) {
    .task-item:hover {
        transform: translateY(-3px);
        box-shadow: var(--shadow-md);
        border-color: var(--primary);
        background: linear-gradient(135deg, rgba(99, 102, 241, 0.05) 0%, rgba(139, 92, 246, 0.05) 100%);
    }
}

.task-item:active {
    transform: scale(0.98);
}

.task-item.selected {
    background: linear-gradient(135deg, var(--success) 0%, #059669 100%);
    color: white;
    border-color: var(--success);
    box-shadow: 0 4px 14px rgba(16, 185, 129, 0.4);
    transform: translateY(-2px);
}

.task-item.selected:hover {
    background: linear-gradient(135deg, #059669 0%, var(--success) 100%);
    box-shadow: 0 6px 18px rgba(16, 185, 129, 0.5);
}

.task-item .task-value {
    position: absolute;
    top: -6px;
    right: -6px;
    background-color: var(--warning);
    color: white;
    font-size: 10px;
    width: 18px;
    height: 18px;
    display: none;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.task-item .checkmark {
    position: absolute;
    top: 3px;
    left: 3px;
    font-size: 12px;
    color: white;
    display: none;
}

.task-item .task-input {
    -webkit-appearance: none;
    width: 100%;
    margin: 2px 0 0;
    background: transparent;
    display: none;
    cursor: pointer;
    /* Touch-friendly slider height - 44px minimum for accessibility */
    height: 32px;
    /* Ensure touch events work on mobile */
    touch-action: manipulation;
}

.task-item .task-input::-webkit-slider-runnable-track {
    height: 8px;
    width: 100%;
    background: var(--success-light);
    border-radius: 4px;
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.1);
}

.task-item .task-input::-moz-range-track {
    height: 8px;
    background: var(--success-light);
    border-radius: 4px;
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.1);
}

.task-item .task-input::-webkit-slider-thumb {
    -webkit-appearance: none;
    height: 24px;
    width: 24px;
    border-radius: 50%;
    background: #fff;
    border: 3px solid var(--success);
    margin-top: -8px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25);
    /* Ensure minimum touch target */
    cursor: pointer;
}

.task-item .task-input::-moz-range-thumb {
    height: 24px;
    width: 24px;
    border-radius: 50%;
    background: #fff;
    border: 3px solid var(--success);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25);
    cursor: pointer;
}

.task-item.selected .checkmark {
    display: block;
}

.task-item.selected .task-input {
    display: block;
}

.task-item.selected .task-value {
    display: flex;
}

/* Max points badge - always visible for multi-point tasks */
.task-item .task-max-points {
    position: absolute;
    top: -6px;
    right: -6px;
    background-color: var(--primary);
    color: white;
    font-size: 10px;
    width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-weight: 700;
    box-shadow: 0 2px 4px rgba(99, 102, 241, 0.3);
    z-index: 1;
}

/* Hide max-points badge when selected (task-value takes over) */
.task-item.selected .task-max-points {
    display: none;
}

/* Slider container */
.task-item .task-slider-container {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 6px 8px 8px;
    background: rgba(255, 255, 255, 0.98);
    border-radius: 0 0 var(--radius-sm) var(--radius-sm);
    display: none;
    z-index: 1;
    /* Ensure touch events work properly */
    touch-action: manipulation;
}

.task-item.selected .task-slider-container {
    display: block;
}

/* Ensure task number stays visible above slider */
.task-item > div:first-child {
    position: relative;
    z-index: 2;
    /* Make task number visible on selected items with sliders */
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 28px;
}

/* Task number label in selected multi-point tasks */
.task-item.selected:has(.task-slider-container) > div:first-child {
    background: var(--success);
    border-radius: var(--radius-sm);
    padding: 4px 8px;
    font-size: 1.1rem;
    font-weight: 700;
    color: white;
    box-shadow: 0 2px 6px rgba(16, 185, 129, 0.3);
}

/* Slider position indicators */
.slider-positions {
    display: flex;
    justify-content: space-between;
    padding: 0 4px;
    margin-bottom: 4px;
    /* Add touch target padding */
    min-height: 20px;
    align-items: center;
}

.slider-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background-color: var(--gray-300);
    transition: all 0.2s ease;
    flex-shrink: 0;
    /* Increase touch target with padding */
    padding: 4px;
    box-sizing: content-box;
    cursor: pointer;
    border: 2px solid transparent;
}

.slider-dot.active {
    background-color: var(--primary);
    transform: scale(1.15);
    box-shadow: 0 0 6px rgba(99, 102, 241, 0.5);
    border-color: var(--primary-dark);
}

/* When task is selected, slider dots should be green to match the task selection */
.task-item.selected .slider-dot.active {
    background-color: var(--success);
    box-shadow: 0 0 6px rgba(16, 185, 129, 0.5);
    border-color: #059669;
}

/* Adjust task-item for slider */
.task-item:has(.task-slider-container) {
    padding-bottom: 55px;
}

.task-item.selected:has(.task-slider-container) {
    padding-bottom: 55px;
}

/* sm: 480px+ */
@media (min-width: 480px) {
    .tasks-container {
        grid-template-columns: repeat(auto-fill, minmax(75px, 1fr));
        gap: 10px;
    }

    .task-item {
        padding: 14px 10px;
        min-height: 55px;
    }

    .task-item .task-value {
        top: -8px;
        right: -8px;
        font-size: 12px;
        width: 20px;
        height: 20px;
    }

    .task-item .task-max-points {
        top: -8px;
        right: -8px;
        font-size: 12px;
        width: 20px;
        height: 20px;
    }

    .task-item .checkmark {
        font-size: 14px;
        top: 4px;
        left: 4px;
    }

    .slider-dot {
        width: 12px;
        height: 12px;
        /* Larger touch target on small screens */
        padding: 4px;
    }

    .task-item .task-slider-container {
        padding: 8px 10px 10px;
    }

    .task-item:has(.task-slider-container) {
        padding-bottom: 60px;
    }

    .task-item.selected:has(.task-slider-container) {
        padding-bottom: 60px;
    }
}

/* md: 768px+ */
@media (min-width: 768px) {
    .tasks-section {
        margin-top: 20px;
    }

    .tasks-section h3 {
        font-size: 1.25rem;
        margin-bottom: 15px;
    }

    .tasks-container {
        grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
        margin-top: 15px;
    }

    .task-item {
        padding: 15px;
        font-size: 1.1rem;
        min-height: 60px;
    }
}

/* ============================================
   Slider Container (Mobile-First)
   ============================================ */

.slider-container {
    margin-top: 12px;
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.slider-container input[type="range"] {
    flex: 1;
    min-width: 100px;
    /* Touch-friendly height */
    height: var(--touch-target-min);
    padding: 0;
}

.slider-container input[type="number"] {
    width: 70px;
    text-align: center;
    flex-shrink: 0;
}

/* md: 768px+ */
@media (min-width: 768px) {
    .slider-container {
        margin-top: 15px;
        flex-wrap: nowrap;
    }
}

/* ============================================
   Two Columns Layout (Mobile-First)
   ============================================ */

.two-columns {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
}

/* sm: 480px+ */
@media (min-width: 480px) {
    .two-columns {
        grid-template-columns: 1fr 1fr;
        gap: 12px;
    }
}

/* md: 768px+ */
@media (min-width: 768px) {
    .two-columns {
        gap: 15px;
    }
}

/* ============================================
   Tabs (Mobile-First)
   ============================================ */

.tabs {
    display: flex;
    margin-bottom: 16px;
    gap: 4px;
    background: var(--gray-100);
    padding: 4px;
    border-radius: var(--radius-sm);
    /* Prevent overflow on small screens */
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.tab {
    flex: 1;
    /* Touch-friendly size */
    min-height: var(--touch-target-min);
    padding: 12px 14px;
    cursor: pointer;
    border: none;
    border-radius: 6px;
    transition: var(--transition);
    font-weight: 500;
    font-size: 0.9rem;
    color: var(--dark-light);
    text-align: center;
    background: transparent;
    /* Remove tap highlight */
    -webkit-tap-highlight-color: transparent;
    user-select: none;
    white-space: nowrap;
}

.tab:hover {
    color: var(--primary);
    background: rgba(255, 255, 255, 0.5);
}

.tab.active {
    color: white;
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    box-shadow: var(--shadow-sm);
}

/* sm: 480px+ */
@media (min-width: 480px) {
    .tabs {
        gap: 6px;
    }

    .tab {
        padding: 10px 18px;
        font-size: 0.95rem;
    }
}

/* md: 768px+ */
@media (min-width: 768px) {
    .tabs {
        margin-bottom: 25px;
        gap: 8px;
    }

    .tab {
        padding: 10px 20px;
    }
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* ============================================
   Score Target (Mobile-First)
   ============================================ */

.score-target {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    margin-top: 16px;
    padding: 16px;
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.1) 0%, rgba(99, 102, 241, 0.1) 100%);
    border-radius: var(--radius);
    border: 2px solid rgba(139, 92, 246, 0.2);
}

.score-target label {
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 0;
    text-align: center;
}

.score-target input {
    width: 100%;
    max-width: 100px;
    text-align: center;
    font-weight: 700;
    font-size: 1.1rem;
}

.score-target .btn {
    width: 100%;
    max-width: 150px;
}

/* sm: 480px+ */
@media (min-width: 480px) {
    .score-target {
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: center;
    }

    .score-target input {
        width: 90px;
    }

    .score-target .btn {
        width: auto;
    }
}

/* md: 768px+ */
@media (min-width: 768px) {
    .score-target {
        margin-top: 20px;
        padding: 18px;
    }
}

/* ============================================
   Highlight Zone (Mobile-First)
   ============================================ */

.highlight-zone {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.1) 0%, rgba(139, 92, 246, 0.1) 100%);
    padding: 16px;
    border-radius: var(--radius);
    margin-top: 16px;
    border: 2px solid rgba(99, 102, 241, 0.2);
    backdrop-filter: blur(5px);
}

.highlight-zone h3 {
    color: var(--primary);
    margin-bottom: 10px;
    font-weight: 700;
    font-size: 1rem;
}

.highlight-zone p {
    line-height: 1.7;
    color: var(--dark);
    font-size: 0.9rem;
}

/* md: 768px+ */
@media (min-width: 768px) {
    .highlight-zone {
        padding: 20px;
        margin-top: 20px;
    }

    .highlight-zone h3 {
        margin-bottom: 12px;
        font-size: 1.1rem;
    }

    .highlight-zone p {
        font-size: 1rem;
    }
}

/* ============================================
   Resource Info (Mobile-First)
   ============================================ */

.resource-info {
    margin-top: 12px;
    font-size: 13px;
    color: #718096;
}

/* md: 768px+ */
@media (min-width: 768px) {
    .resource-info {
        margin-top: 15px;
        font-size: 14px;
    }
}

/* ============================================
   Animations
   ============================================ */

@keyframes pulsate {
    0% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.1);
        opacity: 0.8;
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

@keyframes taskClick {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
    100% {
        transform: scale(1);
    }
}

.task-item.task-clicked {
    animation: taskClick 0.3s ease;
}

.chart-indicator {
    transition: transform 0.5s ease-out;
}

@keyframes targetAppear {
    0% {
        opacity: 0;
        transform: translateY(20px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

.target-indicator {
    animation: targetAppear 0.5s ease-out;
}

/* ============================================
   Floating Score (Mobile-First)
   ============================================ */

.floating-score {
    position: fixed;
    top: 12px;
    left: 12px; /* Left side on mobile to avoid lang switcher overlap */
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    box-shadow: 0 4px 20px rgba(99, 102, 241, 0.4);
    font-weight: 700;
    font-size: 0.95rem;
    transition: var(--transition);
    border: 2px solid white;
    /* Touch-friendly */
    min-width: var(--touch-target-min);
    min-height: var(--touch-target-min);
}

.floating-score:hover {
    transform: scale(1.08);
    box-shadow: 0 6px 25px rgba(99, 102, 241, 0.5);
}

/* sm: 480px+ - Keep on left but slightly larger */
@media (min-width: 480px) {
    .floating-score {
        top: 15px;
        left: 15px;
        width: 56px;
        height: 56px;
        font-size: 1.1rem;
        border-width: 3px;
    }
}

/* xl: 1440px+ - Move to right side only on very wide screens where there's enough space */
@media (min-width: 1440px) {
    .floating-score {
        left: auto;
        right: 20px;
    }
}

/* ============================================
   App Loader (Mobile-First)
   ============================================ */

.app-loader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    padding: 20px;
}

.loader-content {
    text-align: center;
    animation: fadeIn 0.5s ease-in;
    max-width: 100%;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 4px solid rgba(255, 255, 255, 0.2);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 0 auto 20px;
    box-shadow: 0 0 20px rgba(255, 255, 255, 0.3);
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.loader-content p {
    color: white;
    font-size: 1rem;
    font-weight: 600;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

/* sm: 480px+ */
@media (min-width: 480px) {
    .spinner {
        width: 60px;
        height: 60px;
        border-width: 5px;
        margin-bottom: 25px;
    }

    .loader-content p {
        font-size: 1.2rem;
    }
}

/* ============================================
   Error Message (Mobile-First)
   ============================================ */

.error-message {
    background-color: #fee;
    border: 1px solid var(--danger);
    border-radius: var(--radius);
    padding: 12px;
    margin: 16px;
    color: var(--danger);
    text-align: center;
    font-size: 0.9rem;
}

/* md: 768px+ */
@media (min-width: 768px) {
    .error-message {
        padding: 15px;
        margin: 20px;
        font-size: 1rem;
    }
}

/* ============================================
   Toast Notifications (Mobile-First)
   ============================================ */

.toast-container {
    position: fixed;
    top: 70px; /* Below floating score */
    left: 12px;
    right: 12px;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    gap: 8px;
    pointer-events: none;
}

.toast {
    background-color: white;
    border-radius: var(--radius);
    padding: 14px 16px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    opacity: 0;
    transform: translateY(-20px);
    transition: all 0.3s ease;
    font-size: 13px;
    line-height: 1.4;
    border-left: 4px solid;
    pointer-events: auto;
}

.toast.show {
    opacity: 1;
    transform: translateY(0);
}

.toast-info {
    border-left-color: var(--info);
    background-color: #e8f8fc;
    color: #0891b2;
}

.toast-success {
    border-left-color: var(--success);
    background-color: #e0f7fa;
    color: #0d9488;
}

.toast-warning {
    border-left-color: var(--warning);
    background-color: #fff3e0;
    color: #ea580c;
}

.toast-error {
    border-left-color: var(--danger);
    background-color: #fee;
    color: #dc2626;
}

/* sm: 480px+ */
@media (min-width: 480px) {
    .toast-container {
        top: 80px;
        left: auto;
        right: 16px;
        max-width: 350px;
    }

    .toast {
        padding: 15px 18px;
        font-size: 14px;
        transform: translateX(100px);
    }

    .toast.show {
        transform: translateX(0);
    }
}

/* md: 768px+ */
@media (min-width: 768px) {
    .toast-container {
        top: 20px;
        right: 20px;
        max-width: 400px;
        gap: 10px;
    }

    .toast {
        padding: 15px 20px;
        transform: translateX(400px);
    }
}

/* ============================================
   Scores Modal (Mobile-First)
   ============================================ */

.scores-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(5px);
    display: flex;
    align-items: flex-end; /* Slide up from bottom on mobile */
    justify-content: center;
    z-index: 10000;
    opacity: 0;
    transition: opacity 0.3s ease;
    padding: 0;
}

.scores-modal.show {
    opacity: 1;
}

.scores-modal-content {
    background: white;
    border-radius: var(--radius) var(--radius) 0 0;
    box-shadow: var(--shadow-xl);
    width: 100%;
    max-width: 100%;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    transform: translateY(100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.scores-modal.show .scores-modal-content {
    transform: translateY(0);
}

.scores-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 2px solid var(--gray-200);
    flex-shrink: 0;
}

.scores-modal-header h3 {
    margin: 0;
    color: var(--dark);
    font-size: 1.2rem;
    font-weight: 700;
}

.scores-modal-close {
    background: none;
    border: none;
    font-size: 1.75rem;
    line-height: 1;
    color: var(--dark-light);
    cursor: pointer;
    padding: 0;
    /* Touch-friendly */
    width: var(--touch-target-min);
    height: var(--touch-target-min);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: var(--transition);
    -webkit-tap-highlight-color: transparent;
}

.scores-modal-close:hover {
    background-color: var(--gray-100);
    color: var(--danger);
}

.scores-modal-body {
    padding: 16px;
    overflow-y: auto;
    flex: 1;
    -webkit-overflow-scrolling: touch;
}

.scores-item {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 14px;
    margin-bottom: 10px;
    background: linear-gradient(135deg, var(--gray-100) 0%, white 100%);
    border-radius: var(--radius-sm);
    border: 2px solid var(--gray-200);
    transition: var(--transition);
}

.scores-item:hover {
    border-color: var(--primary-light);
    box-shadow: var(--shadow);
}

.scores-item-info {
    flex: 1;
}

.scores-item-name {
    font-weight: 700;
    color: var(--dark);
    font-size: 1rem;
    margin-bottom: 4px;
}

.scores-item-score {
    color: var(--dark-light);
    font-size: 0.9rem;
}

.scores-item-score strong {
    color: var(--primary);
    font-size: 1.05rem;
}

.scores-item-reset {
    padding: 12px 16px;
    background: linear-gradient(135deg, var(--danger) 0%, #dc2626 100%);
    color: white;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: 0 2px 4px rgba(239, 68, 68, 0.25);
    /* Touch-friendly */
    min-height: var(--touch-target-min);
    width: 100%;
    -webkit-tap-highlight-color: transparent;
}

.scores-item-reset:hover {
    background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%);
    box-shadow: 0 4px 8px rgba(239, 68, 68, 0.35);
}

@media (hover: hover) {
    .scores-item-reset:hover {
        transform: translateY(-2px);
    }
}

.scores-item-reset:active {
    transform: translateY(0);
}

.scores-modal-footer {
    padding: 16px 20px;
    border-top: 2px solid var(--gray-200);
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.1) 0%, rgba(139, 92, 246, 0.1) 100%);
    flex-shrink: 0;
}

.scores-total {
    text-align: center;
    font-size: 1.1rem;
    color: var(--dark);
    font-weight: 600;
}

.scores-total strong {
    color: var(--primary);
    font-size: 1.4rem;
    font-weight: 700;
}

/* sm: 480px+ */
@media (min-width: 480px) {
    .scores-item {
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
    }

    .scores-item-reset {
        width: auto;
        padding: 10px 16px;
    }
}

/* md: 768px+ */
@media (min-width: 768px) {
    .scores-modal {
        align-items: center;
        padding: 20px;
    }

    .scores-modal-content {
        max-width: 600px;
        max-height: 80vh;
        border-radius: var(--radius);
        transform: scale(0.9);
    }

    .scores-modal.show .scores-modal-content {
        transform: scale(1);
    }

    .scores-modal-header {
        padding: 20px 25px;
    }

    .scores-modal-header h3 {
        font-size: 1.5rem;
    }

    .scores-modal-close {
        font-size: 2rem;
    }

    .scores-modal-body {
        padding: 25px;
    }

    .scores-item {
        padding: 15px;
    }

    .scores-item:hover {
        transform: translateX(5px);
    }

    .scores-item-name {
        font-size: 1.05rem;
        margin-bottom: 5px;
    }

    .scores-item-score {
        font-size: 0.95rem;
    }

    .scores-item-score strong {
        font-size: 1.1rem;
    }

    .scores-item-reset {
        padding: 8px 16px;
    }

    .scores-modal-footer {
        padding: 20px 25px;
    }

    .scores-total {
        font-size: 1.2rem;
    }

    .scores-total strong {
        font-size: 1.5rem;
    }
}

/* ============================================
   OGE Current Grade Panel (Mobile-First)
   ============================================ */

.current-grade-panel {
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border-radius: var(--radius);
    padding: 14px 16px;
    margin-bottom: 14px;
    border-left: 4px solid var(--primary);
    box-shadow: var(--shadow-sm);
}

.current-grade-info {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    flex-wrap: wrap;
}

.current-grade-label {
    font-weight: 600;
    color: var(--dark-light);
    font-size: 0.85rem;
}

.current-primary {
    font-weight: 700;
    font-size: 0.95rem;
    color: var(--dark);
    background: white;
    padding: 5px 10px;
    border-radius: 6px;
    box-shadow: var(--shadow-sm);
}

.grade-arrow {
    font-size: 1.1rem;
    color: var(--gray-300);
    font-weight: 700;
}

.current-grade {
    font-weight: 700;
    font-size: 0.95rem;
    color: white;
    background: var(--primary);
    padding: 5px 12px;
    border-radius: 6px;
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.3);
    transition: var(--transition);
    cursor: default;
}

/* md: 768px+ */
@media (min-width: 768px) {
    .current-grade-panel {
        padding: 16px 20px;
        margin-bottom: 16px;
    }

    .current-grade-info {
        gap: 12px;
    }

    .current-grade-label {
        font-size: 0.95rem;
    }

    .current-primary,
    .current-grade {
        font-size: 1.1rem;
        padding: 6px 14px;
    }

    .grade-arrow {
        font-size: 1.3rem;
    }
}

/* Custom tooltip for geometry warning */
.current-grade.has-tooltip {
    cursor: help;
    text-decoration: underline dotted;
    position: relative;
}

.current-grade.has-tooltip::after {
    content: attr(data-tooltip);
    position: absolute;
    top: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%);
    background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%);
    color: white;
    padding: 10px 14px;
    border-radius: 10px;
    font-size: 0.8rem;
    font-weight: 500;
    line-height: 1.5;
    white-space: normal;
    width: max-content;
    max-width: 250px;
    text-align: center;
    z-index: 10000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s, visibility 0.2s;
    pointer-events: none;
    box-shadow: 0 4px 16px rgba(220, 38, 38, 0.4);
}

.current-grade.has-tooltip::before {
    content: '';
    position: absolute;
    top: calc(100% + 2px);
    left: 50%;
    transform: translateX(-50%);
    border: 6px solid transparent;
    border-bottom-color: #dc2626;
    z-index: 10000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s, visibility 0.2s;
}

.current-grade.has-tooltip:hover::after,
.current-grade.has-tooltip:hover::before {
    opacity: 1;
    visibility: visible;
}

/* md: 768px+ */
@media (min-width: 768px) {
    .current-grade.has-tooltip::after {
        padding: 12px 16px;
        font-size: 0.85rem;
        max-width: 280px;
    }
}

/* ============================================
   Grade Conditions Panel (Mobile-First)
   ============================================ */

.grade-conditions-panel {
    margin-top: 16px;
    padding: 14px 16px;
    background: linear-gradient(135deg, #fefce8 0%, #fef3c7 100%);
    border-radius: var(--radius);
    border-left: 4px solid #eab308;
    box-shadow: var(--shadow-sm);
}

.grade-conditions-title {
    font-weight: 700;
    font-size: 0.9rem;
    color: #92400e;
    margin-bottom: 10px;
}

.grade-conditions-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.grade-condition-item {
    display: flex;
    align-items: center;
    gap: 8px;
    background: white;
    padding: 6px 10px;
    border-radius: 6px;
    box-shadow: var(--shadow-sm);
}

.grade-badge {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 700;
    font-size: 0.8rem;
    flex-shrink: 0;
}

.grade-condition-text {
    color: var(--dark-light);
    font-size: 0.85rem;
    line-height: 1.4;
}

/* md: 768px+ */
@media (min-width: 768px) {
    .grade-conditions-panel {
        margin-top: 20px;
        padding: 16px 20px;
    }

    .grade-conditions-title {
        font-size: 0.95rem;
        margin-bottom: 12px;
    }

    .grade-conditions-list {
        gap: 8px;
    }

    .grade-condition-item {
        gap: 10px;
        padding: 8px 12px;
    }

    .grade-badge {
        width: 28px;
        height: 28px;
        font-size: 0.9rem;
    }

    .grade-condition-text {
        font-size: 0.9rem;
    }
}

/* ============================================
   EGE Score Panel (Mobile-First)
   ============================================ */

.ege-score-panel {
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border-radius: var(--radius);
    padding: 14px 16px;
    margin-bottom: 14px;
    border-left: 4px solid var(--primary);
    box-shadow: var(--shadow-sm);
}

.ege-score-info {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
}

.ege-score-item {
    display: flex;
    align-items: center;
    gap: 6px;
    background: white;
    padding: 8px 12px;
    border-radius: 8px;
    box-shadow: var(--shadow-sm);
}

.ege-score-label {
    font-weight: 600;
    color: var(--dark-light);
    font-size: 0.8rem;
}

.ege-score-value {
    font-weight: 700;
    font-size: 1.2rem;
    color: var(--primary);
    min-width: 35px;
    text-align: center;
}

.ege-score-value.primary {
    color: var(--dark);
}

.ege-score-value.test {
    color: var(--success);
}

.ege-score-max {
    font-size: 0.8rem;
    color: var(--gray-300);
    font-weight: 500;
}

.ege-score-arrow {
    font-size: 1.25rem;
    color: var(--gray-300);
    font-weight: 700;
}

/* md: 768px+ */
@media (min-width: 768px) {
    .ege-score-panel {
        padding: 16px 20px;
        margin-bottom: 16px;
    }

    .ege-score-info {
        gap: 16px;
    }

    .ege-score-item {
        gap: 8px;
        padding: 10px 16px;
    }

    .ege-score-label {
        font-size: 0.9rem;
    }

    .ege-score-value {
        font-size: 1.5rem;
        min-width: 45px;
    }

    .ege-score-max {
        font-size: 0.85rem;
    }

    .ege-score-arrow {
        font-size: 1.5rem;
    }
}

/* ============================================
   Geometry Warning Panel (Mobile-First)
   ============================================ */

.geometry-warning {
    background: linear-gradient(135deg, #fef2f2 0%, #fee2e2 100%);
    border-radius: var(--radius);
    padding: 12px 15px;
    margin-top: 10px;
    border-left: 4px solid var(--danger);
    box-shadow: var(--shadow-sm);
    display: flex;
    align-items: flex-start;
    gap: 10px;
    animation: warningAppear 0.3s ease-out;
}

@keyframes warningAppear {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.geometry-warning .warning-icon {
    font-size: 1.25rem;
    flex-shrink: 0;
}

.geometry-warning .warning-text {
    color: #991b1b;
    font-size: 0.85rem;
    line-height: 1.5;
}

.geometry-warning .warning-text strong {
    color: #7f1d1d;
    font-weight: 700;
}

/* md: 768px+ */
@media (min-width: 768px) {
    .geometry-warning {
        padding: 16px 20px;
        margin-top: 12px;
        gap: 12px;
    }

    .geometry-warning .warning-icon {
        font-size: 1.5rem;
    }

    .geometry-warning .warning-text {
        font-size: 0.95rem;
    }
}

/* ============================================
   Language Switcher (Mobile-First)
   ============================================ */

.lang-switcher {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 10;
    display: flex;
    gap: 3px;
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    padding: 3px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.lang-btn {
    /* Touch-friendly size */
    min-width: var(--touch-target-min);
    min-height: 36px;
    padding: 6px 10px;
    background: transparent;
    border: none;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.8);
    cursor: pointer;
    transition: var(--transition-fast);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    -webkit-tap-highlight-color: transparent;
}

.lang-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    color: white;
}

.lang-btn.active {
    background: white;
    color: var(--primary);
    box-shadow: var(--shadow-sm);
}

/* sm: 480px+ */
@media (min-width: 480px) {
    .lang-switcher {
        top: 12px;
        right: 12px;
        gap: 4px;
        padding: 4px;
    }

    .lang-btn {
        padding: 6px 12px;
        font-size: 0.85rem;
    }
}

/* md: 768px+ */
@media (min-width: 768px) {
    .lang-switcher {
        top: 15px;
        right: 15px;
    }
}

/* ============================================
   Print Styles
   ============================================ */

@media print {
    .floating-score,
    .lang-switcher,
    .toast-container,
    .app-loader {
        display: none !important;
    }

    .container {
        max-width: 100%;
        padding: 0;
    }

    .main-content {
        display: block;
    }

    .card {
        box-shadow: none;
        border: 1px solid #ddd;
        page-break-inside: avoid;
    }

    header {
        background: #6366f1 !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }
}

/* ============================================
   Accessibility Improvements
   ============================================ */

/* Focus visible styles for keyboard navigation */
:focus-visible {
    outline: 3px solid var(--primary);
    outline-offset: 2px;
}

/* Reduce motion for users who prefer it */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .card {
        border-width: 2px;
    }

    .btn {
        border: 2px solid currentColor;
    }

    .task-item {
        border-width: 3px;
    }
}

/* ============================================
   Author/Tutor CTA Block
   ============================================ */

.author-block {
    margin-top: 24px;
    background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
    border: 2px solid var(--primary-light);
    border-radius: var(--radius);
    overflow: hidden;
}

.author-content {
    display: flex;
    flex-direction: column;
    gap: 20px;
    padding: 20px;
}

.author-info {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 16px;
}

.author-avatar {
    width: 72px;
    height: 72px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.3);
}

.author-avatar svg {
    color: white;
}

.author-avatar-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}

/* When showing photo, remove gradient background */
.author-avatar.has-photo {
    background: none;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
}

.author-text h3 {
    font-size: 1.1rem;
    color: var(--dark);
    margin-bottom: 8px;
    font-weight: 600;
}

.author-text p {
    font-size: 0.95rem;
    color: var(--dark-light);
    line-height: 1.5;
}

.author-actions {
    display: flex;
    justify-content: center;
}

.btn-cta {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    color: white;
    padding: 14px 28px;
    border-radius: 50px;
    font-size: 1rem;
    font-weight: 600;
    text-decoration: none;
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.4);
    transition: var(--transition);
}

.btn-cta:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(99, 102, 241, 0.5);
}

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

.btn-cta svg {
    transition: transform 0.2s ease;
}

.btn-cta:hover svg {
    transform: translateX(4px);
}

/* sm: 480px+ */
@media (min-width: 480px) {
    .author-info {
        flex-direction: row;
        text-align: left;
    }

    .author-text h3 {
        font-size: 1.2rem;
    }
}

/* md: 768px+ */
@media (min-width: 768px) {
    .author-content {
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
        padding: 24px 32px;
    }

    .author-info {
        flex: 1;
    }

    .author-actions {
        flex-shrink: 0;
    }

    .author-text h3 {
        font-size: 1.3rem;
    }

    .author-text p {
        font-size: 1rem;
    }
}

/* lg: 1024px+ */
@media (min-width: 1024px) {
    .author-block {
        margin-top: 32px;
    }

    .author-avatar {
        width: 80px;
        height: 80px;
    }

    .author-avatar svg {
        width: 56px;
        height: 56px;
    }

    .btn-cta {
        padding: 16px 32px;
        font-size: 1.05rem;
    }
}

/* ============================================
   Footer Styles
   ============================================ */

.site-footer {
    margin-top: 32px;
    padding: 24px 16px;
    text-align: center;
    color: var(--dark-light);
    font-size: 0.9rem;
}

.site-footer a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s ease;
}

.site-footer a:hover {
    color: var(--primary-dark);
    text-decoration: underline;
}

.footer-copyright {
    margin-top: 8px;
    font-size: 0.85rem;
    color: var(--gray-300);
}

/* md: 768px+ */
@media (min-width: 768px) {
    .site-footer {
        padding: 32px 24px;
    }
}

/* Print: hide author block */
@media print {
    .author-block,
    .site-footer {
        display: none;
    }
}

/* ============================================
   FAQ Section (Mobile-First)
   ============================================ */

.faq-section {
    margin-top: 24px;
}

.faq-section h2 {
    color: var(--dark);
    font-size: 1.3rem;
    margin-bottom: 20px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 10px;
}

.faq-section h2::before {
    content: '';
    width: 4px;
    height: 24px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    border-radius: 2px;
    flex-shrink: 0;
}

.faq-container {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.faq-item {
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border-radius: var(--radius-sm);
    border: 2px solid var(--gray-200);
    overflow: hidden;
    transition: var(--transition);
}

.faq-item:hover {
    border-color: var(--primary-light);
}

.faq-item[open] {
    border-color: var(--primary);
    box-shadow: var(--shadow);
}

.faq-item summary {
    padding: 16px;
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--dark);
    cursor: pointer;
    list-style: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    transition: var(--transition);
    /* Touch-friendly */
    min-height: var(--touch-target-min);
    -webkit-tap-highlight-color: transparent;
    user-select: none;
}

.faq-item summary::-webkit-details-marker {
    display: none;
}

.faq-item summary::after {
    content: '+';
    font-size: 1.5rem;
    font-weight: 300;
    color: var(--primary);
    transition: transform 0.3s ease;
    flex-shrink: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.faq-item[open] summary::after {
    transform: rotate(45deg);
}

.faq-item summary:hover {
    background: rgba(99, 102, 241, 0.05);
}

.faq-item p {
    padding: 0 16px 16px;
    font-size: 0.9rem;
    color: var(--dark-light);
    line-height: 1.7;
    animation: fadeIn 0.3s ease;
}

/* md: 768px+ */
@media (min-width: 768px) {
    .faq-section {
        margin-top: 32px;
    }

    .faq-section h2 {
        font-size: 1.5rem;
        margin-bottom: 24px;
    }

    .faq-container {
        gap: 16px;
    }

    .faq-item summary {
        padding: 18px 20px;
        font-size: 1rem;
    }

    .faq-item p {
        padding: 0 20px 20px;
        font-size: 0.95rem;
    }
}

/* lg: 1024px+ */
@media (min-width: 1024px) {
    .faq-item summary {
        padding: 20px 24px;
    }

    .faq-item p {
        padding: 0 24px 24px;
        font-size: 1rem;
    }
}

/* ============================================
   SAT/ACT/AP Score Calculator Styles
   ============================================ */

/* SAT Score Panel */
.sat-score-panel,
.act-score-panel {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white;
    padding: 1.5rem;
    border-radius: var(--radius);
    margin-bottom: 1.5rem;
}

.sat-sections,
.act-sections {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

@media (min-width: 768px) {
    .sat-sections,
    .act-sections {
        flex-direction: row;
        gap: 2rem;
    }
}

.section-display {
    flex: 1;
}

.section-name {
    display: block;
    font-size: 0.875rem;
    opacity: 0.9;
    margin-bottom: 0.5rem;
}

.section-bar-container {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 4px;
    height: 8px;
    overflow: hidden;
    margin-bottom: 0.5rem;
}

.section-bar {
    height: 100%;
    border-radius: 4px;
    transition: width 0.5s ease;
}

.section-score {
    font-size: 1.5rem;
    font-weight: 700;
}

.sat-composite,
.act-composite {
    display: flex;
    align-items: baseline;
    justify-content: center;
    gap: 0.5rem;
    padding-top: 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
}

.composite-label {
    font-size: 0.875rem;
    opacity: 0.9;
}

.composite-value {
    font-size: 2.5rem;
    font-weight: 800;
}

.composite-max {
    font-size: 1rem;
    opacity: 0.7;
}

/* Percentile Display */
.percentile-display {
    background: var(--gray-100);
    padding: 1rem;
    border-radius: var(--radius-sm);
    text-align: center;
    margin-bottom: 1rem;
}

/* Concordance Display */
.concordance-display {
    background: var(--info);
    color: white;
    padding: 1rem 1.5rem;
    border-radius: var(--radius-sm);
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.concordance-label {
    font-size: 0.875rem;
}

.concordance-value {
    font-size: 1.5rem;
    font-weight: 700;
}

/* Benchmarks Panel */
.benchmarks-panel {
    background: var(--light);
    padding: 1rem 1.5rem;
    border-radius: var(--radius-sm);
    margin-bottom: 1.5rem;
}

.benchmarks-panel h4 {
    margin: 0 0 1rem;
    color: var(--dark);
    font-size: 1rem;
}

.benchmarks-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 0.75rem;
}

.benchmark-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem;
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
}

.benchmark-item.met {
    background: rgba(16, 185, 129, 0.1);
    color: var(--success);
}

.benchmark-item.not-met {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger);
}

.benchmark-icon {
    font-size: 1.25rem;
}

.benchmark-label {
    flex: 1;
}

/* AP Score Panels */
.ap-summary-panel {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
    margin-bottom: 1.5rem;
}

@media (min-width: 768px) {
    .ap-summary-panel {
        grid-template-columns: repeat(4, 1fr);
    }
}

.ap-stat {
    background: var(--light);
    padding: 1rem;
    border-radius: var(--radius-sm);
    text-align: center;
}

.ap-stat-value {
    display: block;
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary);
}

.ap-stat-label {
    font-size: 0.75rem;
    color: var(--dark-light);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.ap-credits-panel,
.ap-savings-panel {
    background: linear-gradient(135deg, var(--success), var(--success-light));
    color: white;
    padding: 1.5rem;
    border-radius: var(--radius);
    text-align: center;
    margin-bottom: 1rem;
}

.ap-credits-panel h4,
.ap-savings-panel h4 {
    margin: 0 0 0.75rem;
    font-size: 0.875rem;
    opacity: 0.9;
}

.credits-range {
    display: flex;
    justify-content: center;
    align-items: baseline;
    gap: 0.25rem;
}

.credits-min,
.credits-max {
    font-size: 2rem;
    font-weight: 700;
}

.credits-separator {
    font-size: 1.5rem;
    opacity: 0.7;
}

.credits-label {
    font-size: 1rem;
    opacity: 0.9;
    margin-left: 0.5rem;
}

.savings-amount {
    font-size: 1.75rem;
    font-weight: 700;
}

.savings-note {
    font-size: 0.75rem;
    opacity: 0.8;
    margin-top: 0.5rem;
}

/* Chart specific styles */
.sat-chart,
.act-chart,
.ap-chart {
    min-height: 250px;
}

@media (min-width: 768px) {
    .sat-chart,
    .act-chart,
    .ap-chart {
        min-height: 300px;
    }
}

/* ============================================
   Consent Banner & Modal (GDPR/CCPA)
   ============================================ */

.consent-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: white;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.15);
    z-index: 10001;
    transform: translateY(100%);
    transition: transform 0.3s ease;
    border-top: 3px solid var(--primary);
}

.consent-banner-visible {
    transform: translateY(0);
}

.consent-banner-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

@media (min-width: 768px) {
    .consent-banner-content {
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
        padding: 24px 32px;
    }
}

.consent-banner-text h3 {
    font-size: 1rem;
    color: var(--dark);
    margin-bottom: 8px;
    font-weight: 700;
}

.consent-banner-text p {
    font-size: 0.875rem;
    color: var(--dark-light);
    line-height: 1.5;
    margin: 0;
}

.consent-banner-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

@media (min-width: 480px) {
    .consent-banner-actions {
        flex-wrap: nowrap;
    }
}

.consent-btn-settings,
.consent-btn-reject,
.consent-btn-accept {
    flex: 1;
    min-width: 100px;
    padding: 12px 20px;
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: 0.875rem;
    cursor: pointer;
    transition: var(--transition);
    border: 2px solid transparent;
}

.consent-btn-settings {
    background: var(--gray-100);
    color: var(--dark-light);
    border-color: var(--gray-300);
}

.consent-btn-settings:hover {
    background: var(--gray-200);
    border-color: var(--dark-light);
}

.consent-btn-reject {
    background: white;
    color: var(--dark);
    border-color: var(--gray-300);
}

.consent-btn-reject:hover {
    background: var(--gray-100);
    border-color: var(--dark);
}

.consent-btn-accept {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
    border: none;
    box-shadow: 0 4px 6px rgba(99, 102, 241, 0.25);
}

.consent-btn-accept:hover {
    background: linear-gradient(135deg, var(--primary-dark) 0%, var(--secondary) 100%);
    transform: translateY(-1px);
    box-shadow: 0 6px 12px rgba(99, 102, 241, 0.35);
}

/* Consent Modal */
.consent-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 10002;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s, visibility 0.3s;
}

.consent-modal-visible {
    opacity: 1;
    visibility: visible;
}

.consent-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
}

.consent-modal-content {
    position: relative;
    background: white;
    border-radius: var(--radius);
    width: 90%;
    max-width: 600px;
    max-height: 90vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow-xl);
    transform: scale(0.9);
    transition: transform 0.3s;
}

.consent-modal-visible .consent-modal-content {
    transform: scale(1);
}

.consent-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 2px solid var(--gray-200);
}

.consent-modal-header h2 {
    font-size: 1.25rem;
    color: var(--dark);
    margin: 0;
}

.consent-modal-close {
    background: none;
    border: none;
    padding: 8px;
    cursor: pointer;
    color: var(--dark-light);
    border-radius: 50%;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
}

.consent-modal-close:hover {
    background: var(--gray-100);
    color: var(--danger);
}

.consent-modal-body {
    padding: 24px;
    overflow-y: auto;
    flex: 1;
}

.consent-modal-body > p {
    font-size: 0.9rem;
    color: var(--dark-light);
    margin-bottom: 24px;
    line-height: 1.6;
}

.consent-categories {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.consent-category {
    background: var(--gray-100);
    border-radius: var(--radius-sm);
    padding: 16px;
}

.consent-category-header {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 8px;
}

.consent-category-info {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 10px;
}

.consent-category-info h4 {
    font-size: 1rem;
    color: var(--dark);
    margin: 0;
}

.consent-required {
    font-size: 0.75rem;
    background: var(--gray-300);
    color: var(--dark-light);
    padding: 2px 8px;
    border-radius: 12px;
}

.consent-category-description {
    font-size: 0.85rem;
    color: var(--dark-light);
    line-height: 1.5;
    margin: 0;
}

/* Toggle Switch */
.consent-toggle {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 28px;
    flex-shrink: 0;
}

.consent-toggle input {
    opacity: 0;
    width: 0;
    height: 0;
}

.consent-toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--gray-300);
    transition: var(--transition);
    border-radius: 28px;
}

.consent-toggle-slider::before {
    position: absolute;
    content: '';
    height: 22px;
    width: 22px;
    left: 3px;
    bottom: 3px;
    background: white;
    transition: var(--transition);
    border-radius: 50%;
    box-shadow: var(--shadow-sm);
}

.consent-toggle input:checked + .consent-toggle-slider {
    background: var(--success);
}

.consent-toggle input:checked + .consent-toggle-slider::before {
    transform: translateX(22px);
}

.consent-toggle input:disabled + .consent-toggle-slider {
    opacity: 0.6;
    cursor: not-allowed;
}

.consent-modal-footer {
    padding: 20px 24px;
    border-top: 2px solid var(--gray-200);
    display: flex;
    justify-content: flex-end;
}

.consent-btn-save {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
    padding: 12px 32px;
    border: none;
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: 0 4px 6px rgba(99, 102, 241, 0.25);
}

.consent-btn-save:hover {
    background: linear-gradient(135deg, var(--primary-dark) 0%, var(--secondary) 100%);
    transform: translateY(-1px);
    box-shadow: 0 6px 12px rgba(99, 102, 241, 0.35);
}

/* Print: hide consent elements */
@media print {
    .consent-banner,
    .consent-modal {
        display: none !important;
    }
}

/* ============================================
   Impact Dashboard Styles
   ============================================ */

.impact-hero {
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    color: white;
    padding: 60px 20px;
    text-align: center;
    border-radius: var(--radius);
    margin-bottom: 32px;
}

.impact-hero h1 {
    font-size: 2rem;
    margin-bottom: 16px;
}

.impact-hero p {
    font-size: 1.1rem;
    opacity: 0.9;
    max-width: 600px;
    margin: 0 auto;
}

@media (min-width: 768px) {
    .impact-hero {
        padding: 80px 40px;
    }

    .impact-hero h1 {
        font-size: 2.5rem;
    }
}

.impact-stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
    margin-bottom: 32px;
}

@media (min-width: 768px) {
    .impact-stats-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 24px;
    }
}

.impact-stat-card {
    background: white;
    padding: 24px;
    border-radius: var(--radius);
    text-align: center;
    box-shadow: var(--shadow);
    border: 1px solid var(--gray-200);
    transition: var(--transition);
}

.impact-stat-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.impact-stat-icon {
    font-size: 2.5rem;
    margin-bottom: 12px;
}

.impact-stat-value {
    font-size: 2rem;
    font-weight: 800;
    color: var(--primary);
    margin-bottom: 4px;
}

.impact-stat-label {
    font-size: 0.875rem;
    color: var(--dark-light);
}

.impact-chart-section {
    background: white;
    padding: 24px;
    border-radius: var(--radius);
    margin-bottom: 32px;
    box-shadow: var(--shadow);
}

.impact-chart-section h2 {
    font-size: 1.25rem;
    margin-bottom: 24px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.impact-chart-section h2::before {
    content: '';
    width: 4px;
    height: 24px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    border-radius: 2px;
}

.impact-map-placeholder,
.impact-chart-placeholder {
    background: var(--gray-100);
    border-radius: var(--radius-sm);
    height: 300px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--dark-light);
}

.testimonials-section {
    margin-bottom: 32px;
}

.testimonials-section h2 {
    font-size: 1.5rem;
    text-align: center;
    margin-bottom: 24px;
}

.testimonials-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
}

@media (min-width: 768px) {
    .testimonials-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

.testimonial-card {
    background: white;
    padding: 24px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    border-left: 4px solid var(--primary);
}

.testimonial-quote {
    font-style: italic;
    color: var(--dark);
    line-height: 1.6;
    margin-bottom: 16px;
}

.testimonial-author {
    display: flex;
    align-items: center;
    gap: 12px;
}

.testimonial-avatar {
    width: 40px;
    height: 40px;
    background: var(--primary);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
}

.testimonial-info {
    flex: 1;
}

.testimonial-name {
    font-weight: 600;
    color: var(--dark);
}

.testimonial-role {
    font-size: 0.85rem;
    color: var(--dark-light);
}

/* ============================================
   Foreign Exam System Styles
   ============================================ */

.exam-system-container,
.foreign-exam-container {
    margin-bottom: 12px;
}

.exam-system-container select,
.foreign-exam-container select {
    width: 100%;
    padding: 14px 16px;
    border: 2px solid var(--gray-200);
    border-radius: var(--radius-sm);
    font-size: 16px;
    transition: var(--transition);
    background-color: white;
    min-height: var(--touch-target-min);
}

/* ============================================
   Exam Info Block (Date, Duration, Countdown)
   ============================================ */

.exam-info-block {
    background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%);
    border-radius: var(--radius);
    padding: 16px;
    margin-bottom: 16px;
    border-left: 4px solid var(--success);
    box-shadow: var(--shadow-sm);
}

.exam-info-countdown {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 12px 16px;
    background: white;
    border-radius: var(--radius-sm);
    margin-bottom: 14px;
    box-shadow: var(--shadow-sm);
}

.countdown-icon {
    font-size: 1.5rem;
}

.countdown-text {
    font-size: 1rem;
    font-weight: 600;
    color: var(--dark);
}

.countdown-text .countdown-days {
    color: var(--success);
    font-size: 1.25rem;
    font-weight: 700;
}

.countdown-text .countdown-urgent {
    color: var(--danger);
}

.exam-info-details {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}

.exam-info-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
    background: white;
    padding: 10px 12px;
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-sm);
}

.exam-info-item .info-label {
    font-size: 0.75rem;
    color: var(--dark-light);
    font-weight: 500;
}

.exam-info-item .info-value {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--dark);
}

/* md: 768px+ */
@media (min-width: 768px) {
    .exam-info-block {
        padding: 20px;
        margin-bottom: 20px;
    }

    .exam-info-countdown {
        padding: 14px 20px;
        margin-bottom: 16px;
    }

    .countdown-text {
        font-size: 1.1rem;
    }

    .countdown-text .countdown-days {
        font-size: 1.4rem;
    }

    .exam-info-details {
        grid-template-columns: repeat(4, 1fr);
        gap: 14px;
    }

    .exam-info-item {
        padding: 12px 16px;
    }

    .exam-info-item .info-label {
        font-size: 0.8rem;
    }

    .exam-info-item .info-value {
        font-size: 1rem;
    }
}

/* Exam passed state */
.exam-info-block.exam-passed {
    background: linear-gradient(135deg, #f1f5f9 0%, #e2e8f0 100%);
    border-left-color: var(--gray-300);
}

.exam-info-block.exam-passed .countdown-text {
    color: var(--dark-light);
}

/* ============================================
   No Data Message Styles
   ============================================ */

.no-data-message,
.no-chart-message {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    text-align: center;
    color: var(--dark-light);
    font-size: 1rem;
    background: var(--gray-100);
    border-radius: var(--radius);
    border: 2px dashed var(--gray-300);
    min-height: 150px;
}

.no-data-message {
    margin: 20px 0;
}

.no-chart-message {
    margin: 10px 0;
}

/* md: 768px+ */
@media (min-width: 768px) {
    .no-data-message,
    .no-chart-message {
        padding: 60px 40px;
        font-size: 1.1rem;
        min-height: 200px;
    }
}

/* ============================================
   Diagnostic CTA (under recommendations)
   ============================================ */

.cta-diagnostic {
    margin-top: 14px;
    padding-top: 14px;
    border-top: 1px dashed rgba(99, 102, 241, 0.35);
}

.cta-diagnostic-text {
    line-height: 1.6;
    color: var(--dark);
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 10px;
}

.cta-diagnostic-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.cta-diagnostic-btn {
    display: inline-block;
    padding: 10px 16px;
    border-radius: var(--radius);
    font-size: 0.9rem;
    font-weight: 600;
    text-decoration: none;
    color: var(--primary);
    border: 2px solid var(--primary);
    transition: all 0.2s ease;
}

.cta-diagnostic-btn:hover {
    background: rgba(99, 102, 241, 0.1);
}

.cta-diagnostic-btn-primary {
    color: #fff;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    border-color: transparent;
}

.cta-diagnostic-btn-primary:hover {
    background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary-dark) 100%);
    color: #fff;
}
