:root {
    --bg-main: oklch(0.12 0.03 260);
    --bg-sidebar: oklch(0.15 0.03 260);
    --bg-card: oklch(0.18 0.03 260);
    --bg-card-hover: oklch(0.22 0.04 260);
    
    --border-subtle: rgba(255, 255, 255, 0.08);
    --border-accent: oklch(0.7 0.15 220);
    
    --text-primary: oklch(0.98 0.01 260);
    --text-secondary: oklch(0.75 0.02 260);
    --text-muted: oklch(0.55 0.02 260);
    
    --accent-cyan: oklch(0.75 0.16 220);
    --accent-indigo: oklch(0.65 0.2 270);
    --accent-amber: oklch(0.75 0.18 75);
    --accent-green: oklch(0.72 0.19 145);
    --accent-red: oklch(0.65 0.22 25);
    
    --font-heading: 'Space Grotesk', sans-serif;
    --font-body: 'Plus Jakarta Sans', sans-serif;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html, body {
    width: 100vw;
    height: 100vh;
    overflow: hidden;
    background: var(--bg-main);
    font-family: var(--font-body);
    color: var(--text-primary);
    -webkit-font-smoothing: antialiased;
}

/* App 2-Column Dashboard Layout */
.app-layout {
    display: flex;
    width: 100vw;
    height: 100vh;
}

/* Sidebar */
.sidebar {
    width: 320px;
    height: 100vh;
    background: var(--bg-sidebar);
    border-right: 1px solid var(--border-subtle);
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    user-select: none;
}

.sidebar-header {
    padding: 24px 20px;
    border-bottom: 1px solid var(--border-subtle);
}

.brand-badge {
    display: inline-block;
    font-family: var(--font-heading);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.12em;
    color: var(--accent-cyan);
    background: rgba(56, 189, 248, 0.1);
    padding: 4px 10px;
    border-radius: 4px;
    margin-bottom: 8px;
}

.sidebar-title {
    font-family: var(--font-heading);
    font-size: 20px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 12px;
}

.progress-pill {
    background: rgba(255, 255, 255, 0.05);
    padding: 8px 14px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-secondary);
}

.sidebar-nav-title {
    font-family: var(--font-heading);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.1em;
    color: var(--text-muted);
    padding: 16px 20px 8px 20px;
}

.question-grid-nav {
    flex: 1;
    overflow-y: auto;
    padding: 12px 20px;
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 8px;
    align-content: start;
}

.nav-dot {
    height: 38px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border-subtle);
    border-radius: 6px;
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.15s ease;
}

.nav-dot:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
}

.nav-dot.active {
    background: var(--accent-cyan);
    color: #090d16;
    border-color: var(--accent-cyan);
    font-weight: 700;
}

.nav-dot.starred {
    border-color: var(--accent-amber);
    color: var(--accent-amber);
}

.nav-dot.answered-correct {
    border-color: var(--accent-green);
    color: var(--accent-green);
    background: rgba(16, 185, 129, 0.12);
}

.sidebar-footer {
    padding: 12px 14px;
    border-top: 1px solid var(--border-subtle);
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.footer-btn-group {
    display: flex;
    gap: 6px;
    width: 100%;
}

.btn-sidebar-action {
    flex: 1;
    background: rgba(245, 158, 11, 0.12);
    border: 1px solid rgba(245, 158, 11, 0.3);
    color: var(--accent-amber);
    padding: 8px 10px;
    border-radius: 6px;
    font-family: var(--font-heading);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: left;
}

.btn-sidebar-action:hover {
    background: rgba(245, 158, 11, 0.25);
}

.btn-sidebar-action.active {
    background: rgba(245, 158, 11, 0.35);
    border-color: var(--accent-amber);
    box-shadow: 0 0 10px rgba(245, 158, 11, 0.4);
}

.btn-correct-act {
    background: rgba(16, 185, 129, 0.12);
    border-color: rgba(16, 185, 129, 0.3);
    color: var(--accent-green);
}

.btn-correct-act:hover {
    background: rgba(16, 185, 129, 0.25);
}

.btn-correct-act.active {
    background: rgba(16, 185, 129, 0.35);
    border-color: var(--accent-green);
    box-shadow: 0 0 10px rgba(16, 185, 129, 0.4);
}

.btn-reset-small {
    width: 32px;
    height: 32px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-subtle);
    color: var(--text-muted);
    border-radius: 6px;
    font-size: 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.btn-reset-small:hover {
    background: rgba(239, 68, 68, 0.2);
    color: var(--accent-red);
    border-color: rgba(239, 68, 68, 0.4);
}

.btn-wrong-action {
    background: rgba(239, 68, 68, 0.12);
    border-color: rgba(239, 68, 68, 0.3);
    color: var(--accent-red);
}

.btn-wrong-action:hover {
    background: rgba(239, 68, 68, 0.25);
}

/* Main Viewport Layout */
.main-content {
    flex: 1;
    height: 100vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    position: relative;
}

/* Top App Bar */
.top-bar {
    height: 64px;
    padding: 0 32px;
    border-bottom: 1px solid var(--border-subtle);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(12px);
    z-index: 10;
}

.deck-tag {
    font-family: var(--font-heading);
    font-size: 15px;
    font-weight: 600;
    color: var(--accent-indigo);
    background: rgba(99, 102, 241, 0.12);
    padding: 6px 14px;
    border-radius: 6px;
}

.top-actions {
    display: flex;
    gap: 12px;
}

.btn-top {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-subtle);
    color: var(--text-secondary);
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-top:hover {
    background: rgba(255, 255, 255, 0.12);
    color: var(--text-primary);
}

.btn-top.starred {
    background: rgba(245, 158, 11, 0.18);
    color: var(--accent-amber);
    border-color: rgba(245, 158, 11, 0.4);
}

.btn-top-trans {
    color: var(--accent-cyan);
    border-color: rgba(56, 189, 248, 0.3);
}

.btn-top-trans:hover {
    background: rgba(56, 189, 248, 0.15);
}

.btn-top-hint {
    color: #fbbf24;
    border-color: rgba(245, 158, 11, 0.3);
}

/* Stage & Slides */
.deck-stage {
    flex: 1;
    position: relative;
    overflow-y: auto;
    padding: 32px 40px;
}

.slide {
    display: none;
    height: 100%;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.slide.active {
    display: flex;
}

/* Cover Slide Design */
.cover-container {
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    max-width: 900px;
    margin: 0 auto;
}

.hero-badge {
    color: var(--accent-cyan);
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 14px;
    letter-spacing: 0.1em;
    margin-bottom: 16px;
}

.hero-title {
    font-family: var(--font-heading);
    font-size: 56px;
    font-weight: 700;
    line-height: 1.15;
    margin-bottom: 20px;
}

.hero-desc {
    font-size: 20px;
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 40px;
}

.btn-start-hero {
    background: var(--accent-cyan);
    color: #090d16;
    font-family: var(--font-heading);
    font-size: 20px;
    font-weight: 700;
    padding: 18px 44px;
    border-radius: 10px;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 10px 30px rgba(56, 189, 248, 0.3);
}

.btn-start-hero:hover {
    transform: translateY(-2px);
    box-shadow: 0 14px 40px rgba(56, 189, 248, 0.45);
}

/* Quiz Content Card */
.quiz-container {
    max-width: 1100px;
    margin: auto;
    width: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 24px;
}

.question-card-title {
    font-family: var(--font-heading);
    font-size: 26px;
    font-weight: 600;
    line-height: 1.4;
    color: var(--text-primary);
}

/* Translation & Hint Panels */
.panel-trans, .panel-hint {
    display: none;
    border-radius: 10px;
    padding: 18px 22px;
    font-size: 17px;
    line-height: 1.6;
}

.panel-trans.show, .panel-hint.show {
    display: block;
}

.panel-trans {
    background: rgba(56, 189, 248, 0.08);
    border: 1px solid rgba(56, 189, 248, 0.25);
    color: #e0f2fe;
}

.panel-hint {
    background: rgba(245, 158, 11, 0.08);
    border: 1px solid rgba(245, 158, 11, 0.25);
    color: #fef08a;
}

.panel-hint-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
    font-weight: 700;
}

.correct-ans-pill {
    background: var(--accent-green);
    color: #ffffff;
    padding: 4px 12px;
    border-radius: 4px;
    font-size: 14px;
}

/* Options Grid Layout */
.options-grid-modern {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-top: 8px;
}

.opt-card {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: 12px;
    padding: 20px 24px;
    display: flex;
    align-items: center;
    gap: 16px;
    cursor: pointer;
    transition: all 0.2s ease;
    min-height: 80px;
}

.opt-card:hover {
    background: var(--bg-card-hover);
    border-color: rgba(255, 255, 255, 0.2);
    transform: translateY(-1px);
}

.opt-key {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-subtle);
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-heading);
    font-size: 16px;
    font-weight: 700;
    color: var(--text-secondary);
    flex-shrink: 0;
}

.opt-val {
    font-size: 17px;
    line-height: 1.4;
    color: var(--text-primary);
}

.opt-card.selected {
    border-color: var(--accent-cyan);
    background: rgba(56, 189, 248, 0.12);
}

.opt-card.correct {
    border-color: var(--accent-green) !important;
    background: rgba(16, 185, 129, 0.15) !important;
}

.opt-card.correct .opt-key {
    background: var(--accent-green);
    color: #ffffff;
    border-color: transparent;
}

.opt-card.wrong {
    border-color: var(--accent-red) !important;
    background: rgba(239, 68, 68, 0.15) !important;
}

.opt-card.wrong .opt-key {
    background: var(--accent-red);
    color: #ffffff;
    border-color: transparent;
}

/* Bottom Nav Controls Bar */
.bottom-bar {
    height: 72px;
    padding: 0 32px;
    border-top: 1px solid var(--border-subtle);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(15, 23, 42, 0.8);
    backdrop-filter: blur(12px);
}

.nav-control-btn {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid var(--border-subtle);
    color: var(--text-primary);
    padding: 12px 24px;
    border-radius: 8px;
    font-family: var(--font-heading);
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.nav-control-btn:hover {
    background: rgba(255, 255, 255, 0.12);
}

.btn-primary-nav {
    background: var(--accent-indigo);
    border: none;
    color: #ffffff;
}

.btn-primary-nav:hover {
    background: oklch(0.7 0.22 270);
}

.jump-control {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 15px;
    color: var(--text-muted);
}

.jump-num-input {
    width: 68px;
    background: rgba(30, 41, 59, 0.8);
    border: 1px solid rgba(56, 189, 248, 0.3);
    color: var(--accent-cyan);
    padding: 6px 10px;
    border-radius: 6px;
    font-family: var(--font-heading);
    font-size: 17px;
    font-weight: 700;
    text-align: center;
    outline: none;
    -moz-appearance: textfield;
}

.jump-num-input::-webkit-outer-spin-button,
.jump-num-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.btn-reveal-inline {
    background: rgba(56, 189, 248, 0.12);
    border: 1px solid rgba(56, 189, 248, 0.3);
    color: var(--accent-cyan);
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-reveal-inline:hover {
    background: rgba(56, 189, 248, 0.25);
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: rgba(15, 23, 42, 0.5);
}

::-webkit-scrollbar-thumb {
    background: rgba(56, 189, 248, 0.25);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(56, 189, 248, 0.5);
}

/* Mobile Drawer & Backdrop */
.btn-menu-toggle {
    display: none;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid var(--border-subtle);
    color: var(--text-primary);
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 18px;
    cursor: pointer;
    margin-right: 12px;
}

.sidebar-backdrop {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    z-index: 99;
}

.sidebar-backdrop.show {
    display: block;
}

/* Responsive Mobile Rules */
@media (max-width: 900px) {
    .btn-menu-toggle {
        display: flex;
        align-items: center;
        justify-content: center;
        flex-shrink: 0;
    }

    .sidebar {
        position: fixed;
        top: 0;
        left: 0;
        z-index: 100;
        transform: translateX(-100%);
        transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
        box-shadow: 10px 0 30px rgba(0,0,0,0.5);
    }

    .sidebar.open {
        transform: translateX(0);
    }

    .options-grid-modern {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .top-bar {
        padding: 0 12px;
        height: auto;
        min-height: 56px;
        gap: 8px;
    }

    .top-left {
        display: flex;
        align-items: center;
        min-width: 0;
    }

    .deck-tag {
        font-size: 12px;
        padding: 4px 8px;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        max-width: 110px;
    }

    .top-actions {
        gap: 4px;
        flex-shrink: 0;
    }

    .btn-top {
        padding: 5px 8px;
        font-size: 11px;
    }

    .deck-stage {
        padding: 16px 12px;
        align-items: flex-start;
        justify-content: flex-start;
    }

    .quiz-container {
        gap: 16px;
        margin: 0;
    }

    .question-card-title {
        font-size: 18px;
        line-height: 1.35;
    }

    .opt-card {
        padding: 12px 14px;
        min-height: 52px;
        gap: 12px;
    }

    .opt-key {
        width: 30px;
        height: 30px;
        font-size: 13px;
    }

    .opt-val {
        font-size: 14px;
    }

    .bottom-bar {
        padding: 0 10px;
        height: 60px;
        gap: 6px;
    }

    .nav-control-btn {
        padding: 8px 12px;
        font-size: 13px;
    }

    .jump-control {
        gap: 6px;
    }

    .jump-num-input {
        width: 52px;
        font-size: 15px;
        padding: 4px 6px;
    }

    .jump-label {
        display: none;
    }

    .btn-reveal-inline {
        padding: 6px 8px;
        font-size: 11px;
    }
}

/* Custom Glassmorphic Modal Dialog */
.custom-modal-backdrop {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(6, 9, 17, 0.75);
    backdrop-filter: blur(8px);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.2s ease-out;
}

.custom-modal-backdrop.show {
    display: flex;
    opacity: 1;
}

.custom-modal-card {
    width: 90%;
    max-width: 440px;
    background: oklch(0.18 0.03 260);
    border: 1px solid rgba(56, 189, 248, 0.25);
    border-radius: 16px;
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.8), 0 0 20px rgba(56, 189, 248, 0.15);
    overflow: hidden;
    transform: scale(0.92);
    transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.custom-modal-backdrop.show .custom-modal-card {
    transform: scale(1);
}

.custom-modal-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-subtle);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.custom-modal-title {
    font-family: var(--font-heading);
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
}

.custom-modal-close {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 24px;
    cursor: pointer;
    line-height: 1;
    transition: color 0.15s;
}

.custom-modal-close:hover {
    color: var(--text-primary);
}

.custom-modal-body {
    padding: 24px;
    font-size: 16px;
    color: var(--text-secondary);
    line-height: 1.5;
}

.custom-modal-actions {
    padding: 16px 24px;
    border-top: 1px solid var(--border-subtle);
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    background: rgba(15, 23, 42, 0.4);
}

.modal-btn {
    padding: 10px 20px;
    border-radius: 8px;
    font-family: var(--font-heading);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s ease;
}

.modal-btn-cancel {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-subtle);
    color: var(--text-secondary);
}

.modal-btn-cancel:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
}

.modal-btn-confirm {
    background: var(--accent-red);
    border: none;
    color: #ffffff;
}

.modal-btn-confirm:hover {
    background: oklch(0.7 0.25 25);
}

/* Custom Floating Toast Notifications */
.toast-container {
    position: fixed;
    bottom: 84px;
    right: 24px;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    gap: 10px;
    pointer-events: none;
}

.custom-toast {
    background: oklch(0.2 0.04 260);
    border: 1px solid rgba(56, 189, 248, 0.3);
    color: var(--text-primary);
    padding: 14px 20px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    gap: 10px;
    pointer-events: auto;
    opacity: 0;
    transform: translateY(16px);
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

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