/* ==========================================================================
   TVZINHA ONLINE - DESIGN SYSTEM & MODERN STYLING
   ========================================================================== */

:root {
    /* Obsidian & Charcoal Surfaces */
    --bg-base: #090c0b;
    --bg-sidebar: #0f1412;
    --bg-surface: #141a17;
    --bg-surface-elevated: #19221e;
    --bg-surface-hover: #1f2c25;
    --bg-card: rgba(20, 26, 23, 0.85);
    --bg-glass: rgba(15, 20, 18, 0.88);

    /* Primary & Emerald Accents */
    --primary: #10b981;
    --primary-glow: rgba(16, 185, 129, 0.22);
    --primary-hover: #059669;
    --primary-light: #34d399;
    --accent-emerald: #10b981;
    --accent-emerald-hover: #059669;
    --accent-emerald-subtle: rgba(16, 185, 129, 0.12);
    --accent-emerald-glow: rgba(16, 185, 129, 0.22);
    --accent-emerald-border: rgba(16, 185, 129, 0.35);
    --accent-cyan: #06b6d4;
    --accent-red: #ef4444;
    --accent-red-subtle: rgba(239, 68, 68, 0.15);
    --accent-gold: #f59e0b;

    /* Text Colors */
    --text-primary: #f3f4f6;
    --text-secondary: #9ca3af;
    --text-muted: #6b7280;
    --text-inverse: #090c0b;

    /* Hairline Borders & Lines */
    --border-subtle: rgba(255, 255, 255, 0.07);
    --border-medium: rgba(255, 255, 255, 0.12);
    --border-hover: rgba(16, 185, 129, 0.35);
    --border-focus: rgba(16, 185, 129, 0.6);

    /* Shadows & Effects */
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.4);
    --shadow-md: 0 4px 14px rgba(0, 0, 0, 0.5);
    --shadow-lg: 0 10px 30px rgba(0, 0, 0, 0.7);
    --shadow-glow: 0 0 16px var(--accent-emerald-glow);

    /* Transitions & Radii */
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;
    --radius-xl: 22px;
    --radius-full: 9999px;
    --transition-fast: 0.15s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-base: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-smooth: 0.35s cubic-bezier(0.16, 1, 0.3, 1);

    /* Typography */
    --font-heading: 'Outfit', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-body: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
}

/* Reset & Global Base */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    height: 100%;
    width: 100%;
    overflow-x: hidden;
    background-color: var(--bg-base);
    color: var(--text-primary);
    font-family: var(--font-body);
    font-size: 15px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

/* Scrollbar Customization */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: transparent;
}
::-webkit-scrollbar-thumb {
    background: var(--bg-surface-hover);
    border-radius: var(--radius-full);
}
::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}


/* Base Layout */
.app-layout {
    display: flex;
    height: 100vh;
    width: 100vw;
    overflow: hidden;
    position: relative;
}

/* ==========================================================================
   MOBILE HEADER
   ========================================================================== */
.mobile-header {
    display: none;
    align-items: center;
    justify-content: space-between;
    padding: 12px 18px;
    background: var(--bg-surface);
    border-bottom: 1px solid var(--border-subtle);
    position: sticky;
    top: 0;
    z-index: 50;
}

.mobile-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 1.15rem;
}

.mobile-brand span {
    color: var(--primary-light);
}

.mobile-brand .mobile-brand-icon {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    padding: 3px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.4), 0 0 10px var(--primary-glow);
}

.mobile-live-badge {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    color: var(--accent-red);
    background: rgba(239, 68, 68, 0.12);
    border: 1px solid rgba(239, 68, 68, 0.3);
    padding: 4px 10px;
    border-radius: var(--radius-full);
}

/* ==========================================================================
   SIDEBAR & RESIZER
   ========================================================================== */
.sidebar {
    width: var(--sidebar-width, 320px);
    min-width: 250px;
    max-width: 600px;
    height: 100%;
    background: var(--bg-surface);
    border-right: 1px solid var(--border-subtle);
    display: flex;
    flex-direction: column;
    z-index: 100;
    position: relative;
    overflow: hidden;
}

/* Drag to resize handle */
.sidebar-resizer {
    position: absolute;
    top: 0;
    right: 0;
    width: 6px;
    height: 100%;
    cursor: col-resize;
    background: transparent;
    z-index: 120;
    transition: background var(--transition-fast);
}

.sidebar-resizer:hover,
body.is-resizing .sidebar-resizer {
    background: var(--primary);
    box-shadow: 0 0 12px var(--primary-glow);
}

body.is-resizing {
    user-select: none !important;
    cursor: col-resize !important;
}

.sidebar-header {
    padding: 16px 18px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--border-subtle);
    flex-shrink: 0;
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    user-select: none;
    transition: opacity var(--transition-fast);
}

.brand:hover {
    opacity: 0.95;
}

.brand-icon-wrapper {
    width: 46px;
    height: 46px;
    border-radius: 12px;
    background: linear-gradient(145deg, rgba(25, 34, 30, 0.9), rgba(15, 20, 18, 0.95));
    border: 1px solid rgba(16, 185, 129, 0.28);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    overflow: hidden;
    padding: 3px;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.45), 0 0 14px var(--primary-glow);
    transition: transform var(--transition-fast), box-shadow var(--transition-fast), border-color var(--transition-fast);
}

.brand:hover .brand-icon-wrapper {
    transform: scale(1.05);
    border-color: rgba(16, 185, 129, 0.6);
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.5), 0 0 18px rgba(16, 185, 129, 0.35);
}

.brand-logo-img-header {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
    transition: transform var(--transition-fast);
}

.brand:hover .brand-logo-img-header {
    transform: scale(1.02);
}

.mobile-brand .brand-logo-img-header {
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: 0;
    flex-shrink: 0;
}

.brand-text h2 {
    font-family: var(--font-heading);
    font-size: 1.2rem;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.brand-text h2 span {
    background: linear-gradient(135deg, var(--primary-light), var(--accent-cyan));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.brand-tag {
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: var(--accent-cyan);
    background: rgba(6, 182, 212, 0.12);
    padding: 2px 6px;
    border-radius: 4px;
}

.close-mobile {
    display: none;
}

/* Search Bar */
.search-container {
    padding: 12px 16px 8px;
    flex-shrink: 0;
}

.search-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    background: var(--bg-surface-elevated);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 0 10px;
    transition: var(--transition-fast);
}

.search-input-wrapper:focus-within {
    border-color: var(--border-focus);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
}

.search-icon {
    color: var(--text-muted);
    flex-shrink: 0;
}

.search-input-wrapper input {
    width: 100%;
    padding: 8px 6px;
    background: transparent;
    border: none;
    outline: none;
    color: var(--text-primary);
    font-size: 0.88rem;
    font-family: var(--font-body);
}

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

.btn-clear {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.2rem;
    cursor: pointer;
    line-height: 1;
    padding: 2px 4px;
}
.btn-clear:hover {
    color: var(--text-primary);
}
.hidden {
    display: none !important;
}

/* Category Filter Pills */
.filter-pills-container {
    display: flex;
    gap: 6px;
    padding: 4px 16px 10px;
    overflow-x: auto;
    scrollbar-width: none;
    flex-shrink: 0;
}
.filter-pills-container::-webkit-scrollbar {
    display: none;
}

.pill {
    padding: 5px 12px;
    background: var(--bg-surface-elevated);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-full);
    color: var(--text-secondary);
    font-size: 0.78rem;
    font-weight: 500;
    cursor: pointer;
    white-space: nowrap;
    transition: var(--transition-fast);
}

.pill:hover {
    background: var(--bg-surface-hover);
    color: var(--text-primary);
}

.pill.active {
    background: var(--primary);
    border-color: var(--primary);
    color: #ffffff;
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.4);
}

/* Channels Navigation List with Robust Scroll */
.channels-nav {
    flex: 1 1 0%;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 6px 12px 24px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.channels-nav::-webkit-scrollbar {
    width: 6px;
}
.channels-nav::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.1);
}
.channels-nav::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.18);
    border-radius: 4px;
}
.channels-nav::-webkit-scrollbar-thumb:hover {
    background: var(--primary-light);
}

/* Accordion Category */
.category-group {
    border-radius: var(--radius-md);
    background: rgba(26, 32, 44, 0.45);
    border: 1px solid var(--border-subtle);
    overflow: hidden;
    flex-shrink: 0;
    transition: var(--transition-fast);
}

.category-group:hover {
    border-color: var(--border-medium);
}

.category-header {
    width: 100%;
    padding: 10px 12px;
    background: transparent;
    border: none;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    font-family: var(--font-heading);
    font-size: 0.92rem;
    font-weight: 600;
    text-align: left;
    transition: var(--transition-fast);
}

.category-header:hover {
    background: rgba(255, 255, 255, 0.03);
}

.category-title {
    display: flex;
    align-items: center;
    gap: 8px;
}

.category-badge-count {
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--text-muted);
    background: var(--bg-surface);
    padding: 2px 6px;
    border-radius: var(--radius-full);
}

.category-chevron {
    color: var(--text-muted);
    transition: transform var(--transition-base);
}

.category-group.open .category-chevron {
    transform: rotate(180deg);
}

.channel-items-list {
    display: none;
    padding: 4px 8px 8px;
    flex-direction: column;
    gap: 4px;
}

.category-group.open .channel-items-list {
    display: flex;
}

/* Channel Button */
.channel-btn {
    width: 100%;
    padding: 6px 8px;
    background: transparent;
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 500;
    text-align: left;
    transition: var(--transition-fast);
}

.channel-btn:hover {
    background: var(--bg-surface-hover);
    color: var(--text-primary);
    transform: translateX(2px);
}

.channel-btn.active {
    background: rgba(16, 185, 129, 0.08);
    border-color: transparent;
    border-left: 2px solid var(--accent-emerald);
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    color: var(--text-primary);
    font-weight: 600;
}

.channel-btn .channel-info-left {
    display: flex;
    align-items: center;
    gap: 10px;
    overflow: hidden;
}

.channel-btn .channel-name {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.channel-btn .channel-options-count {
    font-size: 0.68rem;
    color: var(--text-muted);
    background: rgba(255, 255, 255, 0.05);
    padding: 2px 5px;
    border-radius: 4px;
    flex-shrink: 0;
}

.channel-btn.active .channel-options-count {
    background: rgba(16, 185, 129, 0.18);
    color: var(--primary-light);
}

/* ==========================================================================
   CHANNEL REAL LOGO CONTAINERS
   ========================================================================== */
.channel-logo-img-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    border-radius: var(--radius-sm);
    background: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.2);
    position: relative;
    overflow: hidden;
    transition: var(--transition-fast);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

.channel-logo-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.12));
    transition: transform var(--transition-fast);
}

/* Sizes */
.channel-logo-img-wrapper.logo-sm {
    width: 32px;
    height: 32px;
    padding: 3px;
    border-radius: 6px;
    background: #ffffff;
}

.channel-logo-img-wrapper.logo-md {
    width: 48px;
    height: 48px;
    padding: 5px;
    border-radius: var(--radius-md);
    background: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.3);
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.25);
}

.channel-logo-img-wrapper.logo-lg {
    width: 64px;
    height: 64px;
    padding: 7px;
    border-radius: var(--radius-lg);
    background: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.3);
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.3);
}

.quick-card:hover .channel-logo-img-wrapper.logo-lg {
    border-color: var(--primary-light);
    box-shadow: 0 0 16px var(--primary-glow), 0 4px 14px rgba(0, 0, 0, 0.3);
}

.quick-card:hover .channel-logo-img {
    transform: scale(1.06);
}

.channel-logo-fallback {
    font-weight: 700;
    font-size: 0.72rem;
    color: #1e293b;
    background: linear-gradient(135deg, #e2e8f0, #cbd5e1);
}

/* ==========================================================================
   MAIN CONTENT AREA
   ========================================================================== */
.main-content {
    flex: 1;
    height: 100%;
    overflow-y: auto;
    background: radial-gradient(circle at 50% 0%, rgba(16, 185, 129, 0.05), transparent 65%), var(--bg-base);
    padding: 28px 36px;
    display: flex;
    flex-direction: column;
}

.content-display {
    max-width: 1280px;
    width: 100%;
    margin: 0 auto;
    height: 100%;
    display: flex;
    flex-direction: column;
}

/* Welcome Screen */
.welcome-screen {
    display: flex;
    flex-direction: column;
    gap: 36px;
    animation: fadeIn 0.4s ease-out;
}

.welcome-hero {
    background: linear-gradient(135deg, rgba(20, 26, 23, 0.8), rgba(15, 20, 18, 0.92));
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-xl);
    padding: 36px 40px;
    position: relative;
    overflow: hidden;
    backdrop-filter: blur(16px);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 32px;
}

.welcome-hero::after {
    content: '';
    position: absolute;
    top: -50%;
    right: -20%;
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(16, 185, 129, 0.08) 0%, transparent 70%);
    pointer-events: none;
}

.welcome-hero-text {
    flex: 1;
    z-index: 2;
}

.welcome-hero-emblem {
    flex-shrink: 0;
    width: 108px;
    height: 108px;
    border-radius: 22px;
    background: linear-gradient(145deg, rgba(25, 34, 30, 0.85), rgba(15, 20, 18, 0.95));
    border: 1px solid rgba(16, 185, 129, 0.28);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 10px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5), 0 0 24px var(--primary-glow);
    z-index: 2;
    transition: transform var(--transition-smooth), box-shadow var(--transition-smooth), border-color var(--transition-smooth);
}

.welcome-hero:hover .welcome-hero-emblem {
    transform: translateY(-3px) scale(1.04);
    border-color: rgba(16, 185, 129, 0.55);
    box-shadow: 0 14px 36px rgba(0, 0, 0, 0.6), 0 0 32px rgba(16, 185, 129, 0.35);
}

.hero-emblem-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    filter: drop-shadow(0 4px 10px rgba(0, 0, 0, 0.45));
    transition: transform var(--transition-fast);
}

.welcome-hero:hover .hero-emblem-img {
    transform: scale(1.03);
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 14px;
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid rgba(16, 185, 129, 0.25);
    border-radius: var(--radius-full);
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--primary-light);
    margin-bottom: 16px;
}

.pulse-dot, .live-dot {
    width: 7px;
    height: 7px;
    background-color: var(--accent-emerald);
    border-radius: 50%;
    box-shadow: 0 0 8px rgba(16, 185, 129, 0.6);
    display: inline-block;
    animation: pulseEmerald 2s infinite;
}

@keyframes pulseEmerald {
    0% {
        box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.5);
    }
    70% {
        box-shadow: 0 0 0 6px rgba(16, 185, 129, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(16, 185, 129, 0);
    }
}

.live-indicator {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    color: var(--accent-emerald);
}

.hero-title {
    font-family: var(--font-heading);
    font-size: 2.1rem;
    font-weight: 700;
    line-height: 1.25;
    margin-bottom: 12px;
    letter-spacing: -0.02em;
}

.hero-subtitle {
    font-size: 1rem;
    color: var(--text-secondary);
    max-width: 720px;
    line-height: 1.6;
}

.hero-subtitle strong {
    color: var(--text-primary);
}

/* Quick Channels Grid with Logos */
.quick-channels-section {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.section-heading {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    border-bottom: 1px solid var(--border-subtle);
    padding-bottom: 10px;
}

.section-heading h3 {
    font-family: var(--font-heading);
    font-size: 1.25rem;
    font-weight: 700;
}

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

.quick-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 18px;
}

.quick-card {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: 20px;
    cursor: pointer;
    transition: var(--transition-base);
    display: flex;
    flex-direction: column;
    gap: 14px;
    backdrop-filter: blur(10px);
    position: relative;
}

.quick-card:hover {
    transform: translateY(-3px);
    border-color: var(--border-hover);
    background: var(--bg-surface-hover);
    box-shadow: 0 8px 24px -5px rgba(0, 0, 0, 0.6), 0 0 16px rgba(16, 185, 129, 0.1);
}

.card-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.card-main-info {
    display: flex;
    align-items: center;
    gap: 14px;
}

.card-category-tag {
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    color: var(--text-muted);
}

.card-live {
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--accent-red);
    display: flex;
    align-items: center;
    gap: 4px;
}

.card-title {
    font-family: var(--font-heading);
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--text-primary);
}

.card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.82rem;
    color: var(--text-secondary);
    margin-top: auto;
    padding-top: 10px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.card-play-action {
    color: var(--primary-light);
    display: flex;
    align-items: center;
    gap: 4px;
    font-weight: 600;
}

/* Star Favorite Button */
.btn-card-fav {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 1.1rem;
    cursor: pointer;
    padding: 4px;
    border-radius: var(--radius-sm);
    transition: var(--transition-fast);
    line-height: 1;
}

.btn-card-fav:hover,
.btn-card-fav.favorited {
    color: var(--accent-gold);
    transform: scale(1.15);
}

/* ==========================================================================
   INTEGRATED PLAYER VIEW
   ========================================================================== */
.player-view-container {
    display: flex;
    flex-direction: column;
    gap: 18px;
    animation: fadeIn 0.35s ease-out;
    position: relative;
    z-index: 10;
}

.player-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 14px;
    background: var(--bg-surface-elevated);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: 14px 20px;
}

.player-info {
    display: flex;
    align-items: center;
    gap: 14px;
}

.player-title-box {
    display: flex;
    flex-direction: column;
}

.player-title-box h2 {
    font-family: var(--font-heading);
    font-size: 1.4rem;
    font-weight: 700;
    line-height: 1.2;
}

.player-title-box .channel-category-label {
    font-size: 0.8rem;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 8px;
}

.player-toolbar {
    display: flex;
    align-items: center;
    gap: 10px;
}

.btn-player-action {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    padding: 8px 14px;
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition-fast);
}

.btn-player-action:hover {
    background: var(--bg-surface-hover);
    color: var(--text-primary);
    border-color: var(--border-medium);
}

.btn-player-action.shield-active {
    background: rgba(16, 185, 129, 0.12);
    border-color: rgba(16, 185, 129, 0.35);
    color: var(--primary-light);
}

.btn-player-action.shield-active:hover {
    background: rgba(16, 185, 129, 0.2);
    border-color: var(--primary);
    color: #fff;
    box-shadow: 0 0 10px rgba(16, 185, 129, 0.25);
}

.player-shield-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    padding: 8px 12px;
    font-size: 0.82rem;
    font-weight: 600;
}

/* Video Stage (16:9 Aspect Ratio) */
.video-theater-wrapper {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    background: #000000;
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-lg), 0 0 35px rgba(0, 0, 0, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: box-shadow var(--transition-smooth);
}

.video-theater-wrapper iframe {
    width: 100%;
    height: 100%;
    border: none;
    background: #000000;
    position: relative;
    z-index: 1;
}

/* Video Loading Spinner Overlay */
.video-loader-overlay {
    position: absolute;
    inset: 0;
    background: rgba(10, 12, 16, 0.9);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    z-index: 2;
    transition: opacity var(--transition-base);
    pointer-events: none;
}

.video-loader-overlay.hidden {
    opacity: 0;
    visibility: hidden;
}

.spinner {
    width: 44px;
    height: 44px;
    border: 3px solid rgba(59, 130, 246, 0.2);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

/* Server / Player Selector Section */
.server-selector-card {
    background: var(--bg-surface-elevated);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: 18px 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.server-selector-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.server-selector-header h4 {
    font-family: var(--font-heading);
    font-size: 0.95rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

.server-selector-hint {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.servers-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.btn-server-option {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition-fast);
}

.btn-server-option:hover {
    background: var(--bg-surface-hover);
    color: var(--text-primary);
    border-color: var(--border-medium);
}

.btn-server-option.active {
    background: var(--accent-emerald);
    border-color: var(--accent-emerald);
    color: #090c0b;
    font-weight: 700;
    box-shadow: 0 2px 10px rgba(16, 185, 129, 0.35);
}

/* Stream Tips Note */
.stream-tip-note {
    font-size: 0.8rem;
    color: var(--text-muted);
    padding: 8px 12px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    gap: 8px;
}

/* ==========================================================================
   SKELETONS & UTILITIES
   ========================================================================== */
.skeleton-wrapper {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 10px;
}

.skeleton {
    background: linear-gradient(90deg, var(--bg-surface-elevated) 25%, var(--bg-surface-hover) 50%, var(--bg-surface-elevated) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: var(--radius-sm);
}

.skeleton-category {
    height: 38px;
    width: 100%;
}

.skeleton-channel {
    height: 30px;
    width: 85%;
    margin-left: 15px;
}

.btn-icon {
    background: transparent;
    border: none;
    color: var(--text-primary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 6px;
    border-radius: var(--radius-sm);
    transition: var(--transition-fast);
}

.btn-icon:hover {
    background: var(--bg-surface-hover);
}

.empty-search-state {
    padding: 30px 15px;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.88rem;
}

/* ==========================================================================
   ANIMATIONS
   ========================================================================== */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(6px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.7);
    }
    70% {
        box-shadow: 0 0 0 8px rgba(239, 68, 68, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(239, 68, 68, 0);
    }
}

@keyframes shimmer {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

/* ==========================================================================
   RESPONSIVE DESIGN (MEDIA QUERIES)
   ========================================================================== */
@media (max-width: 1024px) {
    .main-content {
        padding: 20px;
    }
    .welcome-hero {
        padding: 28px;
    }
    .hero-title {
        font-size: 1.8rem;
    }
}

@media (max-width: 768px) {
    .mobile-header {
        display: flex;
    }

    .welcome-hero {
        flex-direction: column;
        align-items: flex-start;
        padding: 24px 20px;
        gap: 16px;
    }

    .welcome-hero-emblem {
        display: none;
    }

    .app-layout {
        flex-direction: column;
        height: calc(100vh - 58px);
    }

    /* Mobile Drawer */
    .sidebar {
        position: fixed;
        top: 0;
        left: 0;
        bottom: 0;
        width: 85%;
        max-width: 320px;
        transform: translateX(-100%);
        box-shadow: var(--shadow-lg);
    }

    .sidebar.open {
        transform: translateX(0);
    }

    .close-mobile {
        display: flex;
    }

    .sidebar-backdrop {
        position: fixed;
        inset: 0;
        background: rgba(0, 0, 0, 0.7);
        backdrop-filter: blur(4px);
        z-index: 90;
        display: none;
    }

    .sidebar-backdrop.active {
        display: block;
    }

    .main-content {
        padding: 16px;
    }

    .welcome-hero {
        padding: 20px;
    }

    .hero-title {
        font-size: 1.5rem;
    }

    .player-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .player-toolbar {
        width: 100%;
        justify-content: space-between;
        flex-wrap: wrap;
    }

    .btn-player-action {
        flex: 1 1 calc(50% - 6px);
        justify-content: center;
    }

    .matches-grid {
        display: flex;
        overflow-x: auto;
        scroll-snap-type: x mandatory;
        padding-bottom: 8px;
        gap: 12px;
        -webkit-overflow-scrolling: touch;
    }

    .match-card {
        flex: 0 0 260px;
        scroll-snap-align: start;
    }
}

/* ==========================================================================
   VASCO MATCH SCHEDULE MODULE (HOME SCREEN)
   ========================================================================== */
.vasco-matches-section {
    display: flex;
    flex-direction: column;
    gap: 16px;
    animation: fadeIn 0.45s ease-out;
}

.matches-heading-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.matches-team-badge {
    font-size: 1.5rem;
    line-height: 1;
    filter: drop-shadow(0 2px 5px rgba(0, 0, 0, 0.5));
}

.matches-heading-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.matches-source-tag {
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--text-muted);
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-subtle);
    padding: 4px 10px;
    border-radius: var(--radius-full);
    white-space: nowrap;
}

/* Nav Arrows for Match Carousel */
.matches-nav-arrows {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.btn-matches-arrow {
    width: 32px;
    height: 32px;
    border-radius: var(--radius-full);
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid var(--border-subtle);
    color: var(--text-primary);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background var(--transition-fast), border-color var(--transition-fast), transform var(--transition-fast), box-shadow var(--transition-fast);
    padding: 0;
}

.btn-matches-arrow:hover:not(:disabled) {
    background: var(--accent-emerald-subtle);
    border-color: var(--accent-emerald-border);
    color: #34d399;
    transform: scale(1.08);
    box-shadow: 0 0 12px var(--primary-glow);
}

.btn-matches-arrow:active:not(:disabled) {
    transform: scale(0.95);
}

.btn-matches-arrow:disabled,
.btn-matches-arrow.disabled {
    opacity: 0.25;
    cursor: not-allowed;
    pointer-events: none;
}

/* Carousel Wrapper & Scroll Container */
.matches-carousel-wrapper {
    position: relative;
    width: 100%;
}

.matches-grid.matches-carousel {
    display: flex;
    flex-wrap: nowrap;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    scroll-snap-type: x mandatory;
    gap: 16px;
    padding: 4px 4px 12px 4px;
    scrollbar-width: thin;
    scrollbar-color: rgba(16, 185, 129, 0.3) rgba(255, 255, 255, 0.03);
    cursor: grab;
}

.matches-grid.matches-carousel.is-dragging {
    scroll-snap-type: none;
    scroll-behavior: auto;
    cursor: grabbing;
}

.matches-grid.matches-carousel::-webkit-scrollbar {
    height: 6px;
}

.matches-grid.matches-carousel::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.03);
    border-radius: var(--radius-full);
}

.matches-grid.matches-carousel::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.14);
    border-radius: var(--radius-full);
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.matches-grid.matches-carousel::-webkit-scrollbar-thumb:hover {
    background: var(--accent-emerald);
}

/* Match Card in Carousel: 3 side-by-side on desktop */
.matches-carousel .match-card {
    flex: 0 0 calc((100% - 32px) / 3);
    min-width: 290px;
    max-width: 440px;
    scroll-snap-align: start;
    box-sizing: border-box;
}

@media (max-width: 1100px) {
    .matches-carousel .match-card {
        flex: 0 0 calc((100% - 16px) / 2);
        min-width: 280px;
    }
}

@media (max-width: 680px) {
    .matches-carousel .match-card {
        flex: 0 0 85%;
        min-width: 260px;
    }

    .matches-heading-right .matches-source-tag {
        display: none;
    }
}

@media (max-width: 420px) {
    .matches-carousel .match-card {
        flex: 0 0 88%;
        min-width: 240px;
    }
}

/* Match Card */
.match-card {
    background: linear-gradient(145deg, rgba(20, 26, 23, 0.85), rgba(15, 20, 18, 0.95));
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: 16px 18px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    min-height: 230px;
    flex-shrink: 0;
    user-select: none;
    backdrop-filter: blur(14px);
    position: relative;
    overflow: hidden;
    transition: transform var(--transition-base), box-shadow var(--transition-base), border-color var(--transition-base);
}

.match-card:hover {
    transform: translateY(-4px);
    border-color: var(--border-hover);
    box-shadow: 0 10px 24px -6px rgba(0, 0, 0, 0.6), 0 0 16px rgba(16, 185, 129, 0.12);
}

/* Featured Next Match */
.match-card.featured {
    border-color: rgba(16, 185, 129, 0.35);
    background: linear-gradient(145deg, rgba(24, 32, 28, 0.92), rgba(16, 22, 19, 0.98));
    box-shadow: 0 6px 20px -4px rgba(0, 0, 0, 0.6), 0 0 16px rgba(16, 185, 129, 0.08);
}

.match-card.featured::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--accent-emerald);
}

/* Top bar: Championship + Status pill */
.match-top-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.championship-badge {
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding: 3px 8px;
    border-radius: var(--radius-sm);
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 140px;
}

.match-status-badge {
    font-size: 0.68rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 2px 8px;
    border-radius: var(--radius-full);
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.match-status-badge.featured {
    background: rgba(16, 185, 129, 0.12);
    border: 1px solid rgba(16, 185, 129, 0.3);
    color: #34d399;
}

.match-status-badge.today {
    background: var(--accent-red-subtle);
    border: 1px solid rgba(239, 68, 68, 0.4);
    color: #f87171;
}

.match-status-badge.tomorrow {
    background: var(--accent-emerald-subtle);
    border: 1px solid rgba(16, 185, 129, 0.3);
    color: #34d399;
}

/* Match Face-off / Duel */
.match-duel {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 2px 0;
}

.duel-team {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    flex: 1;
    gap: 6px;
    min-width: 0;
}

.duel-badge-wrapper {
    width: 44px;
    height: 44px;
    border-radius: var(--radius-full);
    background: #ffffff;
    padding: 5px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.35);
    border: 1px solid rgba(255, 255, 255, 0.2);
    transition: transform var(--transition-fast);
}

.match-card:hover .duel-badge-wrapper {
    transform: scale(1.06);
}

.duel-badge-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.2));
}

.duel-team-name {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 95px;
}

.duel-vs-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    flex-shrink: 0;
}

.duel-vs {
    font-size: 0.72rem;
    font-weight: 900;
    color: var(--text-muted);
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-full);
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    letter-spacing: 0.05em;
}

.duel-date-time {
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--primary-light);
    text-align: center;
    white-space: nowrap;
}

/* Venue row */
.match-meta-row {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.76rem;
    color: var(--text-muted);
}

.match-meta-row svg {
    width: 13px;
    height: 13px;
    flex-shrink: 0;
    opacity: 0.8;
}

.match-meta-stadium {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Broadcast Footer */
.match-broadcast-footer {
    border-top: 1px solid var(--border-subtle);
    padding-top: 8px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.broadcast-label {
    font-size: 0.68rem;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.broadcast-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.broadcast-pill {
    font-size: 0.72rem;
    font-weight: 600;
    padding: 3px 8px;
    border-radius: var(--radius-sm);
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-subtle);
    color: var(--text-secondary);
    display: inline-flex;
    align-items: center;
    gap: 4px;
    transition: var(--transition-fast);
}

.broadcast-pill.playable {
    background: var(--accent-emerald-subtle);
    border-color: var(--accent-emerald-border);
    color: #34d399;
    cursor: pointer;
}

.broadcast-pill.playable:hover {
    background: var(--accent-emerald);
    color: #090c0b;
    border-color: var(--accent-emerald);
    transform: scale(1.04);
    box-shadow: 0 0 10px var(--accent-emerald-glow);
}

.broadcast-pill.empty {
    font-style: italic;
    color: var(--text-muted);
    border-style: dashed;
}

/* Star & Category SVG Icons */
.btn-card-fav .star-icon {
    width: 15px;
    height: 15px;
    fill: none;
    stroke: var(--text-muted);
    stroke-width: 2;
    transition: var(--transition-fast);
}

.btn-card-fav:hover .star-icon {
    stroke: var(--text-primary);
}

.btn-card-fav.favorited .star-icon {
    fill: #f59e0b;
    stroke: #f59e0b;
}

.category-header-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    margin-right: 8px;
    flex-shrink: 0;
}

.category-header-btn:hover .category-header-icon,
.category-header-btn[aria-expanded="true"] .category-header-icon {
    color: var(--accent-emerald);
}

.pill .icon-svg {
    display: inline-flex;
    align-items: center;
    margin-right: 5px;
    vertical-align: -2px;
}

/* Skeleton Loaders */
.skeleton-match-card {
    min-height: 190px;
    animation: pulse 1.8s infinite;
}

.skeleton-match-line {
    height: 14px;
    background: rgba(255, 255, 255, 0.07);
    border-radius: 4px;
}

.skeleton-match-line.short {
    width: 50%;
}

.skeleton-match-duel {
    height: 50px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: var(--radius-md);
    margin: 8px 0;
}
/* --- TV Remote & D-Pad Focus Navigation Styles --- */
:focus-visible,
.tv-focused {
    outline: 2px solid var(--accent-emerald) !important;
    outline-offset: 3px !important;
    box-shadow: 0 0 16px var(--accent-emerald-glow) !important;
    transform: scale(1.02);
    transition: transform var(--transition-fast), outline var(--transition-fast), box-shadow var(--transition-fast);
    z-index: 10;
}

:focus:not(:focus-visible):not(.tv-focused) {
    outline: none;
}
