:root {
    /* Color Palette */
    --bg-primary: #0f111a;
    --bg-secondary: #1a1d2d;
    --bg-panel: rgba(26, 29, 45, 0.6);
    --bg-panel-hover: rgba(36, 40, 60, 0.8);
    
    --accent-color: #00d2ff;
    --accent-glow: rgba(0, 210, 255, 0.2);
    --accent-secondary: #3a7bd5;
    
    --text-primary: #ffffff;
    --text-secondary: #94a0b8;
    --text-muted: #64748b;
    
    --border-color: rgba(255, 255, 255, 0.08);
    --border-color-highlight: rgba(255, 255, 255, 0.15);
    
    /* Layout */
    --left-pane-width: 320px;
    
    /* Typography */
    --font-main: 'Inter', system-ui, -apple-system, sans-serif;
}

[v-cloak] {
    display: none;
}

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

body {
    font-family: var(--font-main);
    background-color: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    overflow: hidden; /* Prevent body scroll, layout panels handle it */
    background-image: 
        radial-gradient(circle at 15% 50%, rgba(58, 123, 213, 0.08), transparent 25%),
        radial-gradient(circle at 85% 30%, rgba(0, 210, 255, 0.08), transparent 25%);
    background-attachment: fixed;
}

/* App Container */
.app-container {
    height: 100vh;
    width: 100vw;
    display: flex;
    flex-direction: column;
}

/* Scrollbar styling */
::-webkit-scrollbar {
    width: 6px;
}
::-webkit-scrollbar-track {
    background: transparent;
}
::-webkit-scrollbar-thumb {
    background: var(--border-color-highlight);
    border-radius: 10px;
}
::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* Mobile Header (Hidden on Desktop) */
.mobile-header {
    display: none;
    flex-direction: column;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
    padding: 12px 20px;
    z-index: 100;
}

.mobile-header-top {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 12px;
}

.mobile-header-top h1 {
    font-size: 1.25rem;
    font-weight: 700;
}

.hamburger-btn {
    background: none;
    border: none;
    color: var(--text-primary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 4px;
}

/* Split Layout */
.split-layout {
    flex: 1;
    display: flex;
    overflow: hidden;
    position: relative;
}

/* Desktop Top Navbar */
.top-navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 20px;
    height: 60px;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
    position: relative;
    z-index: 100;
}

.nav-brand {
    display: flex;
    align-items: center;
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
}

.nav-brand span {
    background: linear-gradient(90deg, #fff, var(--text-secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.desktop-hamburger {
    margin-right: 12px;
}

.nav-controls {
    display: flex;
    align-items: center;
    gap: 20px;
    flex: 1;
    margin-left: 60px;
    justify-content: flex-end;
    margin-right: 20px;
}

.progress-container {
    position: absolute;
    bottom: -1px;
    left: 0;
    width: 100%;
    height: 3px;
    background: transparent;
    z-index: 101;
}

.progress-bar {
    height: 100%;
    background: var(--accent-color);
    width: 0%;
    transition: width 0.1s;
    box-shadow: 0 0 10px var(--accent-color);
}

/* Left Pane (Table of Contents) */
.left-pane {
    width: var(--left-pane-width);
    background-color: var(--bg-secondary);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    height: 100%;
    z-index: 50;
    transition: margin-left 0.3s cubic-bezier(0.4, 0, 0.2, 1), transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.left-pane.desktop-closed {
    margin-left: calc(-1 * var(--left-pane-width));
}

.category-selector {
    display: flex;
    align-items: center;
    gap: 12px;
}

.category-selector label {
    color: var(--text-muted);
    font-size: 0.9rem;
    font-weight: 500;
}

.category-selector select {
    flex: 1;
    background-color: rgba(0,0,0,0.2);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    padding: 8px 12px;
    border-radius: 6px;
    font-family: inherit;
    font-size: 0.95rem;
    outline: none;
    cursor: pointer;
    transition: all 0.2s ease;
}

.category-selector select:focus {
    border-color: var(--accent-color);
}

/* Search Bar */
.search-bar {
    position: relative;
    display: flex;
    align-items: center;
}

.search-icon {
    position: absolute;
    left: 12px;
    width: 16px;
    height: 16px;
    color: var(--text-muted);
}

.search-bar input {
    width: 100%;
    background-color: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 10px 12px 10px 36px;
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.9rem;
    transition: all 0.2s ease;
}

.search-bar input:focus {
    outline: none;
    border-color: var(--accent-color);
    box-shadow: 0 0 0 2px var(--accent-glow);
}

.search-bar input::placeholder {
    color: var(--text-muted);
}

.mobile-search {
    display: none;
}

.desktop-search input {
    width: 280px;
}

/* Nav List */
.left-pane-header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-color);
    background: rgba(0, 0, 0, 0.2);
}

.sidebar-category-select {
    width: 100%;
    background-color: rgba(0,0,0,0.3);
    color: var(--accent-color);
    border: 1px solid var(--border-color);
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 1rem;
    font-weight: 600;
    font-family: inherit;
    outline: none;
    cursor: pointer;
    transition: all 0.2s ease;
}

.sidebar-category-select:focus {
    border-color: var(--accent-color);
}

.sidebar-category-select option {
    background-color: var(--bg-secondary);
    color: var(--text-primary);
}

.left-pane-content {
    flex: 1;
    overflow-y: auto;
    padding: 12px 10px;
}

.no-results-small {
    padding: 20px;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.nav-list {
    list-style: none;
}

.nav-item {
    padding: 12px 16px;
    margin-bottom: 4px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 1px solid transparent;
    display: flex;
    gap: 8px;
}

.nav-item:hover {
    background-color: var(--bg-panel-hover);
}

.nav-item.active {
    background-color: var(--bg-panel);
    border-color: var(--border-color-highlight);
    box-shadow: inset 3px 0 0 var(--accent-color);
}

.nav-q-num {
    font-weight: 700;
    color: var(--accent-color);
    font-size: 0.85rem;
    padding-top: 2px;
}

.nav-q-text {
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.4;
    /* Limit to 2 lines */
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.nav-item:hover .nav-q-text, 
.nav-item.active .nav-q-text {
    color: var(--text-primary);
}


/* Right Pane (Continuous Content) */
.right-pane {
    flex: 1;
    overflow-y: auto;
    padding: 0;
    scroll-behavior: smooth; /* Smooth scrolling for click anchors */
}

.no-results {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
    font-size: 1.1rem;
}

.question-block {
    padding: 40px 60px;
    border-bottom: 1px solid var(--border-color);
}

.question-block:nth-child(even) {
    background-color: rgba(26, 29, 45, 0.3);
}

.question-title {
    font-size: 1.6rem;
    font-weight: 700;
    margin-bottom: 24px;
    color: var(--text-primary);
    line-height: 1.3;
}

.q-num {
    color: var(--accent-color);
}

.bottom-padding {
    height: 60vh; /* Allows the last item to scroll to the top of the viewport */
}

/* Twists (Alternate Questions) */
.twists-container {
    margin-top: -10px;
    margin-bottom: 24px;
    padding: 12px 16px;
    background-color: rgba(255, 255, 255, 0.03);
    border-left: 3px solid var(--accent-secondary);
    border-radius: 0 6px 6px 0;
}

.twists-container strong {
    color: var(--text-muted);
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 6px;
    display: block;
}

.twists-container ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.twists-container li {
    color: var(--text-secondary);
    font-size: 0.95rem;
    font-style: italic;
    margin-bottom: 4px;
}
.twists-container li:last-child {
    margin-bottom: 0;
}

/* Rich Content Styling */
.answer-content {
    color: var(--text-secondary);
    font-size: 1.05rem;
}

.text-block {
    margin-bottom: 20px;
}

.text-block:last-child {
    margin-bottom: 0;
}

.text-block p {
    margin-bottom: 1.2rem;
}
.text-block p:last-child {
    margin-bottom: 0;
}

.text-block ul, .text-block ol {
    margin-bottom: 1.2rem;
    padding-left: 1.5rem;
}

.text-block li {
    margin-bottom: 0.5rem;
}

.text-block strong {
    color: var(--text-primary);
    font-weight: 600;
}

.text-block code {
    background-color: rgba(0, 0, 0, 0.4);
    padding: 0.2rem 0.4rem;
    border-radius: 4px;
    font-family: monospace;
    font-size: 0.9em;
    color: var(--accent-color);
    border: 1px solid var(--border-color);
}

.text-block blockquote {
    border-left: 4px solid var(--accent-color);
    padding-left: 1rem;
    margin: 1.2rem 0;
    background-color: rgba(0, 210, 255, 0.05);
    padding: 1rem;
    border-radius: 0 8px 8px 0;
}

/* Code Blocks */
.code-block {
    margin: 24px 0;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid var(--border-color);
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
}

.code-block pre {
    margin: 0 !important;
    border-radius: 0 !important;
    background-color: #000 !important;
}

/* Image Blocks */
.image-block {
    margin: 32px 0;
    border-radius: 8px;
    overflow: hidden;
    background: rgba(0,0,0,0.3);
    border: 1px solid var(--border-color);
    box-shadow: 0 4px 20px rgba(0,0,0,0.3);
}

.image-block img {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 0 auto;
}

.image-block figcaption {
    padding: 12px 16px;
    background: var(--bg-secondary);
    color: var(--text-muted);
    font-size: 0.9rem;
    border-top: 1px solid var(--border-color);
    text-align: center;
}

.image-placeholder {
    padding: 60px 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    background: repeating-linear-gradient(
        45deg,
        rgba(0,0,0,0.2),
        rgba(0,0,0,0.2) 10px,
        rgba(26,29,45,0.2) 10px,
        rgba(26,29,45,0.2) 20px
    );
}

.image-placeholder span {
    font-weight: 600;
    font-size: 1.1rem;
    margin-bottom: 8px;
}

.image-placeholder small {
    font-family: monospace;
    color: var(--accent-color);
    background: rgba(0,0,0,0.5);
    padding: 4px 8px;
    border-radius: 4px;
}


/* Mobile Overlay */
.mobile-overlay {
    display: none;
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 40;
    backdrop-filter: blur(2px);
}

/* Responsive Design */
@media (max-width: 900px) {
    .mobile-header {
        display: flex;
    }
    
    .desktop-only {
        display: none !important;
    }
    
    .mobile-search {
        display: flex;
    }

    .desktop-search {
        display: none;
    }

    .left-pane {
        position: absolute;
        left: 0;
        top: 0;
        transform: translateX(-100%);
        box-shadow: 5px 0 25px rgba(0,0,0,0.8);
    }
    
    .left-pane.desktop-closed {
        margin-left: 0;
    }
    
    .left-pane.mobile-open {
        transform: translateX(0);
    }
    
    .mobile-overlay {
        display: block; /* Vue v-show controls visibility */
    }

    .question-block {
        padding: 30px 20px;
    }
    
    .question-title {
        font-size: 1.3rem;
    }
}
