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

:root {
    /* Color Palette - Aurora Dark Mode */
    --bg-dark: #020617; /* slate-950 */
    --bg-surface: rgba(2, 6, 23, 0.85); /* Much darker for text legibility */
    
    --text-primary: #f8fafc; /* slate-50 */
    --text-secondary: #94a3b8; /* slate-400 */
    /* Halftone Effect for Gradients */
    --halftone-pattern: radial-gradient(rgba(2, 6, 23, 0.9) 1.5px, transparent 2px);
    
    /* Vibrant Gradients & Accents */
    --accent-gradient: var(--halftone-pattern), linear-gradient(135deg, #6366f1, #06b6d4); /* Indigo to Cyan */
    --accent-gradient-hover: var(--halftone-pattern), linear-gradient(135deg, #818cf8, #22d3ee);
    --accent-purple: #8b5cf6;
    --accent-cyan: #06b6d4;
    --accent-pink: #ec4899;
    
    /* UI Elements */
    --glass-border: rgba(255, 255, 255, 0.08);
    --glass-border-highlight: rgba(255, 255, 255, 0.15);
    --glass-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
    --glow-shadow: 0 0 20px rgba(99, 102, 241, 0.3);

    /* Typography */
    --font-heading: 'Outfit', sans-serif;
    --font-body: 'Inter', sans-serif;
    --font-mono: 'Fira Code', monospace;
    
    /* Transitions & Animations */
    --transition-fast: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-smooth: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    --transition-bounce: all 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
    
    /* Dynamic Layout Settings */
    --content-max-width: 900px;
    --content-font-size: 1rem;
    --content-line-height: 1.7;
}

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

body {
    font-family: var(--font-body);
    background-color: var(--bg-dark);
    color: var(--text-primary);
    height: 100vh;
    overflow: hidden;
    font-size: var(--content-font-size);
    line-height: var(--content-line-height);
    position: relative;
    -webkit-font-smoothing: antialiased;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}
::-webkit-scrollbar-track {
    background: transparent;
}
::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
}
::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* Aurora Background Animation */
.aurora-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    overflow: hidden;
    z-index: 0;
    pointer-events: none;
}

/* Halftone Effect Overlay */
.aurora-bg::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    /* Creates a dotted halftone pattern using the dark background color */
    background-image: radial-gradient(var(--bg-dark) 2px, transparent 2.5px);
    background-size: 6px 6px;
    z-index: 1;
    opacity: 0.8;
}

.orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(100px);
    opacity: 0.25;
    transition: top 1.5s ease, bottom 1.5s ease, left 1.5s ease, right 1.5s ease, opacity 1.5s ease, animation 1.5s ease;
}

.orb-1 {
    width: 45vw;
    height: 45vw;
    top: -10%;
    left: -10%;
    animation: float1 25s infinite ease-in-out alternate;
}

.orb-2 {
    width: 35vw;
    height: 35vw;
    bottom: -15%;
    right: -10%;
    animation: float2 28s infinite ease-in-out alternate-reverse;
}

.orb-3 {
    width: 40vw;
    height: 40vw;
    top: 30%;
    left: 40%;
    opacity: 0.3;
    animation: float3 22s infinite ease-in-out alternate;
}

.orb-4 {
    width: 35vw;
    height: 35vw;
    bottom: 20%;
    left: 10%;
    opacity: 0.25;
    animation: float4 30s infinite ease-in-out alternate-reverse;
}

@keyframes float1 {
    0% { transform: translate(0, 0) scale(1); background: #6366f1; }
    50% { transform: translate(15vw, 20vh) scale(1.2); background: #a855f7; }
    100% { transform: translate(-5vw, 30vh) scale(0.9); background: #3b82f6; }
}

@keyframes float2 {
    0% { transform: translate(0, 0) scale(1); background: #06b6d4; }
    50% { transform: translate(-20vw, -15vh) scale(1.1); background: #10b981; }
    100% { transform: translate(10vw, -25vh) scale(0.85); background: #3b82f6; }
}

@keyframes float3 {
    0% { transform: translate(0, 0) scale(1); background: #ec4899; }
    50% { transform: translate(15vw, -25vh) scale(0.9); background: #f43f5e; }
    100% { transform: translate(-15vw, 15vh) scale(1.3); background: #d946ef; }
}

@keyframes float4 {
    0% { transform: translate(0, 0) scale(1); background: #f59e0b; }
    50% { transform: translate(-20vw, 20vh) scale(1.2); background: #ef4444; }
    100% { transform: translate(25vw, -10vh) scale(0.8); background: #ec4899; }
}

/* Completed Mode Orb Animations (Hugging Edges) */
body.chapter-completed-mode .orb-1 {
    top: -20%; left: -10%; right: auto; bottom: auto;
    animation: float-edge-x 20s infinite ease-in-out alternate;
}
body.chapter-completed-mode .orb-2 {
    bottom: -20%; right: -10%; left: auto; top: auto;
    animation: float-edge-x-rev 25s infinite ease-in-out alternate-reverse;
}
body.chapter-completed-mode .orb-3 {
    top: -10%; right: -20%; left: auto; bottom: auto;
    animation: float-edge-y 22s infinite ease-in-out alternate;
}
body.chapter-completed-mode .orb-4 {
    bottom: -10%; left: -20%; right: auto; top: auto;
    animation: float-edge-y-rev 28s infinite ease-in-out alternate-reverse;
}

@keyframes float-edge-x {
    0% { transform: translateX(0) scale(1); background: #10b981; }
    50% { transform: translateX(60vw) scale(1.2); background: #06b6d4; }
    100% { transform: translateX(110vw) scale(0.9); background: #3b82f6; }
}
@keyframes float-edge-x-rev {
    0% { transform: translateX(0) scale(1); background: #f43f5e; }
    50% { transform: translateX(-60vw) scale(1.1); background: #10b981; }
    100% { transform: translateX(-110vw) scale(0.85); background: #8b5cf6; }
}
@keyframes float-edge-y {
    0% { transform: translateY(0) scale(1); background: #ec4899; }
    50% { transform: translateY(50vh) scale(0.9); background: #10b981; }
    100% { transform: translateY(110vh) scale(1.3); background: #34d399; }
}
@keyframes float-edge-y-rev {
    0% { transform: translateY(0) scale(1); background: #f59e0b; }
    50% { transform: translateY(-50vh) scale(1.2); background: #10b981; }
    100% { transform: translateY(-110vh) scale(0.8); background: #06b6d4; }
}

/* Base Panel Class - Glassmorphism */
.glass-panel {
    background: radial-gradient(rgba(255, 255, 255, 0.04) 1px, transparent 1.5px), var(--bg-surface);
    background-size: 4px 4px, 100% 100%;
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--glass-border);
    box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.1), var(--glass-shadow);
    z-index: 10;
}

/* Layout */
.app-container {
    display: flex;
    height: 100vh;
    overflow: hidden;
    position: relative;
    z-index: 10;
}

/* Sidebar */
.sidebar {
    width: 350px;
    height: 100vh;
    position: fixed;
    left: 0;
    top: 0;
    display: flex;
    flex-direction: column;
    border-right: 1px solid var(--glass-border);
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1), width 0.4s cubic-bezier(0.16, 1, 0.3, 1), background 0.4s;
    background: rgba(2, 6, 23, 0.7);
}

.sidebar-header {
    padding: 2.5rem 2rem;
    border-bottom: 1px solid var(--glass-border);
    position: relative;
    overflow: hidden;
}

.sidebar-header h1 {
    font-family: var(--font-heading);
    font-size: 2.8rem;
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
    letter-spacing: -1px;
}

.text-gradient {
    background: var(--accent-gradient);
    background-size: 6px 6px, 100% 100%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.sidebar-header h1 span {
    background: var(--accent-gradient);
    background-size: 6px 6px, 100% 100%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.sidebar-header p {
    color: var(--accent-cyan);
    font-size: 0.75rem;
    font-family: var(--font-mono);
    text-transform: uppercase;
    letter-spacing: 4px;
    font-weight: 500;
}

#nav-menu {
    list-style: none;
    padding: 1.5rem 0;
    overflow-y: auto;
    flex: 1;
}

.nav-item {
    padding: 1rem 2rem;
    cursor: pointer;
    transition: var(--transition-fast);
    color: var(--text-secondary);
    font-size: 1rem;
    border-left: 3px solid transparent;
    display: flex;
    align-items: center;
    position: relative;
    font-weight: 500;
}

.nav-item:hover {
    color: var(--text-primary);
    padding-left: 2.5rem;
    background: rgba(255, 255, 255, 0.03);
}

.nav-item.active {
    color: var(--text-primary);
    border-left-color: var(--accent-cyan);
    font-weight: 600;
    background: linear-gradient(90deg, rgba(6, 182, 212, 0.1) 0%, transparent 100%);
}

.sidebar-info-section {
    padding: 1.5rem 2rem;
    border-top: 1px solid var(--glass-border);
    margin-top: auto;
    background: rgba(2, 6, 23, 0.5);
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

.sidebar-info-section p {
    margin-bottom: 0.5rem;
    font-size: 0.85rem;
}

.sidebar-info-section p:last-child {
    margin-bottom: 0;
}

.sidebar-info-section strong {
    color: var(--accent-cyan);
    font-weight: 600;
}

/* Main Content */
.main-content {
    flex: 1;
    margin-left: 350px;
    height: 100vh;
    display: flex;
    flex-direction: column;
    position: relative;
    overflow-y: auto;
    scroll-behavior: smooth;
    background: transparent;
    border: 1px solid transparent;
    box-shadow: inset 0 0 0 rgba(16, 185, 129, 0), 0 0 0 rgba(16, 185, 129, 0);
    transition: box-shadow 1.2s ease, border-color 1.2s ease, margin-right 0.3s ease;
    isolation: isolate;
}

.completed-overlay {
    position: fixed;
    top: 0;
    left: 350px;
    right: 0;
    bottom: 0;
    pointer-events: none;
    z-index: 1;
    opacity: 0;
    transition: opacity 1.2s ease;
    background: 
        linear-gradient(to bottom, rgba(16, 185, 129, 0.25) 0%, transparent 15%),
        linear-gradient(to top, rgba(16, 185, 129, 0.25) 0%, transparent 15%),
        linear-gradient(to right, rgba(16, 185, 129, 0.25) 0%, transparent 10%),
        linear-gradient(to left, rgba(16, 185, 129, 0.25) 0%, transparent 10%),
        radial-gradient(rgba(16, 185, 129, 0.35) 1.5px, transparent 1.5px);
    background-size: 100% 100%, 100% 100%, 100% 100%, 100% 100%, 12px 12px;
    -webkit-mask-image: linear-gradient(to right, transparent 0%, black 8%, black 92%, transparent 100%);
    mask-image: linear-gradient(to right, transparent 0%, black 8%, black 92%, transparent 100%);
}

.completed-overlay.active {
    opacity: 1;
}

.main-content.gemini-snapped {
    margin-right: 450px;
}

.top-bar {
    padding: 2rem 4rem;
    position: fixed;
    top: 0;
    left: 350px;
    right: 0;
    z-index: 50;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 2rem;
    border-bottom: none;
    background: transparent;
    backdrop-filter: none;
    pointer-events: none;
}

#mobile-menu-btn {
    display: none;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    border-radius: 8px;
    color: var(--text-primary);
    cursor: pointer;
    margin-right: 1.5rem;
    padding: 0.6rem;
    transition: var(--transition-fast);
}

#mobile-menu-btn:hover {
    background: rgba(255, 255, 255, 0.1);
}

#current-chapter-title {
    font-family: var(--font-heading);
    font-size: 2.2rem;
    font-weight: 700;
    color: var(--text-primary);
    pointer-events: auto;
    background: rgba(2, 6, 23, 0.65);
    backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    padding: 0.6rem 2rem;
    border-radius: 20px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.3);
    margin: 0;
}

/* Top Bar Actions Overhaul */
.top-bar-actions {
    margin-left: 0;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background: rgba(2, 6, 23, 0.65);
    backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    padding: 0.5rem 0.8rem;
    border-radius: 50px;
    box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.05), 0 8px 32px rgba(0, 0, 0, 0.3);
    pointer-events: auto;
}

.top-action-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.2), rgba(6, 182, 212, 0.2));
    border: 1px solid rgba(6, 182, 212, 0.3);
    color: var(--text-primary);
    padding: 0.5rem 1.2rem;
    border-radius: 30px;
    font-family: var(--font-heading);
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    transition: var(--transition-bounce);
}

.top-action-btn:hover {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.4), rgba(6, 182, 212, 0.4));
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(6, 182, 212, 0.2);
}

.top-action-btn svg {
    color: var(--accent-cyan);
}

.icon-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid transparent;
    color: var(--text-secondary);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    transition: var(--transition-fast);
}

.icon-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
    border: 1px solid var(--glass-border);
    transform: rotate(15deg);
}

.content-wrapper {
    padding: 8rem 4rem 4rem 4rem;
    max-width: var(--content-max-width);
    margin: 0 auto;
    width: 100%;
    transition: max-width 0.3s ease;
    position: relative;
    z-index: 2;
}

.content-wrapper > p,
.content-wrapper > ul,
.content-wrapper > ol {
    background: radial-gradient(rgba(255, 255, 255, 0.04) 1px, transparent 1.5px), rgba(2, 6, 23, 0.65);
    background-size: 4px 4px, 100% 100%;
    backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    padding: 1.5rem;
    box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.1), 0 4px 20px rgba(0,0,0,0.2);
    margin-bottom: 2rem;
}

.content-wrapper > ul,
.content-wrapper > ol {
    padding-left: 3rem; /* extra space for bullets */
}

/* Animations */
.fade-in {
    animation: fadeIn 0.5s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Content Styles */
h2, h3, h4 {
    font-family: var(--font-heading);
    color: var(--text-primary);
    margin-bottom: 1.5rem;
    margin-top: 2.5rem;
    line-height: 1.2;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 1), 0 5px 25px rgba(0, 0, 0, 0.8), 0 0 40px rgba(0, 0, 0, 0.6);
}

h2 {
    font-size: 3rem;
    margin-bottom: 2rem;
    letter-spacing: -1px;
    padding-bottom: 0.5rem;
    position: relative;
    display: inline-block;
}

h2::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 60px;
    height: 4px;
    background: var(--accent-gradient);
    background-size: 6px 6px, 100% 100%;
    border-radius: 2px;
}

h3 {
    font-size: 1.8rem;
    font-weight: 600;
}

p {
    margin-bottom: 1.5rem;
    color: var(--text-secondary);
    font-size: 1.1rem;
    transition: var(--transition-fast);
}

p:hover {
    color: #f8fafc;
}

ul, ol {
    margin-bottom: 1.5rem;
    padding-left: 1.5rem;
    color: var(--text-secondary);
    font-size: 1.1rem;
}

li {
    margin-bottom: 0.75rem;
    position: relative;
    transition: var(--transition-fast);
}

li:hover {
    color: #f8fafc;
}

li::marker {
    color: var(--accent-cyan);
}

strong {
    color: var(--text-primary);
    font-weight: 700;
    letter-spacing: 0.2px;
}

/* Logic Cards (Glassmorphism Edition) */
.logic-card {
    background: radial-gradient(rgba(255, 255, 255, 0.04) 1px, transparent 1.5px), rgba(2, 6, 23, 0.75);
    background-size: 4px 4px, 100% 100%;
    backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    padding: 2rem;
    margin-bottom: 2rem;
    position: relative;
    transition: var(--transition-bounce);
    box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.1), 0 4px 20px rgba(0,0,0,0.2);
    overflow: hidden;
}

.logic-card:hover {
    transform: translateY(-5px);
    border-color: var(--glass-border-highlight);
    box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.2), 0 10px 30px rgba(0,0,0,0.4), 0 0 20px rgba(99, 102, 241, 0.15);
}

.logic-card::after {
    content: '';
    position: absolute;
    top: 0;
    left: -150%;
    width: 50%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.08), transparent);
    transform: skewX(-25deg);
    transition: 0s;
    pointer-events: none;
    z-index: 1;
}

.logic-card:hover::after {
    left: 200%;
    transition: left 0.8s ease-in-out;
}

.logic-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; width: 4px; height: 100%;
}

.logic-card.definition::before { background: var(--accent-cyan); }
.logic-card.example::before { background: var(--accent-purple); }
.logic-card.rule::before { background: var(--accent-pink); }

.logic-card.example p {
    font-style: italic;
    font-weight: 300;
    opacity: 0.9;
}

.card-title {
    font-family: var(--font-mono);
    font-weight: 600;
    font-size: 1.05rem;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    letter-spacing: 2px;
    color: var(--text-primary);
    text-transform: uppercase;
}

.definition .card-title { color: var(--accent-cyan); }
.example .card-title { color: var(--accent-purple); }
.rule .card-title { color: var(--accent-pink); }

.logic-card p:last-child,
.logic-card ul:last-child {
    margin-bottom: 0;
}

/* Highlight Box */
.highlight-box {
    background: radial-gradient(rgba(255, 255, 255, 0.04) 1px, transparent 1.5px), linear-gradient(90deg, rgba(236, 72, 153, 0.15) 0%, transparent 100%), rgba(2, 6, 23, 0.6);
    background-size: 4px 4px, 100% 100%, 100% 100%;
    backdrop-filter: blur(12px);
    border: 1px solid rgba(236, 72, 153, 0.3);
    border-left: 4px solid var(--accent-pink);
    border-radius: 0 16px 16px 0;
    padding: 2rem;
    margin: 2.5rem 0;
    box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.1), 0 4px 20px rgba(0,0,0,0.15);
    transition: var(--transition-bounce);
    position: relative;
    overflow: hidden;
}

.highlight-box p,
.highlight-box li,
.highlight-box strong {
    text-shadow: 0 2px 10px rgba(0, 0, 0, 1), 0 5px 20px rgba(0, 0, 0, 0.8);
}

.highlight-box:hover {
    transform: translateY(-3px);
    box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.2), 0 8px 25px rgba(236, 72, 153, 0.25);
}

/* Improved Graphics and Components */
.badge {
    display: inline-block;
    padding: 0.3rem 0.8rem;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 20px;
    font-family: var(--font-mono);
    font-size: 0.8rem;
    font-weight: 500;
    letter-spacing: 1px;
    border: 1px solid var(--glass-border);
    backdrop-filter: blur(4px);
}
.badge.plus { color: var(--accent-cyan); border-color: rgba(6, 182, 212, 0.3); background: rgba(6, 182, 212, 0.1); }
.badge.minus { color: var(--accent-pink); border-color: rgba(236, 72, 153, 0.3); background: rgba(236, 72, 153, 0.1); }

.styled-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    margin: 1.5rem 0;
    font-size: 1rem;
    background: rgba(2, 6, 23, 0.65);
    backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.1), 0 4px 15px rgba(0,0,0,0.2);
}
.styled-table th, .styled-table td {
    padding: 1.2rem;
    text-align: center;
    border-bottom: 1px solid var(--glass-border);
    text-shadow: 0 2px 10px rgba(0, 0, 0, 1), 0 5px 20px rgba(0, 0, 0, 0.8);
}
.styled-table th {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
    font-family: var(--font-mono);
    text-transform: uppercase;
    font-size: 0.85rem;
    font-weight: 500;
    letter-spacing: 2px;
}
.styled-table tr:last-child td {
    border-bottom: none;
}

.syllogism-figures {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1.5rem;
    margin: 2rem 0;
}
.figure-card {
    background: radial-gradient(rgba(255, 255, 255, 0.04) 1px, transparent 1.5px), rgba(2, 6, 23, 0.65);
    background-size: 4px 4px, 100% 100%;
    backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    padding: 1.5rem;
    text-align: center;
    transition: var(--transition-bounce);
    box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.1), 0 4px 15px rgba(0,0,0,0.15);
    position: relative;
    overflow: hidden;
}
.figure-card:hover {
    transform: translateY(-5px) scale(1.02);
    border-color: var(--glass-border-highlight);
    box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.2), 0 8px 25px rgba(6, 182, 212, 0.2);
}
.figure-title {
    color: var(--accent-cyan);
    margin-bottom: 1rem;
    font-weight: bold;
    font-family: var(--font-heading);
    border-bottom: 1px solid var(--glass-border);
    padding-bottom: 0.5rem;
}
.figure-body {
    font-family: var(--font-mono);
    font-size: 1.1rem;
    line-height: 1.6;
    color: var(--text-primary);
    font-weight: 400;
    letter-spacing: 1px;
}
.figure-line {
    border-top: 2px solid var(--text-secondary);
    margin: 8px auto;
    width: 60%;
}

.text-center {
    text-align: center;
}
.svg-illustration {
    display: block;
    max-width: 100%;
    filter: drop-shadow(0 0 10px rgba(255,255,255,0.1));
}

/* Gemini Feature */
.gemini-floating-btn {
    position: fixed;
    background: linear-gradient(135deg, #6366f1, #06b6d4);
    color: #ffffff;
    border: none;
    border-radius: 30px;
    padding: 10px 24px;
    font-family: var(--font-heading);
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.4);
    z-index: 1000;
    transition: var(--transition-bounce);
}

.gemini-floating-btn:hover {
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 8px 25px rgba(99, 102, 241, 0.6);
}

/* Gemini Chat Features */
.gemini-modal {
    position: fixed;
    top: 50%;
    left: 50%;
    z-index: 2000;
    width: 600px;
    max-height: 80vh;
    background: radial-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1.5px), rgba(15, 23, 42, 0.85);
    background-size: 4px 4px, 100% 100%;
    backdrop-filter: blur(24px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    display: none;
    flex-direction: column;
    overflow: hidden;
    transform: translate(-50%, -45%) scale(0.95);
    opacity: 0;
    transition: opacity 0.3s cubic-bezier(0.16, 1, 0.3, 1), transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5), inset 0 0 0 1px rgba(255, 255, 255, 0.1);
}

.gemini-modal.active {
    display: flex;
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
}

/* Snapped to right */
.gemini-modal.snapped-right {
    top: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    left: auto !important;
    height: 100vh;
    max-height: 100vh;
    width: 450px;
    border-radius: 0;
    transform: none !important;
    border-right: none;
    border-top: none;
    border-bottom: none;
}

.gemini-modal.snapped-right .gemini-modal-content {
    border-radius: 0;
    height: 100vh;
    display: flex;
    flex-direction: column;
}

.gemini-modal.snapped-right .gemini-modal-body {
    max-height: none;
    flex: 1;
}

/* Gradient border effect for modal */
.gemini-modal::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 3px;
    background: linear-gradient(135deg, #6366f1, #06b6d4);
    z-index: 10;
}

.gemini-modal-header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--glass-border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(2, 6, 23, 0.5);
    cursor: grab;
}

.gemini-modal-header:active {
    cursor: grabbing;
}

.gemini-modal-header h3 {
    margin: 0;
    font-size: 1.2rem;
    font-weight: 600;
    background: linear-gradient(135deg, #6366f1, #06b6d4);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.close-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    border-radius: 50%;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    font-size: 1.2rem;
    cursor: pointer;
    transition: var(--transition-fast);
}

.close-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
    transform: rotate(90deg);
}

.gemini-modal-body {
    display: flex;
    flex-direction: column;
    gap: 1.2rem;
    padding: 1.5rem;
    overflow-y: auto;
    flex: 1;
    min-height: 0;
    max-height: 400px;
}

.explanation-block {
    padding: 1rem 0;
    width: 100%;
    font-size: 1rem;
    line-height: 1.6;
    animation: fadeIn 0.4s ease-out forwards;
    opacity: 0;
    transform: translateY(10px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.explanation-block:last-child {
    border-bottom: none;
}

.explanation-block.user {
    color: var(--text-secondary);
    font-style: italic;
    border-left: 3px solid var(--accent-pink);
    padding-left: 1.5rem;
    margin: 1rem 0;
    background: linear-gradient(90deg, rgba(236, 72, 153, 0.05), transparent);
    border-radius: 0 8px 8px 0;
}

.explanation-block.assistant {
    color: var(--text-primary);
    padding-left: 0.5rem;
}

.explanation-block.assistant strong {
    color: var(--accent-cyan);
}

.explanation-block.context-intro {
    background: linear-gradient(90deg, rgba(6, 182, 212, 0.08), transparent);
    border-left: 3px solid var(--accent-cyan);
    padding: 1rem 1.5rem;
    border-radius: 0 12px 12px 0;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.explanation-block.context-intro em {
    display: block;
    margin-top: 0.5rem;
    color: var(--text-secondary);
    font-size: 0.95rem;
}

.gemini-modal-footer {
    display: flex;
    padding: 1.2rem 1.5rem;
    background: rgba(2, 6, 23, 0.6);
    border-top: 1px solid var(--glass-border);
    gap: 0.75rem;
}

#gemini-input {
    flex: 1;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    padding: 0.8rem 1.2rem;
    color: var(--text-primary);
    font-family: var(--font-body);
    font-size: 0.95rem;
    outline: none;
    transition: var(--transition-fast);
}

/* Settings Sliders */
.styled-slider {
    -webkit-appearance: none;
    width: 100%;
    height: 6px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 5px;
    outline: none;
}

.styled-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--accent-cyan);
    cursor: pointer;
    box-shadow: 0 0 10px rgba(6, 182, 212, 0.5);
    transition: transform 0.1s;
}

.styled-slider::-webkit-slider-thumb:hover {
    transform: scale(1.2);
}

.icon-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    border-radius: 8px;
    cursor: pointer;
    padding: 0.6rem;
    transition: var(--transition-fast);
    display: flex;
    align-items: center;
    justify-content: center;
}

.icon-btn:hover {
    background: rgba(255, 255, 255, 0.1);
}

#reset-settings-btn:hover {
    background: rgba(255, 255, 255, 0.2) !important;
}

/* Toggle Switch */
.toggle-switch {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(255, 255, 255, 0.1);
    transition: .4s;
    border-radius: 24px;
    border: 1px solid var(--glass-border);
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 16px;
    width: 16px;
    left: 3px;
    bottom: 3px;
    background-color: var(--text-primary);
    transition: .4s;
    border-radius: 50%;
}

input:checked + .toggle-slider {
    background-color: var(--accent-cyan);
    border-color: var(--accent-cyan);
}

input:checked + .toggle-slider:before {
    transform: translateX(20px);
    background-color: #fff;
}

#gemini-input:focus {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(99, 102, 241, 0.5);
    box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.2);
}

#gemini-submit-btn {
    background: linear-gradient(135deg, #6366f1, #06b6d4);
    color: #fff;
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    min-width: 40px;
    padding: 0;
    cursor: pointer;
    transition: var(--transition-bounce);
    display: flex;
    align-items: center;
    justify-content: center;
}

#gemini-submit-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.4);
}

/* Chat loading animation */
.chat-loading {
    align-self: center;
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    padding: 1.5rem;
    width: 100%;
}
.chat-loading span {
    width: 8px;
    height: 8px;
    background: var(--accent-cyan);
    border-radius: 50%;
    animation: bounce 1.4s infinite ease-in-out both;
}
.chat-loading span:nth-child(1) { animation-delay: -0.32s; }
.chat-loading span:nth-child(2) { animation-delay: -0.16s; }

@keyframes bounce {
    0%, 80%, 100% { transform: scale(0); opacity: 0.5; }
    40% { transform: scale(1); opacity: 1; }
}

/* Responsive */
@media (max-width: 900px) {
    .content-wrapper {
        padding: 3rem 2rem;
    }
}

@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
        background: rgba(2, 6, 23, 0.95);
        backdrop-filter: blur(20px);
        z-index: 100;
    }
    
    .sidebar.open {
        transform: translateX(0);
    }
    
    .main-content {
        margin-left: 0;
    }
    
    #mobile-menu-btn {
        display: block;
    }
    
    .top-bar {
        padding: 1.5rem 2rem;
        left: 0;
    }
    
    .content-wrapper {
        padding: 7rem 1.5rem 2rem 1.5rem;
    }

    h2 {
        font-size: 2.2rem;
    }
    
    #current-chapter-title {
        font-size: 1.5rem;
        padding: 0.4rem 1rem;
    }

    .top-bar-actions {
        padding: 0.3rem 0.5rem;
    }
    
    .gemini-modal {
        width: 90vw;
        right: 5vw;
        left: 5vw;
        bottom: 80px;
    }
}

/* Quiz Styles */
.quiz-section {
    margin-top: 4rem;
    padding-top: 2rem;
    border-top: 1px solid var(--glass-border);
}

.quiz-title {
    font-family: var(--font-heading);
    font-size: 1.8rem;
    color: var(--accent-cyan);
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.quiz-question-card {
    background: radial-gradient(rgba(255, 255, 255, 0.04) 1px, transparent 1.5px), rgba(2, 6, 23, 0.65);
    background-size: 4px 4px, 100% 100%;
    backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    transition: var(--transition-bounce);
}

.quiz-question-card h4 {
    margin-top: 0;
    margin-bottom: 1rem;
    color: var(--text-primary);
    font-size: 1.1rem;
}

.quiz-options {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
}

.quiz-option-label {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0.8rem 1rem;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--glass-border);
    border-radius: 8px;
    cursor: pointer;
    transition: var(--transition-fast);
}

.quiz-option-label:hover {
    background: rgba(255, 255, 255, 0.08);
}

.quiz-option-label input[type="radio"] {
    accent-color: var(--accent-cyan);
}

.quiz-submit-btn {
    background: linear-gradient(135deg, #6366f1, #06b6d4);
    color: white;
    border: none;
    padding: 10px 24px;
    font-family: var(--font-heading);
    font-size: 1.1rem;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    transition: var(--transition-bounce);
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-top: 1rem;
}

.quiz-submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(6, 182, 212, 0.4);
}

.quiz-result {
    margin-top: 1.5rem;
    padding: 1rem;
    border-radius: 8px;
    font-weight: 600;
    display: none;
}

.quiz-result.success {
    background: rgba(16, 185, 129, 0.1);
    color: #10b981;
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.quiz-result.error {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
    border: 1px solid rgba(239, 68, 68, 0.3);
}

/* Sidebar Completed Checkmark */
.nav-item {
    position: relative;
}

.nav-item.completed {
    border-left-color: rgba(16, 185, 129, 0.5);
    background: linear-gradient(90deg, rgba(16, 185, 129, 0.08) 0%, transparent 80%);
}

.nav-item.completed.active {
    background: linear-gradient(90deg, rgba(16, 185, 129, 0.25) 0%, transparent 100%);
    border-left-color: #10b981;
}

.nav-item.completed::after {
    content: '✓';
    position: absolute;
    right: 1.5rem;
    color: #10b981;
    font-weight: bold;
    font-size: 1.2rem;
    text-shadow: 0 0 10px rgba(16, 185, 129, 0.5);
}

/* Completed Chapter Background */
.main-content.chapter-completed-bg {
    border: 1px solid rgba(16, 185, 129, 0.6);
    box-shadow: inset 0 0 80px rgba(16, 185, 129, 0.15), 0 0 20px rgba(16, 185, 129, 0.2);
}

.quiz-buttons {
    display: flex;
    gap: 1rem;
    margin-top: 1.5rem;
    flex-wrap: wrap;
}

.quiz-reset-btn, .quiz-show-answers-btn {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
    border: 1px solid var(--glass-border);
    padding: 10px 24px;
    font-family: var(--font-heading);
    font-size: 1.1rem;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    transition: var(--transition-bounce);
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.quiz-reset-btn:hover, .quiz-show-answers-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--text-secondary);
}

.quiz-option-label.correct-answer {
    background: rgba(16, 185, 129, 0.2);
    border-color: #10b981;
}

.quiz-option-label.wrong-answer {
    background: rgba(239, 68, 68, 0.2);
    border-color: #ef4444;
}

.quiz-submit-btn {
    margin-top: 0;
}

/* Testare & Analitici Styles */
.test-settings-container, .analytics-container {
    background: radial-gradient(rgba(255, 255, 255, 0.04) 1px, transparent 1.5px), rgba(2, 6, 23, 0.65);
    background-size: 4px 4px, 100% 100%;
    backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    padding: 2rem;
    margin-bottom: 2.5rem;
    box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.1), 0 4px 15px rgba(0,0,0,0.15);
}

.test-settings-container h3, .analytics-container h3 {
    margin-top: 0;
    color: var(--accent-cyan);
    font-family: var(--font-heading);
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
    border-bottom: 1px solid var(--glass-border);
    padding-bottom: 0.5rem;
}

.chapter-checkbox-list {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
    margin-bottom: 1.5rem;
}

.chapter-checkbox-label {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0.8rem 1.2rem;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--glass-border);
    border-radius: 8px;
    cursor: pointer;
    transition: var(--transition-fast);
    color: var(--text-primary);
}

.chapter-checkbox-label:hover {
    background: rgba(255, 255, 255, 0.08);
}

.chapter-checkbox-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--accent-cyan);
    cursor: pointer;
}

.start-test-btn {
    background: linear-gradient(135deg, #10b981, #059669);
    color: white;
    border: none;
    padding: 12px 28px;
    font-family: var(--font-heading);
    font-size: 1.1rem;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    transition: var(--transition-bounce);
    display: inline-flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    justify-content: center;
}

.start-test-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(16, 185, 129, 0.4);
}

.analytics-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
}

.analytics-card {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    padding: 1.5rem;
    text-align: center;
    transition: var(--transition-bounce);
    position: relative;
    overflow: hidden;
}

.analytics-card:hover {
    border-color: var(--accent-cyan);
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(6, 182, 212, 0.15);
}

.analytics-card h4 {
    margin-top: 0;
    margin-bottom: 1rem;
    color: var(--text-primary);
    font-size: 1.1rem;
}

.analytics-percentage {
    font-family: var(--font-heading);
    font-size: 2.5rem;
    font-weight: 800;
    background: linear-gradient(135deg, #6366f1, #06b6d4);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    cursor: pointer;
    display: inline-block;
    transition: transform 0.2s;
}

.analytics-percentage:hover {
    transform: scale(1.1);
}

.analytics-percentage::after {
    content: '📈';
    font-size: 1rem;
    vertical-align: super;
    margin-left: 5px;
    opacity: 0.7;
}

.test-progress-bar-bg {
    width: 100%;
    height: 8px;
    background: rgba(255,255,255,0.1);
    border-radius: 4px;
    margin-top: 1rem;
    overflow: hidden;
}

.test-progress-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #6366f1, #06b6d4);
    border-radius: 4px;
    transition: width 1s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Info Chapter Styling */
body.info-mode-bg {
    background: var(--bg-dark);
}

body.info-mode-bg .aurora-bg {
    opacity: 0.5; /* Dim the aurora slightly so halftone pops more */
}

.info-page-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 60vh;
    position: relative;
    z-index: 2;
}

.info-page-content {
    background: rgba(2, 6, 23, 0.7);
    border: 1px solid var(--glass-border-highlight);
    box-shadow: 0 20px 50px rgba(0,0,0,0.5), inset 0 0 0 1px rgba(255,255,255,0.1);
    position: relative;
    overflow: hidden;
    padding: 3rem;
    border-radius: 24px;
    width: 100%;
    max-width: var(--content-max-width);
}

.info-bg-glow {
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(99, 102, 241, 0.15) 0%, transparent 60%);
    animation: rotateGlow 15s linear infinite;
    pointer-events: none;
    z-index: 0;
}

@keyframes rotateGlow {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.info-title {
    font-size: 2.5rem;
    font-family: var(--font-heading);
    background: linear-gradient(135deg, #a855f7, #06b6d4);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: 0 0 20px rgba(6, 182, 212, 0.3);
    position: relative;
    z-index: 1;
}

.info-card {
    background: rgba(255, 255, 255, 0.03);
    border-radius: 16px;
    padding: 2rem;
    border: 1px solid rgba(255,255,255,0.05);
    backdrop-filter: blur(10px);
    position: relative;
    z-index: 1;
}

.info-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 0;
}

.info-label {
    color: var(--text-secondary);
    font-size: 1rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 1.5px;
}

.info-value {
    color: var(--text-primary);
    font-size: 1.25rem;
    font-weight: 600;
    font-family: var(--font-mono);
    text-align: right;
}

.info-divider {
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.1), transparent);
    margin: 1.5rem 0;
}

.glow-text {
    color: #fff;
    text-shadow: 0 0 10px rgba(255,255,255,0.5), 0 0 20px rgba(6, 182, 212, 0.5);
}

.accent-text {
    color: var(--accent-cyan);
    text-shadow: 0 0 10px rgba(6, 182, 212, 0.4);
}

.sidebar-toggle {
    position: absolute;
    right: 15px;
    top: 35px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    border-radius: 50%;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    cursor: pointer;
    z-index: 20;
    transition: var(--transition-fast);
}

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

/* Sidebar Collapsed Mode */
body.sidebar-collapsed .sidebar {
    width: 8px;
    background: rgba(6, 182, 212, 0.4);
    box-shadow: 0 0 15px rgba(6, 182, 212, 0.2);
    cursor: pointer;
    transition: width 0.4s cubic-bezier(0.16, 1, 0.3, 1), background 0.4s;
}

body.sidebar-collapsed .sidebar:hover {
    background: rgba(6, 182, 212, 0.8);
    width: 12px;
}

body.sidebar-collapsed .sidebar > *:not(#sidebar-header-logo) {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.2s, visibility 0.2s;
}

/* Floating Logo */
body.sidebar-collapsed .sidebar-header {
    position: fixed;
    top: 2rem;
    left: 2rem;
    width: auto;
    padding: 0.6rem 2rem;
    background: rgba(2, 6, 23, 0.65);
    backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.3);
    z-index: 100;
    cursor: pointer;
    display: flex;
    align-items: baseline;
    gap: 10px;
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

body.sidebar-collapsed .sidebar-header:hover {
    background: rgba(2, 6, 23, 0.8);
    border-color: var(--accent-cyan);
}

body.sidebar-collapsed .sidebar-header h1 {
    font-size: 2.2rem;
    margin: 0;
}

body.sidebar-collapsed .sidebar-header p {
    font-size: 0.9rem;
    margin: 0;
    letter-spacing: 3px;
}

body.sidebar-collapsed .sidebar-toggle {
    display: none;
}

body.sidebar-collapsed .main-content {
    margin-left: 8px;
    transition: margin-left 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

body.sidebar-collapsed .completed-overlay {
    left: 8px;
    transition: left 0.4s cubic-bezier(0.16, 1, 0.3, 1), opacity 1.2s ease;
}

body.sidebar-collapsed .top-bar {
    left: 8px;
    padding-left: 18rem; /* Make room for floating logo */
    transition: left 0.4s cubic-bezier(0.16, 1, 0.3, 1), padding-left 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

@media (max-width: 768px) {
    .sidebar-toggle {
        display: none;
    }
    body.sidebar-collapsed .sidebar {
        transform: translateX(-100%);
        width: 350px;
        opacity: 1;
        background: rgba(2, 6, 23, 0.7);
    }
    body.sidebar-collapsed .sidebar.open {
        transform: translateX(0);
    }
    body.sidebar-collapsed .main-content {
        margin-left: 0;
    }
    body.sidebar-collapsed .completed-overlay {
        left: 0;
    }
    body.sidebar-collapsed .top-bar {
        left: 0;
        padding-left: 2rem;
    }
}
