/* =============================================
   LLTV - Learn Languages Through Video
   Light/Dark theme - tokens from design-tokens.css
   ============================================= */

/* General - YouTube-style */
body {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    background: var(--bg-primary);
    color: var(--text-primary);
    font-family: var(--lltv-font-body);
}
main { flex: 1; }

/* YouTube-style layout: sidebar + main content */
body.youtube-layout {
    flex-direction: row;
    flex-wrap: wrap;
}
body.youtube-layout .navbar,
body.youtube-layout .youtube-top-nav {
    width: 100%;
    flex-basis: 100%;
}
/* Wrapper for main + footer so both resize with sidebar */
body.youtube-layout .youtube-content-wrapper {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
    margin-left: 240px;
    transition: margin-left 0.2s ease;
}
body.youtube-layout.sidebar-collapsed .youtube-content-wrapper {
    margin-left: 72px;
}

/* Collapsible sidebar - expanded (240px) */
body.youtube-layout .youtube-sidebar {
    position: fixed;
    left: 0;
    top: 56px;
    bottom: 0;
    width: 240px;
    background: var(--bg-primary);
    border-right: none;
    z-index: 90;
    padding-top: 12px;
    overflow-y: auto;
    overflow-x: hidden;
    transition: width 0.2s ease;
}
body.youtube-layout .youtube-sidebar-nav {
    display: flex;
    flex-direction: column;
    padding: 0 12px;
    align-items: flex-start;
}
body.youtube-layout .youtube-sidebar-link {
    display: inline-flex;
    flex-direction: row;
    align-items: center;
    justify-content: flex-start;
    gap: 24px;
    height: 40px;
    padding: 0 12px;
    color: var(--text-primary);
    text-decoration: none;
    border-radius: 10px;
    margin-bottom: 2px;
    transition: background 0.15s;
    width: fit-content;
    min-width: 0;
    box-sizing: border-box;
}
body.youtube-layout .youtube-sidebar-link:hover {
    background: var(--bg-hover);
}
body.youtube-layout .youtube-sidebar-link i {
    font-size: 24px;
    flex-shrink: 0;
    width: 24px;
    text-align: center;
}
body.youtube-layout .youtube-sidebar-link .sidebar-label {
    font-size: 14px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
body.youtube-layout .youtube-sidebar-divider {
    height: 1px;
    background: var(--border-color);
    margin: 12px 0;
    align-self: stretch;
}
body.youtube-layout .youtube-sidebar-section .sidebar-section-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    padding: 0 12px;
    margin-bottom: 4px;
    display: block;
}
body.youtube-layout .youtube-sidebar-section {
    align-self: stretch;
}
body.youtube-layout .youtube-main {
    flex: 1;
    padding: 24px 0;
}
body.youtube-layout .youtube-sidebar-link.active {
    background: var(--bg-hover);
    font-weight: 500;
}
/* Collapsed: pill-shaped active state like YouTube */
body.youtube-layout.sidebar-collapsed .youtube-sidebar-link {
    margin-bottom: 2px;
    border-radius: 10px;
}

/* Collapsed state (72px) - icons with labels below, YouTube-style */
body.youtube-layout.sidebar-collapsed .youtube-sidebar {
    width: 72px;
    padding-top: 12px;
}
body.youtube-layout.sidebar-collapsed .youtube-sidebar-nav {
    padding: 0 8px;
    align-items: stretch;
}
body.youtube-layout.sidebar-collapsed .youtube-sidebar-link {
    flex-direction: column;
    justify-content: center;
    align-items: center;
    height: 74px;
    gap: 6px;
    padding: 0;
    border-radius: 10px;
    width: 100%;
}
body.youtube-layout.sidebar-collapsed .youtube-sidebar-link .sidebar-label {
    display: block;
    font-size: 10px;
    text-align: center;
    line-height: 1.2;
}
body.youtube-layout.sidebar-collapsed .youtube-sidebar-section {
    display: none;
}
body.youtube-layout.sidebar-collapsed .youtube-sidebar-divider {
    display: none;
}
@media (max-width: 768px) {
    body.youtube-layout .youtube-sidebar {
        display: none;
    }
    body.youtube-layout .youtube-content-wrapper {
        margin-left: 0 !important;
    }
}
.hidden { display: none !important; }

/* Typography */
.text-gradient {
    background: linear-gradient(135deg, var(--gradient-start), var(--gradient-end));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Spacing */
.py-6 { padding-top: 5rem; padding-bottom: 5rem; }
.mb-6 { margin-bottom: 5rem; }
.min-vh-75 { min-height: 75vh; }

/* =============================================
   Navigation
   ============================================= */
.navbar {
    background: var(--navbar-bg) !important;
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border-color);
    padding: 0.5rem 0;
    min-height: 70px;
}
.navbar-brand {
    font-weight: 800;
    font-size: 1.4rem;
    color: var(--text-primary) !important;
}
.brand-text {
    background: linear-gradient(135deg, var(--gradient-start), var(--gradient-end));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
.navbar-nav .nav-link {
    color: var(--text-secondary) !important;
    font-weight: 500;
    padding: 0.5rem 1rem !important;
    border-radius: 0.5rem;
    transition: all 0.2s;
}
.navbar-nav .nav-link:hover,
.navbar-nav .nav-link.active {
    color: var(--text-primary) !important;
    background: var(--bg-hover);
}
.dropdown-scroll { max-height: 300px; overflow-y: auto; }
/* Language dropdown: ensure space below trigger, center aligned */
.dropdown-menu-lang {
    margin-top: 8px !important;
    min-width: 180px;
}
.dropdown-menu {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
}
.dropdown-item {
    color: var(--text-secondary);
}
.dropdown-item:hover, .dropdown-item.active {
    background: var(--bg-hover);
    color: var(--text-primary);
}

/* Theme toggle */
#theme-toggle {
    color: var(--text-secondary) !important;
    text-decoration: none;
}
#theme-toggle:hover {
    color: var(--text-primary) !important;
}

/* =============================================
   YouTube-style top navbar
   ============================================= */
.youtube-top-nav {
    min-height: 56px !important;
    padding: 0 16px !important;
    border-bottom: none !important;
    overflow: visible !important;
}
.youtube-nav-inner {
    display: flex;
    align-items: center;
    width: 100%;
    gap: 16px;
}
.youtube-nav-left {
    flex-shrink: 0;
    gap: 4px;
}
.youtube-nav-hamburger {
    width: 40px;
    height: 40px;
    padding: 0;
    border-radius: 50%;
    color: var(--text-primary);
    background: transparent;
    border: none;
}
.youtube-nav-hamburger:hover {
    background: var(--bg-hover);
}
.youtube-nav-hamburger i {
    font-size: 24px;
}
.youtube-nav-brand {
    color: var(--text-primary) !important;
    text-decoration: none;
    font-weight: 700;
    font-size: 1.25rem;
}
.youtube-nav-region {
    font-size: 10px;
    margin-left: 2px;
}
.youtube-nav-center {
    max-width: 640px;
    flex: 1;
}
.youtube-search-form {
    width: 100%;
    max-width: 100%;
}
.youtube-search-wrap {
    display: flex;
    align-items: center;
    background: var(--bg-hover);
    border: none;
    border-radius: 40px;
    overflow: hidden;
}
.youtube-search-input {
    flex: 1;
    min-width: 0;
    padding: 8px 16px;
    border: none;
    background: transparent;
    color: var(--text-primary);
    font-size: 16px;
}
.youtube-search-input::placeholder {
    color: var(--text-secondary);
}
.youtube-search-input:focus {
    outline: none;
}
.youtube-search-btn {
    width: 64px;
    height: 36px;
    padding: 0;
    border: none;
    background: var(--bg-hover);
    color: var(--text-secondary);
    border-radius: 0 40px 40px 0;
}
.youtube-search-btn:hover {
    background: var(--bg-hover-strong);
    color: var(--text-primary);
}
.youtube-voice-btn {
    width: 40px;
    height: 40px;
    padding: 0;
    border-radius: 50%;
    background: var(--bg-hover);
    color: var(--text-primary);
    border: none;
}
.youtube-voice-btn:hover {
    background: var(--bg-hover-strong);
}
.youtube-nav-right {
    flex-shrink: 0;
    margin-left: auto;
    overflow: visible;
}
.youtube-nav-right .btn-icon {
    width: 40px;
    height: 40px;
    padding: 0;
    border-radius: 50%;
    color: var(--text-primary);
    background: transparent;
    border: none;
}
.youtube-nav-right .btn-icon:hover {
    background: var(--bg-hover);
}
.youtube-nav-right .dropdown-toggle::after {
    display: none;
}
.youtube-nav-right .dropdown {
    display: flex;
    align-items: center;
}
.youtube-nav-right .dropdown .dropdown-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.youtube-lang-toggle {
    width: auto !important;
    min-width: 40px;
    height: 40px !important;
    padding: 0 8px !important;
    gap: 4px;
}

/* YouTube-style Sign in button (not logged in) */
.youtube-sign-in-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 0 16px;
    height: 36px;
    border-radius: 18px;
    border: 1px solid rgba(0, 0, 0, 0.1);
    background: var(--bg-primary);
    color: #065fd4;
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    transition: background 0.15s, border-color 0.15s;
}
.youtube-sign-in-btn:hover {
    background: var(--bg-hover);
    border-color: rgba(0, 0, 0, 0.15);
    color: #065fd4;
}
.youtube-sign-in-btn i {
    font-size: 20px;
}
[data-theme="dark"] .youtube-sign-in-btn {
    border-color: rgba(255, 255, 255, 0.2);
}
[data-theme="dark"] .youtube-sign-in-btn:hover {
    border-color: rgba(255, 255, 255, 0.3);
}

/* YouTube-style avatar (logged in) - blue circle with white initial */
.youtube-nav-avatar {
    width: 32px !important;
    height: 32px !important;
    border-radius: 50%;
    overflow: hidden;
    border: 2px solid #065fd4 !important;
    background: #065fd4 !important;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}
.youtube-nav-avatar .avatar-initial {
    color: white;
    font-size: 14px;
    font-weight: 600;
}

@media (max-width: 900px) {
    .youtube-nav-center {
        max-width: 180px;
    }
}

/* =============================================
   Hero Section
   ============================================= */
.hero-section {
    padding: 4rem 0;
    background: linear-gradient(180deg, var(--bg-primary) 0%, var(--bg-secondary) 100%);
}

/* Player Mockup */
.player-mockup {
    background: var(--bg-card);
    border-radius: 12px;
    border: 1px solid var(--border-color);
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0,0,0,0.4);
}
.player-video-area {
    background: linear-gradient(135deg, #1a1a2e, #16213e);
    aspect-ratio: 16/9;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}
.play-icon {
    font-size: 4rem;
    color: rgba(255,255,255,0.6);
}
.subtitle-overlay {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    text-align: center;
    width: 90%;
}
.subtitle-line.target {
    background: rgba(0,0,0,0.7);
    color: #fff;
    padding: 6px 16px;
    border-radius: 6px;
    font-size: 1.1rem;
    font-weight: 500;
    display: inline-block;
    margin-bottom: 4px;
}
.subtitle-line.native {
    background: rgba(0,0,0,0.5);
    color: #9ca3af;
    padding: 4px 12px;
    border-radius: 4px;
    font-size: 0.85rem;
    display: inline-block;
}
.word-highlight {
    color: #fbbf24;
    text-decoration: underline;
    text-decoration-color: #fbbf24;
    cursor: pointer;
}
.word-dim { font-style: italic; }
.player-vocab-sidebar {
    padding: 12px;
    display: flex;
    gap: 8px;
    overflow-x: auto;
}
.vocab-card-mini {
    background: var(--bg-hover);
    border-radius: 8px;
    padding: 8px 12px;
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 120px;
    font-size: 0.8rem;
}
.vocab-card-mini .word { font-weight: 600; }
.vocab-card-mini .translation { color: var(--text-secondary); }

/* =============================================
   Language Pills
   ============================================= */
.lang-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 20px;
    border: 1px solid var(--border-color);
    border-radius: 50px;
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 500;
    transition: all 0.2s;
    background: var(--bg-card);
}
.lang-pill:hover {
    border-color: var(--accent-primary);
    color: var(--text-primary);
    background: var(--bg-hover);
    transform: translateY(-2px);
}

/* =============================================
   Feature Cards
   ============================================= */
.feature-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    transition: all 0.3s;
}
.feature-card:hover {
    border-color: var(--accent-primary);
    transform: translateY(-4px);
}
.feature-icon {
    width: 60px;
    height: 60px;
    border-radius: 14px;
    background: linear-gradient(135deg, var(--gradient-start), var(--gradient-end));
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: white;
}

/* Feature Previews */
.feature-preview {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 2rem;
}
.dual-subs-preview .preview-line {
    font-size: 1.3rem;
    font-weight: 600;
    padding: 12px 0;
}
.dual-subs-preview .preview-line-trans {
    color: var(--text-secondary);
    font-size: 1rem;
    margin-bottom: 1rem;
}
.word-popup-preview {
    background: var(--bg-hover);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 16px;
    max-width: 250px;
}
.flashcard-mock { text-align: center; padding: 2rem 0; }
.flashcard-front .cefr-badge {
    display: inline-block;
    background: var(--accent-primary);
    color: white;
    padding: 2px 12px;
    border-radius: 50px;
    font-size: 0.8rem;
    font-weight: 600;
    margin-bottom: 1rem;
}
.flashcard-word { font-size: 2rem; font-weight: 700; }
.flashcard-stats-row {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    margin-top: 1.5rem;
    font-size: 0.85rem;
}

/* Phone Mockup */
.phone-mockup {
    width: 220px;
    margin: 0 auto;
    border: 3px solid var(--border-color);
    border-radius: 24px;
    overflow: hidden;
    background: #000;
}
.phone-screen {
    aspect-ratio: 9/16;
    position: relative;
    background: linear-gradient(135deg, #1a1a2e, #16213e);
}
.feed-video-mock {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
    color: rgba(255,255,255,0.3);
}
.feed-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 16px;
    background: linear-gradient(transparent, rgba(0,0,0,0.8));
}
.feed-subtitle { font-size: 0.9rem; font-weight: 500; }
.feed-actions {
    position: absolute;
    right: 12px;
    bottom: 80px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    font-size: 1.3rem;
    color: white;
}

/* =============================================
   Category Cards
   ============================================= */
.category-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 20px 12px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    color: var(--text-secondary);
    transition: all 0.2s;
}
.category-card:hover {
    border-color: var(--accent-primary);
    color: var(--text-primary);
    transform: translateY(-3px);
    background: var(--bg-hover);
}
.category-icon { font-size: 1.8rem; }

/* =============================================
   Video Cards - YouTube-style grid layout
   ============================================= */
.video-card { display: block; text-decoration: none; color: inherit; }
.thumbnail-row { margin-bottom: 12px; position: relative; }
.video-thumbnail {
    position: relative;
    border-radius: 10px;
    overflow: hidden;
    aspect-ratio: 16/9;
    background: var(--bg-secondary);
}
.video-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s;
}
.video-card:hover .video-thumbnail img { transform: scale(1.05); }
.video-play-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0,0,0,0.3);
    opacity: 0;
    transition: opacity 0.3s;
    font-size: 3rem;
    color: white;
}
.video-card:hover .video-play-overlay { opacity: 1; }
.video-duration {
    position: absolute;
    bottom: 8px;
    right: 8px;
    background: rgba(0,0,0,0.85);
    color: white;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
}
.video-level {
    position: absolute;
    top: 8px;
    left: 8px;
}
.video-short-badge {
    position: absolute;
    top: 8px;
    right: 8px;
    background: rgba(239, 68, 68, 0.9);
    color: white;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 600;
}
/* YouTube-style video info: channel avatar + metadata */
.video-info { padding: 12px 0 0; }
.videos-info-grid {
    display: grid;
    grid-template-columns: 48px 1fr;
    gap: 12px;
}
.video-channel-picture {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    overflow: hidden;
    background: var(--bg-hover);
}
.video-channel-picture img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.channel-avatar-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-hover);
    color: var(--text-secondary);
    font-size: 1.8rem;
}
.video-title {
    font-size: 14px;
    font-weight: 500;
    line-height: 20px;
    color: var(--text-primary);
    margin: 0 0 4px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.video-channel,
.video-stats {
    font-size: 12px;
    color: var(--text-secondary);
}
.video-channel { margin-bottom: 2px; }
.video-meta {
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: 2px;
    display: flex;
    gap: 6px;
}
.video-stats {
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: 2px;
    display: flex;
    gap: 8px;
}

/* CEFR Level Badges */
.badge-level-A1 { background: #22c55e; color: white; padding: 2px 10px; border-radius: 50px; font-size: 0.7rem; font-weight: 700; }
.badge-level-A2 { background: #84cc16; color: white; padding: 2px 10px; border-radius: 50px; font-size: 0.7rem; font-weight: 700; }
.badge-level-B1 { background: #eab308; color: #000; padding: 2px 10px; border-radius: 50px; font-size: 0.7rem; font-weight: 700; }
.badge-level-B2 { background: #f97316; color: white; padding: 2px 10px; border-radius: 50px; font-size: 0.7rem; font-weight: 700; }
.badge-level-C1 { background: #ef4444; color: white; padding: 2px 10px; border-radius: 50px; font-size: 0.7rem; font-weight: 700; }
.badge-level-C2 { background: #a855f7; color: white; padding: 2px 10px; border-radius: 50px; font-size: 0.7rem; font-weight: 700; }

/* =============================================
   Comparison Table
   ============================================= */
.comparison-table {
    border-radius: 12px;
    overflow: hidden;
    background: var(--bg-card);
    color: var(--text-primary);
}
.comparison-table th,
.comparison-table td {
    background: var(--bg-card);
    border-color: var(--border-color);
    color: var(--text-primary);
    vertical-align: middle;
}
.comparison-table tbody tr:hover th,
.comparison-table tbody tr:hover td {
    background: var(--bg-hover);
}
.highlight-col { background: var(--accent-subtle) !important; }

/* =============================================
   CTA Section
   ============================================= */
.cta-section {
    background: linear-gradient(135deg, var(--accent-subtle), rgba(6,182,212,0.15));
}

/* =============================================
   Filter Bar (Browse) - YouTube-style
   ============================================= */
.filter-bar {
    background: var(--bg-primary);
    padding: 16px 0;
    border: none;
}
.filter-bar form {
    overflow-x: auto;
}
.filter-bar .form-control,
.filter-bar .form-select {
    background: var(--bg-hover);
    border: none;
    color: var(--text-primary);
}
.filter-bar .input-group-text {
    background: var(--bg-hover);
    border: none;
    color: var(--text-secondary);
}
.filter-bar .input-group {
    border: none;
}
.filter-search {
    min-width: 200px;
    flex: 1;
    max-width: 400px;
}
.filter-search .form-control {
    min-width: 120px;
}
.filter-select {
    min-width: 150px;
}
.filter-select-narrow {
    min-width: 130px;
}
.browse-content .btn-outline-secondary {
    border: none;
    background: var(--bg-hover);
}
.browse-content .btn-outline-secondary:hover {
    background: var(--bg-hover-strong);
}
.youtube-nav-right .btn-outline-secondary {
    border: none;
    background: var(--bg-hover);
}
.youtube-nav-right .btn-outline-secondary:hover {
    background: var(--bg-hover-strong);
}
@media (max-width: 768px) {
    .filter-search { min-width: 100%; max-width: 100%; }
}

/* YouTube-style video grid */
.video-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    column-gap: 16px;
    row-gap: 40px;
    padding: 0 24px;
}
@media (max-width: 600px) {
    .video-grid { grid-template-columns: 1fr; padding: 0 16px; }
}
@media (min-width: 601px) and (max-width: 900px) {
    .video-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 901px) and (max-width: 1200px) {
    .video-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (min-width: 1201px) {
    .video-grid { grid-template-columns: repeat(4, 1fr); }
}
.video-grid-empty {
    grid-column: 1 / -1;
}

/* =============================================
   Watch Page
   ============================================= */
.watch-page main { padding-top: 0; }
.video-player-wrapper {
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    background: #000;
}
.subtitle-display {
    position: absolute;
    bottom: 60px;
    left: 50%;
    transform: translateX(-50%);
    text-align: center;
    width: 90%;
    pointer-events: none;
    z-index: 10;
}
.subtitle-target {
    background: rgba(0,0,0,0.75);
    color: #fff;
    padding: 8px 20px;
    border-radius: 8px;
    font-size: 1.2rem;
    font-weight: 500;
    display: inline-block;
    margin-bottom: 4px;
}
.subtitle-native {
    background: rgba(0,0,0,0.5);
    color: #9ca3af;
    padding: 4px 12px;
    border-radius: 4px;
    font-size: 0.9rem;
    display: inline-block;
}
.player-controls {
    background: var(--bg-card);
    padding: 10px 16px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

/* Transcript */
.transcript-panel {
    background: var(--bg-card);
    border-radius: 12px;
    border: 1px solid var(--border-color);
    padding: 20px;
}
.transcript-segments {
    max-height: 400px;
    overflow-y: auto;
}
.transcript-segment {
    display: flex;
    gap: 12px;
    padding: 8px 10px;
    border-radius: 6px;
    transition: background 0.2s;
}
.transcript-segment:hover { background: var(--bg-hover); }
.transcript-segment.active { background: var(--accent-subtle); }
.segment-time {
    color: var(--accent-primary);
    font-size: 0.75rem;
    min-width: 40px;
    font-weight: 600;
}
.segment-text { font-size: 0.95rem; line-height: 1.6; }
.clickable-word {
    cursor: pointer;
    border-radius: 3px;
    transition: all 0.15s;
}
.clickable-word:hover {
    background: rgba(251, 191, 36, 0.3);
    color: #fbbf24;
}

/* Sidebar */
.sidebar-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 20px;
}
.vocab-list { display: flex; flex-direction: column; gap: 12px; }
.vocab-item {
    background: var(--bg-hover);
    border-radius: 8px;
    padding: 10px 12px;
}
.related-video-item {
    display: flex;
    gap: 10px;
    padding: 8px 0;
    border-bottom: 1px solid var(--border-color);
}
.related-video-item:last-child { border: none; }
.related-video-item img {
    width: 120px;
    height: 68px;
    object-fit: cover;
    border-radius: 6px;
}
.related-video-title {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-primary);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.related-video-meta {
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-top: 4px;
    display: flex;
    gap: 6px;
    align-items: center;
}

/* =============================================
   Dashboard
   ============================================= */
.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 20px;
    text-align: center;
}
.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    margin-bottom: 8px;
}
.stat-value { font-size: 1.8rem; font-weight: 700; }
.stat-label { font-size: 0.85rem; color: var(--text-secondary); }

.dashboard-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 24px;
}
.language-progress-item {
    padding: 12px 0;
    border-bottom: 1px solid var(--border-color);
}
.language-progress-item:last-child { border: none; }

.vocab-stat-item {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid var(--border-color);
}
.vocab-stat-item:last-child { border: none; }

.video-card-horizontal {
    display: flex;
    gap: 10px;
    padding: 8px;
    background: var(--bg-hover);
    border-radius: 8px;
    transition: background 0.2s;
}
.video-card-horizontal:hover { background: var(--bg-secondary); }
.video-card-horizontal img {
    width: 100px;
    height: 56px;
    object-fit: cover;
    border-radius: 6px;
}

/* Achievements */
.achievements-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.achievement-item {
    width: 42px;
    height: 42px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    border: 1px solid var(--border-color);
}
.achievement-item.earned {
    background: linear-gradient(135deg, var(--gradient-start), var(--gradient-end));
    color: white;
    border: none;
}
.achievement-item.locked {
    background: var(--bg-hover);
    color: var(--text-secondary);
    opacity: 0.5;
}

/* =============================================
   Flashcards
   ============================================= */
.flashcard-card {
    perspective: 1000px;
    cursor: pointer;
    max-width: 500px;
    margin: 0 auto;
}
.flashcard-inner {
    position: relative;
    width: 100%;
    min-height: 280px;
    transition: transform 0.6s;
    transform-style: preserve-3d;
}
.flashcard-face {
    position: absolute;
    inset: 0;
    backface-visibility: hidden;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 40px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
}
.flashcard-back-face {
    transform: rotateY(180deg);
}
.flashcard-main-word { font-size: 2.5rem; font-weight: 700; }
.flashcard-pos { font-size: 0.9rem; }
.flashcard-context { font-style: italic; max-width: 80%; }
.flashcard-translation { font-size: 2rem; }
.flashcard-cefr {
    position: absolute;
    top: 16px;
    right: 16px;
}

.wordlist-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 16px;
    transition: border-color 0.2s;
}
.wordlist-card:hover { border-color: var(--accent-primary); }

/* =============================================
   Feed Page
   ============================================= */
.feed-page { background: #000; }
.feed-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    background: linear-gradient(rgba(0,0,0,0.8), transparent);
}
.feed-container {
    scroll-snap-type: y mandatory;
    overflow-y: scroll;
    height: 100vh;
}
.feed-item {
    scroll-snap-align: start;
    height: 100vh;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #000;
}
.feed-video { width: 100%; height: 100%; }
.feed-video iframe { width: 100%; height: 100%; }
.feed-thumbnail {
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    display: flex;
    align-items: center;
    justify-content: center;
}
.feed-play-btn { font-size: 4rem; color: rgba(255,255,255,0.7); }
.feed-info-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 20px;
    background: linear-gradient(transparent, rgba(0,0,0,0.9));
}
.feed-subtitle-area {
    margin-bottom: 12px;
}
.feed-sub-target { font-size: 1rem; font-weight: 600; }
.feed-side-actions {
    position: absolute;
    right: 16px;
    bottom: 120px;
    display: flex;
    flex-direction: column;
    gap: 20px;
    align-items: center;
}
.feed-action {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    font-size: 1.5rem;
    color: white;
    cursor: pointer;
}
.feed-action span { font-size: 0.7rem; }
.feed-bottom-info {
    display: flex;
    align-items: center;
}
.feed-empty {
    height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
}

/* =============================================
   Onboarding
   ============================================= */
.onboarding-step {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 24px;
}
.onboarding-option {
    display: block;
    cursor: pointer;
}
.onboarding-option input { display: none; }
.onboarding-option-label {
    display: block;
    padding: 12px 16px;
    background: var(--bg-hover);
    border: 2px solid var(--border-color);
    border-radius: 10px;
    text-align: center;
    font-weight: 500;
    transition: all 0.2s;
    color: var(--text-secondary);
}
.onboarding-option input:checked + .onboarding-option-label {
    border-color: var(--accent-primary);
    background: var(--accent-subtle);
    color: var(--text-primary);
}
.onboarding-option:hover .onboarding-option-label {
    border-color: var(--accent-primary);
    color: var(--text-primary);
}

/* =============================================
   Footer
   ============================================= */
.site-footer {
    background: var(--bg-secondary);
    border-top: 1px solid var(--border-color);
    padding: 3rem 0 1.5rem;
    margin-top: auto;
}

/* =============================================
   Buttons
   ============================================= */
.btn-primary {
    background: var(--accent-primary);
    border-color: var(--accent-primary);
}
.btn-primary:hover {
    background: var(--accent-hover);
    border-color: var(--accent-hover);
}

/* =============================================
   Forms (auth pages)
   ============================================= */
.form-control:focus {
    box-shadow: 0 0 0 0.2rem var(--accent-focus);
}
.alert ul { margin: 0; padding-left: 1rem; }

/* =============================================
   Pricing Cards
   ============================================= */
.pricing-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    transition: transform 0.2s;
}
.pricing-card:hover { transform: translateY(-5px); }
.pricing-card.featured { border: 2px solid var(--accent-primary); }

/* Payment form */
#card-element {
    border: 1px solid var(--border-color);
    padding: 0.75rem;
    border-radius: 0.375rem;
    background: var(--bg-hover);
}
.spinner-border-sm { width: 1rem; height: 1rem; }

/* =============================================
   Scrollbar
   ============================================= */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg-primary); }
::-webkit-scrollbar-thumb { background: var(--border-color); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-secondary); }

/* =============================================
   Responsive
   ============================================= */
@media (max-width: 768px) {
    .display-3 { font-size: 2rem; }
    .display-5 { font-size: 1.5rem; }
    .display-6 { font-size: 1.3rem; }
    .py-6 { padding-top: 3rem; padding-bottom: 3rem; }
    .hero-section { padding: 2rem 0; }
    .min-vh-75 { min-height: auto; }
    .player-vocab-sidebar { display: none; }
    .comparison-table { font-size: 0.8rem; }
}

