:root {
    --primary: #6c5ce7;
    --primary-light: #a29bfe;
    --secondary: #00b894;
    --accent-primary: #6c5ce7;
    --accent-secondary: #a29bfe;
    --accent-glow: rgba(108, 92, 231, 0.4);
    
    --bg-primary: #0a0a0f;
    --bg-secondary: #0f0f16;
    --bg-tertiary: #16161e;
    --bg-card: #14141d;
    --bg-hover: rgba(255, 255, 255, 0.05);
    --bg-active: rgba(108, 92, 231, 0.1);
    
    --text-primary: #ffffff;
    --text-secondary: #b2bec3;
    --text-muted: #636e72;
    --white: #ffffff;
    
    --border-color: rgba(255, 255, 255, 0.08);
    --border-hover: rgba(255, 255, 255, 0.15);
    
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.2);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.4);
    --shadow-glow: 0 0 20px rgba(108, 92, 231, 0.2);
    
    --transition-fast: 0.2s ease;
    --transition-normal: 0.3s ease;
    
    --sidebar-width: 280px;
    --topnav-height: 64px;
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    
    --gradient-1: linear-gradient(135deg, #6c5ce7, #a29bfe);
    --gradient-hero: linear-gradient(135deg, #ffffff 0%, #a29bfe 100%);
}

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

body {
    background-color: var(--bg-primary);
    color: var(--text-primary);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    line-height: 1.5;
    overflow-x: hidden;
}

/* ============================================
   Typography & Layout
   ============================================ */
h1, h2, h3, h4 {
    font-weight: 700;
    letter-spacing: -0.02em;
}

a {
    transition: all var(--transition-fast);
}

.hidden {
    display: none !important;
}

/* ============================================
   Top Navigation
   ============================================ */
.top-nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--topnav-height);
    background: rgba(10, 10, 15, 0.8);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    z-index: 1000;
}

.logo-container {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
}

.logo-icon {
    width: 32px;
    height: 32px;
    background: var(--gradient-1);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
}

.logo-text {
    font-size: 18px;
    font-weight: 800;
    letter-spacing: -0.5px;
    background: var(--gradient-hero);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.search-container {
    flex: 0 1 400px;
    position: relative;
    margin: 0 24px;
}

.search-input {
    width: 100%;
    height: 38px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 0 16px 0 40px;
    color: white;
    font-size: 14px;
    transition: all 0.3s ease;
}

.search-input:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(108, 92, 231, 0.15);
}

.search-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    pointer-events: none;
}

.top-actions {
    display: flex;
    align-items: center;
    gap: 16px;
}

.btn-icon {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-icon:hover {
    color: white;
    border-color: var(--border-hover);
    background: var(--bg-hover);
}

.user-menu { position: relative; }
.user-avatar {
    width: 34px; height: 34px; border-radius: 50%;
    background: var(--primary); color: #fff;
    border: none; cursor: pointer;
    font-size: 14px; font-weight: 700;
    display: flex; align-items: center; justify-content: center;
    transition: opacity 0.15s;
}
.user-avatar:hover { opacity: 0.85; }
.user-dropdown {
    display: none; position: absolute; right: 0; top: calc(100% + 8px);
    background: var(--bg-card); border: 1px solid var(--border-color);
    border-radius: 10px; padding: 8px; min-width: 200px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.4); z-index: 200;
}
.user-dropdown.open { display: block; }
.user-dropdown-email {
    padding: 6px 10px 10px; font-size: 12px;
    color: var(--text-secondary); border-bottom: 1px solid var(--border-color);
    word-break: break-all;
}
.user-dropdown-logout {
    display: flex; align-items: center; gap: 8px; width: 100%;
    margin-top: 6px; padding: 7px 10px; border-radius: 7px;
    background: none; border: none; cursor: pointer;
    color: #fca5a5; font-size: 13px; text-align: left;
    transition: background 0.15s;
}
.user-dropdown-logout:hover { background: rgba(220,38,38,0.15); }

.menu-toggle {
    display: none;
}

/* ============================================
   App Container
   ============================================ */
.app-container {
    display: flex;
    margin-top: var(--topnav-height);
    min-height: calc(100vh - var(--topnav-height));
}

/* ============================================
   Sidebar
   ============================================ */
.sidebar {
    position: fixed;
    top: var(--topnav-height);
    left: 0;
    bottom: 0;
    width: var(--sidebar-width);
    background: var(--bg-secondary);
    border-right: 1px solid var(--border-color);
    overflow-y: auto;
    z-index: 900;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.sidebar-header {
    padding: 24px 20px 12px;
}

.sidebar-header h3 {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: var(--text-muted);
    font-weight: 700;
}

.sidebar-nav {
    padding: 12px 12px 40px;
}

.sidebar-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    margin-bottom: 4px;
    border-radius: 10px;
    color: var(--text-secondary);
    font-size: 13.5px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.sidebar-item:hover {
    background: var(--bg-hover);
    color: white;
}

.sidebar-item.active {
    background: var(--bg-active);
    color: var(--accent-secondary);
}

.sidebar-item-number {
    width: 24px;
    height: 24px;
    border-radius: 6px;
    background: var(--bg-tertiary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 700;
    color: var(--text-muted);
}

.sidebar-item.active .sidebar-item-number {
    background: var(--accent-primary);
    color: white;
}

.sidebar-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.7);
    z-index: 850;
    display: none;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.sidebar-overlay.active {
    display: block;
    opacity: 1;
}

/* ============================================
   Main Content
   ============================================ */
.main-content {
    margin-left: var(--sidebar-width);
    flex: 1;
    padding: 40px;
    max-width: 1400px;
    width: 100%;
}

.content-view {
    animation: slideUp 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

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

/* ============================================
   Home View
   ============================================ */
.hero-section {
    margin-bottom: 48px;
    max-width: 800px;
}

.welcome-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 14px;
    background: rgba(108, 92, 231, 0.1);
    border: 1px solid rgba(108, 92, 231, 0.2);
    border-radius: 50px;
    color: var(--accent-secondary);
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 20px;
}

.hero-section h2 {
    font-size: 48px;
    margin-bottom: 16px;
    line-height: 1.1;
}

.hero-section p {
    font-size: 18px;
    color: var(--text-secondary);
    line-height: 1.6;
}

.classroom-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 24px;
}

.classroom-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 24px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    display: flex;
    flex-direction: column;
}

.classroom-card:hover {
    transform: translateY(-5px);
    border-color: var(--accent-primary);
    box-shadow: 0 10px 30px rgba(0,0,0,0.3), var(--shadow-glow);
}

.card-header {
    display: flex;
    gap: 16px;
    margin-bottom: 20px;
}

.card-number {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 18px;
    color: white;
}

.card-title {
    font-size: 18px;
    font-weight: 700;
    line-height: 1.3;
}

.card-meta {
    margin-top: auto;
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 13px;
    color: var(--text-muted);
}

.card-meta-item {
    display: flex;
    align-items: center;
    gap: 6px;
}

/* ============================================
   Classroom/Module View
   ============================================ */
.view-header {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-bottom: 40px;
}

.back-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--text-muted);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
}

.back-link:hover {
    color: white;
}

.view-title {
    font-size: 32px;
    font-weight: 800;
}

.view-subtitle {
    font-size: 14px;
    color: var(--text-muted);
    font-weight: 500;
}

/* Module Items */
.modules-list {
    display: grid;
    gap: 10px;
}

.module-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px 24px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.2s ease;
}

.module-item:hover {
    background: var(--bg-hover);
    border-color: var(--border-hover);
    transform: translateX(5px);
}

.module-item-number {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.05);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 700;
    color: var(--text-muted);
}

.module-item-title {
    font-size: 15px;
    font-weight: 600;
    color: white;
}

.module-item-arrow {
    margin-left: auto;
    color: var(--text-muted);
    opacity: 0;
    transition: all 0.2s ease;
}

.module-item:hover .module-item-arrow {
    opacity: 1;
    transform: translateX(5px);
}

.section-header {
    margin-top: 32px;
    margin-bottom: 12px;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: var(--accent-secondary);
    font-weight: 700;
}

.section-header:first-child {
    margin-top: 0;
}

/* ============================================
   Video Players
   ============================================ */
.video-container {
    width: 100%;
    aspect-ratio: 16/9;
    background: black;
    border-radius: var(--radius-lg);
    overflow: hidden;
    margin-bottom: 32px;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-lg);
}

.video-container iframe {
    width: 100%;
    height: 100%;
    border: none;
}

.video-placeholder {
    width: 100%;
    aspect-ratio: 16/9;
    background: var(--bg-tertiary);
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 32px;
    border: 1px dashed var(--border-color);
    color: var(--text-muted);
    position: relative;
    overflow: hidden;
}

.video-placeholder.protected-video {
    background: linear-gradient(135deg, #0f0f16 0%, #1a1a2e 100%);
    border: 1px solid rgba(108, 92, 231, 0.2);
    flex-direction: column;
    text-align: center;
    padding: 40px;
}

.video-placeholder.protected-video h3 {
    font-size: 24px;
    color: white;
    margin: 16px 0 8px;
}

.video-placeholder.protected-video p {
    color: var(--text-secondary);
    max-width: 440px;
    margin-bottom: 24px;
    line-height: 1.6;
}

.skool-btn-large {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    background: var(--primary);
    color: white;
    padding: 14px 28px;
    border-radius: 12px;
    text-decoration: none;
    font-weight: 700;
    box-shadow: 0 4px 15px rgba(108, 92, 231, 0.4);
}

.skool-btn-large:hover {
    transform: translateY(-2px);
    background: #7d6df3;
    box-shadow: 0 8px 25px rgba(108, 92, 231, 0.5);
}

/* ============================================
   Content & Text
   ============================================ */
.module-content-inner {
    max-width: 900px;
}


.skool-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--accent-secondary);
    font-weight: 600;
    margin-bottom: 32px;
    text-decoration: none;
    font-size: 14px;
    padding: 8px 16px;
    background: var(--bg-active);
    border-radius: 8px;
}

.skool-link:hover {
    background: var(--primary);
    color: white;
}

.external-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    color: var(--text-primary);
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
    margin-right: 12px;
    margin-top: 12px;
}

.external-link:hover {
    border-color: var(--accent-primary);
    background: var(--bg-hover);
}
html.light .external-link:hover {
    background: rgba(0,0,0,0.08);
    border-color: var(--accent-primary);
    color: var(--text-primary);
}

/* ============================================
   Resources Section
   ============================================ */
.resources-section {
    margin-top: 40px;
    padding: 24px;
    background: var(--bg-secondary);
    border-radius: 12px;
    border: 1px solid var(--border);
}

.resources-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin: 0 0 16px 0;
}

.resources-list {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.resource-download-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    background: var(--bg-primary);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 14px;
    text-decoration: none;
    transition: all 0.2s ease;
    cursor: pointer;
}

.resource-download-btn:hover {
    border-color: var(--accent-primary);
    background: var(--bg-hover);
    color: var(--accent-primary);
}

/* ============================================
   Module Navigation Top + Footer
   ============================================ */
.module-nav-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.module-nav-footer {
    margin-top: 64px;
    padding-top: 32px;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
}

.nav-button {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 12px 24px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    color: white;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.nav-button:hover:not(:disabled) {
    background: var(--bg-hover);
    border-color: var(--accent-primary);
}

.nav-button:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

/* ============================================
   Responsive Setup
   ============================================ */
@media (max-width: 1024px) {
    .sidebar {
        transform: translateX(-100%);
    }
    
    .sidebar.open {
        transform: translateX(0);
    }
    
    .main-content {
        margin-left: 0;
        padding: 24px;
    }
    
    .menu-toggle {
        display: flex;
    }
    
    .search-container {
        display: none;
    }
}

@media (max-width: 768px) {
    .hero-section h2 {
        font-size: 32px;
    }
    
    .classroom-grid {
        grid-template-columns: 1fr;
    }
    
    .view-title {
        font-size: 26px;
    }
}

/* Scrollbar Customization */
::-webkit-scrollbar {
    width: 6px;
}
::-webkit-scrollbar-track {
    background: var(--bg-primary);
}
::-webkit-scrollbar-thumb {
    background: var(--bg-tertiary);
    border-radius: 10px;
}
::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* Rich Text Content */
.text-content {
    line-height: 1.8;
    font-size: 16px;
    color: var(--text-secondary);
}

.text-content p {
    margin-bottom: 16px;
}

/* Headings */
.text-content h1 { font-size: 26px; margin: 40px 0 16px; color: white; border-bottom: 1px solid var(--border-color); padding-bottom: 10px; }
.text-content h2 { font-size: 21px; margin: 36px 0 14px; color: white; }
.text-content h3 { font-size: 17px; margin: 28px 0 10px; color: white; }
.text-content h4 { font-size: 15px; margin: 20px 0 8px; color: var(--text-primary); font-weight: 700; }

/* Lists — nested hierarchy with different markers per level */
.text-content ul,
.text-content ol {
    margin: 0 0 16px 0;
    padding-left: 28px;
}

/* Level 1 */
.text-content ul                    { list-style-type: disc; }
.text-content ol                    { list-style-type: decimal; }

/* Level 2 */
.text-content ul ul,
.text-content ol ul                 { list-style-type: circle; margin-bottom: 0; }
.text-content ul ol,
.text-content ol ol                 { list-style-type: lower-alpha; margin-bottom: 0; }

/* Level 3 */
.text-content ul ul ul,
.text-content ol ul ul              { list-style-type: square; }

.text-content li {
    margin-bottom: 6px;
    line-height: 1.7;
    color: var(--text-secondary);
}

.text-content li > p {
    margin-bottom: 4px;
}

/* Nested lists get smaller top/bottom breathing room */
.text-content li > ul,
.text-content li > ol {
    margin-top: 6px;
    padding-left: 24px;
}

/* Blockquote */
.text-content blockquote {
    border-left: 4px solid var(--accent-primary);
    margin: 24px 0;
    padding: 14px 20px;
    background: rgba(108, 92, 231, 0.07);
    border-radius: 0 8px 8px 0;
    color: var(--text-secondary);
    font-style: italic;
}

.text-content blockquote p { margin-bottom: 0; }

/* Inline */
.text-content strong { color: white; font-weight: 700; }
.text-content em { color: var(--text-primary); }
.text-content a { color: var(--accent-secondary); text-decoration: underline; text-underline-offset: 3px; }
.text-content a:hover { color: white; }
.text-content code { background: #1a2820; border: 1px solid #2d5a3d; padding: 2px 7px; border-radius: 5px; font-family: 'Cascadia Code', 'Fira Code', 'Consolas', monospace; font-size: 13px; color: #6dcc8a; letter-spacing: 0.02em; white-space: nowrap; }
.text-content pre { background: #111a15; padding: 16px 20px; border-radius: 10px; overflow-x: auto; margin-bottom: 20px; border: 1px solid #2d5a3d; }
.text-content pre code { background: none; border: none; padding: 0; color: #a8d8b8; font-size: 14px; white-space: pre; }

/* Horizontal rule */
.text-content hr { border: none; border-top: 1px solid var(--border-color); margin: 32px 0; }

/* ============================================
   Light Mode
   ============================================ */
html.light {
    --bg-primary: #ffffff;
    --bg-secondary: #ffffff;
    --bg-tertiary: #ebebeb;
    --bg-card: #ffffff;
    --bg-hover: rgba(0, 0, 0, 0.05);
    --bg-active: rgba(108, 92, 231, 0.08);

    --text-primary: #1a1a2e;
    --text-secondary: #4a4a6a;
    --text-muted: #888;
    --white: #1a1a2e;

    --border-color: rgba(0, 0, 0, 0.1);
    --border-hover: rgba(0, 0, 0, 0.2);

    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.08);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.12);
    --shadow-glow: 0 0 20px rgba(108, 92, 231, 0.12);

    --gradient-hero: linear-gradient(135deg, #1a1a2e 0%, #6c5ce7 100%);
}

html.light body {
    background-color: #ffffff;
}

html.light .top-nav {
    background: rgba(255, 255, 255, 0.9);
}

html.light .search-input {
    color: var(--text-primary);
}

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

html.light .module-item-title {
    color: var(--text-primary);
}

html.light .nav-button {
    color: var(--text-primary);
}

html.light .text-content h1,
html.light .text-content h2,
html.light .text-content h3,
html.light .text-content h4 {
    color: var(--text-primary);
}

html.light .text-content strong { color: var(--text-primary); }
html.light .text-content em { color: var(--text-secondary); }

html.light .text-content code {
    background: #e8f4f0;
    border-color: #b2d8cc;
    color: #1a6647;
}

html.light .text-content pre {
    background: #f0f7f4;
    border-color: #b2d8cc;
}

html.light .text-content pre code {
    color: #1a6647;
}

html.light .video-placeholder.protected-video {
    background: linear-gradient(135deg, #ebebeb 0%, #ddd8ff 100%);
}

html.light .video-placeholder.protected-video h3 {
    color: var(--text-primary);
}

html.light ::-webkit-scrollbar-track {
    background: var(--bg-secondary);
}

html.light ::-webkit-scrollbar-thumb {
    background: #ccc;
}

/* ============================================
   Theme Buttons
   ============================================ */
.theme-btn {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    color: var(--text-muted);
}

.theme-btn.active {
    color: var(--accent-secondary);
    background: var(--bg-active);
    border-color: var(--accent-primary);
}

/* ============================================
   Bookmark Button & Module Title Row
   ============================================ */
.module-title-row {
    display: flex;
    align-items: flex-start;
    gap: 16px;
}

.bookmark-btn {
    flex-shrink: 0;
}

.bookmark-btn.active {
    color: var(--accent-secondary);
    background: var(--bg-active);
    border-color: var(--accent-primary);
}

/* Complete button */
.complete-btn { color: var(--text-muted); }
.complete-btn.active { color: #22c55e; background: rgba(34,197,94,0.12); border-color: #22c55e; }

/* Sidebar tree */
.sidebar-modules { display: none; padding: 2px 0 6px 0; }
.sidebar-modules.open { display: block; }
.sidebar-module {
    display: flex; align-items: center; gap: 8px;
    padding: 5px 16px 5px 36px; cursor: pointer;
    border-radius: 6px; margin: 1px 8px;
    font-size: 12px; color: var(--text-secondary);
    line-height: 1.4; transition: background 0.15s;
}
.sidebar-module:hover { background: var(--bg-hover); color: var(--text-primary); }
.sidebar-module.active { background: var(--bg-active); color: var(--accent-secondary); }
.sidebar-check { flex-shrink: 0; width: 16px; height: 16px; display: flex; align-items: center; justify-content: center; }
.sidebar-check svg { width: 14px; height: 14px; }
.sidebar-check.done svg { color: #22c55e; }
.sidebar-check.pending svg { color: var(--text-muted); opacity: 0.35; }
.sidebar-module-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; }
.sidebar-bm { flex-shrink: 0; display: flex; align-items: center; color: var(--text-muted); opacity: 0.25; }
.sidebar-bm.active { color: #3b82f6; opacity: 1; }
.sidebar-chevron { margin-left: auto; flex-shrink: 0; transition: transform 0.2s; color: var(--text-muted); }
.sidebar-item.expanded .sidebar-chevron { transform: rotate(90deg); }

/* Video loading overlay */
@keyframes robotFloat {
  0%, 100% { transform: translateY(0) scale(1); }
  50% { transform: translateY(-12px) scale(1.08); }
}
@keyframes robotGlow {
  0%, 100% { filter: drop-shadow(0 0 8px rgba(108,92,231,0.4)); }
  50% { filter: drop-shadow(0 0 24px rgba(108,92,231,0.9)); }
}
.video-loading-overlay {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  background: #000; border-radius: 8px; z-index: 2;
  pointer-events: none;
  transition: background 0.2s;
}
.video-loading-overlay.buffering {
  background: rgba(0,0,0,0.55);
  backdrop-filter: blur(2px);
}
.video-loading-overlay.paused {
  background: transparent;
}
.video-loading-robot {
  font-size: 120px; line-height: 1;
  animation: robotFloat 1.8s ease-in-out infinite, robotGlow 1.8s ease-in-out infinite;
  user-select: none;
}
.video-loading-overlay.buffering .video-loading-robot,
.video-loading-overlay.paused .video-loading-robot {
  font-size: 80px;
}
.local-video-container:fullscreen,
.local-video-container:-webkit-full-screen {
  background: #000;
  display: flex;
  align-items: center;
  justify-content: center;
}
.local-video-container:fullscreen video,
.local-video-container:-webkit-full-screen video {
  width: 100% !important;
  height: 100% !important;
  border-radius: 0 !important;
  object-fit: contain;
}
.local-video-container:fullscreen .video-loading-overlay,
.local-video-container:-webkit-full-screen .video-loading-overlay {
  border-radius: 0;
}
