:root {
    --bg-dark: #0f0f11;
    --surface: #18181b;
    --surface-hover: #27272a;
    --primary: #a855f7;
    /* Modern Purple */
    --primary-glow: rgba(168, 85, 247, 0.4);
    --text-main: #f4f4f5;
    --text-muted: #a1a1aa;
    --radius: 16px;
    --header-height: 80px;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

body {
    background-color: var(--bg-dark);
    color: var(--text-main);
    font-family: 'Inter', system-ui, sans-serif;
    margin: 0;
    min-height: 100vh;
}

/* --- Glass Header --- */
.glass-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--header-height);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 5%;
    background: rgba(15, 15, 17, 0.8);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    z-index: 100;
}

.brand h1 {
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0;
    letter-spacing: -0.02em;
}

.brand .dot {
    color: var(--primary);
}

/* AI Gradient Animation */
.ai-gradient {
    background: linear-gradient(45deg, #f3ec78, #af4261, #c060ff, #60c0ff, #f3ec78);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    background-size: 300% 300%;
    animation: aiGradient 6s ease infinite;
}

@keyframes aiGradient {
    0% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }

    100% {
        background-position: 0% 50%;
    }
}

/* Morphing X Styles */
#morphing-x {
    font-size: 1em;
    /* Base size, overridden by JS */
    display: inline-flex;
    align-items: center;
    justify-content: center;
    vertical-align: middle;
    opacity: 1;
    transform: translateY(0) scale(1);
    transition: opacity 0.4s ease, transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);

    /* Fixed dimensions to prevent layout shift */
    width: 40px;
    height: 40px;
    line-height: 1;
    /* Fix vertical alignment issues */
    margin: 0;
    /* Reset margins */

    /* Gradient Style */
    background: linear-gradient(45deg, #f3ec78, #af4261, #c060ff, #60c0ff, #f3ec78);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    background-size: 300% 300%;
    animation: aiGradient 6s ease infinite;
}

#morphing-x.hidden {
    opacity: 0;
    transform: translateY(5px) scale(0.8);
}

/* Search Input - Centered */
.search-wrapper {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    width: 400px;
    max-width: 40%;
}

.search-wrapper input {
    appearance: none;
    -webkit-appearance: none;
    width: 100%;
    background: var(--surface);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-main);
    padding: 0.75rem 1rem;
    padding-right: 2.5rem;
    border-radius: 12px;
    font-family: inherit;
    font-size: 0.9rem;
    transition: all 0.2s ease;
}

.search-wrapper input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(168, 85, 247, 0.1);
}

.search-wrapper .shortcut {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.1);
    padding: 2px 8px;
    border-radius: 6px;
    font-size: 0.75rem;
    color: var(--text-muted);
    pointer-events: none;
}

/* --- Filter Bar --- */
.filter-bar {
    position: sticky;
    top: var(--header-height);
    z-index: 90;
    background: rgba(15, 15, 17, 0.9);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    padding: 1rem 5%;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    margin-bottom: 1.5rem;
}

.filter-chips {
    display: flex;
    gap: 0.75rem;
    overflow-x: auto;
    padding-bottom: 4px;
    /* Space for scrollbar if needed */
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    /* Firefox */
}

.filter-chips::-webkit-scrollbar {
    display: none;
    /* Chrome/Safari */
}

.chip {
    background: var(--surface);
    border: 1px solid rgba(255, 255, 255, 0.05);
    color: var(--text-muted);
    padding: 0.5rem 1.25rem;
    border-radius: 20px;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.chip:hover {
    background: var(--surface-hover);
    color: var(--text-main);
}

.chip.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
    box-shadow: 0 4px 12px var(--primary-glow);
}

/* --- Main Content --- */
main {
    padding-top: var(--header-height);
    padding-bottom: 4rem;
}

/* Reserve space for timeline on desktop */
@media (min-width: 1024px) {
    main {
        padding-right: 60px;
        /* Timeline width + spacing */
    }
}

/* --- Bento Grid Layout --- */
.bento-grid {
    display: grid;
    /* Auto-fit columns min 320px wide */
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 1.5rem;
    padding: 0;
    /* Reduced side padding for fluid look */
    grid-auto-flow: dense;
    /* Crucial for packing distinct sizes */
    max-width: 100%;
    /* Fluid width */
    margin: 0 auto;
}

/* Large Screen Optimization (Netflix Style) */
@media (min-width: 1800px) {
    .bento-grid {
        /* Larger cards on very large screens */
        grid-template-columns: repeat(auto-fill, minmax(400px, 1fr));
        gap: 2rem;
        /* More breathing room */
    }

    /* Adjust font sizes for larger cards */
    .card-title {
        font-size: 1.2rem;
    }
}

/* The Video Card */
.video-card {
    background: var(--surface);
    border-radius: var(--radius);
    overflow: hidden;
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1),
        box-shadow 0.3s cubic-bezier(0.34, 1.56, 0.64, 1),
        border-color 0.2s ease;
    border: 1px solid rgba(255, 255, 255, 0.05);
    display: flex;
    flex-direction: column;
    position: relative;
    height: 100%;
}

.video-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 20px 40px -5px rgba(0, 0, 0, 0.4);
    border-color: rgba(168, 85, 247, 0.3);
    z-index: 2;
}

/* Scheduled Video Styles */
.video-card.scheduled {
    /* Remove opacity/grayscale to make the gradient pop */
    opacity: 1;
    filter: none;
}

.video-card.scheduled:hover {
    transform: translateY(-6px);
    box-shadow: 0 20px 40px -5px rgba(0, 0, 0, 0.4);
    border-color: var(--primary);
}

.scheduled-badge {
    background: rgba(255, 255, 255, 0.2);
    color: var(--text-main);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    margin-left: 8px;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.scheduled-thumbnail {
    position: relative;
    aspect-ratio: 16 / 9;
    width: 100%;
    /* Gradient background set in accent classes for Chrome compatibility */
    animation: gradientMove 5s ease infinite;
    border-radius: var(--radius) var(--radius) 0 0;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.scheduled-thumbnail img {
    display: none;
    /* Hide the image to show the gradient */
}

.scheduled-overlay {
    /* Reset overlay positioning since parent is flex centered */
    position: static;
    transform: none;
    color: white;
    width: auto;
    height: auto;
    background: transparent;
    box-shadow: none;
    backdrop-filter: none;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.scheduled-overlay svg {
    width: 48px;
    height: 48px;
    filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.3));
}

/* Feature large videos (Bento effect) */
.video-card.featured {
    grid-column: span 2;
    grid-row: span 2;
}

.video-card.featured lite-youtube {
    aspect-ratio: 16 / 9;
    height: auto;
    flex-grow: 1;
}

.video-card.featured .card-title {
    font-size: 1.5rem;
    margin-bottom: 0.75rem;
}

/* --- 16:9 Aspect Ratio Handler --- */
lite-youtube {
    aspect-ratio: 16 / 9;
    width: 100%;
    background-color: #000;
    background-size: cover;
    background-position: center;
    border-radius: var(--radius) var(--radius) 0 0;
}

.card-content {
    padding: 1.25rem;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.card-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
}

.card-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin: 0 0 0.5rem 0;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    /* Truncate after 2 lines */
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    color: var(--text-main);
}

.card-description {
    font-size: 0.9rem;
    color: var(--text-muted);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-bottom: 1rem;
}

.channel-tag {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--primary);
    background: rgba(168, 85, 247, 0.1);
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.channel-link-icon {
    color: white;
    opacity: 1;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    text-decoration: none;
    margin-left: 2px;
}

.channel-link-icon:hover {
    color: var(--primary);
    transform: scale(1.15);
}

.video-date {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.lang-badge {
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--text-main);
    background: rgba(255, 255, 255, 0.15);
    padding: 0.2rem 0.6rem;
    border-radius: 12px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.series-meta {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-top: 0.5rem;
    font-style: italic;
}

/* --- Mobile Responsiveness --- */
@media (max-width: 768px) {
    .glass-header {
        padding: 1rem;
        height: auto;
        min-height: 90px;
        flex-wrap: wrap;
        gap: 0.5rem;
        padding-bottom: 1rem;
        align-items: flex-start;
    }

    .brand {
        width: auto;
        margin-top: 0.5rem;
    }

    .controls {
        width: 100%;
        flex-direction: column;
        gap: 1rem;
    }

    .search-wrapper {
        position: relative;
        left: auto;
        transform: none;
        width: 100%;
        max-width: 100%;
        order: 3;
        margin-top: 0.5rem;
    }

    .filter-bar {
        top: 0;
        padding: 0.75rem 1rem;
    }

    .filter-chips {
        width: 100%;
        overflow-x: auto;
        padding-bottom: 0.5rem;
        -webkit-overflow-scrolling: touch;
    }

    .chip {
        white-space: nowrap;
    }

    main {
        padding-top: 180px;
        padding-right: 0;
        /* Reset desktop padding */
    }

    /* 2-Column Grid for Mobile */
    .bento-grid {
        grid-template-columns: repeat(2, 1fr);
        /* Force 2 columns */
        gap: 0.75rem;
        /* Smaller gap */
        padding: 0 1rem;
    }

    .video-card.featured {
        grid-column: span 2;
        grid-row: span 1;
    }

    /* Compact Card Styles for Mobile */
    .card-content {
        padding: 0.75rem;
        /* Reduced padding */
    }

    .card-title {
        font-size: 0.9rem;
        /* Smaller title */
        line-height: 1.3;
        margin-bottom: 0.25rem;
    }

    .card-meta {
        margin-bottom: 0.5rem;
    }

    .channel-tag {
        font-size: 0.65rem;
        padding: 0.15rem 0.5rem;
    }

    .video-date {
        font-size: 0.7rem;
    }

    .series-meta {
        font-size: 0.75rem;
    }
}

/* --- Sectional Layout --- */
.content-section {
    margin-bottom: 3rem;
    padding: 0 5%;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.section-header h2 {
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0;
    color: var(--text-main);
}

/* --- Swimlane (Horizontal Scroll) --- */
.swimlane {
    display: flex;
    gap: 1.5rem;
    overflow-x: auto;
    padding-bottom: 1.5rem;
    /* Space for scrollbar/shadow */
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    /* Firefox */
}

.swimlane::-webkit-scrollbar {
    display: none;
    /* Chrome/Safari */
}

/* --- Series Card --- */
.series-card {
    flex: 0 0 300px;
    /* Fixed width for swimlane items */
    scroll-snap-align: start;
    background: var(--surface);
    border-radius: var(--radius);
    border: 1px solid rgba(255, 255, 255, 0.05);
    overflow: hidden;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    display: flex;
    flex-direction: column;
    height: 100%;
}

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

.series-thumbnail-stack {
    position: relative;
    aspect-ratio: 16/9;
    background: #000;
    overflow: hidden;
}

.series-thumbnail-stack img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.series-card:hover .series-thumbnail-stack img {
    transform: scale(1.05);
}

/* Stack effect overlay */
.series-thumbnail-stack::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--primary);
    box-shadow: 0 -2px 10px rgba(168, 85, 247, 0.5);
}

.series-count-badge {
    position: absolute;
    bottom: 10px;
    right: 10px;
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 600;
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    gap: 4px;
}

/* --- Grid Headers --- */
.grid-header {
    grid-column: 1 / -1;
    margin-top: 3rem;
    margin-bottom: 1.5rem;
    padding-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 12px;
    position: relative;
}

/* Add a subtle line that goes under the header text */
.grid-header::after {
    content: '';
    flex-grow: 1;
    height: 1px;
    background: linear-gradient(90deg, var(--primary-glow), transparent);
    margin-left: 1rem;
    opacity: 0.5;
}

.grid-header h3 {
    font-size: 1.2rem;
    font-weight: 700;
    margin: 0;
    color: var(--primary);
    /* Accent color */
    text-transform: uppercase;
    letter-spacing: 0.05em;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Optional: Add a small dot or icon before the text */
.grid-header h3::before {
    content: '';
    display: block;
    width: 6px;
    height: 6px;
    background: var(--primary);
    border-radius: 50%;
    box-shadow: 0 0 8px var(--primary);
}

.grid-header .header-count {
    font-size: 0.9rem;
    color: var(--text-muted);
    font-weight: 400;
}

/* First header shouldn't have top margin if it's at the very top */
.grid-header:first-child {
    margin-top: 0;
}

.series-content {
    padding: 1.25rem;
    flex-grow: 1;
}

.series-title {
    font-size: 1.1rem;
    font-weight: 700;
    margin: 0 0 0.5rem 0;
    color: var(--text-main);
}

.series-meta {
    font-size: 0.85rem;
    color: var(--text-muted);
}

/* Loading State */
.loading-state {
    grid-column: 1 / -1;
    text-align: center;
    padding: 4rem;
    color: var(--text-muted);
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(168, 85, 247, 0.1);
    border-radius: 50%;
    border-top-color: var(--primary);
    animation: spin 1s linear infinite;
    margin: 0 auto 1rem;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Mobile adjustments for swimlane */
@media (max-width: 768px) {
    .swimlane {
        padding-right: 1rem;
        /* Peek effect */
    }

    .series-card {
        flex: 0 0 260px;
        /* Slightly smaller on mobile */
    }
}

.series-link {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(0, 0, 0, 0.6);
    color: white;
    padding: 6px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(4px);
    transition: all 0.2s ease;
    z-index: 5;
}

.series-link:hover {
    background: var(--primary);
    transform: scale(1.1);
}

/* --- Custom Language Picker --- */
.language-picker-container {
    position: relative;
}

.lang-btn {
    appearance: none;
    -webkit-appearance: none;
    background: var(--surface);
    color: var(--text-main);
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 0.5rem 1rem;
    border-radius: 12px;
    font-size: 0.9rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s ease;
}

.lang-btn:hover {
    background: var(--surface-hover);
    border-color: var(--primary);
}

.lang-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    background: var(--surface);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 0.5rem;
    min-width: 150px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    z-index: 100;
}

.lang-dropdown.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.lang-option {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0.5rem 0.75rem;
    border-radius: 8px;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.2s ease;
}

.lang-option:hover {
    background: var(--surface-hover);
    color: var(--text-main);
}

.lang-option.active {
    background: rgba(168, 85, 247, 0.1);
    color: var(--primary);
}

/* --- Card-Based Socials Layout --- */
.socials-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 1.5rem;
    padding: 0 2%;
    max-width: 98%;
    /* Fluid width */
    margin: 0 auto;
}

/* Section wrapper for each social platform */
.social-section {
    margin-bottom: 2.5rem;
}

.social-section:last-child {
    margin-bottom: 0;
}

/* Section header - no longer in grid */
.social-group-header {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--text-main);
}

/* Independent grid for cards within each section */
.social-section-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 1.5rem;
    grid-auto-flow: dense;
}

/* Override bento-grid for socials container to stack sections vertically */
#socialsGrid.bento-grid {
    display: block;
    padding: 0 5%;
}

/* --- Timeline Navigation --- */
#timeline-nav {
    position: fixed;
    right: 20px;
    /* Adjusted to account for padding */
    top: 50%;
    transform: translateY(-50%);
    z-index: 95;
    display: none;
    /* Hidden by default, toggled via .is-visible */
    flex-direction: column;
    gap: 24px;
    padding: 20px;
    /* Added horizontal padding to prevent shadow clipping */
    max-height: 80vh;
    overflow-y: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

#timeline-nav::-webkit-scrollbar {
    display: none;
}

#timeline-nav.is-visible {
    display: flex;
}

/* Connecting Line */
#timeline-nav::before {
    content: '';
    position: absolute;
    top: 20px;
    bottom: 20px;
    right: 7px;
    /* Aligned with dots (dot width 14px / 2) */
    width: 1px;
    background: linear-gradient(to bottom,
            transparent,
            rgba(255, 255, 255, 0.1) 10%,
            rgba(255, 255, 255, 0.1) 90%,
            transparent);
    z-index: -1;
    pointer-events: none;
}

.timeline-year-group {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 8px;
    position: relative;
}

.timeline-year {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--text-muted);
    margin-bottom: 4px;
    opacity: 0.5;
    transition: all 0.3s ease;
    padding-right: 24px;
    /* Space for the line/dots */
    text-transform: uppercase;
    letter-spacing: 0.05em;
    position: relative;
}

.timeline-year.active {
    color: var(--primary);
    opacity: 1;
    font-size: 1rem;
    text-shadow: 0 0 15px var(--primary-glow);
}

.timeline-months {
    display: flex;
    flex-direction: column;
    gap: 12px;
    /* More breathing room */
    align-items: flex-end;
}

.timeline-month {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
    cursor: pointer;
    padding: 4px 0;
    position: relative;
    height: 20px;
    /* Fixed height for hit area */
}

.month-label {
    font-size: 0.75rem;
    color: var(--text-main);
    opacity: 0;
    transform: translateX(10px);
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    pointer-events: none;
    white-space: nowrap;
    background: rgba(15, 15, 17, 0.9);
    padding: 4px 10px;
    border-radius: 6px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    font-weight: 500;
}

.timeline-month:hover .month-label,
.timeline-month.active .month-label {
    opacity: 1;
    transform: translateX(0);
}

.month-dot {
    width: 6px;
    height: 6px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    position: relative;
    margin-right: 4px;
    /* Center alignment adjustment */
    border: 2px solid transparent;
    /* Prepare for border transition */
}

/* Hover State */
.timeline-month:hover .month-dot {
    background: var(--text-main);
    transform: scale(1.5);
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.3);
}

/* Active State */
.timeline-month.active .month-dot {
    background: var(--bg-dark);
    border-color: var(--primary);
    width: 12px;
    height: 12px;
    margin-right: 1px;
    /* Adjust for size change to keep centered */
    transform: scale(1.2);
    box-shadow: 0 0 15px var(--primary);
}

/* Active dot inner glow */
.timeline-month.active .month-dot::after {
    content: '';
    position: absolute;
    inset: 2px;
    background: var(--primary);
    border-radius: 50%;
}

/* Hide on mobile/tablet */
@media (max-width: 1024px) {

    #timeline-nav,
    #timeline-nav.is-visible {
        display: none;
    }
}

/* YouTube Card Specifics */
/* YouTube Card Specifics */
.youtube-card {
    grid-column: auto;
    /* Ensure it flows in grid */
    display: flex;
    flex-direction: column;
    /* Stack vertically like other cards */
    align-items: center;
    text-align: center;
    gap: 1rem;
}

.youtube-card .social-icon {
    width: 64px;
    height: 64px;
    margin-bottom: 0;
    flex-shrink: 0;
}

.youtube-card .social-info {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    /* Center content */
}

.youtube-card .social-desc {
    color: var(--text-muted);
    font-size: 0.95rem;
    margin-top: 0.5rem;
}

/* Mobile adjustments not strictly needed if we use the same grid, 
   but keeping a check just in case */
@media (max-width: 768px) {
    .youtube-card {
        gap: 1rem;
    }
}

/* --- Controls Section --- */
.controls-section {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 5%;
    gap: 1rem;
    margin-top: 1rem;
}

.language-selector select {
    background: var(--surface);
    color: var(--text-main);
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 0.5rem 1rem;
    border-radius: 12px;
    font-size: 0.9rem;
    cursor: pointer;
    outline: none;
    appearance: none;
    /* Remove default arrow */
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    background-size: 1em;
    padding-right: 2.5rem;
}

.view-toggle {
    display: flex;
    background: var(--surface);
    border-radius: 12px;
    padding: 4px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.toggle-btn {
    appearance: none;
    -webkit-appearance: none;
    background: transparent;
    border: none;
    color: var(--text-muted);
    padding: 0.5rem 1rem;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s ease;
}

.toggle-btn.active {
    background: var(--primary);
    color: white;
}

.toggle-btn:hover:not(.active) {
    color: var(--text-main);
}

/* Accent Colors - Applied to cards or sections */
.accent-math {
    --primary: #3b82f6;
    --primary-glow: rgba(59, 130, 246, 0.4);
}

.accent-chemistry {
    --primary: #10b981;
    --primary-glow: rgba(16, 185, 129, 0.4);
}

.accent-audiobook {
    --primary: #f59e0b;
    --primary-glow: rgba(245, 158, 11, 0.4);
}

.accent-gallery {
    --primary: #ec4899;
    --primary-glow: rgba(236, 72, 153, 0.4);
}

/* Social Accents */
.accent-patreon {
    --primary: #FF424D;
    --primary-glow: rgba(255, 66, 77, 0.4);
}

.accent-youtube {
    --primary: #FF0000;
    --primary-glow: rgba(255, 0, 0, 0.4);
}

.accent-instagram {
    --primary: #E1306C;
    --primary-glow: rgba(225, 48, 108, 0.4);
}

.accent-tiktok {
    --primary: #00F2EA;
    --primary-glow: rgba(0, 242, 234, 0.4);
}

/* Apply accent to specific elements within the scoped container */
.accent-math .channel-tag,
.accent-chemistry .channel-tag,
.accent-audiobook .channel-tag,
.accent-gallery .channel-tag,
.accent-patreon .channel-tag,
.accent-youtube .channel-tag,
.accent-instagram .channel-tag,
.accent-tiktok .channel-tag {
    color: var(--primary);
    background: color-mix(in srgb, var(--primary), transparent 90%);
}

/* Explicitly set --primary and gradient for scheduled thumbnails to ensure gradient works in Chrome */
.video-card.accent-math .scheduled-thumbnail {
    --primary: #3b82f6;
    background: linear-gradient(135deg, var(--primary), #282828);
    background-size: 200% 200%;
}

.video-card.accent-chemistry .scheduled-thumbnail {
    --primary: #10b981;
    background: linear-gradient(135deg, var(--primary), #282828);
    background-size: 200% 200%;
}

.video-card.accent-audiobook .scheduled-thumbnail {
    --primary: #f59e0b;
    background: linear-gradient(135deg, var(--primary), #282828);
    background-size: 200% 200%;
}

.video-card.accent-gallery .scheduled-thumbnail {
    --primary: #ec4899;
    background: linear-gradient(135deg, var(--primary), #282828);
    background-size: 200% 200%;
}

.video-card.accent-book .scheduled-thumbnail {
    --primary: #f59e0b;
    background: linear-gradient(135deg, var(--primary), #282828);
    background-size: 200% 200%;
}

.accent-math .series-link:hover,
.accent-chemistry .series-link:hover,
.accent-audiobook .series-link:hover,
.accent-gallery .series-link:hover {
    background: var(--primary);
}

/* Social Card Styles - Similar to Video Cards */
.social-card {
    background: var(--surface);
    border-radius: var(--radius);
    overflow: hidden;
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1),
        box-shadow 0.3s cubic-bezier(0.34, 1.56, 0.64, 1),
        border-color 0.2s ease;
    border: 1px solid rgba(255, 255, 255, 0.05);
    display: flex;
    flex-direction: column;
    position: relative;
    height: 100%;
    text-decoration: none;
}

.social-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 20px 40px -5px rgba(0, 0, 0, 0.4);
    z-index: 2;
}

/* Social Banner (Replaces Thumbnail) - Like Video Thumbnail */
.social-banner {
    aspect-ratio: 16 / 9;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.social-banner svg {
    width: 64px;
    height: 64px;
    color: white;
    z-index: 1;
    filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.3));
}

/* Platform-Specific Card Styles */
.social-card.card-patreon {
    grid-column: span 2;
}

/* Mobile adjustments for grid headers */
@media (max-width: 768px) {
    .grid-header {
        margin-top: 2rem;
        margin-bottom: 1rem;
    }

    .grid-header h3 {
        font-size: 1rem;
    }
}

.social-card.card-patreon .social-banner {
    background: linear-gradient(135deg, #FF424D, #F96854);
    background-size: 200% 200%;
    animation: gradientMove 5s ease infinite;
}

.social-card.card-patreon:hover {
    border-color: rgba(255, 66, 77, 0.5);
}

.social-card.card-youtube .social-banner {
    background: linear-gradient(135deg, #FF0000, #282828);
    background-size: 200% 200%;
    animation: gradientMove 5s ease infinite;
}

.social-card.card-youtube:hover {
    border-color: rgba(255, 0, 0, 0.5);
}

.social-card.card-instagram .social-banner {
    background: linear-gradient(45deg, #f09433 0%, #e6683c 25%, #dc2743 50%, #cc2366 75%, #bc1888 100%);
    background-size: 200% 200%;
    animation: gradientMove 5s ease infinite;
}

.social-card.card-instagram:hover {
    border-color: rgba(225, 48, 108, 0.5);
}

.social-card.card-tiktok .social-banner {
    background: linear-gradient(135deg, #000000, #25F4EE, #FE2C55);
    background-size: 200% 200%;
    animation: gradientMove 5s ease infinite;
}

.social-card.card-tiktok:hover {
    border-color: rgba(254, 44, 85, 0.5);
}

@keyframes gradientMove {
    0% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }

    100% {
        background-position: 0% 50%;
    }
}

/* Social Card Content - Reuses Video Card Patterns */
.social-card .card-content {
    padding: 1.25rem;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.social-card .card-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
}

.social-platform-tag {
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    display: inline-block;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.tag-patreon {
    color: #FF424D;
    background: rgba(255, 66, 77, 0.1);
}

.tag-youtube {
    color: #FF0000;
    background: rgba(255, 0, 0, 0.1);
}

.tag-instagram {
    color: #E1306C;
    background: rgba(225, 48, 108, 0.1);
}

.tag-tiktok {
    color: #FE2C55;
    background: rgba(254, 44, 85, 0.1);
}

.social-handle {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-main);
    margin: 0 0 0.5rem 0;
    line-height: 1.4;
}

.social-desc {
    font-size: 0.9rem;
    color: var(--text-muted);
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.social-cta {
    margin-top: auto;
    padding-top: 1rem;
    font-size: 0.85rem;
    color: var(--primary);
    font-weight: 600;
}

/* Mobile Adjustments for Social Cards */
@media (max-width: 768px) {
    .socials-container {
        grid-template-columns: 1fr;
        padding: 0 1rem;
    }

    .social-section-grid {
        grid-template-columns: 1fr;
    }

    .social-card.card-patreon {
        grid-column: span 1;
    }
}



@media (max-width: 768px) {
    .controls-section {
        flex-direction: column;
        align-items: stretch;
    }

    .view-toggle {
        justify-content: center;
    }

    .toggle-btn {
        flex: 1;
        justify-content: center;
    }
}


/* --- Icon Wrappers for Section Headers --- */
.icon-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-muted);
}

.icon-patreon {
    color: #FF424D;
    background: rgba(255, 66, 77, 0.1);
}

.icon-youtube {
    color: #FF0000;
    background: rgba(255, 0, 0, 0.1);
}

.icon-instagram {
    color: #E1306C;
    background: rgba(225, 48, 108, 0.1);
}

.icon-tiktok {
    color: #FE2C55;
    background: rgba(254, 44, 85, 0.1);
}