/* ============================================
   Quiz System — Premium Dark Theme
   Icons: Lucide (CDN in header.php / pages)
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800;900&family=JetBrains+Mono:wght@400;500;600&display=swap');

:root {
    /* Core palette */
    --bg-body: #0b0d14;
    --bg-primary: #0f1219;
    --bg-secondary: #151920;
    --bg-card: #1a1f2e;
    --bg-card-hover: #1f2538;
    --bg-elevated: #232a3b;
    --bg-input: #131720;
    --bg-glass: rgba(26, 31, 46, 0.7);
    --bg-overlay: rgba(11, 13, 20, 0.85);

    /* Borders */
    --border: rgba(255,255,255,0.06);
    --border-light: rgba(255,255,255,0.1);
    --border-focus: #7c6cf0;

    /* Text */
    --text-primary: #eaecf2;
    --text-secondary: #8b90a0;
    --text-muted: #555a6e;
    --text-inverse: #0b0d14;

    /* Accent */
    --accent: #7c6cf0;
    --accent-hover: #8f82f5;
    --accent-soft: rgba(124, 108, 240, 0.12);
    --accent-glow: rgba(124, 108, 240, 0.3);
    --accent-gradient: linear-gradient(135deg, #7c6cf0 0%, #5eead4 100%);
    --accent-gradient-h: linear-gradient(90deg, #7c6cf0 0%, #5eead4 100%);

    /* Status */
    --success: #34d399;
    --success-soft: rgba(52, 211, 153, 0.1);
    --danger: #f87171;
    --danger-soft: rgba(248, 113, 113, 0.1);
    --warning: #fbbf24;
    --warning-soft: rgba(251, 191, 36, 0.1);
    --info: #60a5fa;
    --info-soft: rgba(96, 165, 250, 0.1);

    /* Geometry */
    --radius-xs: 6px;
    --radius: 10px;
    --radius-md: 14px;
    --radius-lg: 20px;
    --radius-xl: 28px;

    /* Shadows */
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.3);
    --shadow: 0 4px 20px rgba(0,0,0,0.35);
    --shadow-lg: 0 12px 48px rgba(0,0,0,0.45);
    --shadow-glow: 0 0 40px rgba(124,108,240,0.15);

    /* Motion */
    --ease: cubic-bezier(0.4, 0, 0.2, 1);
    --ease-bounce: cubic-bezier(0.34, 1.56, 0.64, 1);
    --speed-fast: 0.15s;
    --speed: 0.25s;
    --speed-slow: 0.4s;

    /* Typography */
    --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-mono: 'JetBrains Mono', 'Fira Code', monospace;
}

/* ========== Reset ========== */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
    font-family: var(--font);
    background: var(--bg-body);
    color: var(--text-primary);
    line-height: 1.65;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
}
a { color: var(--accent); text-decoration: none; transition: color var(--speed) var(--ease); }
a:hover { color: var(--accent-hover); }
::selection { background: var(--accent); color: #fff; }

/* ========== Layout ========== */
.container { max-width: 920px; margin: 0 auto; padding: 0 20px; }
.container-wide { max-width: 1200px; margin: 0 auto; padding: 0 20px; }

/* ========== Site Header ========== */
.site-header {
    background: var(--bg-glass);
    backdrop-filter: blur(20px) saturate(1.4);
    -webkit-backdrop-filter: blur(20px) saturate(1.4);
    border-bottom: 1px solid var(--border);
    padding: 0;
    position: sticky;
    top: 0;
    z-index: 100;
}
.site-header .inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 64px;
}
.site-logo {
    font-size: 1.15rem;
    font-weight: 800;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 12px;
    letter-spacing: -0.02em;
}
.site-logo .logo-icon {
    width: 38px; height: 38px;
    background: var(--accent-gradient);
    border-radius: 11px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    box-shadow: 0 4px 16px rgba(124,108,240,0.35);
}
.site-logo .logo-icon i { width: 20px; height: 20px; }
.header-nav { display: flex; gap: 4px; align-items: center; }
.header-nav a {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    border-radius: var(--radius);
    color: var(--text-secondary);
    font-weight: 600;
    font-size: 0.85rem;
    transition: all var(--speed) var(--ease);
}
.header-nav a:hover { background: var(--bg-elevated); color: var(--text-primary); }
.header-nav a i { width: 16px; height: 16px; opacity: 0.7; }

/* ========== Cards ========== */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 28px;
    transition: all var(--speed) var(--ease);
    position: relative;
}
.card:hover { border-color: var(--border-light); }
.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border);
}
.card-title {
    font-size: 1rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 8px;
}
.card-title i { width: 18px; height: 18px; color: var(--accent); }

/* ========== Buttons ========== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    border: none;
    border-radius: var(--radius);
    font-family: var(--font);
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--speed) var(--ease);
    text-decoration: none;
    line-height: 1.4;
    white-space: nowrap;
    position: relative;
    overflow: hidden;
}
.btn i { width: 16px; height: 16px; flex-shrink: 0; }

.btn-primary {
    background: var(--accent);
    color: #fff;
    box-shadow: 0 2px 12px var(--accent-glow);
}
.btn-primary:hover {
    background: var(--accent-hover);
    transform: translateY(-1px);
    box-shadow: 0 6px 24px var(--accent-glow);
    color: #fff;
}
.btn-primary:active { transform: translateY(0); }

.btn-success { background: var(--success); color: var(--text-inverse); }
.btn-success:hover { filter: brightness(1.1); transform: translateY(-1px); color: var(--text-inverse); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { filter: brightness(1.1); transform: translateY(-1px); color: #fff; }
.btn-outline {
    background: transparent;
    border: 1px solid var(--border-light);
    color: var(--text-secondary);
}
.btn-outline:hover {
    border-color: var(--accent);
    color: var(--accent);
    background: var(--accent-soft);
}
.btn-ghost { background: transparent; color: var(--text-secondary); padding: 8px; }
.btn-ghost:hover { background: var(--bg-elevated); color: var(--text-primary); }

.btn-sm { padding: 7px 14px; font-size: 0.8rem; border-radius: var(--radius-xs); }
.btn-sm i { width: 14px; height: 14px; }
.btn-lg { padding: 14px 28px; font-size: 0.95rem; border-radius: var(--radius-md); }
.btn-block { display: flex; width: 100%; }

/* ========== Forms ========== */
.form-group { margin-bottom: 20px; }
.form-label {
    display: block;
    margin-bottom: 7px;
    font-weight: 600;
    font-size: 0.8rem;
    color: var(--text-secondary);
    letter-spacing: 0.04em;
    text-transform: uppercase;
}
.form-control {
    width: 100%;
    padding: 11px 14px;
    background: var(--bg-input);
    border: 1.5px solid var(--border-light);
    border-radius: var(--radius);
    color: var(--text-primary);
    font-family: var(--font);
    font-size: 0.9rem;
    transition: all var(--speed) var(--ease);
}
.form-control:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-soft), 0 0 20px rgba(124,108,240,0.08);
    background: var(--bg-primary);
}
.form-control::placeholder { color: var(--text-muted); }
textarea.form-control { min-height: 90px; resize: vertical; line-height: 1.6; }
select.form-control { cursor: pointer; appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='%23555a6e' viewBox='0 0 16 16'%3E%3Cpath d='M4 6l4 4 4-4'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; padding-right: 36px; }

/* ========== Tables ========== */
.table-wrapper { overflow-x: auto; border-radius: var(--radius-md); border: 1px solid var(--border); -webkit-overflow-scrolling: touch; }
.table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
}
.table th {
    background: var(--bg-secondary);
    padding: 12px 14px;
    text-align: left;
    font-weight: 700;
    color: var(--text-muted);
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}
.table td {
    padding: 12px 14px;
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
}
.table tr:last-child td { border-bottom: none; }
.table tbody tr { transition: background var(--speed-fast) var(--ease); }
.table tbody tr:hover td { background: rgba(124,108,240,0.03); }

/* ========== Badges ========== */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 10px;
    border-radius: 100px;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.02em;
}
.badge i { width: 12px; height: 12px; }
.badge-success { background: var(--success-soft); color: var(--success); }
.badge-danger { background: var(--danger-soft); color: var(--danger); }
.badge-warning { background: var(--warning-soft); color: var(--warning); }
.badge-info { background: var(--info-soft); color: var(--info); }

/* ========== Alerts ========== */
.alert {
    padding: 14px 18px;
    border-radius: var(--radius);
    margin-bottom: 20px;
    font-weight: 600;
    font-size: 0.875rem;
    display: flex;
    align-items: center;
    gap: 10px;
    border: 1px solid transparent;
}
.alert i { width: 18px; height: 18px; flex-shrink: 0; }
.alert-success { background: var(--success-soft); color: var(--success); border-color: rgba(52,211,153,0.15); }
.alert-danger { background: var(--danger-soft); color: var(--danger); border-color: rgba(248,113,113,0.15); }
.alert-warning { background: var(--warning-soft); color: var(--warning); border-color: rgba(251,191,36,0.15); }
.alert-info { background: var(--info-soft); color: var(--info); border-color: rgba(96,165,250,0.15); }

/* ========== Page ========== */
.page-title {
    font-size: 1.65rem;
    font-weight: 800;
    margin: 28px 0 6px;
    letter-spacing: -0.03em;
    display: flex;
    align-items: center;
    gap: 12px;
}
.page-title i { color: var(--accent); width: 28px; height: 28px; }
.page-subtitle {
    color: var(--text-secondary);
    margin-bottom: 28px;
    font-size: 0.95rem;
}

/* ========== Test Grid (Front) ========== */
.test-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
}
.test-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 0;
    transition: all var(--speed-slow) var(--ease);
    position: relative;
    overflow: hidden;
}
.test-card-inner { padding: 28px; }
.test-card-top {
    height: 4px;
    background: var(--accent-gradient-h);
    opacity: 0.6;
    transition: opacity var(--speed) var(--ease);
}
.test-card:hover .test-card-top { opacity: 1; }
.test-card:hover {
    transform: translateY(-4px);
    border-color: rgba(124,108,240,0.3);
    box-shadow: var(--shadow-lg), var(--shadow-glow);
}
.test-card h3 {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 8px;
    letter-spacing: -0.01em;
}
.test-card p {
    color: var(--text-secondary);
    font-size: 0.88rem;
    margin-bottom: 18px;
    line-height: 1.6;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.test-meta {
    display: flex;
    gap: 16px;
    margin-bottom: 20px;
    color: var(--text-muted);
    font-size: 0.82rem;
    font-weight: 500;
}
.test-meta span {
    display: flex;
    align-items: center;
    gap: 5px;
}
.test-meta i { width: 14px; height: 14px; }

/* ========== Quiz UI ========== */
.quiz-container { max-width: 680px; margin: 0 auto; padding: 28px 20px; }

.quiz-progress {
    background: var(--bg-elevated);
    border-radius: 100px;
    height: 6px;
    margin-bottom: 28px;
    overflow: hidden;
}
.quiz-progress-bar {
    height: 100%;
    background: var(--accent-gradient-h);
    border-radius: 100px;
    transition: width 0.5s var(--ease);
}
.quiz-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 28px;
}
.quiz-question-num {
    font-size: 0.78rem;
    color: var(--text-muted);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}
.quiz-timer {
    display: flex;
    align-items: center;
    gap: 6px;
    font-family: var(--font-mono);
    font-size: 1rem;
    font-weight: 600;
    color: var(--warning);
    background: var(--warning-soft);
    padding: 6px 14px;
    border-radius: 100px;
}
.quiz-timer i { width: 16px; height: 16px; }
.quiz-timer.danger { color: var(--danger); background: var(--danger-soft); }

.quiz-question-text {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 24px;
    line-height: 1.55;
    letter-spacing: -0.01em;
}
.quiz-hint {
    color: var(--text-muted);
    font-size: 0.82rem;
    margin-top: -12px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 6px;
}
.quiz-hint i { width: 14px; height: 14px; }

.quiz-answers { display: flex; flex-direction: column; gap: 10px; margin-bottom: 28px; }
.quiz-answer {
    background: var(--bg-card);
    border: 1.5px solid var(--border-light);
    border-radius: var(--radius-md);
    padding: 16px 18px;
    cursor: pointer;
    transition: all var(--speed) var(--ease);
    display: flex;
    align-items: center;
    gap: 14px;
    font-weight: 500;
    font-size: 0.95rem;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}
.quiz-answer:hover {
    border-color: rgba(124,108,240,0.4);
    background: var(--bg-card-hover);
}
.quiz-answer:active { transform: scale(0.99); }
.quiz-answer.selected {
    border-color: var(--accent);
    background: var(--accent-soft);
    box-shadow: 0 0 0 1px var(--accent), 0 0 20px rgba(124,108,240,0.1);
}
.quiz-answer .marker {
    width: 22px; height: 22px;
    border: 2px solid var(--border-light);
    border-radius: 50%;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--speed) var(--ease);
}
.quiz-answer.selected .marker {
    border-color: var(--accent);
    background: var(--accent);
    box-shadow: 0 0 10px var(--accent-glow);
}
.quiz-answer.selected .marker::after {
    content: '';
    width: 7px; height: 7px;
    background: #fff;
    border-radius: 50%;
}
.checkbox-answer .marker { border-radius: 5px; }
.checkbox-answer.selected .marker::after {
    content: '✓';
    width: auto; height: auto;
    background: none;
    color: #fff;
    font-size: 0.7rem;
    font-weight: 800;
    border-radius: 0;
}

.quiz-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
}

/* ========== Results Page ========== */
.result-card {
    text-align: center;
    padding: 48px 28px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    margin: 28px 0;
    position: relative;
    overflow: hidden;
}
.result-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 4px;
    background: var(--accent-gradient-h);
}
.result-emoji { font-size: 3.5rem; margin-bottom: 16px; }
.result-score {
    font-size: 4.5rem;
    font-weight: 900;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    line-height: 1.1;
    margin-bottom: 4px;
    letter-spacing: -0.04em;
}
.result-label {
    color: var(--text-secondary);
    font-size: 1.15rem;
    font-weight: 600;
    margin-bottom: 28px;
}
.result-details {
    display: flex;
    justify-content: center;
    gap: 40px;
    margin-top: 20px;
    padding-top: 24px;
    border-top: 1px solid var(--border);
}
.result-stat { text-align: center; }
.result-stat .num { font-size: 1.5rem; font-weight: 800; letter-spacing: -0.02em; }
.result-stat .label { font-size: 0.72rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.06em; font-weight: 600; margin-top: 2px; }

/* ========== Email Form ========== */
.email-form {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 24px;
    margin: 24px 0;
    display: flex;
    gap: 12px;
    align-items: flex-end;
}
.email-form .form-group { flex: 1; margin-bottom: 0; }

/* ========== Admin Layout ========== */
.admin-layout { display: flex; min-height: 100vh; }
.admin-sidebar {
    width: 264px;
    background: var(--bg-secondary);
    border-right: 1px solid var(--border);
    padding: 0;
    position: fixed;
    top: 0; left: 0; bottom: 0;
    overflow-y: auto;
    z-index: 200;
    display: flex;
    flex-direction: column;
    transition: transform var(--speed-slow) var(--ease);
}
.admin-sidebar .sidebar-head {
    padding: 20px 22px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 12px;
}
.admin-sidebar .sidebar-head .logo-icon {
    width: 34px; height: 34px;
    background: var(--accent-gradient);
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    flex-shrink: 0;
}
.admin-sidebar .sidebar-head .logo-icon i { width: 18px; height: 18px; }
.admin-sidebar .sidebar-head span { font-weight: 800; font-size: 1rem; letter-spacing: -0.02em; }

.admin-sidebar nav { padding: 12px 10px; flex: 1; }
.admin-sidebar nav .nav-section {
    font-size: 0.68rem;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    padding: 16px 14px 6px;
}
.admin-sidebar nav a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    color: var(--text-secondary);
    font-weight: 600;
    font-size: 0.88rem;
    border-radius: var(--radius);
    transition: all var(--speed) var(--ease);
    margin-bottom: 2px;
}
.admin-sidebar nav a i { width: 18px; height: 18px; flex-shrink: 0; opacity: 0.6; }
.admin-sidebar nav a:hover {
    background: var(--bg-elevated);
    color: var(--text-primary);
}
.admin-sidebar nav a:hover i { opacity: 1; }
.admin-sidebar nav a.active {
    background: var(--accent-soft);
    color: var(--accent);
}
.admin-sidebar nav a.active i { opacity: 1; color: var(--accent); }
.admin-sidebar nav a.nav-danger { color: var(--danger); }
.admin-sidebar nav a.nav-danger:hover { background: var(--danger-soft); }
.admin-sidebar nav a.nav-danger i { color: var(--danger); }

.admin-sidebar .sidebar-footer {
    padding: 14px 22px;
    border-top: 1px solid var(--border);
    font-size: 0.75rem;
    color: var(--text-muted);
}

.admin-content { flex: 1; margin-left: 264px; padding: 28px 32px; min-width: 0; }
.admin-topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 28px;
}
.admin-topbar .user-info {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text-secondary);
    font-size: 0.85rem;
    font-weight: 500;
}
.admin-topbar .user-avatar {
    width: 34px; height: 34px;
    background: var(--accent-soft);
    color: var(--accent);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 0.8rem;
}

/* ========== Stats Grid ========== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
    gap: 16px;
    margin-bottom: 28px;
}
.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 22px;
    display: flex;
    align-items: flex-start;
    gap: 14px;
    transition: all var(--speed) var(--ease);
}
.stat-card:hover { border-color: var(--border-light); }
.stat-icon {
    width: 42px; height: 42px;
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.stat-icon i { width: 20px; height: 20px; }
.stat-icon.purple { background: var(--accent-soft); color: var(--accent); }
.stat-icon.blue { background: var(--info-soft); color: var(--info); }
.stat-icon.green { background: var(--success-soft); color: var(--success); }
.stat-icon.yellow { background: var(--warning-soft); color: var(--warning); }
.stat-card .stat-value {
    font-size: 1.65rem;
    font-weight: 800;
    line-height: 1.2;
    letter-spacing: -0.03em;
}
.stat-card .stat-label {
    color: var(--text-muted);
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-top: 2px;
}

/* ========== Animations ========== */
@keyframes fadeUp {
    from { opacity: 0; transform: translateY(16px); }
    to { opacity: 1; transform: translateY(0); }
}
.fade-in { animation: fadeUp var(--speed-slow) var(--ease) forwards; }
.fade-in-1 { animation-delay: 0.05s; opacity: 0; }
.fade-in-2 { animation-delay: 0.1s; opacity: 0; }
.fade-in-3 { animation-delay: 0.15s; opacity: 0; }
.fade-in-4 { animation-delay: 0.2s; opacity: 0; }

@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.5; } }

/* ========== Question Builder (Admin) ========== */
.question-block {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 24px;
    margin-bottom: 16px;
    position: relative;
}
.question-block .q-number {
    position: absolute;
    top: -10px; left: 16px;
    background: var(--accent);
    color: #fff;
    font-size: 0.72rem;
    font-weight: 700;
    padding: 2px 12px;
    border-radius: 100px;
    letter-spacing: 0.02em;
}
.answer-row {
    display: flex;
    gap: 10px;
    align-items: center;
    margin-bottom: 8px;
}
.answer-row input[type="text"] { flex: 1; }
.answer-row input[type="number"] { width: 80px; }
.answer-row .remove-answer {
    width: 30px; height: 30px;
    background: var(--danger-soft);
    color: var(--danger);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--speed) var(--ease);
    flex-shrink: 0;
}
.answer-row .remove-answer:hover { background: var(--danger); color: #fff; }

/* ========== Login Page ========== */
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-body);
    padding: 20px;
    position: relative;
}
.login-page::before {
    content: '';
    position: absolute;
    width: 400px; height: 400px;
    background: radial-gradient(circle, rgba(124,108,240,0.08) 0%, transparent 70%);
    top: 30%; left: 50%;
    transform: translate(-50%, -50%);
    pointer-events: none;
}
.login-card {
    width: 100%;
    max-width: 420px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    padding: 40px;
    position: relative;
    box-shadow: var(--shadow-lg);
}
.login-card h1 { font-size: 1.4rem; text-align: center; margin-bottom: 4px; letter-spacing: -0.02em; }
.login-card .subtitle { text-align: center; color: var(--text-secondary); margin-bottom: 28px; font-size: 0.9rem; }
.login-icon {
    width: 56px; height: 56px;
    background: var(--accent-gradient);
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
    box-shadow: 0 8px 32px rgba(124,108,240,0.3);
}
.login-icon i { width: 28px; height: 28px; color: #fff; }

/* ========== Empty State ========== */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
}
.empty-state .empty-icon {
    width: 64px; height: 64px;
    background: var(--bg-elevated);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
}
.empty-state .empty-icon i { width: 28px; height: 28px; color: var(--text-muted); }
.empty-state p { font-size: 0.95rem; margin-bottom: 20px; }

/* ========== Points Badge ========== */
.points-badge {
    background: var(--warning-soft);
    color: var(--warning);
    font-size: 0.72rem;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 4px;
    white-space: nowrap;
}

/* ========== Actions ========== */
.actions { display: flex; gap: 5px; }

/* ========== Scrollbar ========== */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-light); border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* ========== Mobile Menu ========== */
.mobile-menu-btn {
    display: none;
    background: var(--bg-elevated);
    border: 1px solid var(--border-light);
    color: var(--text-primary);
    width: 40px; height: 40px;
    border-radius: var(--radius);
    cursor: pointer;
    align-items: center;
    justify-content: center;
    -webkit-tap-highlight-color: transparent;
}
.mobile-menu-btn i { width: 20px; height: 20px; }
.sidebar-close-btn {
    display: none;
    position: absolute;
    top: 16px; right: 16px;
    background: var(--bg-elevated);
    border: 1px solid var(--border-light);
    color: var(--text-primary);
    width: 36px; height: 36px;
    border-radius: 50%;
    cursor: pointer;
    align-items: center;
    justify-content: center;
    z-index: 10;
}
.sidebar-close-btn i { width: 18px; height: 18px; }
.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: var(--bg-overlay);
    z-index: 199;
    opacity: 0;
    transition: opacity var(--speed) var(--ease);
}

/* ========== Responsive ========== */
@media (max-width: 1024px) {
    .admin-content { padding: 20px; }
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
    /* Admin sidebar: slide from left */
    .admin-sidebar {
        transform: translateX(-100%);
        width: 280px;
        box-shadow: none;
    }
    .admin-sidebar.open {
        transform: translateX(0);
        box-shadow: var(--shadow-lg);
    }
    .sidebar-overlay.open {
        display: block;
        opacity: 1;
    }
    .sidebar-close-btn { display: flex; }
    .mobile-menu-btn { display: flex; }
    .admin-content { margin-left: 0; padding: 16px; }

    /* Cards */
    .card { padding: 20px; border-radius: var(--radius-md); }

    /* Test grid */
    .test-grid { grid-template-columns: 1fr; gap: 14px; }
    .test-card-inner { padding: 22px; }

    /* Quiz */
    .quiz-container { padding: 20px 16px; }
    .quiz-question-text { font-size: 1.1rem; }
    .quiz-answer { padding: 14px 16px; font-size: 0.9rem; }
    .quiz-nav { flex-wrap: wrap; gap: 10px; }
    .quiz-nav .btn { flex: 1; min-width: 120px; }

    /* Results */
    .result-card { padding: 36px 20px; }
    .result-score { font-size: 3.5rem; }
    .result-details { flex-direction: column; gap: 16px; }
    .email-form { flex-direction: column; }

    /* Tables */
    .table { font-size: 0.82rem; }
    .table th, .table td { padding: 10px 10px; }

    /* Page title */
    .page-title { font-size: 1.3rem; }
    .page-subtitle { font-size: 0.88rem; margin-bottom: 20px; }

    /* Stats */
    .stats-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
    .stat-card { padding: 16px; }
    .stat-card .stat-value { font-size: 1.35rem; }

    /* Header */
    .site-header .inner { height: 56px; }
    .site-logo { font-size: 1rem; }
    .site-logo .logo-icon { width: 32px; height: 32px; border-radius: 9px; }
    .header-nav a span { display: none; }

    /* Login */
    .login-card { padding: 28px 22px; border-radius: var(--radius-lg); }

    /* Filters */
    .filter-form { flex-direction: column !important; }
    .filter-form .form-group { min-width: 100% !important; }

    /* Actions stacking */
    .page-header-actions { flex-direction: column; width: 100%; }
    .page-header-actions .btn { width: 100%; }

    /* Question block */
    .question-block { padding: 18px; }
    .answer-row { flex-wrap: wrap; }
    .answer-row input[type="number"] { width: 70px; }
}

@media (max-width: 400px) {
    .stats-grid { grid-template-columns: 1fr; }
    .result-score { font-size: 2.8rem; }
    .stat-card { flex-direction: column; align-items: flex-start; gap: 10px; }
}

/* Utility: hide text on small screens */
@media (max-width: 768px) {
    .hide-mobile { display: none !important; }
}
@media (min-width: 769px) {
    .show-mobile-only { display: none !important; }
}
