:root {
    --bg-dark: #f8fafc;
    --bg-panel: #ffffff;
    --bg-card: #ffffff;
    --border-color: #e2e8f0;
    --border-glow: #cbd5e1;
    --text-primary: #0f172a;
    --text-secondary: #334155;
    --text-muted: #64748b;
    --accent-cyan: #0284c7;
    --accent-blue: #2563eb;
    --accent-purple: #7c3aed;
    --accent-red: #dc2626;
    --accent-gold: #d97706;
    --gradient-primary: linear-gradient(135deg, #2563eb 0%, #0284c7 100%);
    --gradient-purple: linear-gradient(135deg, #7c3aed 0%, #a855f7 100%);
    --font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

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

body {
    background-color: var(--bg-dark);
    color: var(--text-primary);
    font-family: var(--font-family);
    overflow: hidden;
    height: 100vh;
    display: flex;
}

/* Layout */
.app-container {
    display: flex;
    width: 100vw;
    height: 100vh;
    position: relative;
}

/* Sidebar slide selector list */
.sidebar {
    width: 280px;
    background: var(--bg-panel);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    z-index: 10;
    transition: transform 0.3s ease;
}

.sidebar.hidden {
    transform: translateX(-280px);
    position: absolute;
}

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

.sidebar-title {
    font-size: 1.1rem;
    font-weight: 800;
    color: var(--text-primary);
    letter-spacing: -0.3px;
}

.sidebar-subtitle {
    font-size: 0.78rem;
    color: var(--text-muted);
    margin-top: 4px;
}

.slide-list {
    flex: 1;
    overflow-y: auto;
    padding: 12px;
}

.slide-item {
    display: flex;
    align-items: center;
    padding: 10px 12px;
    border-radius: 6px;
    cursor: pointer;
    margin-bottom: 4px;
    transition: all 0.15s ease;
    border: 1px solid transparent;
}

.slide-item:hover {
    background: #f1f5f9;
}

.slide-item.active {
    background: #f1f5f9;
    border-color: var(--border-color);
}

.slide-item-num {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-muted);
    width: 22px;
    height: 22px;
    border-radius: 4px;
    background: #e2e8f0;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 12px;
}

.slide-item.active .slide-item-num {
    background: var(--text-primary);
    color: #ffffff;
}

.slide-item-title {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 1;
}

.slide-item.active .slide-item-title {
    color: var(--text-primary);
    font-weight: 600;
}

.sidebar-footer {
    padding: 16px 24px;
    border-top: 1px solid var(--border-color);
    font-size: 0.75rem;
    color: var(--text-muted);
    display: flex;
    justify-content: space-between;
}

/* Presentation Main Area */
.presentation-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: hidden;
}

.presentation-header {
    height: 60px;
    padding: 0 40px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--border-color);
    background: #ffffff;
    z-index: 5;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.toggle-sidebar-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 1.1rem;
    padding: 6px;
    border-radius: 4px;
    transition: all 0.15s;
    display: flex;
    align-items: center;
}

.toggle-sidebar-btn:hover {
    background: #f1f5f9;
    color: var(--text-primary);
}

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

.header-right {
    display: flex;
    align-items: center;
    gap: 8px;
}

.header-btn {
    background: #ffffff;
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s;
    display: flex;
    align-items: center;
    gap: 6px;
}

.header-btn:hover {
    background: #f8fafc;
    color: var(--text-primary);
    border-color: #cbd5e1;
}

.header-btn.active {
    background: var(--text-primary);
    color: #ffffff;
    border: none;
}

/* Slides Content Container */
.slides-container {
    flex: 1;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
}

.slide {
    position: absolute;
    width: 100%;
    height: 100%;
    max-width: 1000px;
    max-height: 560px;
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    padding: 48px;
    opacity: 0;
    pointer-events: none;
    transform: scale(0.985);
    transition: all 0.25s ease-out;
    box-shadow: 0 4px 24px rgba(15, 23, 42, 0.04);
    overflow: hidden;
}

.slide.active {
    opacity: 1;
    pointer-events: auto;
    transform: scale(1);
}

/* Slide Header & Titles */
.slide-header {
    margin-bottom: 24px;
}

.slide-category {
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--accent-blue);
    text-transform: uppercase;
    letter-spacing: 1.5px;
    margin-bottom: 6px;
    display: inline-block;
}

.slide-title {
    font-size: 2rem;
    font-weight: 800;
    color: var(--text-primary);
    letter-spacing: -0.5px;
    line-height: 1.25;
}

.slide-subtitle-desc {
    font-size: 1rem;
    color: var(--text-secondary);
    margin-top: 6px;
}

/* Common Layout Helpers inside slides */
.grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 36px;
    align-items: center;
    height: 100%;
}

.grid-3 {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 20px;
    height: 100%;
}

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

/* Slide Cover Specific */
.cover-layout {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    height: 100%;
}

.cover-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 16px;
}

.cover-badge {
    border: 1px solid var(--text-primary);
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--text-primary);
    text-transform: uppercase;
}

.cover-body {
    margin: 50px 0;
}

.cover-title {
    font-size: 3rem;
    font-weight: 850;
    line-height: 1.2;
    color: var(--text-primary);
    letter-spacing: -1px;
}

.cover-subtitle {
    font-size: 1.35rem;
    font-weight: 500;
    margin-top: 12px;
    color: var(--text-secondary);
}

.cover-footer {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    border-top: 1px solid var(--border-color);
    padding-top: 20px;
}

.author-info {
    display: flex;
    gap: 32px;
}

.author-box {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.author-role {
    font-size: 0.65rem;
    text-transform: uppercase;
    color: var(--text-muted);
    letter-spacing: 0.5px;
}

.author-name {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-primary);
}

/* Spacious, clean paragraphs & concepts */
.clean-concept-box {
    padding: 4px 0;
}

.clean-concept-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 10px;
}

.clean-concept-text {
    font-size: 1rem;
    line-height: 1.6;
    color: var(--text-secondary);
}

.clean-quote-box {
    border-left: 3px solid var(--text-primary);
    padding: 12px 20px;
    background: #f8fafc;
    border-radius: 0 6px 6px 0;
    margin-top: 16px;
    font-size: 0.95rem;
    line-height: 1.5;
    color: var(--text-secondary);
}

/* Info card styling adjustments for space */
.info-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 24px;
}

.info-card-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
}

.info-card-icon {
    width: 36px;
    height: 36px;
    border-radius: 6px;
    background: #f1f5f9;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-primary);
    font-size: 1.1rem;
    font-weight: bold;
}

.icon-purple, .icon-gold, .icon-red {
    background: #f1f5f9;
    color: var(--text-primary);
}

.info-card-title {
    font-size: 1.05rem;
    font-weight: 700;
}

.info-card-desc {
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

/* Code viewer */
.code-viewer {
    display: flex;
    flex-direction: column;
    background: #f8fafc;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    height: 100%;
    overflow: hidden;
}

.code-tabs {
    display: flex;
    background: #f1f5f9;
    border-bottom: 1px solid var(--border-color);
    padding: 0 8px;
}

.code-tab {
    background: none;
    border: none;
    color: var(--text-muted);
    padding: 10px 14px;
    font-size: 0.72rem;
    font-weight: 600;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    transition: all 0.1s;
    font-family: monospace;
}

.code-tab:hover {
    color: var(--text-primary);
}

.code-tab.active {
    color: var(--text-primary);
    border-bottom-color: var(--text-primary);
}

.code-container {
    flex: 1;
    overflow: auto;
    padding: 16px;
    font-family: 'Consolas', 'Courier New', Courier, monospace;
    font-size: 0.78rem;
    line-height: 1.45;
}

.code-container pre {
    margin: 0;
    white-space: pre-wrap;
    word-break: break-all;
}

.code-highlight {
    color: #0f172a;
}

.code-keyword { color: #0550ae; font-weight: 600; }
.code-type { color: #cf222e; }
.code-method { color: #8250df; }
.code-comment { color: #6e7781; font-style: italic; }
.code-string { color: #0a3069; }
.code-number { color: #0550ae; }

.code-annotation {
    background: #f8fafc;
    border-left: 3px solid var(--text-primary);
    padding: 14px 18px;
    border-radius: 0 6px 6px 0;
    font-size: 0.9rem;
    line-height: 1.5;
    color: var(--text-secondary);
}

.code-annotation strong {
    color: var(--text-primary);
}

/* Bullet list */
.bullet-list {
    list-style: none;
}

.bullet-list li {
    position: relative;
    padding-left: 20px;
    margin-bottom: 14px;
    font-size: 0.95rem;
    line-height: 1.5;
    color: var(--text-secondary);
}

.bullet-list li strong {
    color: var(--text-primary);
    display: inline;
    font-weight: 700;
}

.bullet-list li strong::after {
    content: " — ";
    color: var(--text-muted);
}

.bullet-list li::before {
    content: "";
    position: absolute;
    left: 0;
    top: 7px;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--text-primary);
}

.bullet-list.purple li::before {
    background: var(--text-primary);
}

/* Slide Visual image */
.slide-visual-wrapper {
    width: 100%;
    height: 100%;
    max-height: 380px;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid var(--border-color);
    position: relative;
    background: #f8fafc;
}

.slide-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.image-overlay-caption {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    padding: 12px 16px;
    background: linear-gradient(transparent, rgba(15, 23, 42, 0.85));
    font-size: 0.8rem;
    color: #ffffff;
}

/* Interactive Simulator: BFS Grid */
.sim-container {
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 16px;
    display: flex;
    flex-direction: column;
    height: 100%;
    position: relative;
}

.sim-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 12px;
    align-items: center;
}

.sim-btn {
    background: #ffffff;
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 6px 14px;
    border-radius: 4px;
    font-size: 0.78rem;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.1s;
    display: flex;
    align-items: center;
    gap: 4px;
}

.sim-btn:hover {
    background: #f8fafc;
    border-color: #cbd5e1;
}

.sim-btn.primary {
    background: var(--text-primary);
    color: #ffffff;
    border: none;
}

.sim-btn.primary:hover {
    background: #1e293b;
}

.sim-canvas-wrapper {
    flex: 1;
    position: relative;
    border-radius: 6px;
    overflow: hidden;
    border: 1px solid var(--border-color);
    background: #f8fafc;
    min-height: 280px;
}

.sim-canvas {
    width: 100%;
    height: 100%;
    display: block;
}

.sim-status {
    position: absolute;
    bottom: 8px;
    left: 8px;
    background: rgba(15, 23, 42, 0.9);
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 0.72rem;
    font-family: monospace;
    color: #ffffff;
}

/* Interactive Simulator: Camera zoom & shake */
.camera-sim-wrapper {
    display: flex;
    flex-direction: column;
    gap: 16px;
    height: 100%;
    justify-content: center;
}

.camera-screen-box {
    width: 100%;
    height: 240px;
    background: #f8fafc;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.camera-screen-content {
    width: 100%;
    height: 100%;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.05s ease;
}

.speed-lines {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s ease;
    background: radial-gradient(circle, transparent 40%, rgba(15,23,42,0.03) 70%, rgba(15,23,42,0.08) 100%);
}

.camera-hud {
    position: absolute;
    top: 12px;
    left: 12px;
    font-family: monospace;
    font-size: 0.72rem;
    color: var(--text-primary);
    display: flex;
    flex-direction: column;
    gap: 2px;
    background: #ffffff;
    padding: 4px 8px;
    border-radius: 4px;
    border: 1px solid var(--border-color);
}

.camera-hud-item span {
    font-weight: 700;
}

.camera-hearts {
    position: absolute;
    top: 12px;
    right: 12px;
    display: flex;
    gap: 4px;
}

.heart-icon {
    width: 16px;
    height: 16px;
    background: #ef4444;
    clip-path: path('M12 4.419c-2.826-5.695-11.999-4.064-11.999 3.27 0 7.27 9.903 10.938 11.999 12.311 2.096-1.373 11.999-5.041 11.999-12.311 0-7.334-9.173-8.965-11.999-3.27z');
    transform: scale(0.7);
    transform-origin: center;
    transition: all 0.2s ease;
}

.heart-icon.lost {
    background: #e2e8f0;
}

.camera-scene-elements {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
    transform: perspective(300px) rotateX(40deg) scale(1.1);
    transform-origin: center;
    transition: transform 0.4s ease;
}

.camera-track {
    width: 180px;
    height: 300px;
    background: #f1f5f9;
    border-left: 2px solid var(--text-primary);
    border-right: 2px solid var(--text-primary);
    position: absolute;
    bottom: -60px;
    display: flex;
    justify-content: center;
    overflow: hidden;
}

.camera-player {
    width: 24px;
    height: 24px;
    background: var(--text-primary);
    border-radius: 50%;
    position: absolute;
    bottom: 50px;
    z-index: 2;
    transition: all 0.2s;
}

.camera-obstacle-obj {
    width: 20px;
    height: 20px;
    background: #cbd5e1;
    border: 2px solid var(--text-primary);
    border-radius: 4px;
    position: absolute;
    top: 40px;
    animation: obstacleFly 2s infinite linear;
}

@keyframes obstacleFly {
    0% { top: -20px; transform: scale(0.4); }
    100% { top: 230px; transform: scale(1.2); }
}

.cam-slider-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
    width: 100%;
}

.cam-slider-label {
    display: flex;
    justify-content: space-between;
    font-size: 0.82rem;
    color: var(--text-secondary);
}

.cam-slider {
    width: 100%;
    height: 4px;
    border-radius: 2px;
    outline: none;
    -webkit-appearance: none;
    background: #e2e8f0;
}

.cam-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--text-primary);
    cursor: pointer;
}

/* Controls Navigation Panel */
.navigation-controls {
    height: 72px;
    border-top: 1px solid var(--border-color);
    background: #ffffff;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 40px;
    z-index: 5;
}

.nav-buttons {
    display: flex;
    gap: 8px;
}

.nav-btn {
    background: #ffffff;
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    width: 42px;
    height: 42px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1rem;
    transition: all 0.15s ease;
}

.nav-btn:hover {
    background: #f8fafc;
    border-color: #cbd5e1;
}

.nav-btn:active {
    transform: scale(0.96);
}

.nav-progress-container {
    flex: 1;
    max-width: 400px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
}

.nav-progress-bar-bg {
    width: 100%;
    height: 3px;
    background: #e2e8f0;
    border-radius: 2px;
    overflow: hidden;
}

.nav-progress-bar-fill {
    height: 100%;
    width: 0%;
    background: var(--text-primary);
    border-radius: 2px;
    transition: width 0.2s ease;
}

.nav-slide-counter {
    font-size: 0.78rem;
    color: var(--text-muted);
    font-weight: 600;
}

.floating-actions {
    display: flex;
    gap: 6px;
}

/* Tooltips */
[data-tooltip] {
    position: relative;
}

[data-tooltip]::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 125%;
    left: 50%;
    transform: translateX(-50%) scale(0.97);
    background: #0f172a;
    color: #ffffff;
    padding: 6px 10px;
    border-radius: 4px;
    font-size: 0.7rem;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: all 0.1s ease;
}

[data-tooltip]:hover::after {
    opacity: 1;
    transform: translateX(-50%) scale(1);
}

@media (max-width: 900px) {
    .sidebar {
        position: absolute;
        left: 0;
        top: 0;
        bottom: 0;
        transform: translateX(-100%);
    }
    .sidebar.visible {
        transform: translateX(0);
    }
    .grid-2 {
        grid-template-columns: 1fr;
        gap: 16px;
        overflow-y: auto;
    }
    .grid-3 {
        grid-template-columns: 1fr;
    }
    .slide {
        padding: 24px;
        max-height: 85vh;
    }
}

/* Fullscreen Mode Overrides */
.presentation-area:fullscreen {
    background-color: #ffffff;
}

.presentation-area:fullscreen .presentation-header,
.presentation-area:fullscreen .navigation-controls {
    display: none;
}

.presentation-area:fullscreen .slides-container {
    padding: 0;
    width: 100vw;
    height: 100vh;
}

.presentation-area:fullscreen .slide {
    max-width: 100vw;
    max-height: 100vh;
    width: 100vw;
    height: 100vh;
    border-radius: 0;
    border: none;
    box-shadow: none;
    padding: 80px;
}

