/* ============================================================
   oQiz - LNLN Design Language
   Dark-first design system with Lexend typography
   ============================================================ */

/* === Design Tokens === */
:root {
    /* Background Layers (5-level depth system) */
    --bg-primary: #0a0a0a;
    --bg-secondary: #121212;
    --bg-tertiary: #1e1e1e;
    --bg-quaternary: #2a2a2a;
    --bg-hover: #333333;

    /* Text Hierarchy */
    --text-primary: #ffffff;
    --text-secondary: #e0e0e0;
    --text-muted: #a0a0a0;
    --text-disabled: #666666;

    /* Accent (oQiz brand - indigo/purple) */
    --accent: #667eea;
    --accent-hover: #5a6fd6;
    --accent-light: rgba(102, 126, 234, 0.1);

    /* Status Colors */
    --success: #10b981;
    --danger: #ef4444;
    --warning: #f59e0b;
    --info: #06b6d4;

    /* Borders */
    --border: #333333;
    --border-light: #404040;
    --border-focus: var(--accent);

    /* Border Radius */
    --radius: 16px;
    --radius-md: 12px;
    --radius-sm: 8px;
    --radius-xs: 6px;

    /* Shadows */
    --shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.3);
    --shadow-focus: 0 0 0 3px var(--accent-light);

    /* Transitions */
    --transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* === Base Styles === */
* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: "Lexend", -apple-system, BlinkMacSystemFont, "Segoe UI", "Roboto", sans-serif;
    font-size: 14px;
    line-height: 1.6;
    color: var(--text-secondary);
    background: var(--bg-primary);
    min-height: 100vh;
}

h1, h2, h3, h4, h5, h6 {
    color: var(--text-primary);
    font-weight: 600;
    letter-spacing: -0.02em;
}

h1 { font-size: 1.75rem; }
h2 { font-size: 1.35rem; }
h3 { font-size: 1.15rem; }

a {
    color: var(--accent);
    text-decoration: none;
    transition: var(--transition);
}
a:hover { color: var(--accent-hover); }

/* === Container === */
.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 1.5rem 2rem;
}

/* === Header (Glassmorphism Sticky — LNLN Design Language) === */
.header {
    background: rgba(18, 18, 18, 0.85);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--border);
    padding: 0.875rem 2rem;
    position: sticky;
    top: 0;
    z-index: 1000;
    transition: box-shadow 0.3s ease;
}

.header.scrolled {
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.3);
}

.header-content {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--text-primary);
    text-decoration: none;
    white-space: nowrap;
    transition: var(--transition);
}
.logo:hover { color: var(--accent); }
.logo iconify-icon { color: var(--accent); font-size: 1.4rem; }

/* Mobile hamburger toggle */
.nav-toggle {
    display: none;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: none;
    border: 1px solid var(--border);
    border-radius: var(--radius-xs);
    cursor: pointer;
    color: var(--text-secondary);
    font-size: 20px;
    transition: var(--transition);
}
.nav-toggle:hover {
    background: var(--bg-tertiary);
    border-color: var(--border-light);
    color: var(--text-primary);
}

.nav {
    display: flex;
    gap: 0.25rem;
    align-items: center;
}

.nav a {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    color: var(--text-muted);
    text-decoration: none;
    transition: var(--transition);
    font-size: 13px;
    font-weight: 500;
    padding: 0.5rem 0.75rem;
    border-radius: var(--radius-xs);
    position: relative;
}
.nav a:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.05);
}
.nav a.active {
    color: var(--accent);
    background: var(--accent-light);
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

/* === Language Switcher === */
.lang-switcher {
    display: flex;
    background: var(--bg-tertiary);
    border-radius: var(--radius-xs);
    padding: 2px;
}

.lang-btn {
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted);
    text-decoration: none;
    transition: var(--transition);
}
.lang-btn:hover { color: var(--text-primary); }
.lang-btn.active {
    background: var(--bg-quaternary);
    color: var(--text-primary);
}

/* === Buttons === */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 10px 18px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: transparent;
    color: var(--text-secondary);
    font-family: inherit;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
    line-height: 1.4;
}
.btn:hover {
    background: var(--bg-tertiary);
    border-color: var(--border-light);
    color: var(--text-primary);
}

.btn-primary {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
}
.btn-primary:hover {
    background: var(--accent-hover);
    border-color: var(--accent-hover);
    color: #fff;
}

.btn-success {
    background: var(--success);
    border-color: var(--success);
    color: #fff;
}
.btn-success:hover {
    background: #0ea572;
    border-color: #0ea572;
    color: #fff;
}

.btn-danger {
    background: transparent;
    border-color: var(--danger);
    color: var(--danger);
}
.btn-danger:hover {
    background: var(--danger);
    color: #fff;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 13px;
}

.btn--large {
    padding: 14px 28px;
    font-size: 16px;
    font-weight: 600;
}

.btn-icon {
    padding: 8px;
    background: transparent;
    border: 1px solid transparent;
    border-radius: var(--radius-xs);
    cursor: pointer;
    transition: var(--transition);
    color: var(--text-muted);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-family: inherit;
}
.btn-icon:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

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

.btn:disabled, .btn[disabled] {
    opacity: 0.4;
    cursor: not-allowed;
    pointer-events: none;
}

/* === Cards === */
.card {
    background: linear-gradient(135deg, var(--bg-secondary) 0%, #0f0f0f 100%);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    position: relative;
    overflow: hidden;
    transition: var(--transition-slow);
}
.card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--border-light), transparent);
}
.card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow);
    border-color: var(--border-light);
}

.card-body {
    padding: 1.5rem;
}

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

.card-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
}

.card-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--border);
}

/* Card that doesn't hover-lift (static) */
.card-static {
    background: linear-gradient(135deg, var(--bg-secondary) 0%, #0f0f0f 100%);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    position: relative;
    overflow: hidden;
}
.card-static::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--border-light), transparent);
}

/* === Status Badges === */
.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.badge-default {
    background: linear-gradient(135deg, rgba(160, 160, 160, 0.18), rgba(160, 160, 160, 0.1));
    border: 1px solid rgba(160, 160, 160, 0.35);
    color: var(--text-muted);
}

.badge-accent {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.18), rgba(102, 126, 234, 0.1));
    border: 1px solid rgba(102, 126, 234, 0.35);
    color: var(--accent);
}

.badge-success {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.18), rgba(16, 185, 129, 0.1));
    border: 1px solid rgba(16, 185, 129, 0.35);
    color: var(--success);
}

.badge-danger {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.18), rgba(239, 68, 68, 0.1));
    border: 1px solid rgba(239, 68, 68, 0.35);
    color: var(--danger);
}

.badge-warning {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.18), rgba(245, 158, 11, 0.1));
    border: 1px solid rgba(245, 158, 11, 0.35);
    color: var(--warning);
}

.badge-info {
    background: linear-gradient(135deg, rgba(6, 182, 212, 0.18), rgba(6, 182, 212, 0.1));
    border: 1px solid rgba(6, 182, 212, 0.35);
    color: var(--info);
}

/* Mode-specific badges */
.badge-standard {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.18), rgba(102, 126, 234, 0.1));
    border: 1px solid rgba(102, 126, 234, 0.35);
    color: #7b93ee;
}
.badge-practice {
    background: linear-gradient(135deg, rgba(168, 85, 247, 0.18), rgba(168, 85, 247, 0.1));
    border: 1px solid rgba(168, 85, 247, 0.35);
    color: #a855f7;
}
.badge-learning {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.18), rgba(16, 185, 129, 0.1));
    border: 1px solid rgba(16, 185, 129, 0.35);
    color: var(--success);
}
.badge-flashcard {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.18), rgba(245, 158, 11, 0.1));
    border: 1px solid rgba(245, 158, 11, 0.35);
    color: var(--warning);
}
.badge-inverse {
    background: linear-gradient(135deg, rgba(244, 63, 94, 0.18), rgba(244, 63, 94, 0.1));
    border: 1px solid rgba(244, 63, 94, 0.35);
    color: #f43f5e;
}

/* === Tags === */
.tag {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.1), rgba(118, 75, 162, 0.1));
    border: 1px solid rgba(102, 126, 234, 0.2);
    color: var(--text-muted);
    transition: var(--transition);
    text-decoration: none;
}
.tag:hover {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.2), rgba(118, 75, 162, 0.2));
    border-color: rgba(102, 126, 234, 0.4);
    color: var(--text-secondary);
}
.tag.active {
    background: var(--accent);
    color: #fff;
    border-color: transparent;
}

/* === Form Elements === */
.form-group {
    margin-bottom: 1.25rem;
}

.form-label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

.form-input,
.form-select,
.form-textarea {
    display: block;
    width: 100%;
    padding: 12px 16px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-family: inherit;
    font-size: 14px;
    transition: var(--transition);
    outline: none;
}
.form-input:focus,
.form-select:focus,
.form-textarea:focus {
    border-color: var(--accent);
    box-shadow: var(--shadow-focus);
    background: var(--bg-quaternary);
}
.form-input::placeholder,
.form-textarea::placeholder {
    color: var(--text-disabled);
}

.form-hint {
    display: block;
    margin-top: 0.35rem;
    font-size: 12px;
    color: var(--text-muted);
}

.form-textarea {
    resize: vertical;
    min-height: 80px;
}

/* === Tables === */
.brand-table-container {
    overflow-x: auto;
    border-radius: var(--radius);
    border: 1px solid var(--border);
}

.brand-table {
    width: 100%;
    border-collapse: collapse;
}

.brand-table th {
    background: var(--bg-tertiary);
    padding: 12px 16px;
    text-align: left;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    border-bottom: 1px solid var(--border);
}

.brand-table td {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
    color: var(--text-secondary);
    font-size: 14px;
}

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

.brand-table tr:hover td { background: var(--bg-tertiary); }

/* === Modal === */
.modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(4px);
    padding: 1rem;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition-slow);
}
.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    max-width: 600px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    transform: translateY(30px) scale(0.96);
    transition: var(--transition-slow);
}
.modal-overlay.active .modal {
    transform: translateY(0) scale(1);
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border);
}

.modal-title {
    font-size: 1.15rem;
    font-weight: 600;
    color: var(--text-primary);
}

.modal-body { padding: 1.5rem; }

.modal-footer {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.75rem;
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--border);
}

/* === Toast === */
.toast {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    padding: 12px 20px;
    border-radius: var(--radius-sm);
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    color: var(--text-secondary);
    font-size: 14px;
    box-shadow: var(--shadow-lg);
    opacity: 0;
    transform: translateY(20px);
    transition: var(--transition-slow);
    z-index: 3000;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.toast.show { opacity: 1; transform: translateY(0); }
.toast-success { border-color: rgba(16, 185, 129, 0.35); color: var(--success); }
.toast-error { border-color: rgba(239, 68, 68, 0.35); color: var(--danger); }

/* === Alerts === */
.alert {
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.alert-success {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.12), rgba(16, 185, 129, 0.06));
    border: 1px solid rgba(16, 185, 129, 0.3);
    color: var(--success);
}
.alert-danger {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.12), rgba(239, 68, 68, 0.06));
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: var(--danger);
}
.alert-warning {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.12), rgba(245, 158, 11, 0.06));
    border: 1px solid rgba(245, 158, 11, 0.3);
    color: var(--warning);
}
.alert-info {
    background: linear-gradient(135deg, rgba(6, 182, 212, 0.12), rgba(6, 182, 212, 0.06));
    border: 1px solid rgba(6, 182, 212, 0.3);
    color: var(--info);
}

/* === Empty State === */
.empty-state {
    text-align: center;
    padding: 3rem 1.5rem;
}
.empty-state iconify-icon {
    font-size: 48px;
    color: var(--text-disabled);
    margin-bottom: 1rem;
    display: block;
}
.empty-state-text {
    font-size: 1rem;
    color: var(--text-muted);
    margin-bottom: 1.5rem;
}

/* === Progress Bar === */
.progress-bar {
    width: 100%;
    height: 6px;
    background: var(--bg-tertiary);
    border-radius: 3px;
    overflow: hidden;
}
.progress-bar-fill {
    height: 100%;
    background: var(--accent);
    border-radius: 3px;
    transition: width 0.5s ease-out;
}

/* === Loading Spinner === */
.loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--border);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

/* === Footer (LNLN Design Language) === */
.footer {
    background: rgba(18, 18, 18, 0.85);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-top: 1px solid var(--border);
    padding: 1.25rem 2rem;
    margin-top: 3rem;
}
.footer-content {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1rem;
}
.footer .logo {
    font-size: 1rem;
    gap: 0.5rem;
}
.footer .logo iconify-icon {
    font-size: 1.1rem;
}
.footer-links {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}
.footer-links a {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    color: var(--text-muted);
    text-decoration: none;
    font-size: 13px;
    font-weight: 500;
    transition: var(--transition);
}
.footer-links a:hover {
    color: var(--text-primary);
}
.footer-credit {
    color: var(--text-muted);
    font-size: 12px;
}
.footer-credit a {
    color: var(--text-muted);
    text-decoration: none;
    font-weight: 600;
    transition: var(--transition);
}
.footer-credit a:hover {
    color: var(--text-primary);
}

/* === Grid Layouts === */
.grid { display: grid; gap: 1.5rem; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.grid-5 { grid-template-columns: repeat(5, 1fr); }

/* === Flex Utilities === */
.flex { display: flex; }
.flex-col { flex-direction: column; }
.flex-wrap { flex-wrap: wrap; }
.items-center { align-items: center; }
.items-start { align-items: flex-start; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }
.justify-end { justify-content: flex-end; }
.flex-1 { flex: 1; }
.gap-1 { gap: 0.5rem; }
.gap-2 { gap: 0.75rem; }
.gap-3 { gap: 1rem; }
.gap-4 { gap: 1.5rem; }

/* === Spacing Utilities === */
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 0.75rem; }
.mb-3 { margin-bottom: 1rem; }
.mb-4 { margin-bottom: 1.5rem; }
.mb-6 { margin-bottom: 2rem; }
.mt-3 { margin-top: 1rem; }
.mt-4 { margin-top: 1.5rem; }
.mt-6 { margin-top: 2rem; }
.p-4 { padding: 1.5rem; }
.p-6 { padding: 2rem; }

/* === Text Utilities === */
.text-primary { color: var(--text-primary); }
.text-secondary { color: var(--text-secondary); }
.text-muted { color: var(--text-muted); }
.text-disabled { color: var(--text-disabled); }
.text-accent { color: var(--accent); }
.text-success { color: var(--success); }
.text-danger { color: var(--danger); }
.text-center { text-align: center; }
.font-bold { font-weight: 700; }
.font-semibold { font-weight: 600; }

/* === Display Utilities === */
.hidden { display: none !important; }
.block { display: block; }

/* === Scrollbar === */
* {
    scrollbar-width: thin;
    scrollbar-color: var(--border) var(--bg-tertiary);
}
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: var(--bg-tertiary); }
::-webkit-scrollbar-thumb { background: var(--border-light); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-disabled); }

/* === Animations === */
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideUp { from { transform: translateY(30px) scale(0.96); opacity: 0; } to { transform: translateY(0) scale(1); opacity: 1; } }
@keyframes slideIn { from { transform: translateY(-10px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes pulse-smooth { 0%,100% { transform: scale(1); } 50% { transform: scale(1.08); opacity: 0.9; } }

.animate-fade-in { animation: fadeIn 0.4s ease-out forwards; }
.animate-slide-up { animation: slideUp 0.4s ease-out forwards; }

/* ============================================================
   oQiz-Specific Components
   ============================================================ */

/* === Quiz Card (Grid View) === */
.quiz-card {
    display: flex;
    flex-direction: column;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    transition: var(--transition-slow);
}
.quiz-card::before {
    height: 3px;
    background: linear-gradient(90deg, transparent, var(--accent), transparent);
    opacity: 0.4;
    transition: opacity 0.3s ease;
}
.quiz-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25), 0 0 0 1px rgba(102, 126, 234, 0.15);
    border-color: rgba(102, 126, 234, 0.3);
}
.quiz-card:hover::before {
    opacity: 1;
}
.quiz-card .card-body {
    flex: 1;
    padding: 1.5rem 1.5rem 1rem;
}
.quiz-card .card-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--border);
    background: rgba(0, 0, 0, 0.15);
}
.quiz-card .quiz-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 1rem;
    line-height: 1.3;
    letter-spacing: -0.02em;
}
.quiz-card .quiz-meta {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 12px;
    font-weight: 500;
    color: var(--text-muted);
    background: var(--bg-tertiary);
    padding: 4px 10px;
    border-radius: 8px;
    border: 1px solid var(--border);
}
.quiz-card .quiz-meta iconify-icon { color: var(--accent); opacity: 0.7; }

/* Start Quiz button refinement in card */
.quiz-card .card-footer .btn-primary {
    font-weight: 600;
    letter-spacing: 0.01em;
    transition: var(--transition);
}
.quiz-card .card-footer .btn-primary:hover {
    box-shadow: 0 4px 16px rgba(102, 126, 234, 0.3);
    transform: translateY(-1px);
}

/* Quiz card tags container */
.quiz-card .tag {
    font-size: 11px;
    padding: 3px 8px;
}

/* === Quiz List View === */
.quiz-list-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem 1.5rem;
    transition: var(--transition);
    cursor: pointer;
}
.quiz-list-item:hover {
    background: var(--bg-tertiary);
}
.quiz-list-info {
    flex: 1;
    min-width: 0;
}
.quiz-list-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.35rem;
    letter-spacing: -0.01em;
}
.quiz-list-count {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    font-size: 12px;
    color: var(--text-muted);
}
.quiz-list-count iconify-icon {
    color: var(--accent);
    opacity: 0.6;
}

/* === Mode Selection Cards === */
.mode-option {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.25rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--bg-tertiary);
    transition: var(--transition);
    text-decoration: none;
    cursor: pointer;
}
.mode-option:hover {
    border-color: var(--accent);
    background: var(--bg-quaternary);
    transform: translateX(4px);
}
.mode-option .mode-icon {
    width: 44px;
    height: 44px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: var(--transition);
}
.mode-option:hover .mode-icon { transform: scale(1.1); }
.mode-option .mode-info { flex: 1; min-width: 0; }
.mode-option .mode-info h4 { font-size: 14px; font-weight: 600; color: var(--text-primary); margin-bottom: 2px; }
.mode-option .mode-info p { font-size: 12px; color: var(--text-muted); line-height: 1.4; }
.mode-option .mode-arrow { color: var(--text-disabled); transition: var(--transition); flex-shrink: 0; }
.mode-option:hover .mode-arrow { color: var(--accent); transform: translateX(2px); }

/* Mode icon colors */
.mode-icon-standard { background: rgba(102, 126, 234, 0.15); color: #667eea; }
.mode-icon-practice { background: rgba(168, 85, 247, 0.15); color: #a855f7; }
.mode-icon-learning { background: rgba(16, 185, 129, 0.15); color: #10b981; }
.mode-icon-flashcard { background: rgba(245, 158, 11, 0.15); color: #f59e0b; }
.mode-icon-inverse { background: rgba(244, 63, 94, 0.15); color: #f43f5e; }

/* === Mode Info Cards (small overview) === */
.mode-cards-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 0.75rem;
}
.mode-info-card {
    padding: 0.75rem;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background: var(--bg-secondary);
}
.mode-info-card .status-badge { margin-bottom: 0.5rem; }
.mode-info-card p { font-size: 12px; color: var(--text-muted); line-height: 1.4; }

/* === Quiz Progress === */
.quiz-progress {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 0.75rem;
}
.quiz-progress-label { font-size: 15px; font-weight: 600; color: var(--text-primary); }
.quiz-progress-score {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
}

/* === Quiz Options (Radio/Checkbox) === */
.option-item { margin-bottom: 0.5rem; }
.option-item label {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 14px 16px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: var(--transition);
    background: var(--bg-tertiary);
}
.option-item label:hover {
    border-color: var(--border-light);
    background: var(--bg-quaternary);
    transform: translateX(3px);
}
.option-item label.selected {
    border-color: var(--accent);
    background: var(--accent-light);
}
.option-item label.correct {
    border-color: var(--success) !important;
    background: rgba(16, 185, 129, 0.08) !important;
}
.option-item label.incorrect {
    border-color: var(--danger) !important;
    background: rgba(239, 68, 68, 0.08) !important;
}
.option-item label.disabled {
    pointer-events: none;
    opacity: 0.7;
    cursor: not-allowed;
}
.option-item label.learning-correct {
    border-color: var(--success) !important;
    background: rgba(16, 185, 129, 0.06) !important;
}

.option-radio, .option-checkbox {
    width: 20px;
    height: 20px;
    border: 2px solid var(--border-light);
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    margin-top: 1px;
}
.option-radio { border-radius: 50%; }
.option-checkbox { border-radius: 4px; }
.option-radio.checked, .option-checkbox.checked { background: var(--accent); border-color: var(--accent); }
.option-radio.checked::after { content: ''; width: 8px; height: 8px; border-radius: 50%; background: #fff; }
.option-checkbox.checked::after { content: ''; width: 6px; height: 10px; border: solid #fff; border-width: 0 2px 2px 0; transform: rotate(45deg); margin-top: -2px; }
.option-radio.correct, .option-checkbox.correct { border-color: var(--success); background: var(--success); }
.option-radio.incorrect, .option-checkbox.incorrect { border-color: var(--danger); background: var(--danger); }

.option-text { flex: 1; color: var(--text-secondary); font-size: 14px; line-height: 1.5; }
.correct-answer-mark { color: var(--success); font-weight: 600; margin-left: 4px; }

/* Hidden real input */
.option-item input[type="radio"], .option-item input[type="checkbox"] { position: absolute; opacity: 0; width: 0; height: 0; }

/* === Feedback === */
.feedback {
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    margin-top: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 14px;
}
.feedback.feedback-correct { background: rgba(16, 185, 129, 0.1); border: 1px solid rgba(16, 185, 129, 0.3); color: var(--success); }
.feedback.feedback-incorrect { background: rgba(239, 68, 68, 0.1); border: 1px solid rgba(239, 68, 68, 0.3); color: var(--danger); }
.feedback.feedback-warning { background: rgba(245, 158, 11, 0.1); border: 1px solid rgba(245, 158, 11, 0.3); color: var(--warning); }

.explanation-box {
    margin-top: 1rem;
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    background: rgba(6, 182, 212, 0.08);
    border: 1px solid rgba(6, 182, 212, 0.25);
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    font-size: 14px;
    color: var(--info);
}
.explanation-box iconify-icon { flex-shrink: 0; margin-top: 2px; }

/* === Flashcard === */
.flashcard-container { perspective: 1000px; width: 100%; max-width: 600px; margin: 2rem auto; }
.flashcard { position: relative; width: 100%; min-height: 280px; cursor: pointer; transform-style: preserve-3d; transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1); }
.flashcard.flipped { transform: rotateY(180deg); }
.flashcard-face { position: absolute; width: 100%; min-height: 280px; backface-visibility: hidden; border-radius: var(--radius); display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 2rem; text-align: center; }
.flashcard-front { background: linear-gradient(135deg, var(--accent) 0%, #764ba2 100%); color: #fff; }
.flashcard-back { background: linear-gradient(135deg, #0d7377, #14a085); color: #fff; transform: rotateY(180deg); }
.flashcard-label { font-size: 11px; text-transform: uppercase; letter-spacing: 0.1em; opacity: 0.8; margin-bottom: 1rem; font-weight: 600; }
.flashcard-content { font-size: 1.25rem; line-height: 1.6; font-weight: 500; }
.flashcard-hint { position: absolute; bottom: 1rem; font-size: 12px; opacity: 0.6; }

/* === Toggle Switch === */
.toggle-wrapper { display: flex; align-items: center; gap: 0.5rem; cursor: pointer; }
.toggle { position: relative; width: 40px; height: 22px; background: var(--bg-hover); border-radius: 11px; transition: var(--transition); border: 1px solid var(--border); }
.toggle::after { content: ''; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; background: var(--text-muted); border-radius: 50%; transition: var(--transition); }
.toggle.active { background: var(--accent); border-color: var(--accent); }
.toggle.active::after { transform: translateX(18px); background: #fff; }
.toggle-label { font-size: 13px; color: var(--text-muted); font-weight: 500; user-select: none; }

/* === Quiz Results === */
.result-card { text-align: center; padding: 3rem 2rem; }
.result-icon { width: 80px; height: 80px; border-radius: var(--radius); background: var(--accent); display: flex; align-items: center; justify-content: center; margin: 0 auto 1.5rem; }
.result-score { font-size: 3rem; font-weight: 800; color: var(--accent); letter-spacing: -0.03em; }
.result-total { font-size: 1.5rem; font-weight: 600; color: var(--text-primary); }

/* === Answer Summary Table === */
.summary-table-wrap { max-height: 300px; overflow-y: auto; border-radius: var(--radius-sm); border: 1px solid var(--border); margin-top: 1.5rem; text-align: left; }

/* === Admin-specific === */
.question-item { border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 1rem 1.25rem; background: var(--bg-tertiary); transition: var(--transition); }
.question-item:hover { border-color: var(--border-light); }
.question-item + .question-item { margin-top: 0.75rem; }

/* Action icons row */
.action-icons { display: flex; align-items: center; gap: 0.25rem; }
.action-icon { padding: 6px; border-radius: var(--radius-xs); color: var(--text-muted); transition: var(--transition); display: inline-flex; text-decoration: none; cursor: pointer; background: none; border: none; font-family: inherit; }
.action-icon:hover { background: var(--bg-hover); color: var(--text-primary); }
.action-icon.icon-play:hover { color: var(--success); }
.action-icon.icon-edit:hover { color: var(--accent); }
.action-icon.icon-export:hover { color: var(--success); }
.action-icon.icon-delete:hover { color: var(--danger); }

/* === View Toggle === */
.view-toggle { display: flex; background: var(--bg-tertiary); border-radius: var(--radius-xs); padding: 2px; }
.view-toggle-btn { padding: 6px 8px; border-radius: 4px; color: var(--text-muted); cursor: pointer; transition: var(--transition); display: flex; align-items: center; background: none; border: none; }
.view-toggle-btn:hover { color: var(--text-primary); }
.view-toggle-btn.active { background: var(--bg-quaternary); color: var(--accent); }

/* === Divider line for list items === */
.list-divide > * + * { border-top: 1px solid var(--border); }

/* === Page section header === */
.page-header { margin-bottom: 2rem; }
.page-header h1 { margin-bottom: 0.25rem; }
.page-header p { color: var(--text-muted); font-size: 14px; }

/* === Unlock page specific === */
.unlock-page { display: flex; align-items: center; justify-content: center; min-height: 100vh; background: linear-gradient(135deg, var(--accent), #764ba2); padding: 1rem; }
.unlock-card { background: var(--bg-secondary); border: 1px solid var(--border); border-radius: var(--radius); padding: 2.5rem; width: 100%; max-width: 420px; }
.unlock-logo { text-align: center; margin-bottom: 2rem; }
.unlock-logo iconify-icon { font-size: 48px; color: var(--accent); margin-bottom: 0.75rem; display: block; }
.unlock-logo h1 { font-size: 2rem; color: var(--text-primary); letter-spacing: -0.03em; }
.unlock-logo p { font-size: 14px; color: var(--text-muted); margin-top: 0.25rem; }

/* ============================================================
   Responsive Breakpoints
   ============================================================ */
@media (max-width: 1024px) {
    .grid-5 { grid-template-columns: repeat(3, 1fr); }
    .grid-4 { grid-template-columns: repeat(2, 1fr); }
    .mode-cards-grid { grid-template-columns: repeat(3, 1fr); }
    .nav { gap: 0.125rem; }
    .nav a { padding: 0.5rem 0.5rem; font-size: 12px; }
}

@media (max-width: 768px) {
    .container { padding: 1.25rem; }
    .header { padding: 0.75rem 1rem; }

    .nav-toggle { display: flex; }

    .nav {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: rgba(18, 18, 18, 0.95);
        backdrop-filter: blur(16px);
        -webkit-backdrop-filter: blur(16px);
        border-bottom: 1px solid var(--border);
        flex-direction: column;
        padding: 0.75rem;
        gap: 0.25rem;
    }

    .nav.open {
        display: flex;
    }

    .nav a {
        padding: 0.75rem 1rem;
        font-size: 14px;
        border-radius: var(--radius-sm);
        width: 100%;
    }

    .nav a:hover {
        background: var(--bg-tertiary);
    }

    .header-actions {
        gap: 0.5rem;
    }

    .grid-2, .grid-3, .grid-4, .grid-5 { grid-template-columns: 1fr; }
    .mode-cards-grid { grid-template-columns: repeat(2, 1fr); }
    h1 { font-size: 1.5rem; }
    .btn { min-height: 44px; }

    .footer { padding: 1.25rem 1rem; }
    .footer-content { flex-direction: column; text-align: center; }
    .footer-links { justify-content: center; }
}

@media (max-width: 480px) {
    .container { padding: 1rem; }
    .mode-cards-grid { grid-template-columns: 1fr; }
    .form-input, .form-textarea, .form-select { font-size: 16px; }
}
