/* Reset & Base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary: #2563eb;
    --primary-dark: #1e40af;
    --primary-light: #3b82f6;
    --success: #059669;
    --warning: #d97706;
    --danger: #dc2626;
    --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;
    --white: #ffffff;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
    background: var(--gray-50);
    color: var(--gray-900);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    font-size: 16px;
    overflow-x: hidden;
}

/* Prevent zoom on iOS */
input, select, textarea {
    font-size: 16px !important;
}

/* Header - Mobile First */
.header {
    background: var(--white);
    border-bottom: 1px solid var(--gray-200);
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
}

.logo-icon-wrapper {
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.logo-svg {
    width: 32px;
    height: 32px;
    color: white;
}

.logo-text {
    display: flex;
    flex-direction: column;
}

.logo-title {
    font-weight: 700;
    font-size: 15px;
    color: var(--gray-900);
    line-height: 1.2;
    letter-spacing: -0.02em;
}

.logo-subtitle {
    display: none;
}

/* Bottom Navigation */
.header-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--white);
    border-top: 1px solid var(--gray-200);
    padding: 8px 0;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0;
    z-index: 1000;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.08);
}

.nav-link {
    padding: 10px 8px;
    font-size: 11px;
    text-align: center;
    border-radius: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    line-height: 1.2;
    min-height: 56px;
    justify-content: center;
    background: none;
    border: none;
    color: var(--gray-600);
    cursor: pointer;
    transition: color 0.15s;
}

.nav-link:hover {
    background: transparent;
}

.nav-link.active {
    background: transparent;
    color: var(--primary);
    font-weight: 600;
}

/* Container */
.container-wide {
    padding: 0;
    margin: 0;
}

/* Views */
.view {
    display: none;
    padding: 16px 0 80px;
    min-height: calc(100vh - 60px - 72px);
}

.view.active {
    display: block;
}

/* Page Header */
.page-header {
    margin-bottom: 20px;
    padding: 0 16px;
}

.page-header h1 {
    font-size: 22px;
    font-weight: 700;
    color: var(--gray-900);
    margin-bottom: 6px;
    letter-spacing: -0.02em;
}

.page-description {
    font-size: 14px;
    color: var(--gray-600);
    line-height: 1.4;
}

/* Grid Layout - Mobile First (Single Column) */
.grid-layout {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.left-column {
    order: 2;
}

.right-column {
    order: 1;
}

/* Cards */
.card {
    background: var(--white);
    border-radius: 0;
    border-left: none;
    border-right: none;
    border-top: 1px solid var(--gray-200);
    border-bottom: 8px solid var(--gray-100);
    margin-bottom: 0;
}

.card-header {
    padding: 16px;
    border-bottom: 1px solid var(--gray-200);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.card-header.collapsible {
    cursor: pointer;
    user-select: none;
}

.card-header.collapsible:active {
    background: var(--gray-50);
}

.card-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--gray-900);
}

.card-description {
    font-size: 13px;
    color: var(--gray-500);
    margin-top: 4px;
}

.card-body {
    padding: 16px;
}

.expand-icon {
    color: var(--gray-400);
    transition: transform 0.2s;
    flex-shrink: 0;
}

.card-header.expanded .expand-icon {
    transform: rotate(180deg);
}

.collapsible-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.collapsible-content.expanded {
    max-height: 2000px;
}

/* Form Elements */
.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--gray-700);
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.form-hint {
    display: block;
    font-size: 12px;
    color: var(--gray-500);
    margin-top: 6px;
}

.form-input, .form-select {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid var(--gray-300);
    border-radius: 8px;
    font-size: 16px;
    color: var(--gray-900);
    background: var(--white);
    transition: all 0.15s;
}

.form-input:focus, .form-select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.form-select[size] {
    padding: 8px;
    max-height: 200px;
    font-size: 15px;
}

.form-select option {
    padding: 10px;
}

/* Input Groups */
.input-group {
    display: flex;
    align-items: center;
    border: 1px solid var(--gray-300);
    border-radius: 8px;
    overflow: hidden;
}

.input-group:focus-within {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.input-prefix, .input-suffix {
    padding: 12px 14px;
    background: var(--gray-50);
    color: var(--gray-600);
    font-size: 15px;
    font-weight: 500;
    flex-shrink: 0;
}

.input-group input {
    border: none;
    flex: 1;
    min-width: 0;
}

/* Search */
.search-wrapper {
    position: relative;
    margin-bottom: 12px;
}

.search-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--gray-400);
    pointer-events: none;
    z-index: 1;
}

.search-input {
    padding: 12px 44px 12px 40px;
    font-size: 16px;
    border-radius: 8px;
}

.clear-search-btn {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    width: 28px;
    height: 28px;
    border-radius: 6px;
    border: none;
    background: var(--gray-200);
    color: var(--gray-600);
    cursor: pointer;
    font-size: 18px;
    line-height: 1;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
}

.clear-search-btn:active {
    background: var(--gray-300);
}

.search-dropdown {
    position: absolute;
    top: 50px;
    left: 0;
    right: 0;
    background: var(--white);
    border: 1px solid var(--gray-300);
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
    max-height: 280px;
    overflow-y: auto;
    z-index: 9999;
}

.search-result-item {
    padding: 14px 16px;
    cursor: pointer;
    border-bottom: 1px solid var(--gray-100);
    font-size: 15px;
    min-height: 52px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.search-result-item:last-child {
    border-bottom: none;
}

.search-result-item:active {
    background: var(--primary);
    color: var(--white);
}

.search-result-item mark {
    background: rgba(255, 193, 7, 0.3);
    padding: 2px 4px;
    border-radius: 3px;
}

.search-result-meta {
    font-size: 13px;
    color: var(--gray-500);
    margin-top: 3px;
}

/* Pills - Mobile Optimized */
.filter-pills {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 4px;
    flex-wrap: nowrap;
    scrollbar-width: none;
}

.filter-pills::-webkit-scrollbar {
    display: none;
}

.pill {
    padding: 10px 18px;
    background: var(--white);
    border: 2px solid var(--gray-300);
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    color: var(--gray-700);
    cursor: pointer;
    white-space: nowrap;
    flex-shrink: 0;
    min-height: 44px;
    display: flex;
    align-items: center;
}

.pill:active {
    background: var(--gray-50);
}

.pill.active {
    background: var(--gray-900);
    color: var(--white);
    border-color: var(--gray-900);
}

/* Checkbox */
.checkbox-wrapper {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px;
    background: var(--gray-50);
    border-radius: 8px;
    cursor: pointer;
    min-height: 52px;
}

.checkbox-wrapper:active {
    background: var(--gray-100);
}

.checkbox {
    width: 22px;
    height: 22px;
    cursor: pointer;
    accent-color: var(--primary);
    flex-shrink: 0;
}

.checkbox-label {
    font-size: 15px;
    font-weight: 500;
    color: var(--gray-700);
    cursor: pointer;
    user-select: none;
}

.input-reveal {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--gray-200);
}

/* Sliders */
.slider-group {
    margin-bottom: 16px;
}

.slider-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.slider-label {
    font-size: 13px;
    font-weight: 500;
    color: var(--gray-700);
}

.slider-value {
    font-size: 14px;
    font-weight: 600;
    color: var(--gray-900);
    background: var(--gray-100);
    padding: 4px 12px;
    border-radius: 4px;
}

.range-slider {
    width: 100%;
    height: 8px;
    border-radius: 4px;
    background: var(--gray-200);
    outline: none;
    cursor: pointer;
    margin-bottom: 8px;
    -webkit-appearance: none;
}

.range-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--primary);
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.range-slider::-moz-range-thumb {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--primary);
    cursor: pointer;
    border: none;
}

.slider-labels {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    color: var(--gray-500);
}

/* Info Box */
.info-box {
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: 8px;
    padding: 14px;
    margin-top: 16px;
}

.info-row {
    display: flex;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px solid var(--gray-100);
}

.info-row:last-of-type {
    border-bottom: none;
}

.info-label {
    font-size: 13px;
    color: var(--gray-600);
}

.info-value {
    font-size: 14px;
    font-weight: 600;
    color: var(--gray-900);
}

.info-highlight {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--gray-200);
    font-size: 14px;
    color: var(--gray-700);
    text-align: center;
}

/* Buttons - Larger touch targets */
.btn-primary {
    width: 100%;
    padding: 16px 20px;
    background: var(--primary);
    color: var(--white);
    border: none;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.2);
    min-height: 52px;
}

.btn-primary:active {
    transform: scale(0.98);
    background: var(--primary-dark);
}

.btn-secondary {
    padding: 12px 20px;
    background: var(--white);
    color: var(--gray-700);
    border: 1px solid var(--gray-300);
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    min-height: 44px;
}

.btn-secondary:active {
    background: var(--gray-50);
}

.link-btn {
    background: none;
    border: none;
    color: var(--primary);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    padding: 8px;
    min-height: 44px;
}

/* Notice */
.notice {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 14px;
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    border-radius: 8px;
    font-size: 14px;
    color: #1e40af;
    margin: 16px;
}

/* Placeholder State */
.placeholder-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 40px 20px;
    margin: 0 16px;
    background: var(--white);
    border: 2px dashed var(--gray-300);
    border-radius: 12px;
    color: var(--gray-400);
}

.placeholder-state svg {
    width: 48px;
    height: 48px;
}

.placeholder-state h3 {
    font-size: 16px;
    color: var(--gray-700);
    margin: 12px 0 6px;
}

.placeholder-state p {
    font-size: 13px;
    color: var(--gray-500);
    line-height: 1.5;
}

/* Results */
#results {
    background: var(--white);
    border: none;
    border-radius: 0;
    padding: 0;
}

.results-header {
    padding: 20px 16px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: var(--white);
    border: none;
}

.results-header h2 {
    font-size: 18px;
    font-weight: 700;
    color: var(--white);
    margin-bottom: 4px;
}

.results-header p {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.9);
}

#results > div:not(.results-header) {
    padding: 16px;
}

/* Badges */
.badges {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 16px;
    background: var(--gray-50);
    border-bottom: 8px solid var(--gray-100);
}

.badge {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 12px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
    width: 100%;
    min-height: 40px;
}

.badge-success {
    background: #d1fae5;
    color: #065f46;
}

.badge-warning {
    background: #fef3c7;
    color: #92400e;
}

.badge-info {
    background: #dbeafe;
    color: #1e40af;
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
    padding: 0 16px;
    margin-bottom: 24px;
}

.stat-card {
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: 12px;
    padding: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 14px;
    min-height: 80px;
}

.stat-card:active {
    background: var(--gray-50);
}

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 10px;
    background: var(--gray-100);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary);
    flex-shrink: 0;
}

.stat-content {
    flex: 1;
}

.stat-label {
    font-size: 11px;
    color: var(--gray-500);
    margin-bottom: 2px;
}

.stat-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--gray-900);
}

/* Filters Bar - Mobile Optimized */
.filters-bar {
    background: var(--white);
    border-top: 1px solid var(--gray-200);
    border-bottom: 1px solid var(--gray-200);
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.filter-section {
    width: 100%;
}

.filter-label {
    display: block;
    font-size: 11px;
    font-weight: 600;
    color: var(--gray-700);
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

/* Mobile-friendly filter chips with larger touch targets */
.filter-chips {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    flex-wrap: nowrap;
    padding-bottom: 4px;
    scrollbar-width: none;
}

.filter-chips::-webkit-scrollbar {
    display: none;
}

/* Simple button-based filters instead of checkboxes */
.chip-checkbox {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 18px;
    background: var(--white);
    border: 2px solid var(--gray-300);
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    color: var(--gray-700);
    cursor: pointer;
    user-select: none;
    white-space: nowrap;
    flex-shrink: 0;
    min-height: 44px;
}

/* Hide the actual checkbox */
.chip-checkbox input {
    display: none;
}

/* Active state when checked */
.chip-checkbox:has(input:checked) {
    background: var(--primary);
    color: var(--white);
    border-color: var(--primary);
}

.chip-btn {
    padding: 10px 18px;
    background: var(--white);
    border: 2px solid var(--gray-300);
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    color: var(--gray-700);
    cursor: pointer;
    white-space: nowrap;
    flex-shrink: 0;
    min-height: 44px;
}

.chip-btn.active {
    background: var(--primary);
    color: var(--white);
    border-color: var(--primary);
}

.sort-select {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid var(--gray-300);
    border-radius: 8px;
    font-size: 15px;
    color: var(--gray-700);
    background: var(--white);
    min-height: 48px;
}

/* Course Grid */
.course-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0;
}

.course-card-item {
    background: var(--white);
    border-top: 1px solid var(--gray-200);
    border-bottom: 1px solid var(--gray-200);
    padding: 16px;
    cursor: pointer;
    min-height: 120px;
}

.course-card-item:active {
    background: var(--gray-50);
}

.course-card-header {
    margin-bottom: 12px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--gray-100);
}

.course-card-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--gray-900);
    margin-bottom: 4px;
}

.course-card-subtitle {
    font-size: 13px;
    color: var(--gray-500);
}

.course-stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 12px;
}

.course-stat {
    background: var(--gray-50);
    padding: 10px;
    border-radius: 8px;
}

.course-stat-label {
    font-size: 10px;
    color: var(--gray-600);
    font-weight: 500;
    margin-bottom: 3px;
}

.course-stat-value {
    font-size: 15px;
    font-weight: 700;
    color: var(--gray-900);
}

/* Empty State */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 60px 20px;
    color: var(--gray-400);
}

.empty-state svg {
    width: 52px;
    height: 52px;
}

.empty-state h3 {
    font-size: 16px;
    color: var(--gray-700);
    margin: 12px 0 6px;
}

.empty-state p {
    font-size: 14px;
    color: var(--gray-500);
}

.loading-text {
    text-align: center;
    padding: 40px 20px;
    color: var(--gray-500);
    font-size: 15px;
}

/* Alert */
.alert {
    padding: 14px 16px;
    border-radius: 8px;
    font-size: 15px;
    margin: 16px;
}

.alert-error {
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

/* Charts */
.chart-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
    padding: 0 16px;
}

.chart-card {
    background: var(--gray-50);
    border: 1px solid var(--gray-200);
    border-radius: 12px;
    padding: 16px;
}

.chart-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--gray-900);
    margin-bottom: 12px;
}

/* Metrics Grid */
.metrics-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
    padding: 16px;
    background: var(--gray-50);
    border-bottom: 8px solid var(--gray-100);
}

.metric-card {
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: 8px;
    padding: 14px;
    text-align: center;
}

.metric-label {
    font-size: 10px;
    font-weight: 600;
    color: var(--gray-600);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 6px;
}

.metric-value {
    font-size: 22px;
    font-weight: 700;
    color: var(--gray-900);
}

.metric-change {
    font-size: 11px;
    color: var(--gray-500);
    margin-top: 4px;
}

/* Quiz iframe */
#quizFrame {
    height: calc(100vh - 140px) !important;
    border-radius: 0 !important;
}

/* Comparison Results */
#comparisonResults {
    padding: 0;
}

#comparisonResults .card {
    margin-bottom: 0;
}

/* Smooth scrolling */
html {
    scroll-behavior: smooth;
}

/* Better tap highlights */
* {
    -webkit-tap-highlight-color: rgba(37, 99, 235, 0.1);
}

/* Pull to refresh spacing */
body {
    overscroll-behavior-y: contain;
}

/* Extra Small Mobile (iPhone SE, etc.) */
@media (max-width: 375px) {
    .logo-title {
        font-size: 14px;
    }
    
    .page-header h1 {
        font-size: 20px;
    }
    
    .nav-link {
        font-size: 10px;
        padding: 8px 4px;
        min-height: 52px;
    }
    
    .metric-value {
        font-size: 20px;
    }
    
    .pill, .chip-checkbox, .chip-btn {
        padding: 8px 14px;
        font-size: 13px;
    }
}

/* Tablet and Desktop */
@media (min-width: 769px) {
    body {
        font-size: 14px;
    }
    
    .container-wide {
        max-width: 1400px;
        margin: 0 auto;
        padding: 0 24px;
    }
    
    .header-content {
        padding: 16px 0;
    }
    
    .logo-icon-wrapper {
        width: 44px;
        height: 44px;
    }
    
    .logo-svg {
        width: 40px;
        height: 40px;
    }
    
    .logo-title {
        font-size: 17px;
    }
    
    .logo-subtitle {
        display: block;
        font-size: 11px;
        color: var(--gray-500);
    }
    
    /* Desktop Navigation */
    .header-nav {
        position: static;
        background: transparent;
        border: none;
        padding: 0;
        display: flex;
        gap: 4px;
        box-shadow: none;
        grid-template-columns: auto;
    }
    
    .nav-link {
        padding: 8px 16px;
        font-size: 14px;
        border-radius: 6px;
        flex-direction: row;
        min-height: auto;
        gap: 0;
    }
    
    .nav-link:hover {
        background: var(--gray-100);
        color: var(--gray-900);
    }
    
    .nav-link.active {
        background: var(--gray-900);
        color: var(--white);
    }
    
    .view {
        padding: 32px 0;
    }
    
    .page-header {
        padding: 0;
        margin-bottom: 32px;
    }
    
    .page-header h1 {
        font-size: 28px;
        margin-bottom: 8px;
    }
    
    .page-description {
        font-size: 15px;
    }
    
    /* Desktop Grid Layout */
    .grid-layout {
        display: grid;
        grid-template-columns: 420px 1fr;
        gap: 32px;
        flex-direction: row;
    }
    
    .left-column {
        order: 1;
        position: sticky;
        top: 90px;
        align-self: start;
    }
    
    .right-column {
        order: 2;
        min-height: 600px;
    }
    
    /* Desktop Cards */
    .card {
        border-radius: 12px;
        border: 1px solid var(--gray-200);
        margin-bottom: 20px;
    }
    
    .card-header {
        padding: 20px 24px;
    }
    
    .card-title {
        font-size: 15px;
    }
    
    .card-body {
        padding: 24px;
    }
    
    /* Desktop Forms */
    .form-group {
        margin-bottom: 24px;
    }
    
    .form-label {
        font-size: 13px;
    }
    
    .form-input, .form-select {
        padding: 10px 12px;
        font-size: 14px;
        border-radius: 6px;
    }
    
    .form-select[size] {
        font-size: 14px;
    }
    
    /* Desktop Search */
    .search-input {
        padding: 10px 36px 10px 36px;
        font-size: 14px;
        border-radius: 6px;
    }
    
    .search-icon {
        left: 12px;
    }
    
    .clear-search-btn {
        right: 8px;
        width: 24px;
        height: 24px;
    }
    
    .search-dropdown {
        top: 48px;
        max-height: 320px;
        border-radius: 8px;
    }
    
    .search-result-item {
        padding: 12px 14px;
        font-size: 14px;
        min-height: auto;
    }
    
    .search-result-item:hover {
        background: var(--primary);
        color: var(--white);
    }
    
    .search-result-meta {
        font-size: 12px;
    }
    
    /* Desktop Pills */
    .filter-pills {
        flex-wrap: wrap;
        margin-top: 12px;
    }
    
    .pill {
        padding: 6px 14px;
        font-size: 13px;
        border-radius: 100px;
        min-height: auto;
    }
    
    .pill:hover {
        background: var(--gray-50);
    }
    
    .pill:active {
        background: var(--gray-100);
    }
    
    /* Desktop Checkbox */
    .checkbox-wrapper {
        padding: 12px;
        border-radius: 6px;
        min-height: auto;
    }
    
    .checkbox {
        width: 16px;
        height: 16px;
    }
    
    .checkbox-label {
        font-size: 14px;
    }
    
    .checkbox-wrapper:hover {
        background: var(--gray-100);
    }
    
    /* Desktop Sliders */
    .slider-group {
        margin-bottom: 20px;
    }
    
    .slider-header {
        margin-bottom: 8px;
    }
    
    .slider-label {
        font-size: 13px;
    }
    
    .slider-value {
        font-size: 13px;
    }
    
    .range-slider {
        height: 4px;
        margin-bottom: 6px;
    }
    
    .range-slider::-webkit-slider-thumb {
        width: 16px;
        height: 16px;
    }
    
    .range-slider::-webkit-slider-thumb:hover {
        background: var(--primary-dark);
        transform: scale(1.2);
    }
    
    .range-slider::-moz-range-thumb {
        width: 16px;
        height: 16px;
    }
    
    .slider-labels {
        font-size: 11px;
    }
    
    /* Desktop Info Box */
    .info-box {
        padding: 12px;
        border-radius: 6px;
    }
    
    .info-row {
        padding: 8px 0;
    }
    
    .info-label {
        font-size: 13px;
    }
    
    .info-value {
        font-size: 13px;
    }
    
    .info-highlight {
        font-size: 13px;
    }
    
    /* Desktop Buttons */
    .btn-primary {
        padding: 12px 20px;
        font-size: 14px;
        border-radius: 6px;
        min-height: auto;
    }
    
    .btn-primary:hover {
        background: var(--primary-dark);
        transform: translateY(-1px);
        box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
    }
    
    .btn-primary:active {
        transform: translateY(0);
    }
    
    .btn-secondary {
        padding: 8px 16px;
        font-size: 13px;
        border-radius: 6px;
        min-height: auto;
    }
    
    .btn-secondary:hover {
        background: var(--gray-50);
    }
    
    /* Desktop Notice */
    .notice {
        padding: 12px 16px;
        font-size: 13px;
        border-radius: 6px;
        margin-top: 16px;
    }
    
    /* Desktop Placeholder */
    .placeholder-state {
        padding: 80px 40px;
        margin: 0;
        border-radius: 12px;
    }
    
    .placeholder-state svg {
        width: 64px;
        height: 64px;
    }
    
    .placeholder-state h3 {
        font-size: 16px;
        margin: 16px 0 8px;
    }
    
    .placeholder-state p {
        font-size: 14px;
        max-width: 400px;
    }
    
    /* Desktop Results */
    #results {
        background: var(--white);
        border: 1px solid var(--gray-200);
        border-radius: 12px;
        padding: 32px;
    }
    
    .results-header {
        padding: 0 0 24px 0;
        background: transparent;
        color: var(--gray-900);
        border-bottom: 1px solid var(--gray-200);
        margin-bottom: 24px;
    }
    
    .results-header h2 {
        font-size: 22px;
        color: var(--gray-900);
    }
    
    .results-header p {
        font-size: 14px;
        color: var(--gray-600);
    }
    
    #results > div:not(.results-header) {
        padding: 0;
    }
    
    /* Desktop Badges */
    .badges {
        flex-direction: row;
        gap: 8px;
        padding: 0;
        background: transparent;
        border-bottom: none;
        margin-bottom: 20px;
        flex-wrap: wrap;
    }
    
    .badge {
        width: auto;
        padding: 4px 10px;
        font-size: 12px;
        border-radius: 100px;
        min-height: auto;
    }
    
    /* Desktop Stats Grid */
    .stats-grid {
        grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
        gap: 20px;
        padding: 0;
        margin-bottom: 32px;
    }
    
    .stat-card {
        padding: 24px;
        border-radius: 12px;
        gap: 16px;
        min-height: auto;
    }
    
    .stat-card:hover {
        border-color: var(--primary);
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
        transform: translateY(-2px);
    }
    
    .stat-icon {
        width: 48px;
        height: 48px;
    }
    
    .stat-label {
        font-size: 12px;
    }
    
    .stat-title {
        font-size: 16px;
    }
    
    /* Desktop Filters Bar */
    .filters-bar {
        border-radius: 12px;
        padding: 24px;
        flex-direction: row;
        flex-wrap: wrap;
        gap: 24px;
        align-items: flex-end;
        margin-bottom: 24px;
    }
    
    .filter-section {
        flex: 1;
        min-width: 200px;
    }
    
    .filter-label {
        font-size: 12px;
        margin-bottom: 8px;
    }
    
    .filter-chips {
        flex-wrap: wrap;
    }
    
    .chip-checkbox, .chip-btn {
        padding: 6px 12px;
        font-size: 13px;
        border-radius: 100px;
        min-height: auto;
    }
    
    .chip-checkbox:hover, .chip-btn:hover {
        background: var(--gray-50);
    }
    
    .sort-select {
        padding: 8px 12px;
        font-size: 13px;
        border-radius: 6px;
        min-height: auto;
    }
    
    /* Desktop Course Grid */
    .course-grid {
        grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
        gap: 20px;
    }
    
    .course-card-item {
        border: 1px solid var(--gray-200);
        border-radius: 12px;
        padding: 20px;
        min-height: auto;
    }
    
    .course-card-item:hover {
        border-color: var(--primary);
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
        transform: translateY(-2px);
    }
    
    .course-card-header {
        margin-bottom: 16px;
        padding-bottom: 16px;
    }
    
    .course-card-title {
        font-size: 15px;
    }
    
    .course-card-subtitle {
        font-size: 13px;
    }
    
    .course-stats {
        gap: 12px;
        margin-bottom: 16px;
    }
    
    .course-stat {
        padding: 10px;
    }
    
    .course-stat-label {
        font-size: 11px;
    }
    
    .course-stat-value {
        font-size: 16px;
    }
    
    /* Desktop Empty State */
    .empty-state {
        padding: 80px 40px;
    }
    
    .empty-state svg {
        width: 64px;
        height: 64px;
    }
    
    .empty-state h3 {
        font-size: 16px;
        margin: 16px 0 8px;
    }
    
    .empty-state p {
        font-size: 14px;
    }
    
    .loading-text {
        padding: 60px 20px;
        font-size: 14px;
    }
    
    /* Desktop Alert */
    .alert {
        padding: 12px 16px;
        font-size: 14px;
        border-radius: 6px;
        margin: 0;
    }
    
    /* Desktop Charts */
    .chart-grid {
        grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
        gap: 20px;
        padding: 0;
    }
    
    .chart-card {
        padding: 20px;
        border-radius: 12px;
    }
    
    .chart-title {
        font-size: 14px;
        margin-bottom: 16px;
    }
    
    /* Desktop Metrics Grid */
    .metrics-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 16px;
        padding: 0;
        background: transparent;
        border-bottom: none;
        margin-bottom: 24px;
    }
    
    .metric-card {
        padding: 16px;
        border-radius: 8px;
    }
    
    .metric-label {
        font-size: 11px;
        margin-bottom: 8px;
    }
    
    .metric-value {
        font-size: 28px;
    }
    
    .metric-change {
        font-size: 12px;
    }
    
    /* Desktop Quiz iframe */
    #quizFrame {
        height: 90vh !important;
        border-radius: 12px !important;
    }
    
    /* Desktop Comparison Results */
    #comparisonResults {
        padding: initial;
    }
    
    #comparisonResults .card {
        margin-bottom: 20px;
    }
}

/* Tablet Landscape */
@media (min-width: 769px) and (max-width: 1024px) {
    .grid-layout {
        grid-template-columns: 380px 1fr;
    }
    
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .chart-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Mobile (up to 768px) - HIDE filters and search */
@media (max-width: 768px) {
    .desktop-only-filters {
        display: none !important;
    }
}

/* Desktop (769px and up) - SHOW filters and search */
@media (min-width: 769px) {
    .desktop-only-filters {
        display: block;
    }
}

/* Mobile only (up to 768px) */
@media (max-width: 768px) {
    /* Bottom Navigation */
    .header-nav {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        background: var(--white);
        border-top: 2px solid var(--gray-300); /* Stronger border */
        padding: 8px 0;
        display: grid;
        grid-template-columns: repeat(4, 1fr);
        gap: 0;
        z-index: 1000;
        box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.12); /* Stronger shadow */
    }

    .nav-link {
        padding: 10px 8px;
        font-size: 12px; /* Slightly larger */
        font-weight: 600; /* Make it bold */
        text-align: center;
        border-radius: 0;
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 4px;
        line-height: 1.2;
        min-height: 56px;
        justify-content: center;
        background: none;
        border: none;
        color: var(--gray-700); /* Darker color */
        cursor: pointer;
        transition: all 0.2s ease;
    }

    .nav-link:hover {
        background: transparent;
    }

    .nav-link.active {
        background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%); /* Subtle background */
        color: var(--primary);
        font-weight: 700; /* Extra bold when active */
        border-top: 3px solid var(--primary); /* Top indicator */
    }
}

/* Extra Small Mobile (iPhone SE, etc.) */
@media (max-width: 375px) {
    .nav-link {
        font-size: 11px;
        font-weight: 600;
        padding: 8px 4px;
        min-height: 52px;
    }
    
    .nav-link.active {
        font-weight: 700;
    }
}

@media (max-width: 768px) {
    #resultsPlaceholder {
        display: none !important;
    }
}

.course-disclaimer {
        display: block;
        background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
        border: 1px solid #fbbf24;
        border-radius: 8px;
        padding: 12px 14px;
        margin: 16px 0;
        font-size: 13px;
        color: #92400e;
        line-height: 1.5;
    }
    
    .course-disclaimer strong {
        font-weight: 600;
        color: #78350f;
    }
}

/* Desktop - hide the disclaimer or keep it subtle */
@media (min-width: 769px) {
    .course-disclaimer {
        display: block;
        background: #eff6ff;
        border: 1px solid #bfdbfe;
        border-radius: 6px;
        padding: 10px 14px;
        margin: 16px 0 0 0;
        font-size: 13px;
        color: #1e40af;
        line-height: 1.5;
    }
    
    .course-disclaimer strong {
        font-weight: 600;
    }
}

.logo-icon-wrapper {
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, #f1f5f9 0%, #e2e8f0 100%);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    border: 2px solid #cbd5e1;
}