﻿/* Main Layout CSS - 1-3-1 Grid with 1-5 vertical spacing */

:root {
    --primary-color: #1a1a1a;
    --accent-color: #00d4ff;
    --secondary-color: #2a2a2a;
    --text-color: #ffffff;
    --spacing-unit: 16px;
    --horizontal-gap: 1.5%;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    width: 100%;
    height: 100%;
    margin: 0;
    padding: 0;
}

body {
    height: 100%;
    width: 100%;
    overflow: hidden;
    background-color: var(--primary-color);
    background-image: url('../images/matrix-bg.jpg');
    background-size: cover;
    background-position: center top;
    background-attachment: fixed;
    background-repeat: no-repeat;
    color: var(--text-color);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    margin: 0 !important;
    padding: 0 !important;
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(180deg, rgba(0,0,0,0.3) 0%, rgba(0,0,0,0.6) 100%);
    pointer-events: none;
    z-index: 1;
}

.immersive-main {
    width: 100vw;
    height: 100vh;
    display: flex;
    flex-direction: column;
    background-color: rgba(26, 26, 26, 0.4);
    position: fixed;
    top: 0;
    left: 0;
    margin: 0;
    padding: 0;
    z-index: 2;
}

.immersive-container {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    margin: 0;
    padding: 0;
}

/* Top Bar - Fixed */
.immersive-top-bar {
    width: 100%;
    height: 80px;
    background: #0d1117;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 0 var(--spacing-unit);
    position: relative;
    z-index: 100;
    border-bottom: 1px solid rgba(0, 212, 255, 0.12);
    box-shadow:
        inset 0 0 80px rgba(0, 212, 255, 0.04),
        0 0 0 1px rgba(0, 212, 255, 0.05),
        0 2px 8px rgba(0, 0, 0, 0.35);
}

.immersive-top-bar::after {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse 60% 100% at 50% 0%, rgba(0, 212, 255, 0.07) 0%, transparent 70%);
    pointer-events: none;
    z-index: 0;
}

/* Logo Styling */
.immersive-logo-wrapper {
    display: flex;
    align-items: center;
    padding: calc(var(--spacing-unit) * 0.5 - 5px) 0 calc(var(--spacing-unit) * 0.5 - 5px);
    margin: 0;
    position: relative;
    z-index: 1;
}

.immersive-logo-btn {
    background: none;
    border: none;
    padding: 0;
    margin: 0;
    cursor: pointer;
    display: block;
    line-height: 0;
    outline: none;
}

.immersive-logo-btn:focus,
.immersive-logo-btn:focus-visible {
    outline: none;
}

/* Site status bar — top-left of header */
.site-status-bar {
    position: absolute;
    left: calc(var(--horizontal-gap) + (100% - 4 * var(--horizontal-gap)) / 10 - 15px);
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 1px;
    z-index: 2;
    font-size: 10px;
    font-family: 'Courier New', monospace;
    white-space: nowrap;
    pointer-events: none;
}

.site-status-bar .ssb-row {
    display: flex;
    align-items: center;
    gap: 5px;
}

.site-status-bar .ssb-light {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    flex-shrink: 0;
    background: rgba(255,255,255,0.15);
    box-shadow: none;
    transition: background 0.5s, box-shadow 0.5s;
}

.site-status-bar .ssb-light.green {
    background: #3daa5c;
    box-shadow: 0 0 5px rgba(61,170,92,0.7);
}

.site-status-bar .ssb-light.yellow {
    background: #c8a020;
    box-shadow: 0 0 5px rgba(200,160,32,0.7);
}

.site-status-bar .ssb-light.red {
    background: #d04040;
    box-shadow: 0 0 5px rgba(208,64,64,0.7);
}

.site-status-bar .ssb-label {
    font-size: 9px;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.28);
    min-width: 90px;
}

.site-status-bar .ssb-time {
    color: rgba(255, 255, 255, 0.6);
    font-weight: 600;
}

.site-status-bar .ssb-val {
    color: rgba(255, 255, 255, 0.45);
    font-weight: 600;
}

.site-status-bar .ssb-refresh {
    pointer-events: all;
    background: none;
    border: 1px solid rgba(255, 255, 255, 0.13);
    color: rgba(255, 255, 255, 0.35);
    border-radius: 3px;
    padding: 2px 6px;
    font-size: 9px;
    font-family: inherit;
    letter-spacing: 0.4px;
    cursor: pointer;
    line-height: 1.4;
    transition: color 0.2s, border-color 0.2s;
    margin-top: 2px;
}

.site-status-bar .ssb-refresh:hover {
    color: rgba(255, 255, 255, 0.85);
    border-color: rgba(255, 255, 255, 0.4);
}

.site-status-bar .ssb-arrow {
    display: none;
    flex-shrink: 0;
    overflow: visible;
}

.site-status-bar.ssb-stale .ssb-arrow {
    display: block;
}

.ssb-arrow-base {
    fill: none;
    stroke: rgba(0, 212, 255, 0.18);
    stroke-width: 2.5;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.ssb-arrow-glow {
    fill: none;
    stroke: #00d4ff;
    stroke-width: 2.5;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-dasharray: 15 100;
    stroke-dashoffset: 0;
    filter: drop-shadow(0 0 3px rgba(0, 212, 255, 0.9));
    animation: ssb-sweep 2.4s ease-in infinite;
}

@keyframes ssb-sweep {
    from { stroke-dashoffset: 0; }
    to   { stroke-dashoffset: -115; }
}

.immersive-logo {
    max-height: calc(var(--spacing-unit) * 5.5);
    max-width: 1000px;
    width: auto;
    height: auto;
    object-fit: contain;
    display: block;
}

/* Menu Button - hidden */
.menu-button {
    display: none;
}

/* Category Navigation Buttons */
.category-buttons {
    width: 100%;
    display: flex;
    gap: 8px;
    padding: 7px 16px;
    background: rgba(13, 17, 23, 0.95);
    border-bottom: 1px solid rgba(0, 212, 255, 0.10);
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    box-sizing: border-box;
    margin: 0;
    position: relative;
    overflow: hidden;
}

/* Subtle horizontal scan line that drifts across the bar */
.category-buttons::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(
        90deg,
        transparent 0%,
        rgba(0, 212, 255, 0.015) 40%,
        rgba(0, 212, 255, 0.035) 50%,
        rgba(0, 212, 255, 0.015) 60%,
        transparent 100%
    );
    width: 60%;
    left: -60%;
    animation: cat-scan 15s ease-in-out infinite;
    pointer-events: none;
}

@keyframes cat-scan {
    0%   { left: -60%; opacity: 0; }
    8%   { opacity: 1; }
    92%  { opacity: 1; }
    100% { left: 100%; opacity: 0; }
}

.category-btn {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 20px;
    color: rgba(255, 255, 255, 0.55);
    padding: 7px 18px;
    cursor: pointer;
    font-size: 12px;
    letter-spacing: 0.08em;
    font-weight: 500;
    transition: all 0.2s ease;
    white-space: nowrap;
    flex-shrink: 0;
    text-transform: uppercase;
}

.category-btn:hover {
    background: rgba(0, 212, 255, 0.08);
    border-color: rgba(0, 212, 255, 0.3);
    color: rgba(255, 255, 255, 0.9);
    transform: none;
}

.category-btn.active {
    background: rgba(0, 212, 255, 0.12);
    border-color: rgba(0, 212, 255, 0.45);
    color: #00d4ff;
    box-shadow: 0 0 12px rgba(0, 212, 255, 0.15), inset 0 1px 0 rgba(0, 212, 255, 0.1);
}

/* Main Grid - 1-3-1 spacing */
.immersive-grid {
    flex: 1;
    display: grid;
    grid-template-columns: 1fr 3fr 1fr;
    gap: var(--horizontal-gap);
    padding: calc(var(--spacing-unit) * 1) var(--horizontal-gap);
    overflow: hidden;
}

.immersive-sidebar {
    background-color: transparent;
    overflow: hidden;
    height: 100%;
}

.immersive-sidebar-left {
    grid-column: 1;
    display: flex;
    flex-direction: column;
    gap: 12px;
    overflow-y: auto;
    padding-top: 4px;
}

.immersive-center-module {
    grid-column: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #0d1117;
    border: 1px solid rgba(0, 212, 255, 0.12);
    border-radius: 8px;
    padding: 1px var(--spacing-unit) 7px;
    overflow-y: auto;
    box-shadow:
        inset 0 0 80px rgba(0, 212, 255, 0.04),
        0 0 0 1px rgba(0, 212, 255, 0.05),
        0 16px 64px rgba(0, 0, 0, 0.8);
    position: relative;
}

.immersive-center-module::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 8px;
    background: radial-gradient(ellipse 80% 30% at 50% 0%, rgba(0, 212, 255, 0.07) 0%, transparent 70%);
    pointer-events: none;
    z-index: 0;
}

.immersive-center-module-content {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    flex-direction: column;
    position: relative;
    z-index: 1;
}

.immersive-sidebar-right {
    grid-column: 3;
    overflow-y: auto;
    padding-top: 4px;
}

/* Music Player Styling */
.music-player {
    background-color: rgba(0, 212, 255, 0.05);
    border: 1px solid rgba(0, 212, 255, 0.2);
    border-radius: 4px;
    padding: var(--spacing-unit);
    margin-bottom: calc(var(--spacing-unit) * 2);
}

.music-player-title {
    font-size: 14px;
    font-weight: bold;
    margin-bottom: 12px;
    color: var(--accent-color);
}

.music-player-controls {
    display: flex;
    gap: 10px;
    margin-bottom: 12px;
}

.music-player-button {
    background-color: var(--accent-color);
    border: none;
    color: var(--primary-color);
    padding: 8px 12px;
    border-radius: 3px;
    cursor: pointer;
    font-size: 12px;
    font-weight: bold;
    transition: all 0.3s ease;
}

.music-player-button:hover {
    background-color: rgba(0, 212, 255, 0.8);
    transform: scale(1.05);
}

.music-player-progress {
    width: 100%;
    height: 4px;
    background-color: rgba(0, 212, 255, 0.2);
    border-radius: 2px;
    overflow: hidden;
    margin-bottom: 10px;
}

.music-player-progress-bar {
    height: 100%;
    background-color: var(--accent-color);
    width: 0%;
    transition: width 0.3s linear;
}

.music-player-info {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.7);
}

/* ============================================================ */
/* FEATURED CAROUSEL STYLING */
/* ============================================================ */

.featured-carousel-container {
    width: 100%;
    height: 265px;
    max-height: 265px;
    display: flex;
    flex-direction: column;
    background-color: rgba(42, 42, 42, 0.6);
    border: 1px solid rgba(0, 212, 255, 0.3);
    border-radius: 4px;
    overflow: hidden;
    position: relative;
    flex-shrink: 0;
}

.featured-carousel-slides {
    flex: 1;
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: stretch;
    width: 100%;
}

.carousel-slide {
    position: absolute;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    opacity: 0;
    transition: opacity 0.6s ease-in-out;
    pointer-events: none;
}

.carousel-slide.active {
    opacity: 1;
    pointer-events: auto;
    position: relative;
}

/* Video Thumbnail in Carousel */
.carousel-thumbnail {
    flex: 1;
    position: relative;
    width: 100%;
    overflow: hidden;
    background-color: #000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.carousel-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
}

.carousel-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.carousel-slide:hover .carousel-overlay {
    opacity: 1;
}

.play-button {
    font-size: 48px;
    color: var(--accent-color);
    text-shadow: 0 0 10px rgba(0, 212, 255, 0.8);
    animation: pulse-play 1.5s ease-in-out infinite;
}

@keyframes pulse-play {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.15); opacity: 0.8; }
}

/* Video Info in Carousel */
.carousel-info {
    padding: calc(var(--spacing-unit) * 0.75);
    background: linear-gradient(180deg, rgba(0, 0, 0, 0.5) 0%, rgba(0, 0, 0, 0.8) 100%);
    flex-shrink: 0;
}

.carousel-category {
    font-size: 11px;
    font-weight: bold;
    color: var(--accent-color);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 4px;
}

.carousel-title {
    font-size: 13px;
    font-weight: 600;
    color: #ffffff;
    line-height: 1.3;
    margin-bottom: 6px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.carousel-meta {
    display: flex;
    flex-direction: column;
    gap: 3px;
    font-size: 10px;
    color: rgba(255, 255, 255, 0.7);
}

.meta-channel {
    font-weight: 500;
    color: rgba(0, 212, 255, 0.8);
}

.meta-views {
    color: rgba(255, 255, 255, 0.5);
}

/* Navigation Dots */
.carousel-dots {
    display: flex;
    justify-content: center;
    gap: 8px;
    padding: 10px 8px;
    background-color: rgba(0, 0, 0, 0.4);
    flex-shrink: 0;
}

.dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.3);
    cursor: pointer;
    transition: all 0.3s ease;
    border: 1px solid rgba(0, 212, 255, 0.5);
}

.dot:hover {
    background-color: rgba(0, 212, 255, 0.6);
    transform: scale(1.2);
}

.dot.active {
    background-color: var(--accent-color);
    box-shadow: 0 0 8px rgba(0, 212, 255, 0.8);
}

/* Timer Bar */
.carousel-timer {
    height: 2px;
    background-color: rgba(0, 0, 0, 0.3);
    overflow: hidden;
    flex-shrink: 0;
}

.timer-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--accent-color), rgba(0, 212, 255, 0.3));
    width: 0%;
    animation: fill-timer 15s linear forwards;
}

@keyframes fill-timer {
    0% { width: 0%; }
    100% { width: 100%; }
}

.featured-carousel-container:hover .carousel-slide {
    cursor: pointer;
}

.featured-carousel-empty {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    color: rgba(255, 255, 255, 0.5);
    font-size: 14px;
}

/* Mobile Menu */
.mobile-menu {
    position: fixed;
    top: 90px;
    right: -250px;
    width: 250px;
    height: calc(100vh - 90px);
    background-color: var(--secondary-color);
    border-left: 1px solid rgba(0, 212, 255, 0.2);
    transition: right 0.3s ease;
    z-index: 101;
    overflow-y: auto;
    padding: var(--spacing-unit);
}

.mobile-menu.active {
    right: 0;
}

.mobile-menu-item {
    padding: 12px 0;
    border-bottom: 1px solid rgba(0, 212, 255, 0.1);
    cursor: pointer;
    transition: all 0.3s ease;
}

.mobile-menu-item:hover {
    color: var(--accent-color);
    padding-left: 10px;
}

/* ============================================================ */
/* ============================================================ */
/* FLOATING VIDEO PLAYER OVERLAY */
/* ============================================================ */

.video-player-overlay {
    position: fixed;
    background: #000;
    z-index: 9999;
    display: none;
    flex-direction: column;
    border: 2px solid var(--accent-color);
    border-radius: 6px;
    box-shadow: 0 0 60px rgba(0, 212, 255, 0.6), 0 8px 32px rgba(0,0,0,0.8);
    overflow: hidden;
}

.vpo-embed {
    position: relative;
    width: 100%;
    height: 100%;
}

.vpo-embed iframe {
    position: absolute;
    inset: 0;
    width: 100% !important;
    height: 100% !important;
    border: none;
    display: block;
}

.vpo-close {
    position: absolute;
    top: 6px;
    right: 6px;
    width: 26px;
    height: 26px;
    background: rgba(0, 0, 0, 0.85);
    border: 1px solid var(--accent-color);
    border-radius: 50%;
    color: #fff;
    font-size: 13px;
    line-height: 1;
    cursor: pointer;
    z-index: 201;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    transition: background 0.2s ease;
}

.vpo-close:hover {
    background: rgba(0, 212, 255, 0.3);
}

/* VIDEO GRID & ITEMS STYLING */
/* ============================================================ */

.video-timeline {
    display: flex;
    flex-direction: column;
    height: 100%;
    gap: 0;
    padding: 2px 4px 0 4px;
    overflow: hidden;
    position: relative;
}

/* Compass Calendar and Keywords - Minimize */
.compass-calendar-container {
    flex-shrink: 0;
    overflow: visible;
    margin-bottom: 0;
}

.trending-keywords-section {
    flex-shrink: 0;
    max-height: 18px;
    overflow: hidden;
    margin-bottom: 2px;
}

.video-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    grid-template-rows: repeat(3, 1fr);
    grid-auto-rows: 0;
    grid-auto-flow: dense;
    align-content: start;
    gap: 8px;
    overflow: hidden;
    flex: 1;
    min-height: 0;
    max-height: 100%;
    transition: opacity 0.3s ease, background-color 0.3s ease;
    position: relative;
}

.video-grid::-webkit-scrollbar {
    width: 8px;
}

.video-grid::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
}

.video-grid::-webkit-scrollbar-thumb {
    background: var(--accent-color);
    border-radius: 4px;
}

.video-grid::-webkit-scrollbar-thumb:hover {
    background: lighten(var(--accent-color), 20%);
}

/* Video Item Card */
.video-item {
    display: flex;
    flex-direction: column;
    background-color: #0d1117;
    border: 1px solid rgba(0, 212, 255, 0.45);
    border-radius: 5px;
    box-shadow: inset 0 1px 0 rgba(0, 212, 255, 0.15);
    overflow: hidden;
    cursor: pointer;
    transition: border-color 0.2s ease, opacity 0.3s ease, box-shadow 0.2s ease, transform 0.2s ease;
    text-decoration: none;
    color: inherit;
    position: relative;
    min-height: 90px;
}

.video-item:hover {
    border-color: rgba(0, 212, 255, 0.6);
    box-shadow: 0 0 20px rgba(0, 212, 255, 0.2), inset 0 1px 0 rgba(0, 212, 255, 0.15);
    transform: translateY(-2px);
}

.video-item.highlighted {
    border-color: var(--accent-color);
    box-shadow: 0 0 30px rgba(0, 212, 255, 0.5);
    background-color: rgba(0, 212, 255, 0.1);
}

.video-item.expanded {
    grid-column: span 3;
    grid-row: span 2;
    height: 100%;
    max-height: none;
    min-height: 0;
    position: relative;
    z-index: 50;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    pointer-events: none; /* prevent <a> from intercepting iframe taps */
}

.video-item.expanded .video-embed,
.video-item.expanded .video-embed iframe,
.video-item.expanded .video-close-btn,
.video-item.expanded .video-open-youtube-link {
    pointer-events: auto;
}



/* Video Thumbnail */
.video-thumbnail {
    position: relative;
    width: 100%;
    flex: 1;
    background-color: #000;
    overflow: hidden;
    min-height: 0;
}

.video-thumbnail img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.video-play-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.25s ease;
    z-index: 10;
    pointer-events: none;
}

.video-item:hover .video-play-overlay {
    opacity: 1;
}

.video-play-overlay svg {
    width: 28px;
    height: 28px;
}

/* Video Embed (YouTube Player) */
.video-embed {
    display: none;
    width: 100%;
    height: 100%;
    background-color: #000;
}

.video-item.expanded .video-thumbnail {
    display: none;
}

.video-item.expanded .video-embed {
    display: flex;
    position: relative;
    width: 100%;
    flex: 1;
    background-color: #000;
    z-index: 51;
}

.video-item.expanded .video-embed iframe {
    width: 100% !important;
    height: 100% !important;
    flex: 1;
    border: none;
    display: block;
}

#yt-player-container,
[id^="yt-player-"] {
    width: 100%;
    height: 100%;
}

/* Video Info */
.video-info {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 20px 6px 5px 6px;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    background: linear-gradient(to bottom, transparent 0%, rgba(0,0,0,0.85) 100%);
    z-index: 10;
    pointer-events: none;
}

.video-item.expanded .video-info {
    display: none;
}

.video-title {
    font-size: 12px;
    font-weight: 600;
    margin-bottom: 2px;
    line-height: 1.2;
    color: var(--text-color);
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.video-channel {
    font-size: 8px;
    color: var(--accent-color);
    margin-bottom: 1px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    display: none;
}

.video-meta {
    font-size: 7px;
    color: #888;
    display: none;
}

/* Close Button */
.video-close-btn {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 30px;
    height: 30px;
    background-color: rgba(0, 0, 0, 0.7);
    border: 1px solid var(--accent-color);
    border-radius: 50%;
    color: var(--accent-color);
    font-size: 18px;
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 52;
    padding: 0;
    line-height: 1;
    display: none;
    align-items: center;
    justify-content: center;
}}

.video-item.expanded .video-close-btn {
    display: flex;
}

.video-close-btn:hover {
    background-color: var(--accent-color);
    color: var(--primary-color);
}

/* Pagination */
.video-pagination {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding: 7px 10px;
    background: transparent;
    position: relative;
    overflow: hidden;
}

.video-pagination::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 1px;
    background: linear-gradient(90deg, rgba(0,212,255,0.55) 0%, transparent 38%, transparent 62%, rgba(0,212,255,0.55) 100%);
}

.video-pagination-bg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.pagination-btn {
    background-color: transparent;
    border: 1px solid var(--accent-color);
    color: var(--accent-color);
    padding: 3px 10px;
    border-radius: 0;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 11px;
}

.pagination-prev {
    border-radius: 3px 0 0 3px;
}

.pagination-next {
    border-radius: 0 3px 3px 0;
    border-left: none;
    margin-left: -1px;
}

.pagination-btn:hover:not(:disabled) {
    color: #fff;
    text-shadow: 0 0 8px var(--accent-color), 0 0 16px var(--accent-color);
}

.pagination-btn:focus {
    outline: none;
}

.pagination-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}



/* Mobile Video Expanded Container */
.mobile-video-expanded {
    display: none;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 92vw;
    background-color: var(--secondary-color);
    z-index: 200;
    border-radius: 8px;
    border: 1px solid rgba(0, 212, 255, 0.5);
    box-shadow: 0 0 40px rgba(0, 212, 255, 0.3), 0 8px 32px rgba(0,0,0,0.9);
    overflow: hidden;
    flex-direction: column;
}

.mobile-video-close-bar {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    padding: 6px 10px;
    background-color: var(--secondary-color);
    border-bottom: 1px solid rgba(0, 212, 255, 0.2);
    flex-shrink: 0;
}

.video-item.expanded-mobile-trigger ~ .mobile-video-expanded,
.video-timeline .mobile-video-expanded {
    display: flex;
    flex-direction: column;
}

.mobile-video-embed {
    width: 100%;
    aspect-ratio: 16 / 9;
    background-color: #000;
    position: relative;
    flex-shrink: 0;
}

.mobile-video-embed iframe {
    width: 100% !important;
    height: 100% !important;
    border: none;
}

.mobile-video-close-btn {
    display: flex;
    position: static;
    width: 32px;
    height: 32px;
    z-index: 210;
}

/* Responsive - keep side panels visible on tablet */
@media (max-width: 1024px) {
    .immersive-top-bar {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        z-index: 100;
    }

    #site-status-bar {
        display: none;
    }

    .immersive-container {
        padding-top: 90px;
    }

    .video-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
        grid-auto-flow: dense;
    }

    .video-item.expanded {
        grid-column: span 3;
        grid-row: span 2;
        height: 260px;
        min-height: 260px;
        max-height: 260px;
    }

    .immersive-grid {
        grid-template-columns: 1fr;
        grid-auto-rows: min-content;
        align-content: start;
        overflow-y: auto;
        gap: 10px;
        padding: 8px 10px;
    }

    .immersive-sidebar-left {
        display: flex;
        grid-column: 1;
        grid-row: 2;
    }

    .immersive-center-module {
        grid-column: 1;
        grid-row: 1;
        min-height: 60vh;
    }

    .immersive-sidebar-right {
        display: block;
        grid-column: 1;
        grid-row: 3;
        max-height: 100%;
        overflow-y: auto;
        padding-bottom: 0;
    }

    .category-buttons {
        gap: 6px;
        padding: 8px 10px;
    }

    .category-btn {
        padding: 5px 10px;
        font-size: 11px;
        border-width: 1px;
    }

    .video-title {
        font-size: 12px;
        -webkit-line-clamp: 2;
        white-space: normal;
    }
}

/* Keep video titles readable at known problematic widths */
@media (max-width: 715px) and (min-width: 591px) {
    .video-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .video-item {
        min-height: 158px;
    }

    .video-thumbnail {
        min-height: 88px;
    }

    .video-info {
        padding: 6px;
    }

    .video-title {
        font-size: 11px;
        line-height: 1.25;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
        white-space: normal;
        word-break: break-word;
    }
}

@media (max-width: 590px) and (min-width: 501px) {
    .video-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .video-item {
        min-height: 168px;
    }

    .video-thumbnail {
        min-height: 92px;
    }

    .video-info {
        padding: 7px;
    }

    .video-title {
        font-size: 12px;
        line-height: 1.3;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
        white-space: normal;
        word-break: break-word;
    }
}

@media (max-width: 500px) {
    .video-grid {
        grid-template-columns: repeat(1, minmax(0, 1fr));
    }

    .video-item {
        min-height: 188px;
    }

    .video-thumbnail {
        min-height: 108px;
    }

    .video-info {
        padding: 8px;
    }

    .video-title {
        font-size: 13px;
        line-height: 1.3;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
        white-space: normal;
        word-break: break-word;
    }
}

/* Scrollbar styling */
.immersive-center-module::-webkit-scrollbar {
    width: 6px;
}

.immersive-center-module::-webkit-scrollbar-track {
    background: transparent;
}

.immersive-center-module::-webkit-scrollbar-thumb {
    background: rgba(0, 212, 255, 0.3);
    border-radius: 3px;
}

.immersive-center-module::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 212, 255, 0.5);
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.immersive-main {
    animation: fadeIn 0.3s ease;
}

/* Keep main-page category grids visually uniform across all categories. */
.video-timeline #video-grid {
    grid-template-rows: repeat(3, 1fr);
    grid-auto-rows: 0;
    align-content: start;
}

.video-timeline #video-grid .video-item {
    height: 100%;
    min-height: 0;
}

.video-timeline #video-grid .video-item.expanded {
    height: 100%;
    min-height: 0;
    max-height: none;
}

/* Mobile: let all videos stack and scroll freely */
@media (max-width: 1024px) {
    .video-timeline {
        overflow-y: auto;
        height: auto;
        max-height: none;
    }

    .video-timeline #video-grid {
        grid-template-rows: none;
        grid-auto-rows: auto;
        height: auto;
        overflow: visible;
    }

    .video-timeline #video-grid .video-item {
        height: auto;
        min-height: 160px;
    }

    .immersive-center-module {
        overflow-y: auto;
        height: auto;
        max-height: none;
    }
}

/* ============================================================ */
/* LASER DOT ANIMATION */
/* ============================================================ */

/* The dot element itself */
.laser-dot {
    position: absolute;
    width: 5px;
    height: 5px;
    border-radius: 50%;
    pointer-events: none;
    z-index: 100;
    will-change: transform, top, left;
    opacity: 1;
    transition: opacity 0.6s ease;
}

/* Glow trail behind the dot */
.laser-dot::after {
    content: '';
    position: absolute;
    inset: -3px;
    border-radius: 50%;
    opacity: 0.35;
    filter: blur(4px);
    background: inherit;
}

/* Blue dot only */
.laser-dot-0 { background: #00d4ff; box-shadow: 0 0 6px 2px #00d4ff, 0 0 14px 3px rgba(0,212,255,0.45); }

/* =========================================================================
   Main Thread Analyzer — right sidebar panel
   ========================================================================= */

.thread-analyzer {
    background-color: rgba(0, 212, 255, 0.05);
    border: 1px solid rgba(0, 212, 255, 0.2);
    border-radius: 4px;
    padding: 12px 14px;
    margin-bottom: 16px;
    font-size: 13px;
    color: #ccc;
}

.ta-header {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    margin-bottom: 10px;
    border-bottom: 1px solid rgba(0, 212, 255, 0.15);
    padding-bottom: 8px;
}

.ta-title {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.12em;
    color: #00d4ff;
    text-transform: uppercase;
}

.ta-meta {
    font-size: 10px;
    color: rgba(0, 212, 255, 0.5);
}

/* Numbered hot topics list — CSS counter badges */
.ta-hot-list {
    list-style: none;
    margin: 0 0 10px 0;
    padding: 0;
    counter-reset: ta-hot;
}

.ta-hot-list li {
    counter-increment: ta-hot;
    display: flex;
    align-items: flex-start;
    gap: 8px;
    padding: 5px 0;
    line-height: 1.4;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.ta-hot-list li:last-child {
    border-bottom: none;
}

.ta-hot-list li::before {
    content: counter(ta-hot);
    flex-shrink: 0;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #00d4ff;
    color: #0a0a0a;
    font-size: 10px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: 1px;
}

.ta-placeholder {
    color: rgba(255, 255, 255, 0.3);
    font-style: italic;
}

.ta-divider {
    height: 1px;
    background: rgba(0, 212, 255, 0.15);
    margin: 8px 0;
}

/* Developing topics list */
.ta-developing-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.ta-developing-list li {
    display: flex;
    align-items: flex-start;
    gap: 7px;
    padding: 5px 0;
    line-height: 1.4;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.ta-developing-list li:last-child {
    border-bottom: none;
}

.ta-badge {
    flex-shrink: 0;
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 0.08em;
    color: #0a0a0a;
    background: #ff9500;
    border-radius: 3px;
    padding: 2px 5px;
    margin-top: 2px;
    text-transform: uppercase;
}

/* ============================================================ */
/* ANALYSIS OPEN — Full-width expansion with decorative edges   */
/* ============================================================ */

body.analysis-open .immersive-grid {
    grid-template-columns: 52px 1fr 52px;
    gap: 4px;
    padding-left: 4px;
    padding-right: 4px;
}

body.analysis-open .immersive-sidebar {
    overflow: hidden;
    padding: 0;
    gap: 0;
    position: relative;
}

body.analysis-open .immersive-sidebar > * {
    display: none !important;
}

/* Left edge: glow from right side into center */
body.analysis-open .immersive-sidebar-left::after,
body.analysis-open .immersive-sidebar-right::after {
    content: '';
    position: absolute;
    inset: 0;
    pointer-events: none;
}

body.analysis-open .immersive-sidebar-left::after {
    background: linear-gradient(
        to right,
        rgba(0, 0, 0, 0.2) 0%,
        rgba(0, 212, 255, 0.04) 60%,
        rgba(0, 212, 255, 0.12) 100%
    );
    border-right: 1px solid rgba(0, 212, 255, 0.24);
    box-shadow: inset -10px 0 28px rgba(0, 212, 255, 0.07);
}

/* Right edge: mirror of left */
body.analysis-open .immersive-sidebar-right::after {
    background: linear-gradient(
        to left,
        rgba(0, 0, 0, 0.2) 0%,
        rgba(0, 212, 255, 0.04) 60%,
        rgba(0, 212, 255, 0.12) 100%
    );
    border-left: 1px solid rgba(0, 212, 255, 0.24);
    box-shadow: inset 10px 0 28px rgba(0, 212, 255, 0.07);
}

/* Center module: square off the edges so it meets the decorative strips */
body.analysis-open .immersive-center-module {
    border-radius: 4px;
    border-color: transparent;
    padding: 0;
}

/* On mobile: no edge strips, analysis stays full column */
@media (max-width: 1024px) {
    body.analysis-open .immersive-grid {
        grid-template-columns: 1fr;
        padding-left: var(--horizontal-gap);
        padding-right: var(--horizontal-gap);
        gap: var(--horizontal-gap);
    }

    body.analysis-open .immersive-sidebar > * {
        display: revert !important;
    }

    body.analysis-open .immersive-sidebar-left::after,
    body.analysis-open .immersive-sidebar-right::after {
        display: none;
    }

    body.analysis-open .immersive-center-module {
        padding-left: var(--spacing-unit);
        padding-right: var(--spacing-unit);
        padding-top: 1px;
        padding-bottom: 2px;
        border-radius: 8px;
        border-color: rgba(0, 212, 255, 0.12);
    }
}




