/*
Theme Name: Tube XV
Theme URI: 
Author: Prof
Author URI: 
Description: A high-performance video theme with the iconic red and black aesthetic. Optimized for speed and premium feel.
Version: 1.25.09
Requires at least: 6.4
Tested up to: 6.7
Requires PHP: 8.4
Text Domain: TubeXV

--------------------------------------------------------------
TABLE OF CONTENTS:
1.  Variables & Configuration
2.  Reset & Base Typography
3.  Layout Structure (Body, Page, Container)
4.  Header & Navigation
5.  Video Cards & Grid System
6.  Single Video Page
7.  Sidebar & Widgets
8.  Footer & App Bar
9.  Mobile Optimization
--------------------------------------------------------------
*/

/* ==========================================================================
   1. Variables & Configuration
   ========================================================================== */
:root {
    /* -- Palette: Red & Black Scheme (XV Style) ----------------- */
    --bg-body: #050505;
    --bg-header: rgba(18, 18, 18, 0.85); /* Slightly darker for glass */
    --bg-card: #111111;
    --bg-menu: #111111;

    /* -- Typography Colors ------------------------------------ */
    --text-main: #ffffff;
    --text-muted: #9a9a9a;

    /* -- Brand Colors ----------------------------------------- */
    --primary: #fb0101;
    --primary-rgb: 251, 1, 1;
    --primary-hover: #ba1111;
    --text-on-primary: #ffffff;
    --success: #10b981;
    --error: #ef4444;

    /* -- UI Surfaces ------------------------------------------ */
    --surface: var(--bg-card);
    --surface-hover: rgba(var(--primary-rgb), 0.1);
    --border-color: rgba(255, 255, 255, 0.06);
    --border-hover: rgba(var(--primary-rgb), 0.35);
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 20px 40px -12px rgba(0, 0, 0, 0.6);
    --shadow-glow: 0 0 20px rgba(var(--primary-rgb), 0.2);
    --glow-soft: 0 0 24px rgba(var(--primary-rgb), 0.12);
    --glow-strong: 0 0 40px rgba(var(--primary-rgb), 0.25);

    /* -- Typography: SYSTEM ONLY (CORE RULE) ----------------- */
    --font-main: -apple-system, BlinkMacSystemFont, "Inter", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;

    /* -- Layout Dimensions ------------------------------------ */
    --header-height: 70px;
    --header-height-scrolled: 60px;
    --gap: 18px;
    --radius: 14px;
    --radius-lg: 18px;

    /* -- Grid System Configuration ---------------------------- */
    --grid-cols-mobile: 1;
    --grid-cols-tablet: 2;
    --grid-cols-laptop: 3;
    --grid-cols-desktop: 4;
    --grid-cols-wide: 5;
}

/* ==========================================================================
   2. Reset & Utilities
   ========================================================================== */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    background-color: var(--bg-body) !important;
    scroll-behavior: smooth;
    --grid-cols-wide: 5;
    /* Override for ultra-wide screens */
}

/* ==========================================================================
   Ambient Background (Liquid Neon 2026)
   ========================================================================== */
body::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: -1;
    background:
        radial-gradient(ellipse 80% 50% at 20% 40%, rgba(var(--primary-rgb), 0.035) 0%, transparent 55%),
        radial-gradient(ellipse 60% 40% at 80% 60%, rgba(var(--primary-rgb), 0.025) 0%, transparent 50%);
    pointer-events: none;
    animation: ambientShift 20s ease-in-out infinite alternate;
}

@keyframes ambientShift {
    0% {
        transform: translateX(0) scale(1);
        opacity: 1;
    }
    100% {
        transform: translateX(-30px) scale(1.05);
        opacity: 0.85;
    }
}

/* ==========================================================================
   3. Layout Structure (Body, Page, Container)
   ========================================================================== */
/* 
 * Body Layout & Spacing 
 * CRITICAL: The padding-top must account for the fixed header + gap.
 * Formula: header-height (70px) + desired-gap (5px) = 75px
 */
body {
    margin: 0;
    font-family: var(--font-main);
    background-color: var(--bg-body);
    color: var(--text-main);
    line-height: 1.5;
    padding-top: 75px !important;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    display: block;
    min-height: 100vh;
    letter-spacing: -0.01em;
}

body.menu-open {
    overflow: hidden !important;
}

#page {
    display: block;
}

html.age-gate-active body {
    overflow: hidden !important;
}

/* Force all WP block/content text to be light on dark for readability */
body,
.entry-content,
.wp-block-post-content {
    color: var(--text-main) !important;
}

h1,
h2,
h3,
h4,
h5,
h6 {
    color: var(--text-main) !important;
}

.has-black-off-background-color,
.has-background-off-black {
    background-color: var(--bg-card) !important;
}

.has-black-pure-background-color,
.has-background-pure-black {
    background-color: var(--bg-body) !important;
}

.has-red-xv-background-color,
.has-background-red-xv {
    background-color: var(--primary) !important;
    color: var(--text-on-primary) !important;
}

/* Base Layout & Reset Handled Above */


/* Player Wrapper - transparent, no interference */
.player-wrapper {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    padding: 0 !important;
    margin-bottom: 20px;
    overflow: hidden;
}

.video-container {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    overflow: hidden;
    position: relative;
    width: 100%;
    aspect-ratio: 16/9;
}

.video-container iframe,
.video-container video,
.video-container embed,
.video-container object,
.video-container .wps-player,
.video-container .wp-video {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    max-width: 100%;
    border: none !important;
}

iframe {
    border: none !important;
}

a {
    color: inherit;
    text-decoration: none;
    transition: color 0.2s;
}

a:hover {
    color: var(--primary);
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

ul {
    list-style: none;
}

/* A11Y */
.screen-reader-text {
    border: 0;
    clip: rect(1px, 1px, 1px, 1px);
    clip-path: inset(50%);
    height: 1px;
    margin: -1px;
    overflow: hidden;
    padding: 0;
    position: absolute;
    width: 1px;
    word-wrap: normal !important;
}

.skip-link:focus,
.screen-reader-text:focus {
    background-color: #fff;
    color: #000;
    border-radius: 3px;
    box-shadow: 0 0 2px 2px rgba(0, 0, 0, 0.6);
    clip: auto !important;
    clip-path: none;
    display: block;
    font-size: 1rem;
    font-weight: bold;
    height: auto;
    left: 5px;
    line-height: normal;
    padding: 15px 23px 14px;
    text-decoration: none;
    top: 5px;
    width: auto;
    z-index: 100000;
    outline: 2px solid var(--primary);
}

.container {
    max-width: 1600px;
    /* Wide default */
    margin: 0 auto;
    padding: 0 20px;
    width: 100%;
}

.site-main {
    padding: 20px 0;
    margin-top: 0 !important;
}

/* ==========================================================================
   4. Header & Navigation
   ========================================================================== */
/* 
 * Fixed Header Configuration
 * The header is fixed to the top. The body padding defined in Section 3 
 * compensates for this height to preventing content hiding.
 */
.site-header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: var(--header-height);
    background: var(--bg-header);
    z-index: 1000;
    border-bottom: 1px solid var(--border-color);
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.5), 0 1px 0 rgba(var(--primary-rgb), 0.08);
    transition: height 0.3s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 var(--gap);
    gap: 20px;
}

.site-header::after {
    content: "";
    position: absolute;
    bottom: -1px;
    left: 0;
    width: 100%;
    height: 1px;
    background: linear-gradient(90deg, transparent 0%, rgba(var(--primary-rgb), 0.3) 50%, transparent 100%);
    opacity: 0.6;
    pointer-events: none;
}

.site-header.scrolled {
    height: var(--header-height-scrolled);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.6), 0 1px 0 rgba(var(--primary-rgb), 0.12);
}

/* Scroll Progress Bar */
.scroll-progress-container {
    position: absolute;
    bottom: -1px;
    left: 0;
    width: 100%;
    height: 3px;
    background: transparent;
    z-index: 1001;
}

.scroll-progress-bar {
    height: 100%;
    width: 0%;
    background: linear-gradient(to right, transparent, var(--primary));
    box-shadow: 0 0 12px rgba(var(--primary-rgb), 0.6);
    transition: width 0.1s ease;
}

/* Admin Bar Compatibility - Unified */
body.admin-bar {
    padding-top: 121px !important;
    /* 75 + 46 (mobile admin bar) */
}

body.admin-bar .site-header {
    top: 46px;
    /* Header moves down */
}

@media screen and (min-width: 783px) {
    body.admin-bar {
        padding-top: 107px !important;
        /* 75 + 32 (desktop admin bar) */
    }

    body.admin-bar .site-header {
        top: 32px;
    }
}


.header-left {
    flex-shrink: 1;
    min-width: 0;
}

.site-header .header-search {
    flex-grow: 1;
    max-width: 600px;
    display: none;
    justify-content: center;
}

.header-right {
    flex-shrink: 0;
    display: flex;
    align-items: center;
}

/* Logo Fixes */
.custom-logo {
    max-height: 50px;
    width: auto;
    height: auto;
    max-width: 100%;
    display: block;
}

.site-title a {
    color: var(--text-main);
    text-decoration: none;
    font-size: 1.5rem;
    font-weight: bold;
}

/* Nav Menu */
.main-navigation ul {
    display: flex;
    gap: 15px;
    margin: 0;
    padding: 0;
    list-style: none;
    align-items: center;
}

.main-navigation a {
    color: var(--text-muted);
    font-weight: 500;
    font-size: 0.95rem;
    padding: 8px 12px;
    border-radius: 99px;
    transition: all 0.2s;
    white-space: nowrap;
}

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

/* Header Right Elements */
.header-right {
    display: flex;
    align-items: center;
    gap: 15px;
}

/* Desktop Menu */
.desktop-nav {
    display: none;
}

@media (min-width: 1024px) {
    .desktop-nav {
        display: block;
    }

    .desktop-menu-list {
        display: flex;
        gap: 8px;
        list-style: none;
        margin: 0;
        padding: 0;
    }

    .desktop-menu-list li a {
        display: inline-flex;
        align-items: center;
        padding: 6px 14px;
        border-radius: 99px;
        font-size: 0.85rem;
        font-weight: 500;
        background: var(--bg-card);
        border: 1px solid var(--border-color);
        color: var(--text-muted);
        transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        text-decoration: none !important;
        white-space: nowrap;
        gap: 8px;
    }

    .desktop-menu-list li a svg {
        flex-shrink: 0;
        transition: transform 0.3s ease;
    }

    .desktop-menu-list li a:hover {
        background: rgba(var(--primary-rgb), 0.1);
        border-color: rgba(var(--primary-rgb), 0.45) !important;
        color: var(--primary);
        transform: translateY(-1px);
        box-shadow: var(--glow-soft);
    }

    .desktop-menu-list li a:hover svg {
        transform: scale(1.1) rotate(-5deg);
    }

    .desktop-menu-list li.current-menu-item a {
        background: var(--primary);
        border-color: var(--primary) !important;
        color: var(--text-on-primary) !important;
        box-shadow: 0 4px 16px rgba(var(--primary-rgb), 0.35);
    }
}

/* Mobile Toggles */
.mobile-search-toggle,
.burger-btn {
    background: none;
    border: none;
    color: var(--text-main);
    cursor: pointer;
    padding: 5px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.mobile-search-toggle {
    display: flex;
}

.burger-btn {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.burger-btn:hover {
    color: var(--primary) !important;
    transform: scale(1.1);
}

/* .tube-bar is deprecated, replaced by SVG */

@media (min-width: 600px) {
    .site-header .header-search {
        display: flex;
        /* Show search bar on tablet/desktop */
    }

    .mobile-search-toggle {
        display: none;
        /* Hide toggle when search bar is visible */
    }
}

/* Hide burger on desktop; hide mobile search overlay on desktop/tablet */
@media (min-width: 600px) {
    .burger-btn {
        display: none;
    }

    .mobile-search-overlay {
        display: none !important;
    }
}

/* Mobile Search Overlay */
.mobile-search-overlay {
    position: fixed;
    top: 70px;
    /* Below fixed header */
    left: 0;
    width: 100%;
    background: var(--bg-header);
    padding: 20px;
    box-shadow: var(--shadow-md);
    z-index: 998;
    transform: translateY(-150%);
    visibility: hidden;
    transition: transform 0.3s ease-in-out, visibility 0.3s ease-in-out;
    border-bottom: 1px solid var(--border-color);
}

/* Adjust overlay top for admin bar */
body.admin-bar .mobile-search-overlay {
    top: 116px;
    /* 70px + 46px */
}

@media screen and (min-width: 783px) {
    body.admin-bar .mobile-search-overlay {
        top: 102px;
        /* 70px + 32px */
    }
}

.mobile-search-overlay.active {
    transform: translateY(0);
    visibility: visible;
}

.mobile-search-overlay .search-form {
    max-width: 100%;
}

/* Slide Menu (Mobile) */
.slide-menu {
    position: fixed;
    top: 0;
    right: -280px;
    /* Hidden off-screen right */
    width: 280px;
    height: 100vh;
    background: var(--bg-menu);
    z-index: 1100;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: -8px 0 32px rgba(0, 0, 0, 0.6);
    display: flex;
    flex-direction: column;
    padding-top: 0;
    border-left: 1px solid var(--border-color);
}

/* Adjust slide-menu for admin bar */
body.admin-bar .slide-menu {
    top: 46px;
    height: calc(100vh - 46px);
}

@media screen and (min-width: 783px) {
    body.admin-bar .slide-menu {
        top: 32px;
        height: calc(100vh - 32px);
    }
}

.slide-menu.open {
    transform: translateX(-280px);
    /* Slide in from right */
}

.menu-header {
    height: 70px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    border-bottom: 1px solid var(--border-color);
    font-weight: 700;
    font-size: 1.1rem;
}

.menu-close-btn {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    color: var(--text-main);
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.2s ease;
}

.menu-close-btn:hover {
    background: var(--primary);
    border-color: var(--primary) !important;
    color: var(--text-on-primary) !important;
    transform: rotate(90deg);
}

.menu-list {
    list-style: none;
    padding: 0;
    margin: 0;
    overflow-y: auto;
}

.menu-list li a {
    display: block;
    padding: 10px 20px;
    margin: 4px 10px;
    border-radius: 99px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    color: var(--text-muted);
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.2s ease;
}

.menu-list li a:hover {
    background: rgba(var(--primary-rgb), 0.1);
    border-color: rgba(var(--primary-rgb), 0.45) !important;
    color: var(--primary);
    padding-left: 25px;
    box-shadow: var(--glow-soft);
}

.menu-list li.current-menu-item a {
    background: var(--primary);
    border-color: var(--primary) !important;
    color: var(--text-on-primary) !important;
    box-shadow: 0 4px 16px rgba(var(--primary-rgb), 0.35);
}

/* Search Form (Premium) */
.search-form {
    display: flex;
    align-items: center;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 99px;
    padding: 2px 2px 2px 20px;
    width: 100%;
    max-width: 550px;
    height: 48px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.3);
}

.search-form:focus-within {
    border-color: rgba(var(--primary-rgb), 0.5) !important;
    background: var(--bg-body);
    box-shadow: var(--glow-soft), inset 0 2px 4px rgba(0, 0, 0, 0.3);
}

.search-form label {
    flex-grow: 1;
    margin: 0;
    display: flex;
    align-items: center;
}

.search-field {
    background: transparent !important;
    border: none !important;
    color: var(--text-main);
    padding: 0;
    font-size: 0.95rem;
    width: 100%;
    height: 100%;
    outline: none !important;
    font-family: inherit;
    box-shadow: none !important;
    letter-spacing: 0.2px;
}

.search-field::placeholder {
    color: #555;
    opacity: 1;
}

/* Fix for browser autofill creating a box */
.search-field:-webkit-autofill,
.search-field:-webkit-autofill:hover,
.search-field:-webkit-autofill:focus,
.search-field:-webkit-autofill:active {
    -webkit-box-shadow: 0 0 0 30px var(--bg-card) inset !important;
    -webkit-text-fill-color: var(--text-main) !important;
    transition: background-color 5000s ease-in-out 0s;
}

.search-submit {
    background: var(--bg-header);
    border: 1px solid var(--border-color);
    color: var(--text-main);
    cursor: pointer;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: all 0.2s ease;
    border-radius: 50%;
    padding: 0;
    margin-left: 10px;
}

.search-submit:hover {
    background: var(--primary);
    transform: scale(1.05);
}

.search-submit svg {
    width: 18px;
    height: 18px;
    stroke-width: 2.5;
}

/* Grid System (Handled in consolidated .site-main above) */

.video-grid {
    display: grid;
    grid-template-columns: repeat(var(--grid-cols-mobile), 1fr);
    gap: var(--gap);
}

@media (min-width: 640px) {
    .video-grid {
        grid-template-columns: repeat(var(--grid-cols-tablet), 1fr);
    }
}

@media (min-width: 1024px) {
    .video-grid {
        grid-template-columns: repeat(var(--grid-cols-laptop), 1fr);
    }
}

.page-header {
    margin-bottom: 20px;
    /* Increased vertical space */
    padding-bottom: 0;
    border-bottom: none;
    /* Removed visual line */
}

.page-title {
    margin: 0;
    font-size: clamp(1.6rem, 3vw, 2.2rem);
    font-weight: 800;
    letter-spacing: -0.02em;
}

@media (min-width: 1280px) {
    .video-grid {
        grid-template-columns: repeat(var(--grid-cols-desktop), 1fr);
    }
}

@media (min-width: 1536px) {
    .video-grid {
        grid-template-columns: repeat(var(--grid-cols-wide), 1fr);
    }
}

/* In-Feed Zone — flows naturally inside the content grid as a single card */
.in-feed-zone {
    display: block;
    width: 100%;
}

/* Category List specific grid */
@media (min-width: 1024px) {
    .category-list-grid {
        grid-template-columns: repeat(5, 1fr) !important;
    }
}


/* ==========================================================================
   5. Video Cards & Grid System
   ========================================================================== */
/* 
 * Card Component 
 * Uses a strict 16:9 aspect ratio hack (.thumb-wrap) to prevent Layout Shifts (CLS).
 * The 'padding-top: 56.25%' trick enforces the ratio before the image loads.
 */
.video-card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.35s ease, border-color 0.3s ease;
    border: 1px solid var(--border-color);
    position: relative;
    box-shadow: var(--shadow-sm);
}

.video-card::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--primary), transparent);
    opacity: 0;
    transition: opacity 0.35s ease;
    z-index: 10;
    pointer-events: none;
}

.video-card:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-lg), var(--glow-soft);
    border-color: var(--border-hover);
}

.video-card:hover::before {
    opacity: 1;
}

/* 16:9 Aspect Ratio Wrapper (Strict Uniformity) */
.thumb-wrap,
.video-thumbnail {
    /* Backwards Compatibility Alias */
    position: relative;
    width: 100%;
    /* 16:9 Modern Native Ratio */
    aspect-ratio: 16/9;
    background: var(--bg-body);
    overflow: hidden;
    display: block;
    /* Ensure block level */
    z-index: 1;
    /* New base z-index */
}

.thumb-wrap img,
.video-thumbnail img {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    transition: transform 0.3s ease;
}

.video-card:hover .thumb-wrap img,
.video-card:hover .video-thumbnail img {
    transform: scale(1.05);
}

/* Play Icon Overlay */
.play-icon-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 48px;
    height: 48px;
    background: rgba(0, 0, 0, 0.75);
    color: var(--primary) !important;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 30;
    pointer-events: none;
    transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1), background 0.2s ease, box-shadow 0.25s ease;
    border: 2px solid var(--primary) !important;
    box-shadow: 0 0 16px rgba(var(--primary-rgb), 0.25);
}

/* --- INTERACTION ANIMATIONS --- */
@keyframes tubePulse {
    0% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.2);
    }

    100% {
        transform: scale(1);
    }
}

@keyframes tubeSuccess {
    0% {
        background-color: transparent;
    }

    50% {
        background-color: rgba(52, 211, 153, 0.2);
    }

    100% {
        background-color: transparent;
    }
}

@keyframes favPulse {
    0% { transform: scale(1); }
    40% { transform: scale(1.3); }
    100% { transform: scale(1); }
}

.vote-success {
    animation: tubePulse 0.4s ease-out;
    color: var(--success) !important;
}

.voted {
    color: var(--primary) !important;
    opacity: 1 !important;
}

/* Favorite Button on Cards */
.thumb-wrap .favorite-btn {
    position: absolute;
    top: 8px;
    right: 8px;
    z-index: 40;
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    line-height: 1;
    transition: transform 0.2s ease;
    color: #fff;
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.6));
}

.thumb-wrap .favorite-btn .favorite-icon {
    display: block;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    pointer-events: none;
}

.thumb-wrap .favorite-btn:hover {
    transform: scale(1.25);
}

.thumb-wrap .favorite-btn.favorited {
    color: var(--primary);
}

.thumb-wrap .favorite-btn.favorited .favorite-icon {
    fill: currentColor;
}

/* Favorite Button on Single Page */
.btn-vote.favorite .favorite-icon {
    display: block;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    margin-right: 4px;
    pointer-events: none;
}

.btn-vote.favorite.favorited {
    border-color: var(--primary) !important;
    color: var(--primary) !important;
}

.btn-vote.favorite.favorited .favorite-icon {
    fill: currentColor;
}

/* Favorites Page */
.favorites-actions {
    margin-bottom: 20px;
}

.favorites-actions .btn-secondary {
    padding: 8px 16px;
    border-radius: var(--radius);
    border: 1px solid var(--border-color);
    background: var(--bg-card);
    color: var(--text-main);
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.2s ease;
}

.favorites-actions .btn-secondary:hover {
    border-color: var(--primary);
    color: var(--primary);
}

#favorites-count {
    color: var(--text-muted);
    font-size: 0.9em;
}

#empty-favorites-message {
    color: var(--text-muted);
}

#empty-favorites-message h3 {
    color: var(--text-main);
    margin-bottom: 8px;
}

.thumb-wrap:hover .play-icon-overlay {
    opacity: 1;
    /* Stay visible */
    transform: translate(-50%, -50%) scale(1.1);
    /* Pulse effect */
}

/* Duration Badge */
.duration-badge {
    position: absolute;
    bottom: 8px;
    right: 8px;
    background: rgba(0, 0, 0, 0.85);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    padding: 3px 7px;
    border-radius: 5px;
    z-index: 10;
    letter-spacing: 0.3px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
}

/* Hover Video / Slide */
.hover-video,
.hover-slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0;
    transition: opacity 0.3s;
    pointer-events: none;
    z-index: 20;
    /* Ensure on top of everything */
}

.thumb-wrap:hover .hover-video,
.thumb-wrap:hover .hover-slide {
    opacity: 1;
}

/* Card Content */
.entry-content {
    padding: 16px;
}

.entry-title {
    font-size: 1rem;
    margin: 0 0 8px;
    line-height: 1.35;
    font-weight: 600;
    letter-spacing: -0.01em;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.entry-title a {
    color: var(--text-main);
}

.entry-title a:hover {
    color: var(--primary) !important;
}

.related-videos .entry-title a {
    color: var(--text-main) !important;
    /* Force white text */
}

/* Ensure Related Video Grid Full Width */
.related-videos {
    width: 100%;
}

.related-videos .video-grid {
    width: 100%;
}

.entry-meta {
    font-size: 0.85rem;
    color: var(--text-muted);
    display: flex;
    justify-content: space-between;
}

/* 5. Pagination */
.pagination {
    margin-top: 1.5rem;
    display: flex;
    justify-content: center;
    width: 100%;
}

/* Fix for WP's .nav-links wrapper */
.pagination .nav-links {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    justify-content: center;
}

.pagination .page-numbers {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    color: var(--text-main);
    font-weight: 600;
    text-decoration: none;
}

.pagination .page-numbers.current,
.pagination .page-numbers:hover {
    background: rgba(var(--primary-rgb), 0.1);
    border-color: rgba(var(--primary-rgb), 0.45) !important;
    color: var(--primary);
    box-shadow: var(--glow-soft);
}

/* ==========================================================================
   8. Footer & App Bar
   ========================================================================== */
.site-footer {
    background-color: var(--bg-header);
    border-top: 1px solid var(--border-color);
    padding: 2rem 0;
    margin-top: 20px;
    /* Tighter space */
}

.footer-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2rem;
}

.footer-menu-items {
    display: flex;
    flex-wrap: wrap;
    flex-direction: row;
    /* Enforce row */
    justify-content: center;
    gap: 2rem;
    list-style: none;
    /* Ensure no bullets */
    padding: 0;
    margin: 0;
    width: 100%;
    /* Ensure full width */
}

.footer-menu-items li {
    display: flex;
    /* Enforce flex item */
    align-items: center;
}

.footer-menu-items a {
    color: var(--text-muted);
    font-size: 0.9rem;
}

.footer-menu-items a:hover {
    color: var(--primary) !important;
}

.site-info {
    font-size: 0.85rem;
}

/* Back to Top Button */
.back-to-top {
    position: fixed;
    bottom: 85px; /* Above mobile app bar */
    right: 20px;
    width: 45px;
    height: 45px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    color: var(--text-main);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 999;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: var(--shadow-md);
}

.back-to-top.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.back-to-top:hover {
    background: var(--bg-card);
    border-color: rgba(var(--primary-rgb), 0.5) !important;
    color: var(--primary);
    transform: translateY(-5px);
    box-shadow: var(--glow-soft), var(--shadow-md);
}

@media (min-width: 1024px) {
    .back-to-top {
        bottom: 30px;
    }
}

/* 7. Single Video */
.video-player-wrapper {
    margin: 0 auto 2rem auto;
    width: 100%;
    max-width: 100%;
    background: var(--bg-body);
    display: flex;
    justify-content: center;
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.3);
}

.video-container {
    width: 100%;
    max-width: 1280px;
    /* Constrain huge monitors */
}

/* ==========================================================================
   7. Sidebar & Widgets
   ========================================================================== */
.widget {
    margin-bottom: 2rem;
    background: var(--bg-card);
    padding: 1.5rem;
    border-radius: var(--radius);
    border: 1px solid var(--border-color);
}

.custom-widget {
    background: transparent;
    border: none;
    border-radius: var(--radius);
    padding: 1.5rem 0;
    text-align: center;
    display: block;
    width: 100%;
    box-shadow: none;
}

.custom-widget img {
    margin: 0 auto;
    max-width: 100%;
    height: auto;
}

/* 9. 404 Error Page */
.error-404 {
    text-align: center;
    padding: 4rem 0;
}

.error-404 .page-title {
    font-size: 6rem;
    color: var(--primary) !important;
    line-height: 1;
    margin-bottom: 1rem;
}

.error-404 h2 {
    font-size: 2rem;
    margin-bottom: 2rem;
    color: var(--text-main);
}

.error-404 .page-content {
    max-width: 600px;
    margin: 0 auto;
}

/* ==========================================================================
   6. Single Video Page
   ========================================================================== */
.tube-container {
    max-width: 1600px;
    margin: 0 auto;
    padding: 0 20px;
    width: 100%;
}

.video-layout-wrapper {
    display: flex;
    gap: 30px;
    position: relative;
}

.video-main-column {
    flex: 1;
    min-width: 0;
    /* Flexbox overflow fix */
}

.single-post .video-layout-wrapper.video-layout-full {
    justify-content: center;
}

.single-post .video-layout-wrapper.video-layout-full .video-main-column {
    max-width: 1280px;
    width: 100%;
}

.video-sidebar {
    width: 320px;
    flex-shrink: 0;
    position: sticky;
    top: 90px;
    align-self: flex-start;
}

.video-layout-wrapper.sidebar-left {
    flex-direction: row-reverse;
}

@media (max-width: 1024px) {

    .video-layout-wrapper,
    .video-layout-wrapper.sidebar-left {
        flex-direction: column;
    }

    .video-sidebar {
        display: none;
    }
}

/* Breadcrumbs */
.breadcrumbs {
    padding: 15px 0;
    font-size: 0.9rem;
    color: var(--text-muted);
}

.breadcrumbs a {
    color: var(--text-muted);
}

.breadcrumbs a:hover {
    color: var(--primary) !important;
}

.breadcrumbs .sep {
    margin: 0 8px;
    opacity: 0.5;
}

.breadcrumbs .current {
    color: var(--text-main);
    font-weight: 600;
}

/* Player Wrapper */
.player-wrapper {
    position: relative;
    display: grid;
    width: 100%;
    max-width: 1280px;
    background: transparent;
    border-radius: var(--radius);
    overflow: hidden;
    margin-bottom: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

.player-wrapper .video-container,
.player-wrapper .xv-layer-mask {
    grid-area: 1 / 1 / 2 / 2;
}

.player-wrapper .video-container iframe,
.player-wrapper .video-container video {
    aspect-ratio: 16/9;
}

/* Video Details */
.video-title {
    font-size: clamp(1.3rem, 2.5vw, 1.7rem);
    margin: 0 0 10px;
    line-height: 1.25;
    color: var(--text-main) !important;
    font-weight: 800;
    letter-spacing: -0.02em;
}

.video-meta-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: none !important;
    padding-bottom: 10px;
    margin-bottom: 10px;
    flex-wrap: wrap;
    gap: 15px;
}

.vote-buttons {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.btn-vote {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    color: var(--text-main);
    padding: 8px 16px;
    border-radius: 99px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.9rem;
}

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

/* Actors/Categories/Tags (Pills) */
.video-actors,
.video-tags,
.video-categories {
    margin-top: 15px;
    font-size: 0.95rem;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}

.video-actors span,
.video-tags span,
.video-categories span {
    color: var(--text-muted);
    font-weight: 600;
    margin-right: 5px;
}

.video-actors a,
.video-tags a,
.video-categories a {
    display: inline-block;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    color: var(--text-muted);
    padding: 6px 14px;
    border-radius: 99px;
    font-size: 0.85rem;
    font-weight: 500;
    transition: all 0.2s;
    text-decoration: none;
}

.video-actors a:hover,
.video-tags a:hover,
.video-categories a:hover {
    background: rgba(var(--primary-rgb), 0.1);
    border-color: rgba(var(--primary-rgb), 0.45) !important;
    color: var(--primary);
    box-shadow: var(--glow-soft);
}

/* Footer Alignment Fix */
.footer-bottom {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    width: 100%;
}

.footer-menu-items {
    justify-content: center;
}

.site-info {
    text-align: center;
    margin-top: 1rem;
    color: var(--text-muted);
}

/* Combined Spacing Logic into Header Section Above */

/* 2. Footer Unstack Force */
.footer-menu-items,
.footer-navigation ul,
.footer-navigation .menu {
    display: flex !important;
    flex-wrap: wrap !important;
    flex-direction: row !important;
    justify-content: center !important;
    gap: 2rem !important;
    width: 100% !important;
    list-style: none !important;
    padding: 0 !important;
    margin: 0 !important;
}

.footer-menu-items li,
.footer-navigation li {
    display: inline-flex !important;
    align-items: center;
}

/* Ensure links are visible */
.footer-navigation a {
    color: var(--text-muted);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.95rem;
}

.footer-navigation a:hover {
    color: var(--primary) !important;
}

/* 3. Related Videos Styling */
.related-videos {
    margin-top: 30px;
    border-top: none !important;
    padding-top: 10px;
    background: transparent !important;
}

.related-videos .section-title {
    margin-bottom: 30px;
    font-size: 1.5rem;
    color: var(--text-main);
}

/* Fix #0b1c3e issue */
.related-videos .video-card,
.related-videos article {
    background-color: var(--bg-card) !important;
    box-shadow: none !important;
    transition: transform 0.2s;
}

.related-videos .video-grid {
    /* Auto-adjust columns to keep cards from being smooshed. Matches index card size roughly. */
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)) !important;
}

.related-videos .video-card:hover {
    transform: translateY(-5px);
}

/* 4. Comments Section Styling */
#comments {
    margin-top: 30px;
    background: var(--bg-card);
    padding: 40px;
    border-radius: 12px;
    border: 1px solid var(--border-color);
}

.comments-title {
    font-size: 1.5rem;
    margin-bottom: 30px;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-main);
}

.comment-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.comment-body {
    background: rgba(255, 255, 255, 0.03);
    padding: 20px;
    margin-bottom: 20px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    position: relative;
}

.comment-meta {
    margin-bottom: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.fn,
.fn a {
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--text-main);
    font-style: normal;
}

.comment-metadata a {
    color: var(--text-muted);
    font-size: 0.85rem;
    text-decoration: none;
}

.comment-content {
    color: var(--text-muted);
    font-size: 0.95rem;
    line-height: 1.6;
}

.reply {
    text-align: right;
    margin-top: 10px;
}

.comment-reply-link {
    display: inline-block;
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-main);
    padding: 5px 15px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    transition: all 0.2s;
    text-decoration: none;
}

.comment-reply-link:hover {
    background: rgba(var(--primary-rgb), 0.1);
    border-color: rgba(var(--primary-rgb), 0.45);
    color: var(--primary);
    box-shadow: var(--glow-soft);
}

/* Comment Form */
#respond {
    margin-top: 40px;
}

.comment-reply-title {
    font-size: 1.3rem;
    margin-bottom: 20px;
    color: var(--text-main);
}

.comment-notes,
.logged-in-as {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-bottom: 20px;
}

.comment-form-comment label,
.comment-form-author label,
.comment-form-email label,
.comment-form-url label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--text-main);
}

.comment-form-comment textarea,
.comment-form-author input,
.comment-form-email input,
.comment-form-url input {
    width: 100%;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--border-color);
    padding: 15px;
    color: var(--text-main);
    border-radius: 6px;
    font-family: inherit;
    font-size: 1rem;
    transition: border-color 0.2s;
}

.comment-form-comment textarea:focus,
.comment-form-author input:focus,
.comment-form-email input:focus,
.comment-form-url input:focus {
    border-color: var(--primary) !important;
    outline: none;
}

.form-submit {
    margin-top: 20px;
}

.form-submit .submit {
    background: var(--primary);
    color: var(--text-on-primary);
    padding: 12px 30px;
    border: none;
    border-radius: 6px;
    font-weight: 700;
    font-size: 1rem;
    cursor: pointer;
    text-transform: uppercase;
    transition: background 0.2s;
}

.form-submit .submit:hover {
    background: var(--primary-hover);
}

/* -- Mobile App Bar (Fixed Bottom) -------------------------- */
.mobile-app-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 60px;
    background: var(--bg-header);
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: space-around;
    align-items: center;
    z-index: 999;
    padding-bottom: env(safe-area-inset-bottom);
    box-shadow: 0 -4px 24px rgba(0, 0, 0, 0.5);
    content-visibility: auto;
    contain-intrinsic-size: 60px;
}

@media (min-width: 601px) {
    .mobile-app-bar {
        display: none;
    }
}



.app-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    font-size: 11px;
    gap: 4px;
    background: none;
    border: none;
    cursor: pointer;
    flex-grow: 1;
    padding: 5px 0;
}

.app-item.active {
    color: var(--text-main);
}

.app-item.active .app-icon {
    color: var(--primary) !important;
}

.app-icon {
    width: 24px;
    height: 24px;
}

.app-item:hover {
    color: var(--text-main);
}

/* Add padding to body so content doesn't get hidden behind bottom bar on mobile */
@media (max-width: 600px) {
    /* body { padding-bottom: 80px; } - handled elsewhere or not needed */
}

/* Modern Pill Buttons */
.pill-btn,
.btn-tracking {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    padding: 10px 24px;
    border-radius: 99px;
    cursor: pointer;
    color: var(--text-main);
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    font-size: 0.95rem;
    font-weight: 500;
    text-decoration: none;
    position: relative;
    overflow: hidden;
}

.pill-btn:hover,
.btn-tracking:hover {
    background: var(--bg-card);
    color: var(--primary);
    border-color: rgba(var(--primary-rgb), 0.5) !important;
    transform: translateY(-2px);
    box-shadow: var(--glow-soft);
}

/* Favorited buttons keep visible text on hover */
.pill-btn.favorited:hover,
.btn-vote.favorite.favorited:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--primary);
}

.pill-btn.voted .count {
    color: var(--primary);
    font-weight: 700;
}

.pill-btn.voted {
    cursor: default;
}

.pill-btn svg {
    stroke-width: 2px;
}

.tracking-btn-wrapper {
    margin-bottom: 20px;
    display: flex;
    justify-content: center;
    width: 100%;
}

/* === Single Video Cleanup (Added to Fix Inline Styles) === */

.meta-left {
    color: var(--text-muted);
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

.meta-left strong {
    color: var(--text-main);
}

/* Premium Widget Zone Wrapper */
.tube-widget-centered {
    display: block;
    text-align: center;
    margin: 0 auto;
    width: 100%;
    background: transparent;
    border: none;
    padding: 0;
    box-shadow: none;
}

.tube-widget-centered .widget,
.tube-widget-centered .custom-widget {
    margin: 0 auto !important;
    padding: 0 !important;
    box-shadow: none !important;
    border: none !important;
}

.video-description {
    margin-bottom: 10px;
    border-bottom: none !important;
    padding-bottom: 10px;
}

.video-actors span,
.video-categories span {
    color: var(--text-muted);
    margin-right: 8px;
}

.related-title {
    font-size: clamp(1.2rem, 2vw, 1.5rem);
    margin-bottom: 20px;
    color: var(--text-main);
    font-weight: 800;
    letter-spacing: -0.02em;
}

/* 
   -----------------------------------
   WIDGET REFINEMENTS
   -----------------------------------
*/

/* 1. Reset generic widget boxes to flat clear look */
.widget.custom-widget {
    background: transparent !important;
    border: none !important;
    border-radius: var(--radius) !important;
    box-shadow: none !important;
    padding: 0 !important;
    margin-bottom: 0 !important;
}

/* 2. Footer Widget - Center and remove box */
#footer-1 .widget.custom-widget,
.footer-widgets .widget.custom-widget,
.footer-widgets .widget {
    display: block;
    text-align: center;
    width: 100%;
    margin: 0 auto 10px auto !important;
    padding: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    border: none !important;
    /* Spacing */
}

/* In-feed Zone: Completely unstyled, transparent wrapper. Shows on all devices. */
.in-feed-zone {
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    background: none !important;
    border: none !important;
    padding: 0 !important;
    margin: 0 !important;
    box-shadow: none !important;
    border-radius: 0 !important;
    width: 100%;
    text-align: center;
}

.in-feed-zone .in-feed-item {
    background: none !important;
    border: none !important;
    padding: 0 !important;
    margin: 0 !important;
    box-shadow: none !important;
    border-radius: 0 !important;
}


/* 3. Sidebar Cleanup */
#sidebar-1 .widget {
    /* TubeXV tighter spacing */
    margin-bottom: 20px !important;
}

/* 4. Top Widget Zone Spacing */
.widget-zone-top {
    margin-top: -5px;
    /* Result: (5px body + 20px site-main - 5px) = 20px (Exact 1-line gap from header) */
    margin-bottom: 20px;
    /* Exact 1-line gap from sort bar */
    display: block;
    width: 100%;
}

.widget-zone-top .widget {
    margin-bottom: 0 !important;
    /* Prevent widget-level padding from doubling the gap */
}


/* Specific Sidebar Ad cleanup - Remove boxes */

.video-sidebar .widget,
#sidebar-1 .widget {
    margin-bottom: 20px !important;
    text-align: center;
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    padding: 0 !important;
}

/* Ensure inner widget content is also clean */
.video-sidebar .widget>*,
#secondary .widget>* {
    background: transparent !important;
    border: none !important;
}

/* Footer Widget Centering & Cleanup */
#footer-1 .widget,
.footer-widgets .widget {
    display: block;
    text-align: center;
    border: none !important;
    background: transparent !important;
    box-shadow: none !important;
    margin-bottom: 30px !important;
}

.friends-menu-items {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 15px;
    list-style: none;
    padding: 0;
    margin: 0;
    text-align: center;
    margin-bottom: 20px !important;
}

.friends-menu-items a {
    color: var(--text-muted);
    font-size: 0.9rem;
    transition: color 0.2s;
    text-transform: uppercase;
    font-weight: 600;
}

.friends-menu-items a:hover {
    color: var(--primary) !important;
}

/* Ensure images/iframes in widgets are responsive */

/* Ensure images in widgets are responsive */
.widget.custom-widget img,
.widget_custom_html img,
.widget_media_image img {
    max-width: 100%;
    height: auto;
    display: inline-block;
    margin: 0 auto;
}



/* Ensure the container doesn't constrain it */
.widget.custom-widget,
.widget_custom_html {
    width: 100%;
    max-width: 100%;
}

/* Global Link Underline Force Removal */
a,
a:hover,
a:focus,
a:active {
    text-decoration: none !important;
}

/* ==========================================================================
   9. Mobile Optimization
   ========================================================================== */
/* Final pass to tighten spacing on small screens (<768px) */
@media (max-width: 767px) {
    .container {
        padding: 0 12px;
        /* Wider content area on mobile */
    }

    .site-header {
        padding: 0 12px;
        gap: 10px;
        position: fixed !important;
        top: 0 !important;
        width: 100%;
        z-index: 1000;
    }
    
    body.admin-bar .site-header {
        top: 46px !important;
    }

    .site-main {
        padding: 15px 0;
        /* Tighter vertical spacing */
    }

    .page-title {
        font-size: 1.5rem;
        /* Smaller headings */
    }

    .page-header {
        margin-bottom: 15px;
        /* Tighter header gap */
    }

    .video-card .entry-content {
        padding: 12px;
        /* Compact card details */
    }

    body {
        padding-top: 80px !important;
        /* Keep consistent 10px gap */
    }

    body.admin-bar {
        padding-top: 126px !important;
        /* 80 + 46 */
    }

    /* Force mobile player height to 300px for robust 300x250 ad display */
    .player-wrapper .video-container iframe,
    .player-wrapper .video-container video,
    .video-container {
        min-height: 300px;
        aspect-ratio: auto !important;
    }

    /* Stack views/date and actions on video page for better layout */
    .video-meta-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    /* Scale down pill buttons and wrap them nicely */
    .pill-btn,
    .btn-vote {
        padding: 8px 14px;
        font-size: 0.85rem;
        gap: 6px;
    }

    .vote-buttons {
        gap: 8px;
        width: 100%;
    }
}

/* Tracking Button */
.btn-tracking {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    background: var(--primary);
    color: var(--text-on-primary);
    font-weight: 700;
    padding: 14px 28px;
    border-radius: 99px;
    text-transform: uppercase;
    font-size: 1rem;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    width: 100%;
    max-width: 400px;
    position: relative;
    overflow: hidden;
}

.btn-tracking:hover {
    transform: translateY(-2px);
    box-shadow: var(--glow-strong), 0 8px 24px rgba(0, 0, 0, 0.4);
    background: var(--primary-hover);
    color: var(--text-on-primary) !important;
}

.btn-tracking .icon {
    font-size: 1.2rem;
}

/* ==========================================================================
   Age Gate (Refactored for Premium Glassmorphic Modal with Blur Transition)
   ========================================================================== */
#page {
    transition: filter 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

html.age-gate-active #page {
    filter: blur(15px);
    pointer-events: none;
    user-select: none;
}

#age-gate {
    position: fixed;
    inset: 0;
    z-index: 99999;
    background: rgba(3, 3, 3, 0.72); /* Premium dark semi-transparent overlay */
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: clamp(12px, 4vw, 24px);
    contain: paint;
}

.verified-user #age-gate {
    display: none !important;
}

#gate-content {
    max-width: 520px;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    background: var(--bg-card); /* Dynamically matches color scheme */
    padding: clamp(30px, 6vw, 50px) clamp(20px, 5vw, 40px);
    border-radius: var(--radius-lg);
    border: 2px solid var(--primary); /* Neon primary border */
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.8), 0 0 35px rgba(var(--primary-rgb), 0.15); /* Dual glow and drop shadow */
    opacity: 0;
    transform: scale(0.94) translateY(15px);
    animation: gateReveal 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    box-sizing: border-box; /* Ensure padding does not overflow width */
}

@keyframes gateReveal {
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.gate-logo {
    font-size: clamp(1.8rem, 7vw, 3rem);
    font-weight: 900;
    color: var(--primary) !important;
    text-transform: uppercase;
    margin-bottom: 24px;
    line-height: 1.1;
    min-height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    max-width: 100%;
    word-break: break-word;
    overflow-wrap: anywhere;
}

.gate-logo img {
    max-height: 80px;
    max-width: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
}

#gate-desc {
    font-size: clamp(0.9rem, 3.8vw, 1.15rem);
    color: var(--text-muted);
    line-height: 1.6;
    margin: 0 0 clamp(20px, 5vw, 35px) 0;
    font-weight: 500;
    max-width: 440px;
}

.gate-btn {
    background: var(--primary);
    color: var(--text-on-primary);
    border: none;
    padding: 0 clamp(16px, 4vw, 40px);
    min-height: 60px;
    width: 100%;
    max-width: clamp(240px, 80vw, 340px);
    font-size: clamp(0.95rem, 3.8vw, 1.2rem);
    font-weight: 800;
    border-radius: 50px;
    cursor: pointer;
    text-transform: uppercase;
    margin-bottom: 25px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s, background 0.2s, box-shadow 0.2s;
    box-shadow: 0 4px 15px rgba(var(--primary-rgb), 0.3);
    box-sizing: border-box;
}

.gate-btn:hover {
    background: var(--primary-hover);
    transform: scale(1.04);
    box-shadow: 0 6px 20px rgba(var(--primary-rgb), 0.5);
}

.gate-sub {
    margin-top: 0;
    font-size: 0.95rem;
    color: var(--text-muted);
}

.gate-sub a {
    color: var(--text-muted);
    text-decoration: underline;
    padding: 20px;
    display: inline-block;
    min-height: 60px;
    min-width: 60px;
    transition: color 0.2s;
}

.gate-sub a:hover {
    color: var(--text-main);
}

/* ==========================================================================
   10. Extra Enhancements (Ported from TubeChromaGlass)
   ========================================================================== */

/* -- Sort Bar --------------------------------------------- */
.sort-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.sort-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 14px;
    border-radius: 99px;
    font-size: 0.85rem;
    font-weight: 600;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    color: var(--text-muted);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    text-decoration: none !important;
}

.sort-pill svg {
    flex-shrink: 0;
    transition: transform 0.3s ease;
}

.sort-pill:hover svg {
    transform: rotate(-10deg) scale(1.1);
}

.sort-pill:hover {
    background: rgba(var(--primary-rgb), 0.1);
    border-color: rgba(var(--primary-rgb), 0.5) !important;
    color: var(--primary);
    transform: translateY(-1px);
    box-shadow: var(--glow-soft);
}

.sort-pill.active {
    background: var(--primary);
    border-color: var(--primary) !important;
    color: var(--text-on-primary) !important;
    box-shadow: 0 4px 16px rgba(var(--primary-rgb), 0.35);
}

/* -- Tags Scroll Bar ---------------------------------------- */
.tags-scroll-wrapper {
    position: relative;
    display: flex;
    align-items: stretch;
    margin-bottom: 25px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    overflow: hidden;
}

.tags-scroll-track {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    scroll-behavior: smooth;
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE 10+ */
    padding: 8px 10px;
    flex: 1;
    min-width: 0;
}

.tags-scroll-track::-webkit-scrollbar {
    display: none; /* WebKit browsers */
}

.tag-pill-scroll {
    display: inline-flex;
    flex-shrink: 0 !important;
    align-items: center;
    white-space: nowrap;
    padding: 5px 12px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    border-radius: 99px;
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-muted);
    text-decoration: none;
    transition: all 0.2s ease;
}

.tag-pill-scroll:hover {
    background: rgba(var(--primary-rgb), 0.1);
    border-color: rgba(var(--primary-rgb), 0.45) !important;
    color: var(--primary);
    box-shadow: var(--glow-soft);
    transform: scale(1.03);
}

.tags-scroll-btn {
    background: var(--bg-card);
    border: none;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 12px;
    cursor: pointer;
    transition: color 0.2s, background-color 0.2s;
    z-index: 2;
    flex-shrink: 0;
}

.tags-scroll-btn:hover {
    color: var(--primary) !important;
    background: rgba(255, 255, 255, 0.02);
}

.tags-scroll-btn.tags-prev {
    border-right: 1px solid var(--border-color);
}

.tags-scroll-btn.tags-next {
    border-left: 1px solid var(--border-color);
}

@media (max-width: 768px) {
    .tags-scroll-wrapper {
        margin-left: -20px;
        margin-right: -20px;
        border-radius: 0;
        border-left: none;
        border-right: none;
    }
}

/* -- SEO / Search Hero ------------------------------------ */
.seo-hero,
.search-hero {
    padding: 28px 0 20px;
    margin-bottom: 0;
    text-align: center;
}

.seo-hero .page-title,
.search-hero .page-title {
    font-size: clamp(1.6rem, 4vw, 2.4rem);
    font-weight: 800;
    letter-spacing: -0.5px;
    margin-bottom: 10px;
    position: relative;
    display: inline-block;
    padding-bottom: 18px;
}

.seo-hero .page-title::after,
.search-hero .page-title::after {
    content: "";
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 70px;
    height: 3px;
    background: linear-gradient(90deg, transparent, var(--primary), transparent);
    border-radius: 3px;
}

.archive-meta-row,
.search-meta-row {
    margin-bottom: 12px;
}

.archive-count,
.search-count {
    display: inline-block;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: var(--primary) !important;
    opacity: 0.8;
    background: rgba(var(--primary-rgb), 0.08);
    border: 1px solid rgba(var(--primary-rgb), 0.2);
    padding: 4px 14px;
    border-radius: 99px;
}

.archive-description {
    font-size: 0.9rem;
    color: var(--text-muted);
    max-width: 600px;
    margin: 0 auto 20px;
    line-height: 1.6;
    opacity: 0.75;
}

/* -- Search Results Enhancements -------------------------- */
mark.highlight {
    background: rgba(var(--primary-rgb), 0.4);
    color: var(--text-main);
    padding: 0 2px;
    border-radius: 2px;
}

.no-results-premium {
    text-align: center;
    padding: 60px 20px;
    max-width: 600px;
    margin: 40px auto;
    background: var(--bg-card);
    border-radius: var(--radius);
    border: 1px solid var(--border-color);
}

.no-results-icon {
    color: var(--primary) !important;
    margin-bottom: 20px;
    opacity: 0.5;
}

.no-results-text {
    font-size: 1.1rem;
    color: var(--text-muted);
    margin-bottom: 30px;
    line-height: 1.6;
}

/* -- Taxonomy Grids (Actors, Categories) ------------------ */
.actor-card,
.category-card,
.term-card {
    text-align: center;
}

.actor-card .entry-title,
.category-card .entry-title,
.term-card .entry-title {
    margin-bottom: 5px;
    font-size: 1.1rem;
    font-weight: 700;
}

.actor-card .meta-count,
.category-card .meta-count,
.term-card .entry-meta span {
    font-size: 0.8rem;
    color: var(--text-muted);
    font-weight: 500;
}

.actor-fallback,
.category-fallback {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--bg-card);
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--border-color);
}

.actor-fallback span,
.category-fallback span {
    font-size: 3.5rem;
    font-weight: 900;
    color: var(--primary) !important;
    text-shadow: 0 0 30px rgba(var(--primary-rgb), 0.4);
    opacity: 0.8;
}

.actor-img,
.category-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.video-card:hover .actor-img,
.video-card:hover .category-img {
    transform: scale(1.08);
}

/* Force consistency on grid */
.category-list-grid {
    gap: 20px;
}

/* Live Search */
.live-search-form {
    position: relative;
}

.live-search-results {
    position: absolute;
    top: calc(100% + 10px);
    left: 0;
    right: 0;
    background: var(--bg-menu);
    border: 1px solid rgba(var(--primary-rgb), 0.25);
    border-radius: var(--radius);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.85), var(--glow-soft);
    z-index: 9999;
    display: none;
    overflow: hidden;
}

.live-search-dropdown {
    max-height: 450px;
    overflow-y: auto;
}

/* Custom scrollbar for results */
.live-search-dropdown::-webkit-scrollbar {
    width: 6px;
}

.live-search-dropdown::-webkit-scrollbar-track {
    background: transparent;
}

.live-search-dropdown::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 3px;
}

.live-search-dropdown::-webkit-scrollbar-thumb:hover {
    background: var(--primary);
}

/* Header */
.live-search-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-color);
    background: rgba(255, 255, 255, 0.02);
    border-radius: var(--radius) var(--radius) 0 0;
}

.live-search-title {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.live-search-count {
    font-size: 12px;
    color: var(--primary);
    font-weight: 700;
}

/* Sections */
.live-search-section {
    border-bottom: 1px solid var(--border-color);
}

.live-search-section:last-child {
    border-bottom: none;
}

.live-search-section-title {
    padding: 8px 16px;
    font-size: 11px;
    font-weight: 700;
    color: var(--primary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    background: rgba(var(--primary-rgb), 0.05);
}

/* Items */
.live-search-item {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    text-decoration: none;
    color: var(--text-main);
    transition: all 0.2s ease;
    border-bottom: 1px solid transparent;
}

.live-search-item:hover,
.live-search-item.active {
    background: rgba(var(--primary-rgb), 0.05);
    border-bottom-color: var(--border-color);
}

.live-search-item.active {
    background: rgba(var(--primary-rgb), 0.1);
    border-left: 3px solid var(--primary);
}

/* Thumbnail */
.live-search-thumbnail {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    overflow: hidden;
    margin-right: 12px;
    flex-shrink: 0;
    border: 1px solid var(--border-color);
    background: #000;
}

.live-search-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* Content */
.live-search-content {
    flex: 1;
    min-width: 0;
}

.live-search-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-main);
    margin: 0 0 4px 0;
    line-height: 1.3;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.live-search-meta {
    font-size: 12px;
    color: var(--text-muted);
    font-weight: 500;
}

/* Icon */
.live-search-icon {
    margin-left: 12px;
    color: var(--primary);
    opacity: 0.8;
    flex-shrink: 0;
}

.live-search-icon svg {
    width: 16px;
    height: 16px;
}

/* Highlight */
.live-search-highlight {
    color: var(--primary) !important;
    font-weight: 800;
    background: transparent;
    text-decoration: underline;
}

/* Loading */
.live-search-loading {
    padding: 16px;
    text-align: center;
    color: var(--text-muted);
    font-size: 14px;
}

/* Responsive */
@media (max-width: 768px) {
    .live-search-results {
        position: fixed;
        top: auto;
        left: 16px;
        right: 16px;
        bottom: 16px;
        max-height: 60vh;
        border-radius: var(--radius-lg);
    }

    .live-search-dropdown {
        border-radius: var(--radius-lg);
    }

    .live-search-header {
        border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    }

    .live-search-item {
        padding: 14px 16px;
    }

    .live-search-thumbnail {
        width: 48px;
        height: 48px;
    }
}

/* Focus management */
.live-search-input:focus+.search-submit {
    border-color: var(--primary);
}

/* Accessibility */
.live-search-item:focus {
    outline: 2px solid var(--primary);
    outline-offset: -2px;
}

/* ==========================================================================
   Text Formatting for Pages and Posts (Content Area)
   ========================================================================== */
.page-main-layout .entry-content, .video-description, .formatted-content {
    line-height: 1.7;
    font-size: 1.05rem;
    color: var(--text-main);
    word-wrap: break-word;
}

/* Page Layout Optimization */
.page-main-layout {
    max-width: 1000px;
    margin: 0 auto;
    padding: 2rem 0;
}

.page-main-layout .entry-content p, .video-description p, .formatted-content p {
    margin-bottom: 1.5rem;
}

.page-main-layout .entry-content h1, .video-description h1, .formatted-content h1,
.page-main-layout .entry-content h2, .video-description h2, .formatted-content h2,
.page-main-layout .entry-content h3, .video-description h3, .formatted-content h3,
.page-main-layout .entry-content h4, .video-description h4, .formatted-content h4,
.page-main-layout .entry-content h5, .video-description h5, .formatted-content h5,
.page-main-layout .entry-content h6, .video-description h6, .formatted-content h6 {
    color: var(--text-main);
    font-weight: 700;
    margin-top: 2rem;
    margin-bottom: 1rem;
    line-height: 1.25;
}

.page-main-layout .entry-content h1, .video-description h1, .formatted-content h1 { font-size: 2.25rem; }
.page-main-layout .entry-content h2, .video-description h2, .formatted-content h2 { font-size: 1.875rem; }
.page-main-layout .entry-content h3, .video-description h3, .formatted-content h3 { font-size: 1.5rem; }
.page-main-layout .entry-content h4, .video-description h4, .formatted-content h4 { font-size: 1.25rem; }

.page-main-layout .entry-content ul, .video-description ul, .formatted-content ul {
    list-style: disc;
    margin: 0 0 1.5rem 2rem;
    padding: 0;
}

.page-main-layout .entry-content ol, .video-description ol, .formatted-content ol {
    list-style: decimal;
    margin: 0 0 1.5rem 2rem;
    padding: 0;
}

.page-main-layout .entry-content li, .video-description li, .formatted-content li {
    margin-bottom: 0.5rem;
}

.page-main-layout .entry-content a, .video-description a, .formatted-content a {
    color: var(--primary) !important;
    text-decoration: underline;
    transition: color 0.2s ease;
}

.page-main-layout .entry-content a:hover, .video-description a:hover, .formatted-content a:hover {
    color: var(--primary-hover);
    text-decoration: none;
}

.page-main-layout .entry-content blockquote, .video-description blockquote, .formatted-content blockquote {
    border-left: 4px solid var(--primary);
    padding: 1rem 1.5rem;
    margin: 0 0 1.5rem 1.5rem;
    background: var(--surface);
    border-radius: 0 var(--radius) var(--radius) 0;
    font-style: italic;
    color: var(--text-muted);
}

.page-main-layout .entry-content blockquote p:last-child, .video-description blockquote p:last-child, .formatted-content blockquote p:last-child {
    margin-bottom: 0;
}

.page-main-layout .entry-content img, .video-description img, .formatted-content img {
    max-width: 100%;
    height: auto;
    border-radius: var(--radius);
    margin-bottom: 1.5rem;
    display: block;
}

.page-main-layout .entry-content figure, .video-description figure, .formatted-content figure {
    margin: 0 0 1.5rem 0;
}

.page-main-layout .entry-content figure figcaption, .video-description figure figcaption, .formatted-content figure figcaption {
    font-size: 0.85rem;
    color: var(--text-muted);
    text-align: center;
    margin-top: 0.5rem;
}

.page-main-layout .entry-content code, .video-description code, .formatted-content code {
    background: var(--surface);
    padding: 0.2rem 0.4rem;
    border-radius: 4px;
    font-family: monospace;
    font-size: 0.9em;
}

.page-main-layout .entry-content pre, .video-description pre, .formatted-content pre {
    background: var(--surface);
    padding: 1.5rem;
    border-radius: var(--radius);
    overflow-x: auto;
    margin-bottom: 1.5rem;
}

.page-main-layout .entry-content pre code, .video-description pre code, .formatted-content pre code {
    background: none;
    padding: 0;
    font-size: 1em;
}

/* ==========================================================================
   Card Reveal Animation (Liquid Neon 2026)
   ========================================================================== */
.reveal {
    opacity: 0;
    transform: translateY(16px);
    transition: opacity 0.5s cubic-bezier(0.4, 0, 0.2, 1), transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.reveal.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Stagger children in grids */
.video-grid .reveal:nth-child(1) { transition-delay: 0ms; }
.video-grid .reveal:nth-child(2) { transition-delay: 40ms; }
.video-grid .reveal:nth-child(3) { transition-delay: 80ms; }
.video-grid .reveal:nth-child(4) { transition-delay: 120ms; }
.video-grid .reveal:nth-child(5) { transition-delay: 160ms; }
.video-grid .reveal:nth-child(6) { transition-delay: 200ms; }

/* Respect reduced motion preference */
@media (prefers-reduced-motion: reduce) {
    .reveal {
        opacity: 1;
        transform: none;
        transition: none;
    }
    body::before {
        animation: none;
    }
    .video-card::before {
        transition: none;
    }
}

/* 
   -----------------------------------
   PLAYER AD OVERLAY (INLINED CONTRACT)
   -----------------------------------
*/
.player-wrapper {
    position: relative;
}

.video-container {
    position: relative;
    z-index: 1;
}

.player-wrapper .video-container {
    overflow: visible;
}


/* ==========================================================================
   Video Servers (MUTA-compatible multi-source switcher)
   ==========================================================================
   Renders a tab bar labelled "Server 1", "Server 2", etc. above the player
   when the post has 2+ video sources (either MUTA plugin tabs or the
   theme's `video_url*` meta fields). With a single source, no tabs are
   rendered — the player shows normally.
*/
.video-servers {
    margin: 0 0 15px;
    width: 100%;
}

.server-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 6px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    margin-bottom: 10px;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.02);
}

.server-tab {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    border-radius: 99px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid transparent;
    color: var(--text-muted);
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    line-height: 1;
    -webkit-appearance: none;
    appearance: none;
    font-family: inherit;
}

.server-tab:hover {
    background: rgba(var(--primary-rgb), 0.1);
    border-color: rgba(var(--primary-rgb), 0.45);
    color: var(--primary);
    transform: translateY(-1px);
    box-shadow: var(--glow-soft);
}

.server-tab.is-active,
.server-tab[aria-selected="true"] {
    background: var(--primary);
    border-color: var(--primary);
    color: var(--text-on-primary);
    box-shadow: 0 4px 14px rgba(var(--primary-rgb), 0.35);
}

.server-tab.is-active .server-tab-icon,
.server-tab[aria-selected="true"] .server-tab-icon {
    color: var(--text-on-primary);
}

.server-tab:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

.server-tab-icon {
    flex-shrink: 0;
    opacity: 0.85;
}

.server-tab-label {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 180px;
}

/* --- Server Quality Badge (4K / 1080p / 720p / ...) --------------- */
.server-quality-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 2px 7px;
    border-radius: 4px;
    font-size: 0.65rem;
    font-weight: 800;
    line-height: 1.2;
    color: #fff !important;
    letter-spacing: 0.3px;
    text-transform: uppercase;
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.08) inset, 0 1px 3px rgba(0, 0, 0, 0.4);
    flex-shrink: 0;
    white-space: nowrap;
    /* default color is overridden by the inline style attribute, but we set
       a sensible fallback for any quality we don't have an explicit entry for. */
    background: #9a9a9a;
}

/* On hover: subtle scale-up */
.server-tab:hover .server-quality-badge {
    transform: scale(1.05);
}

/* When the parent tab is active, give the badge a stronger border so it
   pops against the red background. */
.server-tab.is-active .server-quality-badge,
.server-tab[aria-selected="true"] .server-quality-badge {
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.25) inset, 0 2px 6px rgba(0, 0, 0, 0.35);
}

/* On mobile, trim padding slightly so the tab pill stays compact. */
@media (max-width: 600px) {
    .server-quality-badge {
        padding: 2px 5px;
        font-size: 0.6rem;
    }
}

.server-panels {
    position: relative;
    width: 100%;
}

.server-panel {
    width: 100%;
}

.server-panel[hidden] {
    display: none !important;
}

.server-panel .video-container {
    /* Inherit the standard aspect-ratio + iframe positioning from .video-container */
    width: 100%;
}

/* Single server variant: matches the standard single-player look */
.video-server--single {
    margin: 0;
}

/* Mobile: allow horizontal scroll for the tab bar so it never wraps awkwardly */
@media (max-width: 600px) {
    .server-tabs {
        flex-wrap: nowrap;
        overflow-x: auto;
        scrollbar-width: none;
        -ms-overflow-style: none;
        padding: 5px;
        border-radius: var(--radius);
    }

    .server-tabs::-webkit-scrollbar {
        display: none;
    }

    .server-tab {
        flex-shrink: 0;
        padding: 7px 14px;
        font-size: 0.8rem;
    }

    .server-tab-label {
        max-width: 130px;
    }
}


/* ==========================================================================
   Header Login Button + Logged-in User Dropdown
   ==========================================================================
   The header-right area holds a single login button (logged-out) or a
   clickable user avatar + name + level chip (logged-in). Logged-in users
   get a dropdown panel with profile, favorites, dashboard, and logout.
   ========================================================================== */

.header-login {
    display: inline-flex;
    align-items: center;
    margin-left: 4px;
}

/* Logged-out: single red Login button */
.tube-login-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--primary);
    color: var(--text-on-primary);
    border: none;
    padding: 8px 18px;
    border-radius: 99px;
    font-weight: 700;
    font-size: 0.85rem;
    text-decoration: none;
    line-height: 1;
    box-shadow: 0 4px 14px rgba(var(--primary-rgb), 0.25);
    transition: background 0.25s, transform 0.2s, box-shadow 0.25s;
    cursor: pointer;
    white-space: nowrap;
    -webkit-appearance: none;
    appearance: none;
    font-family: inherit;
}

.tube-login-btn:hover {
    background: var(--primary-hover);
    color: var(--text-on-primary) !important;
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(var(--primary-rgb), 0.45);
}

.tube-login-btn:active {
    transform: translateY(0);
}

.tube-login-btn svg {
    flex-shrink: 0;
}

/* Logged-in: user menu wrapper */
.tube-user-menu {
    position: relative;
    display: inline-flex;
    align-items: center;
}

.tube-user-menu__trigger {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    background: var(--bg-card);
    color: var(--text-main);
    border: 1px solid var(--border-color);
    padding: 5px 12px 5px 5px;
    border-radius: 99px;
    cursor: pointer;
    font-family: inherit;
    font-size: 0.85rem;
    line-height: 1;
    transition: background 0.2s, border-color 0.2s, transform 0.2s;
    -webkit-appearance: none;
    appearance: none;
    max-width: 200px;
}

.tube-user-menu__trigger:hover {
    background: rgba(var(--primary-rgb), 0.1);
    border-color: rgba(var(--primary-rgb), 0.45);
}

.tube-user-menu__trigger[aria-expanded="true"] {
    background: rgba(var(--primary-rgb), 0.12);
    border-color: rgba(var(--primary-rgb), 0.5);
}

.tube-user-menu__avatar {
    position: relative;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    overflow: hidden;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-weight: 800;
    font-size: 0.8rem;
    flex-shrink: 0;
    background: #444; /* fallback; the inline style overrides it */
}

.tube-user-menu__avatar img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: 1;
}

.tube-user-menu__avatar--fallback img {
    display: none;
}

.tube-user-menu__initials {
    position: relative;
    z-index: 0;
}

.tube-user-menu__avatar img:not([style*="display: none"]) + .tube-user-menu__initials {
    display: none;
}

.tube-user-menu__meta {
    display: inline-flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
    min-width: 0;
    line-height: 1.1;
}

.tube-user-menu__name {
    color: var(--text-main);
    font-weight: 700;
    max-width: 110px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.tube-user-menu__level {
    color: var(--text-muted);
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    max-width: 110px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.tube-user-menu__chev {
    color: var(--text-muted);
    flex-shrink: 0;
    transition: transform 0.2s;
}

.tube-user-menu__trigger[aria-expanded="true"] .tube-user-menu__chev {
    transform: rotate(180deg);
}

/* Dropdown panel */
.tube-user-menu__dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    min-width: 260px;
    max-width: 320px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6), 0 0 24px rgba(var(--primary-rgb), 0.12);
    padding: 6px;
    z-index: 1100;
    opacity: 0;
    transform: translateY(-8px) scale(0.98);
    pointer-events: none;
    transition: opacity 0.18s, transform 0.18s;
}

.tube-user-menu__dropdown:not([hidden]) {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: auto;
}

.tube-user-menu__header {
    padding: 14px 16px;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 6px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.tube-user-menu__name-lg {
    font-weight: 800;
    color: var(--text-main);
    font-size: 0.95rem;
}

.tube-user-menu__email {
    color: var(--text-muted);
    font-size: 0.78rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.tube-user-menu__badges {
    margin-top: 6px;
}

.tube-level-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 10px;
    border-radius: 99px;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    line-height: 1.2;
    background: #9a9a9a;
    color: #fff !important;
}

.tube-level-badge-icon {
    font-size: 0.75rem;
    line-height: 1;
}

.tube-user-menu__item {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    text-align: left;
    background: none;
    border: none;
    color: var(--text-muted);
    padding: 10px 12px;
    border-radius: var(--radius);
    font-size: 0.88rem;
    font-family: inherit;
    cursor: pointer;
    transition: background 0.18s, color 0.18s;
    text-decoration: none;
    line-height: 1.2;
}

.tube-user-menu__item:hover,
.tube-user-menu__item:focus-visible {
    background: rgba(var(--primary-rgb), 0.1);
    color: var(--text-main);
    outline: none;
}

.tube-user-menu__item--logout {
    color: #fca5a5;
    margin-top: 4px;
    border-top: 1px solid var(--border-color);
    border-radius: 0 0 var(--radius) var(--radius);
    padding-top: 12px;
}

.tube-user-menu__item--logout:hover,
.tube-user-menu__item--logout:focus-visible {
    background: rgba(239, 68, 68, 0.12);
    color: #fff;
}

.tube-user-menu__item svg {
    flex-shrink: 0;
    opacity: 0.85;
}

/* Mobile: compact the user menu trigger */
@media (max-width: 600px) {
    .tube-login-btn__label {
        display: none;
    }

    .tube-login-btn {
        padding: 8px 10px;
    }

    .tube-user-menu__meta {
        display: none;
    }

    .tube-user-menu__trigger {
        padding: 4px;
        max-width: none;
    }

    .tube-user-menu__dropdown {
        right: -8px;
        min-width: 240px;
    }
}


/* ==========================================================================
   10. Blog System Layout & Typography
   ========================================================================== */

/* Layout Setup */
.blog-layout-wrapper {
    display: grid;
    gap: var(--gap);
    grid-template-columns: 1fr;
    margin-top: 25px;
    align-items: start;
}

@media (min-width: 1024px) {
    .blog-layout-wrapper.sidebar-right {
        grid-template-columns: 1fr 320px;
    }
}

.blog-content-column {
    min-width: 0; /* Prevent overflow break */
}

.blog-sidebar-column {
    position: sticky;
    top: calc(var(--header-height) + 20px);
}

/* Archive Header / Hero */
.blog-hero {
    text-align: center;
    padding: 40px 20px;
    border-radius: var(--radius-lg);
    background: linear-gradient(135deg, rgba(18, 18, 18, 0.6) 0%, rgba(5, 5, 5, 0.9) 100%);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-md);
    margin-bottom: 30px;
    position: relative;
    overflow: hidden;
}

.blog-hero::before {
    content: "";
    position: absolute;
    top: -50%;
    left: -20%;
    width: 140%;
    height: 200%;
    background: radial-gradient(circle, rgba(var(--primary-rgb), 0.05) 0%, transparent 70%);
    pointer-events: none;
}

.blog-hero .page-title {
    font-size: 2.5rem;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 10px;
    background: linear-gradient(to right, #fff 40%, rgba(255,255,255,0.6));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.blog-description {
    max-width: 700px;
    margin: 0 auto;
    color: var(--text-muted);
    font-size: 1.05rem;
}

/* Blog Grid System */
.blog-grid {
    display: grid;
    gap: 24px;
    grid-template-columns: 1fr;
}

@media (min-width: 768px) {
    .blog-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 1400px) {
    .blog-layout-full .blog-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* Blog Card */
.blog-card {
    display: flex;
    flex-direction: column;
    background: var(--bg-card);
    border-radius: var(--radius);
    border: 1px solid var(--border-color);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: transform 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
    height: 100%;
}

.blog-card:hover {
    transform: translateY(-5px);
    border-color: var(--border-hover);
    box-shadow: var(--shadow-md), var(--shadow-glow);
}

.blog-card-thumb {
    position: relative;
    aspect-ratio: 16 / 10;
    overflow: hidden;
    background: #0a0a0a;
}

.blog-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s cubic-bezier(0.165, 0.84, 0.44, 1);
}

.blog-card:hover .blog-img {
    transform: scale(1.08);
}

.blog-badge {
    position: absolute;
    top: 12px;
    left: 12px;
    background: var(--primary);
    color: var(--text-on-primary);
    padding: 5px 12px;
    border-radius: 99px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 4px 12px rgba(var(--primary-rgb), 0.4);
    z-index: 2;
}

.blog-badge a {
    color: var(--text-on-primary) !important;
}

.blog-badge a:hover {
    opacity: 0.9;
}

.blog-card-body {
    display: flex;
    flex-direction: column;
    padding: 20px;
    flex-grow: 1;
}

.blog-meta {
    display: flex;
    align-items: center;
    font-size: 0.78rem;
    color: var(--text-muted);
    margin-bottom: 10px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.blog-meta-sep {
    margin: 0 8px;
    opacity: 0.5;
}

.blog-card-title {
    font-size: 1.25rem;
    font-weight: 700;
    line-height: 1.3;
    margin-bottom: 12px;
}

.blog-card-title a {
    color: var(--text-main);
    text-decoration: none !important;
}

.blog-card-title a:hover {
    color: var(--primary);
}

.blog-excerpt {
    color: var(--text-muted);
    font-size: 0.9rem;
    line-height: 1.6;
    margin-bottom: 20px;
    flex-grow: 1;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.blog-card-footer {
    border-top: 1px solid var(--border-color);
    padding-top: 15px;
    margin-top: auto;
}

.read-more-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--primary) !important;
    transition: color 0.2s;
    text-transform: uppercase;
}

.read-more-btn svg {
    transition: transform 0.2s ease;
}

.read-more-btn:hover {
    color: var(--text-main) !important;
}

.read-more-btn:hover svg {
    transform: translateX(4px);
}

/* Single Blog Post Layout & Typography */
.blog-single-container {
    padding-top: 20px;
}

.blog-breadcrumbs {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 25px;
}

.blog-breadcrumbs .sep {
    opacity: 0.4;
}

.blog-breadcrumbs .current {
    color: var(--text-main);
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 250px;
}

.blog-article-header {
    margin-bottom: 30px;
}

.blog-cat-badges {
    display: flex;
    gap: 8px;
    margin-bottom: 15px;
}

.blog-cat-badges .badge-large {
    position: static;
    display: inline-block;
    padding: 6px 16px;
    font-size: 0.8rem;
}

.blog-article-title {
    font-size: 2.2rem;
    font-weight: 800;
    line-height: 1.2;
    margin-bottom: 20px;
}

@media (min-width: 768px) {
    .blog-article-title {
        font-size: 2.8rem;
    }
}

.blog-article-meta {
    display: flex;
    flex-direction: column;
    gap: 15px;
    padding: 15px 0;
    border-top: 1px solid var(--border-color);
    border-bottom: 1px solid var(--border-color);
}

@media (min-width: 600px) {
    .blog-article-meta {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
    }
}

.meta-item.author {
    display: flex;
    align-items: center;
    gap: 12px;
}

.meta-item.author img {
    border-radius: 50%;
    border: 2px solid var(--primary);
}

.meta-item.author .label {
    display: block;
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
}

.meta-item-group {
    display: flex;
    align-items: center;
    gap: 20px;
}

.meta-item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.meta-item svg {
    opacity: 0.7;
}

/* Featured image on Single */
.blog-article-featured-image {
    width: 100%;
    margin-bottom: 35px;
    border-radius: var(--radius-lg);
    overflow: hidden;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-md);
}

.featured-img-full {
    width: 100%;
    height: auto;
    display: block;
    max-height: 550px;
    object-fit: cover;
}

/* Readability-focused content area */
.blog-article-content {
    font-size: 1.1rem;
    line-height: 1.8;
    color: #e0e0e0;
}

.blog-article-content p {
    margin-bottom: 25px;
}

.blog-article-content h2, 
.blog-article-content h3, 
.blog-article-content h4 {
    margin: 40px 0 20px 0;
    font-weight: 800;
    line-height: 1.3;
}

.blog-article-content h2 {
    font-size: 1.75rem;
}

.blog-article-content blockquote {
    background: rgba(255,255,255,0.02);
    border-left: 4px solid var(--primary);
    padding: 20px 30px;
    margin: 30px 0;
    font-style: italic;
    font-size: 1.2rem;
    color: var(--text-main);
}

.blog-article-content ul, 
.blog-article-content ol {
    margin-bottom: 25px;
    padding-left: 25px;
}

.blog-article-content li {
    margin-bottom: 10px;
}

.blog-article-content img {
    border-radius: var(--radius);
    margin: 30px auto;
    box-shadow: var(--shadow-sm);
}

/* Footer tags & Share */
.blog-article-footer {
    margin-top: 40px;
    padding-top: 25px;
    border-top: 1px solid var(--border-color);
}

.blog-tags-list {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 25px;
}

.tags-label {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-muted);
}

.blog-tag-item {
    background: rgba(255,255,255,0.05);
    color: var(--text-muted) !important;
    padding: 4px 12px;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 500;
    transition: all 0.2s;
}

.blog-tag-item:hover {
    background: var(--primary);
    color: var(--text-on-primary) !important;
}

.blog-share-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 15px 20px;
    background: rgba(255,255,255,0.03);
    border-radius: var(--radius);
    border: 1px solid var(--border-color);
}

.share-label {
    font-size: 0.9rem;
    font-weight: 600;
}

.blog-share-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: var(--primary);
    color: var(--text-on-primary);
    border: none;
    border-radius: 99px;
    font-weight: 600;
    font-size: 0.8rem;
    cursor: pointer;
    transition: background 0.2s, transform 0.2s;
}

.blog-share-btn:hover {
    background: var(--primary-hover);
    transform: translateY(-1px);
}

.blog-share-btn.copied {
    background: var(--success);
}

/* Author Box */
.blog-author-box {
    display: flex;
    gap: 20px;
    padding: 30px;
    background: #101010;
    border-radius: var(--radius);
    border: 1px solid var(--border-color);
    margin: 40px 0;
}

.author-avatar img {
    border-radius: 50%;
    border: 3px solid rgba(var(--primary-rgb), 0.3);
}

.author-info {
    flex-grow: 1;
}

.author-name {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 8px;
}

.author-bio {
    color: var(--text-muted);
    font-size: 0.9rem;
    line-height: 1.6;
}

/* Prev/Next Nav */
.blog-post-navigation {
    margin-bottom: 40px;
}

.blog-post-navigation .nav-links {
    display: grid;
    grid-template-columns: 1fr;
    gap: 15px;
}

@media (min-width: 600px) {
    .blog-post-navigation .nav-links {
        grid-template-columns: 1fr 1fr;
    }
}

.blog-post-navigation a {
    display: block;
    padding: 20px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    transition: all 0.2s;
}

.blog-post-navigation a:hover {
    border-color: var(--primary);
    background: rgba(var(--primary-rgb), 0.03);
}

.blog-post-navigation .meta-nav {
    display: block;
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    font-weight: 700;
    letter-spacing: 0.5px;
    margin-bottom: 5px;
}

.blog-post-navigation .nav-title {
    display: block;
    font-weight: 700;
    font-size: 1rem;
    color: var(--text-main);
}

.nav-next {
    text-align: right;
}

/* Custom Widget Styling for Blog Sidebar */
.blog-widget {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 20px;
    margin-bottom: 20px;
}

.blog-widget .widget-title {
    font-size: 1.1rem;
    font-weight: 800;
    text-transform: uppercase;
    margin-bottom: 15px;
    padding-bottom: 8px;
    border-bottom: 2px solid var(--primary);
    display: inline-block;
}

.blog-widget ul {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.blog-widget li {
    font-size: 0.9rem;
}

.blog-widget a {
    color: var(--text-muted);
}

.blog-widget a:hover {
    color: var(--primary);
}

/* Blog Comments styling alignment */
.blog-content-column #comments {
    margin-top: 40px;
    background: var(--bg-card);
    padding: 30px;
    border-radius: var(--radius);
    border: 1px solid var(--border-color);
}

