/* ============================================
   EXAM WIN - Main Stylesheet
   Primary: #1e7bb9 | Dark: #155d8b | Light: #e8f4fb
   ============================================ */

/* CSS Variables */
:root {
    --primary: #1e7bb9;
    --primary-dark: #155d8b;
    --primary-light: #e8f4fb;
    --primary-rgb: 30, 123, 185;
    --success: #28a745;
    --danger: #dc3545;
    --warning: #ffc107;
    --info: #17a2b8;
    --dark: #1a1a2e;
    --gray: #6c757d;
    --gray-light: #adb5bd;
    --gray-lighter: #dee2e6;
    --light-bg: #f8f9fa;
    --white: #ffffff;
    --text: #333333;
    --text-light: #555555;
    --text-muted: #595959;
    --border: #e0e0e0;
    --shadow: 0 2px 8px rgba(0,0,0,0.08);
    --shadow-lg: 0 8px 30px rgba(0,0,0,0.12);
    --radius: 8px;
    --radius-lg: 12px;
    --radius-sm: 4px;
    --transition: all 0.3s ease;
    --font: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    --header-height: 70px;
}

/* Dark Mode */
[data-theme="dark"] {
    --dark: #0d0d1a;
    --light-bg: #1a1a2e;
    --white: #16213e;
    --text: #e0e0e0;
    --text-light: #c0c0c0;
    --text-muted: #888888;
    --border: #2a2a4a;
    --shadow: 0 2px 8px rgba(0,0,0,0.3);
    --shadow-lg: 0 8px 30px rgba(0,0,0,0.4);
    --gray-lighter: #2a2a4a;
}

/* Reset */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
    font-family: var(--font);
    font-size: 16px;
    line-height: 1.6;
    color: var(--text);
    background: var(--light-bg);
    -webkit-font-smoothing: antialiased;
    transition: background 0.3s ease, color 0.3s ease;
}
a { color: var(--primary); text-decoration: none; transition: var(--transition); }
a:hover { color: var(--primary-dark); }
img { max-width: 100%; height: auto; }
ul, ol { list-style: none; }
button, input, select, textarea { font-family: inherit; font-size: inherit; }
h1, h2, h3, h4, h5, h6 { color: var(--dark); line-height: 1.3; margin-bottom: 0.5em; }
[data-theme="dark"] h1, [data-theme="dark"] h2, [data-theme="dark"] h3,
[data-theme="dark"] h4, [data-theme="dark"] h5, [data-theme="dark"] h6 { color: var(--text); }
h1 { font-size: 2.2rem; }
h2 { font-size: 1.8rem; }
h3 { font-size: 1.4rem; }
h4 { font-size: 1.15rem; }
p { margin-bottom: 1em; }

/* Container */
.container { max-width: 1200px; margin: 0 auto; padding: 0 20px; }
.container-narrow { max-width: 800px; margin: 0 auto; padding: 0 20px; }
.container-wide { max-width: 1400px; margin: 0 auto; padding: 0 20px; }

/* ============================================
   BUTTONS
   ============================================ */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    padding: 10px 24px; border: 2px solid transparent; border-radius: var(--radius);
    font-weight: 600; font-size: 0.95rem; cursor: pointer;
    transition: var(--transition); text-align: center; white-space: nowrap;
}
.btn:hover { transform: translateY(-1px); box-shadow: var(--shadow); }
.btn-primary { background: var(--primary); color: #fff; border-color: var(--primary); }
.btn-primary:hover { background: var(--primary-dark); border-color: var(--primary-dark); color: #fff; }
.btn-outline { background: transparent; color: var(--primary); border-color: var(--primary); }
.btn-outline:hover { background: var(--primary); color: #fff; }
.btn-success { background: var(--success); color: #fff; border-color: var(--success); }
.btn-danger { background: var(--danger); color: #fff; border-color: var(--danger); }
.btn-warning { background: var(--warning); color: #333; border-color: var(--warning); }
.btn-sm { padding: 6px 16px; font-size: 0.85rem; }
.btn-lg { padding: 14px 32px; font-size: 1.1rem; }
.btn-block { width: 100%; }
.btn:disabled { opacity: 0.6; cursor: not-allowed; transform: none; }

/* ============================================
   FORMS
   ============================================ */
.form-group { margin-bottom: 20px; }
.form-group label { display: block; margin-bottom: 6px; font-weight: 600; color: var(--text); font-size: 0.9rem; }
.form-control {
    width: 100%; padding: 10px 14px; border: 2px solid var(--border);
    border-radius: var(--radius); font-size: 1rem; color: var(--text);
    background: var(--white); transition: var(--transition);
}
.form-control:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(var(--primary-rgb), 0.15); }
.form-control::placeholder { color: var(--text-muted); }
textarea.form-control { resize: vertical; min-height: 100px; }
select.form-control { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23666' d='M6 8L1 3h10z'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; padding-right: 36px; }
.form-error { color: var(--danger); font-size: 0.85rem; margin-top: 4px; }
.form-hint { color: var(--text-muted); font-size: 0.85rem; margin-top: 4px; }
.form-row { display: flex; gap: 20px; }
.form-row .form-group { flex: 1; }

/* ============================================
   HEADER
   ============================================ */
.site-header {
    background: var(--white); border-bottom: 1px solid var(--border);
    position: sticky; top: 0; z-index: 1000; height: var(--header-height);
    box-shadow: 0 1px 4px rgba(0,0,0,0.04);
    transition: background 0.3s ease, border-color 0.3s ease;
}
.header-inner { display: flex; align-items: center; justify-content: space-between; height: var(--header-height); }
.logo-link { display: flex; align-items: center; }
.logo { height: 54px; width: auto; }
.main-nav .nav-list { display: flex; gap: 4px; align-items: center; }
.nav-link {
    padding: 8px 16px; border-radius: var(--radius); color: var(--text);
    font-weight: 500; font-size: 0.95rem; transition: var(--transition);
}
.nav-link:hover, .nav-link.active { color: var(--primary); background: var(--primary-light); }
.header-actions { display: flex; align-items: center; gap: 12px; }

/* Theme Toggle */
.theme-toggle {
    width: 38px; height: 38px; border-radius: 50%; border: 2px solid var(--border);
    background: var(--white); cursor: pointer; display: flex; align-items: center;
    justify-content: center; font-size: 1.1rem; transition: var(--transition);
}
.theme-toggle:hover { border-color: var(--primary); }
.theme-icon-dark { display: none; }
[data-theme="dark"] .theme-icon-light { display: none; }
[data-theme="dark"] .theme-icon-dark { display: inline; }

/* User Menu */
.user-menu { position: relative; }
.user-menu-toggle {
    display: flex; align-items: center; gap: 8px; padding: 4px 12px 4px 4px;
    border: 2px solid var(--border); border-radius: 50px; background: var(--white);
    cursor: pointer; transition: var(--transition);
}
.user-menu-toggle:hover { border-color: var(--primary); }
.avatar {
    width: 32px; height: 32px; border-radius: 50%; background: var(--primary);
    color: #fff; display: flex; align-items: center; justify-content: center;
    font-size: 0.8rem; font-weight: 700;
}
.avatar-lg { width: 44px; height: 44px; font-size: 1rem; }
.user-name { font-weight: 500; font-size: 0.9rem; color: var(--text); }
.user-dropdown {
    position: absolute; top: calc(100% + 8px); right: 0; background: var(--white);
    border: 1px solid var(--border); border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg); min-width: 240px; padding: 8px 0;
    display: none; z-index: 100;
}
.user-dropdown.show { display: block; }
.dropdown-header { display: flex; align-items: center; gap: 12px; padding: 12px 16px; }
.dropdown-header small { display: block; color: var(--text-muted); font-size: 0.8rem; }
.dropdown-link { display: block; padding: 8px 16px; color: var(--text); font-size: 0.9rem; transition: var(--transition); }
.dropdown-link:hover { background: var(--primary-light); color: var(--primary); }
.user-dropdown hr { border: none; border-top: 1px solid var(--border); margin: 4px 0; }
.text-danger { color: var(--danger) !important; }

/* Mobile Menu Toggle */
.mobile-menu-toggle {
    display: none; flex-direction: column; gap: 5px; padding: 8px;
    background: none; border: none; cursor: pointer;
}
.mobile-menu-toggle span {
    display: block; width: 24px; height: 2px; background: var(--text);
    transition: var(--transition); border-radius: 2px;
}

/* ============================================
   TOAST NOTIFICATIONS
   ============================================ */
.toast-notification {
    position: fixed; top: 80px; right: 20px; z-index: 9999;
    display: flex; align-items: center; gap: 12px;
    padding: 14px 20px; border-radius: var(--radius);
    background: var(--white); box-shadow: var(--shadow-lg);
    border-left: 4px solid var(--info); min-width: 300px; max-width: 450px;
    animation: slideInRight 0.4s ease;
}
.toast-success { border-left-color: var(--success); }
.toast-error { border-left-color: var(--danger); }
.toast-warning { border-left-color: var(--warning); }
.toast-icon { font-size: 1.2rem; }
.toast-success .toast-icon { color: var(--success); }
.toast-error .toast-icon { color: var(--danger); }
.toast-warning .toast-icon { color: var(--warning); }
.toast-message { flex: 1; font-size: 0.9rem; }
.toast-close { background: none; border: none; font-size: 1.3rem; color: var(--text-muted); cursor: pointer; padding: 0 0 0 8px; }

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

/* ============================================
   BREADCRUMBS
   ============================================ */
.breadcrumbs { padding: 16px 0; }
.breadcrumbs ol { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; }
.breadcrumbs li { font-size: 0.85rem; color: var(--text-muted); }
.breadcrumbs li::after { content: '/'; margin-left: 8px; color: var(--gray-light); }
.breadcrumbs li:last-child::after { display: none; }
.breadcrumbs a { color: var(--primary); }
.breadcrumbs a:hover { text-decoration: underline; }
.breadcrumb-current { color: var(--text); font-weight: 500; }

/* ============================================
   CARDS
   ============================================ */
.card {
    background: var(--white); border: 1px solid var(--border);
    border-radius: var(--radius-lg); padding: 24px;
    box-shadow: var(--shadow); transition: var(--transition);
}
.card:hover { box-shadow: var(--shadow-lg); }
.card h2 { margin-top: 28px; }
.card h2:first-child { margin-top: 0; }
.card h3 { margin-top: 28px; padding-top: 16px; border-top: 1px solid var(--border); }
.card h3:first-child { margin-top: 0; padding-top: 0; border-top: none; }
#about h3 { margin-top: 32px; padding-top: 20px; }
.card-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }
.card-title { font-size: 1.15rem; font-weight: 700; color: var(--dark); margin: 0; }
[data-theme="dark"] .card-title { color: var(--text); }

/* Stat Cards */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 20px; margin-bottom: 30px; }
.stat-card {
    background: var(--white); border: 1px solid var(--border);
    border-radius: var(--radius-lg); padding: 20px; text-align: center;
    transition: var(--transition); position: relative; overflow: hidden;
}
.stat-card::before {
    content: ''; position: absolute; top: 0; left: 0; right: 0; height: 4px;
    background: var(--primary);
}
.stat-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.stat-number { font-size: 2rem; font-weight: 800; color: var(--primary); display: block; }
.stat-label { font-size: 0.85rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.5px; }

/* ============================================
   HERO SECTION
   ============================================ */
.hero {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: #fff; padding: 80px 0; text-align: center; position: relative; overflow: hidden;
}
.hero::before {
    content: ''; position: absolute; top: -50%; left: -50%; width: 200%; height: 200%;
    background: radial-gradient(ellipse, rgba(255,255,255,0.08) 0%, transparent 70%);
    animation: heroPulse 8s ease-in-out infinite;
}
@keyframes heroPulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.1); } }
.hero h1 { font-size: 2.8rem; margin-bottom: 16px; position: relative; color: #fff; }
.hero p { font-size: 1.2rem; opacity: 0.9; margin-bottom: 30px; position: relative; }
.hero-search {
    max-width: 550px; margin: 0 auto 30px; position: relative;
}
.hero-search input {
    width: 100%; padding: 16px 60px 16px 20px; border: none; border-radius: 50px;
    font-size: 1rem; box-shadow: 0 4px 20px rgba(0,0,0,0.15);
}
.hero-search button {
    position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
    width: 44px; height: 44px; border-radius: 50%; background: var(--primary);
    color: #fff; border: none; cursor: pointer; font-size: 1.1rem;
}
.hero-stats { display: flex; justify-content: center; gap: 50px; margin-top: 40px; position: relative; }
.hero-stat { text-align: center; }
.hero-stat-number { font-size: 2rem; font-weight: 800; display: block; }
.hero-stat-label { font-size: 0.9rem; opacity: 0.85; }

/* ============================================
   EXAM CARDS
   ============================================ */
.exam-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 24px; }
.exam-card {
    background: var(--white); border: 1px solid var(--border);
    border-radius: var(--radius-lg); overflow: hidden; transition: var(--transition);
}
.exam-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.exam-card-header { padding: 20px 20px 0; }
.exam-card-category {
    display: inline-block; padding: 4px 12px; border-radius: 50px;
    background: var(--primary-light); color: var(--primary);
    font-size: 0.75rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px;
}
.exam-card-title { font-size: 1.15rem; font-weight: 700; margin: 12px 0 8px; color: var(--dark); }
[data-theme="dark"] .exam-card-title { color: var(--text); }
.exam-card-title a { color: inherit; }
.exam-card-title a:hover { color: var(--primary); }
.exam-card-body { padding: 0 20px; }
.exam-card-desc { color: var(--text-light); font-size: 0.9rem; margin-bottom: 12px; }
.exam-card-meta { display: flex; flex-wrap: wrap; gap: 12px; font-size: 0.8rem; color: var(--text-muted); }
.exam-card-meta span { display: flex; align-items: center; gap: 4px; }
.exam-card-footer {
    padding: 16px 20px; margin-top: 16px; border-top: 1px solid var(--border);
    display: flex; justify-content: space-between; align-items: center;
}
.exam-card-price { font-weight: 700; color: var(--primary); font-size: 1.1rem; }
.exam-card-footer .btn { padding: 6px 16px; font-size: 0.85rem; }

/* ============================================
   SECTIONS
   ============================================ */
.section { padding: 60px 0; }
.section-alt { background: var(--white); }
.section-header { text-align: center; margin-bottom: 40px; }
.section-header h2 { font-size: 2rem; margin-bottom: 10px; }
.section-header p { color: var(--text-light); font-size: 1.1rem; max-width: 600px; margin: 0 auto; }

/* How It Works */
.steps-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 30px; }
.step-card { text-align: center; padding: 30px; }
.step-number {
    width: 60px; height: 60px; border-radius: 50%; background: var(--primary);
    color: #fff; display: flex; align-items: center; justify-content: center;
    font-size: 1.5rem; font-weight: 800; margin: 0 auto 16px;
}
.step-card h3 { font-size: 1.15rem; margin-bottom: 8px; }
.step-card p { color: var(--text-light); font-size: 0.9rem; }

/* Countdown Ticker */
.countdown-bar { background: var(--dark); color: #fff; padding: 12px 0; overflow: hidden; }
.countdown-items { display: flex; gap: 40px; justify-content: center; flex-wrap: wrap; }
.countdown-item { display: flex; align-items: center; gap: 10px; font-size: 0.9rem; }
.countdown-item strong { color: var(--warning); }

/* FAQ Accordion */
.faq-list { max-width: 800px; margin: 0 auto; }
.faq-item { border: 1px solid var(--border); border-radius: var(--radius); margin-bottom: 8px; overflow: hidden; }
.faq-question {
    width: 100%; padding: 16px 20px; background: var(--white); border: none;
    text-align: left; font-size: 1rem; font-weight: 600; cursor: pointer;
    display: flex; justify-content: space-between; align-items: center;
    color: var(--text); transition: var(--transition);
}
.faq-question:hover { background: var(--primary-light); }
.faq-question::after { content: '+'; font-size: 1.3rem; color: var(--primary); transition: var(--transition); }
.faq-item.active .faq-question::after { content: '-'; }
.faq-answer { padding: 0 20px; max-height: 0; overflow: hidden; transition: max-height 0.3s ease, padding 0.3s ease; }
.faq-item.active .faq-answer { max-height: 500px; padding: 0 20px 16px; }
.faq-answer p { color: var(--text-light); font-size: 0.95rem; margin: 0; }

/* ============================================
   PRICING CARDS
   ============================================ */
.pricing-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 24px; max-width: 900px; margin: 0 auto; }
.pricing-card {
    background: var(--white); border: 2px solid var(--border); border-radius: var(--radius-lg);
    padding: 30px; text-align: center; position: relative; transition: var(--transition);
}
.pricing-card.popular { border-color: var(--primary); }
.pricing-badge {
    position: absolute; top: -12px; left: 50%; transform: translateX(-50%);
    background: var(--primary); color: #fff; padding: 4px 16px; border-radius: 50px;
    font-size: 0.75rem; font-weight: 700; text-transform: uppercase;
}
.pricing-duration { font-size: 1.2rem; font-weight: 700; color: var(--dark); margin-bottom: 8px; }
[data-theme="dark"] .pricing-duration { color: var(--text); }
.pricing-price { font-size: 2.5rem; font-weight: 800; color: var(--primary); margin-bottom: 16px; }
.pricing-price small { font-size: 0.9rem; color: var(--text-muted); font-weight: 400; }
.pricing-features { list-style: none; padding: 0; margin: 0 0 24px; }
.pricing-features li { padding: 8px 0; font-size: 0.9rem; color: var(--text-light); border-bottom: 1px solid var(--border); }
.pricing-features li:last-child { border: none; }

/* ============================================
   TABLES
   ============================================ */
.table-responsive { overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; }
.data-table th, .data-table td { padding: 12px 16px; text-align: left; border-bottom: 1px solid var(--border); font-size: 0.9rem; }
.data-table th { background: var(--primary-light); color: var(--primary-dark); font-weight: 700; font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.5px; cursor: pointer; user-select: none; white-space: nowrap; }
.data-table th.no-sort { cursor: default; }
.sort-arrows { display: inline-flex; flex-direction: column; vertical-align: middle; margin-left: 4px; line-height: 1; gap: 0; }
.sort-arrows .arr { font-size: 0.55rem; color: var(--primary-dark); opacity: 0.25; transition: opacity 0.15s; }
.data-table th.sort-asc .arr-up, .data-table th.sort-desc .arr-down { opacity: 1; }
.data-table tr:hover { background: rgba(var(--primary-rgb), 0.03); }
/* Uniform action buttons inside tables */
.data-table .actions { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.data-table .actions form,
.data-table td > form { display: inline-flex; align-items: center; gap: 6px; margin: 0; }
.data-table td .btn { font-family: inherit; }
.data-table td .btn-sm { height: 30px; padding: 0 12px; gap: 4px; }
.data-table td form .form-control { padding: 4px 6px; height: 30px; font-size: 0.85rem; }

/* Badges */
.badge {
    display: inline-block; padding: 3px 10px; border-radius: 50px;
    font-size: 0.75rem; font-weight: 600;
}
.badge-primary { background: var(--primary-light); color: var(--primary); }
.badge-success { background: #d4edda; color: #155724; }
.badge-danger { background: #f8d7da; color: #721c24; }
.badge-warning { background: #fff3cd; color: #856404; }
.badge-info { background: #d1ecf1; color: #0c5460; }
.badge-gray { background: var(--gray-lighter); color: var(--gray); }

/* ============================================
   PAGINATION
   ============================================ */
.pagination { display: flex; align-items: center; justify-content: center; gap: 6px; margin: 32px 0 16px; flex-wrap: wrap; }
.pagination .page-link {
    display: inline-flex; align-items: center; justify-content: center;
    min-width: 40px; height: 40px; padding: 0 12px;
    border: 1.5px solid var(--border); border-radius: var(--radius);
    font-size: 0.9rem; font-weight: 600; color: var(--text);
    background: var(--white); transition: var(--transition); text-decoration: none;
}
.pagination .page-link:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-light); }
.pagination .page-link.active { background: var(--primary); color: #fff; border-color: var(--primary); pointer-events: none; }
.pagination .page-link.disabled { opacity: 0.4; pointer-events: none; }
.pagination .page-link.prev, .pagination .page-link.next { font-weight: 700; gap: 4px; }
.pagination .page-ellipsis { padding: 0 6px; color: var(--text-muted); font-weight: 700; letter-spacing: 2px; user-select: none; }
.pagination .page-info { font-size: 0.82rem; color: var(--text-muted); margin-left: 12px; }

/* ============================================
   SIDEBAR LAYOUT (Dashboard)
   ============================================ */
.dashboard-layout { display: flex; min-height: calc(100vh - var(--header-height)); }
.sidebar {
    width: 260px; background: var(--dark); color: #fff; padding: 20px 0;
    position: sticky; top: var(--header-height); height: calc(100vh - var(--header-height));
    overflow-y: auto; flex-shrink: 0; transition: var(--transition);
}
.sidebar-header { padding: 0 20px 20px; border-bottom: 1px solid rgba(255,255,255,0.1); margin-bottom: 10px; }
.sidebar-header h3 { font-size: 1rem; color: #fff; margin: 0; }
.sidebar-header small { color: rgba(255,255,255,0.6); font-size: 0.8rem; }
.sidebar-nav a {
    display: flex; align-items: center; gap: 10px; padding: 10px 20px;
    color: rgba(255,255,255,0.75); font-size: 0.9rem; transition: var(--transition);
}
.sidebar-nav a:hover, .sidebar-nav a.active { color: #fff; background: rgba(255,255,255,0.1); }
.sidebar-nav a.active { border-left: 3px solid var(--primary); }
.sidebar-nav .nav-icon { width: 20px; text-align: center; }
.dashboard-content { flex: 1; padding: 30px; }
.dashboard-title { font-size: 1.5rem; margin-bottom: 24px; display: flex; align-items: center; justify-content: space-between; }

/* ============================================
   MODAL
   ============================================ */
.modal-overlay {
    position: fixed; top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5); z-index: 9998; display: none;
    align-items: center; justify-content: center;
}
.modal-overlay.show { display: flex; }
.modal {
    background: var(--white); border-radius: var(--radius-lg); padding: 30px;
    max-width: 600px; width: 90%; max-height: 90vh; overflow-y: auto;
    box-shadow: var(--shadow-lg);
}
.modal-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; }
.modal-header h3 { margin: 0; }
.modal-close { background: none; border: none; font-size: 1.5rem; cursor: pointer; color: var(--text-muted); }

/* ============================================
   TEST INTERFACE
   ============================================ */
.test-layout { display: flex; gap: 20px; }
.test-main { flex: 1; }
.test-sidebar { width: 240px; flex-shrink: 0; }
.test-timer {
    background: var(--white); border: 2px solid var(--primary); border-radius: var(--radius);
    padding: 16px; text-align: center; margin-bottom: 20px; position: sticky; top: 80px;
}
.test-timer .time { font-size: 1.8rem; font-weight: 800; color: var(--primary); }
.test-timer.warning .time { color: var(--danger); }
.test-timer.warning { border-color: var(--danger); animation: timerPulse 1s infinite; }
@keyframes timerPulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.7; } }

.question-palette { background: var(--white); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; }
.palette-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
.palette-btn {
    width: 36px; height: 36px; border-radius: 50%; border: 2px solid var(--border);
    background: var(--white); cursor: pointer; font-size: 0.8rem; font-weight: 600;
    display: flex; align-items: center; justify-content: center; transition: var(--transition);
}
.palette-btn.answered { background: var(--success); color: #fff; border-color: var(--success); }
.palette-btn.flagged { background: var(--warning); color: #333; border-color: var(--warning); }
.palette-btn.current { border-color: var(--primary); box-shadow: 0 0 0 2px rgba(var(--primary-rgb), 0.3); }
.palette-legend { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 12px; font-size: 0.75rem; }
.palette-legend span { display: flex; align-items: center; gap: 4px; }
.legend-dot { width: 12px; height: 12px; border-radius: 50%; display: inline-block; }
.legend-dot.answered { background: var(--success); }
.legend-dot.flagged { background: var(--warning); }
.legend-dot.unanswered { background: var(--gray-lighter); border: 1px solid var(--gray-light); }

.question-card { background: var(--white); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 24px; margin-bottom: 20px; }
.question-number { font-size: 0.85rem; color: var(--text-muted); font-weight: 600; margin-bottom: 8px; }
.question-text { font-size: 1.1rem; font-weight: 600; margin-bottom: 20px; color: var(--dark); }
[data-theme="dark"] .question-text { color: var(--text); }
.option-list { display: flex; flex-direction: column; gap: 10px; }
.option-item {
    display: flex; align-items: center; gap: 12px; padding: 12px 16px;
    border: 2px solid var(--border); border-radius: var(--radius); cursor: pointer;
    transition: var(--transition);
}
.option-item:hover { border-color: var(--primary); background: var(--primary-light); }
.option-item.selected { border-color: var(--primary); background: var(--primary-light); }
.option-item.correct { border-color: var(--success); background: #d4edda; }
.option-item.wrong { border-color: var(--danger); background: #f8d7da; }
.option-letter {
    width: 32px; height: 32px; border-radius: 50%; background: var(--gray-lighter);
    display: flex; align-items: center; justify-content: center;
    font-weight: 700; font-size: 0.85rem; flex-shrink: 0;
}
.option-item.selected .option-letter { background: var(--primary); color: #fff; }
.option-item.correct .option-letter { background: var(--success); color: #fff; }
.option-item.wrong .option-letter { background: var(--danger); color: #fff; }

.question-actions { display: flex; gap: 10px; margin-top: 20px; flex-wrap: wrap; }
.question-nav { display: flex; justify-content: space-between; margin-top: 20px; }

/* Result Explanation */
.explanation-panel {
    margin-top: 16px; padding: 16px; background: var(--primary-light);
    border-radius: var(--radius); border-left: 4px solid var(--primary);
}
.explanation-panel h4 { font-size: 0.95rem; color: var(--primary-dark); margin-bottom: 8px; }
.explanation-panel p { color: var(--text); font-size: 0.9rem; margin: 0; }
.hint-panel {
    margin-top: 10px; padding: 12px; background: #fff3cd;
    border-radius: var(--radius); border-left: 4px solid var(--warning);
}
.hint-panel strong { color: #856404; font-size: 0.85rem; }
.hint-panel p { color: #856404; font-size: 0.9rem; margin: 0; }
.difficulty-badge { font-size: 0.7rem; padding: 2px 8px; border-radius: 50px; font-weight: 700; text-transform: uppercase; }
.difficulty-easy { background: #d4edda; color: #155724; }
.difficulty-medium { background: #fff3cd; color: #856404; }
.difficulty-hard { background: #f8d7da; color: #721c24; }

/* ============================================
   PROGRESS BARS
   ============================================ */
.progress-bar { background: var(--gray-lighter); border-radius: 50px; height: 10px; overflow: hidden; }
.progress-fill { height: 100%; background: var(--primary); border-radius: 50px; transition: width 0.5s ease; }
.progress-fill.success { background: var(--success); }
.progress-fill.danger { background: var(--danger); }

/* ============================================
   STREAK BADGE
   ============================================ */
.streak-badge {
    display: inline-flex; align-items: center; gap: 6px; padding: 6px 14px;
    background: linear-gradient(135deg, #ff6b35, #ff4500); color: #fff;
    border-radius: 50px; font-weight: 700; font-size: 0.85rem;
}

/* ============================================
   SHARE BUTTONS
   ============================================ */
.share-buttons { display: flex; gap: 8px; flex-wrap: wrap; }
.share-btn {
    display: inline-flex; align-items: center; gap: 6px; padding: 8px 16px;
    border-radius: var(--radius); font-size: 0.85rem; font-weight: 600;
    color: #fff; border: none; cursor: pointer; transition: var(--transition);
}
.share-btn:hover { opacity: 0.85; transform: translateY(-1px); }
.share-btn.whatsapp { background: #25d366; }
.share-btn.twitter { background: #1da1f2; }
.share-btn.facebook { background: #1877f2; }
.share-btn.copy-link { background: var(--gray); }

/* ============================================
   SCROLL TO TOP
   ============================================ */
.scroll-to-top {
    position: fixed; bottom: 20px; right: 20px; width: 44px; height: 44px;
    border-radius: 50%; background: var(--primary); color: #fff; border: none;
    font-size: 1.3rem; cursor: pointer; display: none; z-index: 999;
    box-shadow: var(--shadow); transition: var(--transition);
    align-items: center; justify-content: center;
}
.scroll-to-top.show { display: flex; }
.scroll-to-top:hover { background: var(--primary-dark); transform: translateY(-2px); }

/* ============================================
   FOOTER
   ============================================ */
.site-footer { background: var(--dark); color: rgba(255,255,255,0.8); padding: 60px 0 0; }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 40px; }
.footer-logo { height: 72px; margin-bottom: 12px; }
.footer-tagline { font-weight: 700; color: #fff; margin-bottom: 8px; }
.footer-desc { font-size: 0.9rem; line-height: 1.7; }
.footer-heading { color: #fff; font-size: 1rem; margin-bottom: 16px; }
.footer-links li { margin-bottom: 8px; }
.footer-links a { color: rgba(255,255,255,0.7); font-size: 0.9rem; transition: var(--transition); }
.footer-links a:hover { color: #fff; }
.footer-contact li { font-size: 0.9rem; margin-bottom: 8px; }
.footer-social { display: flex; gap: 10px; margin-top: 16px; }
.footer-social a {
    width: 36px; height: 36px; border-radius: 50%; border: 1px solid rgba(255,255,255,0.3);
    display: flex; align-items: center; justify-content: center;
    color: rgba(255,255,255,0.7); font-size: 0.8rem; font-weight: 700;
    transition: var(--transition);
}
.footer-social a:hover { background: var(--primary); border-color: var(--primary); color: #fff; }
.footer-bottom {
    margin-top: 40px; padding: 20px 0; border-top: 1px solid rgba(255,255,255,0.1);
    text-align: center; font-size: 0.85rem; color: rgba(255,255,255,0.5);
}

/* ============================================
   PAGE-SPECIFIC: Auth Pages
   ============================================ */
.auth-page { display: flex; align-items: center; justify-content: center; min-height: calc(100vh - var(--header-height) - 80px); padding: 40px 0; }
.auth-card { background: var(--white); border-radius: var(--radius-lg); padding: 40px; max-width: 450px; width: 100%; box-shadow: var(--shadow-lg); }
.auth-card h2 { text-align: center; margin-bottom: 8px; }
.auth-card .subtitle { text-align: center; color: var(--text-muted); margin-bottom: 30px; }
.auth-card .auth-links { text-align: center; margin-top: 20px; font-size: 0.9rem; }
.auth-card .divider { text-align: center; margin: 20px 0; color: var(--text-muted); position: relative; }
.auth-card .divider::before, .auth-card .divider::after { content: ''; position: absolute; top: 50%; width: 40%; height: 1px; background: var(--border); }
.auth-card .divider::before { left: 0; }
.auth-card .divider::after { right: 0; }

/* ============================================
   TESTIMONIALS CAROUSEL
   ============================================ */
.testimonial-track { display: flex; gap: 24px; overflow-x: auto; scroll-snap-type: x mandatory; -webkit-overflow-scrolling: touch; padding: 10px 0; scrollbar-width: none; -ms-overflow-style: none; }
.testimonial-track::-webkit-scrollbar { display: none; }
.testimonial-card {
    min-width: 300px; max-width: 350px; scroll-snap-align: start;
    background: var(--white); border: 1px solid var(--border);
    border-radius: var(--radius-lg); padding: 24px; flex-shrink: 0;
}
.testimonial-text { font-size: 0.95rem; color: var(--text-light); font-style: italic; margin-bottom: 16px; }
.testimonial-author { font-weight: 700; font-size: 0.9rem; }
.testimonial-role { color: var(--text-muted); font-size: 0.8rem; }

/* ============================================
   FORMATTED CONTENT (Eligibility, Exam Pattern)
   ============================================ */
.formatted-content { font-size: 0.95rem; color: var(--text-light); line-height: 1.7; }

/* Eligibility field rows */
.fc-field { display: flex; gap: 0; border-bottom: 1px solid var(--border); padding: 12px 0; }
.fc-field:last-child { border-bottom: none; }
.fc-label { min-width: 180px; max-width: 200px; font-weight: 700; color: var(--text); font-size: 0.9rem; padding-right: 16px; flex-shrink: 0; }
.fc-value { color: var(--text-light); flex: 1; }

/* General paragraphs and intro */
.fc-para { padding: 8px 0; color: var(--text-light); border-bottom: 1px solid var(--border); }
.fc-para:last-child { border-bottom: none; }
.fc-intro { font-weight: 600; color: var(--text); padding: 10px 0 4px; font-size: 0.95rem; }

/* Stage badges for exam pattern */
.fc-stage { background: var(--primary); color: #fff; font-weight: 700; font-size: 0.92rem; padding: 8px 16px; border-radius: var(--radius); margin: 18px 0 10px; }
.fc-stage:first-child { margin-top: 4px; }
.fc-substage { font-weight: 600; color: var(--primary-dark); padding: 8px 0 4px; font-size: 0.95rem; border-bottom: 2px solid var(--primary-light); margin-bottom: 6px; }

/* Section detail tables */
.fc-table { width: 100%; border-collapse: collapse; margin: 8px 0 16px; font-size: 0.9rem; }
.fc-table thead th { background: var(--primary-light); color: var(--primary-dark); font-weight: 700; padding: 10px 14px; text-align: left; font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.3px; }
.fc-table tbody td { padding: 10px 14px; border-bottom: 1px solid var(--border); color: var(--text-light); }
.fc-table tbody tr:last-child td { border-bottom: none; }
.fc-table tbody tr:hover { background: var(--bg-light); }
.fc-table tbody td:first-child { font-weight: 600; color: var(--text); white-space: nowrap; }

@media (max-width: 600px) {
    .fc-field { flex-direction: column; gap: 2px; }
    .fc-label { min-width: auto; max-width: none; }
    .fc-table tbody td:first-child { white-space: normal; }
}

/* ============================================
   PREVIOUS YEAR PAPERS
   ============================================ */
.pp-year-grid { display: flex; flex-direction: column; gap: 16px; }
.pp-year-block { border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.pp-year-badge { background: var(--primary); color: #fff; font-weight: 800; font-size: 1rem; padding: 8px 16px; letter-spacing: 0.5px; }
.pp-paper-list { padding: 0; }
.pp-paper-item { display: flex; justify-content: space-between; align-items: center; padding: 10px 16px; border-bottom: 1px solid var(--border); transition: background 0.15s; }
.pp-paper-item:last-child { border-bottom: none; }
.pp-paper-item:hover { background: var(--bg-light); }
.pp-paper-info { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0; }
.pp-paper-month { background: var(--primary-light); color: var(--primary-dark); font-weight: 700; font-size: 0.75rem; padding: 3px 8px; border-radius: 4px; white-space: nowrap; min-width: 50px; text-align: center; }
.pp-paper-name { font-size: 0.88rem; font-weight: 500; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pp-paper-meta { display: flex; gap: 12px; font-size: 0.78rem; color: var(--text-muted); flex-shrink: 0; margin-left: 12px; }
.pp-paper-meta i { font-size: 0.72rem; margin-right: 2px; }

/* ============================================
   MOCK TESTS & PRACTICE PAPERS
   ============================================ */
.mt-section { margin-bottom: 20px; }
.mt-section:last-child { margin-bottom: 0; }
.mt-type-heading { display: flex; align-items: center; gap: 8px; font-size: 0.95rem; font-weight: 700; margin-bottom: 10px; padding-bottom: 6px; border-bottom: 2px solid var(--border); }
.mt-test-grid { display: flex; flex-direction: column; gap: 8px; }
.mt-test-card { display: flex; align-items: center; gap: 16px; padding: 12px 16px; border: 1px solid var(--border); border-radius: var(--radius); transition: all 0.15s; }
.mt-test-card:hover { border-color: var(--primary); box-shadow: 0 2px 8px rgba(0,0,0,0.06); }
.mt-test-info { flex: 1; min-width: 0; }
.mt-test-title { font-weight: 600; font-size: 0.9rem; color: var(--text); margin-bottom: 2px; }
.mt-subject-tag { display: inline-block; background: var(--primary-light); color: var(--primary-dark); font-size: 0.72rem; font-weight: 600; padding: 2px 8px; border-radius: 4px; }
.mt-test-stats { display: flex; gap: 14px; font-size: 0.78rem; color: var(--text-muted); flex-shrink: 0; }
.mt-test-stats i { font-size: 0.72rem; margin-right: 2px; }
.mt-test-action { flex-shrink: 0; }

@media (max-width: 768px) {
    .pp-paper-item { flex-direction: column; align-items: flex-start; gap: 6px; }
    .pp-paper-meta { margin-left: 0; }
    .mt-test-card { flex-direction: column; align-items: flex-start; gap: 8px; }
    .mt-test-stats { flex-wrap: wrap; gap: 8px; }
}

/* ============================================
   TABLE OF CONTENTS
   ============================================ */
.toc { background: var(--primary-light); border-radius: var(--radius); padding: 20px; margin-bottom: 24px; }
.toc h4 { margin-bottom: 12px; color: var(--primary-dark); }
.toc ul { padding-left: 0; }
.toc li { margin-bottom: 6px; }
.toc a { color: var(--primary); font-size: 0.9rem; }
.toc a:hover { text-decoration: underline; }

/* ============================================
   SKELETON LOADING
   ============================================ */
.skeleton { background: linear-gradient(90deg, var(--gray-lighter) 25%, #f0f0f0 50%, var(--gray-lighter) 75%); background-size: 200% 100%; animation: shimmer 1.5s infinite; border-radius: var(--radius-sm); }
@keyframes shimmer { 0% { background-position: -200% 0; } 100% { background-position: 200% 0; } }
.skeleton-text { height: 16px; margin-bottom: 8px; }
.skeleton-title { height: 24px; width: 60%; margin-bottom: 12px; }
.skeleton-card { height: 200px; }

/* ============================================
   UTILITIES
   ============================================ */
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-primary { color: var(--primary); }
.text-success { color: var(--success); }
.text-danger { color: var(--danger); }
.text-warning { color: var(--warning); }
.text-muted { color: var(--text-muted); }
.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }
.mb-4 { margin-bottom: 32px; }
.mt-0 { margin-top: 0; }
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mt-4 { margin-top: 32px; }
.p-0 { padding: 0; }
.p-2 { padding: 16px; }
.p-3 { padding: 24px; }
.d-flex { display: flex; }
.align-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-1 { gap: 8px; }
.gap-2 { gap: 16px; }
.gap-3 { gap: 24px; }
.flex-wrap { flex-wrap: wrap; }
.hidden { display: none !important; }
.w-100 { width: 100%; }

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 992px) {
    .footer-grid { grid-template-columns: 1fr 1fr; gap: 30px; }
    .sidebar { width: 220px; }
    .dashboard-content { padding: 20px; }
    .hero h1 { font-size: 2.2rem; }
}

@media (max-width: 768px) {
    .main-nav { display: none; position: absolute; top: var(--header-height); left: 0; right: 0; background: var(--white); border-bottom: 1px solid var(--border); box-shadow: var(--shadow); padding: 16px; z-index: 999; }
    .main-nav.show { display: block; }
    .main-nav .nav-list { flex-direction: column; gap: 0; }
    .nav-link { padding: 12px 16px; border-radius: 0; border-bottom: 1px solid var(--border); }
    .mobile-menu-toggle { display: flex; }
    .header-actions .btn { display: none; }
    .user-name { display: none; }
    .hero { padding: 50px 0; }
    .hero h1 { font-size: 1.8rem; }
    .hero-stats { gap: 20px; flex-wrap: wrap; }
    .hero-stat-number { font-size: 1.5rem; }
    .footer-grid { grid-template-columns: 1fr; gap: 24px; }
    .form-row { flex-direction: column; gap: 0; }
    .dashboard-layout { flex-direction: column; }
    .sidebar { width: 100%; height: auto; position: relative; top: 0; }
    .sidebar-nav { display: flex; overflow-x: auto; padding: 0 10px; }
    .sidebar-nav a { white-space: nowrap; padding: 10px 14px; font-size: 0.85rem; }
    .test-layout { flex-direction: column; }
    .test-sidebar { width: 100%; order: -1; }
    .test-timer { position: static; }
    .pricing-grid { grid-template-columns: 1fr; }
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 480px) {
    h1 { font-size: 1.6rem; }
    h2 { font-size: 1.4rem; }
    .container { padding: 0 15px; }
    .card { padding: 16px; }
    .auth-card { padding: 24px; margin: 0 15px; }
    .btn { padding: 8px 18px; font-size: 0.9rem; }
    .stats-grid { grid-template-columns: 1fr; }
    .exam-grid { grid-template-columns: 1fr; }
}

/* ============================================
   LEGAL PAGES
   ============================================ */
.legal-content { max-width: 860px; margin: 0 auto; line-height: 1.8; }
.legal-content h1 { font-size: 2rem; margin-bottom: 8px; color: var(--color-text); }
.legal-content .legal-updated { color: var(--color-text-light); margin-bottom: 24px; font-size: 0.95rem; }
.legal-content h2 { font-size: 1.3rem; margin-top: 32px; margin-bottom: 12px; padding-bottom: 6px; border-bottom: 2px solid var(--color-primary); color: var(--color-primary); }
.legal-content h3 { font-size: 1.1rem; margin-top: 20px; margin-bottom: 8px; color: var(--color-text); }
.legal-content p { margin-bottom: 14px; color: var(--color-text-light); }
.legal-content ul, .legal-content ol { margin-bottom: 14px; padding-left: 24px; color: var(--color-text-light); }
.legal-content li { margin-bottom: 6px; }
.legal-content ul ul { margin-top: 6px; margin-bottom: 6px; }
.legal-content a { color: var(--color-primary); text-decoration: underline; }
.legal-content a:hover { color: var(--color-primary-dark); }
.legal-content strong { color: var(--color-text); }

/* ============================================
   PASSING CHANCES METER - RESPONSIVE
   ============================================ */
@media (max-width: 640px) {
    .card > div[style*="grid-template-columns:200px"] {
        grid-template-columns: 1fr !important;
    }
    .pcm-gauge { margin-bottom: 8px; }
}

/* ============================================
   PRINT STYLES
   ============================================ */
@media print {
    .site-header, .site-footer, .sidebar, .scroll-to-top, .toast-notification,
    .mobile-menu-toggle, .theme-toggle, .share-buttons { display: none !important; }
    body { background: #fff; color: #000; }
    .dashboard-content { padding: 0; }
    .card { box-shadow: none; border: 1px solid #ccc; }
}
