/* ==========================================
   A1 TV - Premium Aesthetic Stylesheet
   ========================================== */

:root {
    --bg-dark: #040711;
    --bg-panel: rgba(10, 16, 32, 0.65);
    --bg-card: rgba(18, 26, 48, 0.45);
    --bg-card-hover: rgba(30, 42, 75, 0.75);
    --bg-card-active: rgba(0, 242, 254, 0.08);
    
    --border-color: rgba(255, 255, 255, 0.06);
    --border-color-hover: rgba(255, 255, 255, 0.12);
    
    /* Neon Theme Colors */
    --accent-cyan: #00f2fe;
    --accent-cyan-rgb: 0, 242, 254;
    --accent-ruby: #ff0844;
    --accent-ruby-rgb: 255, 8, 68;
    
    /* Category Theme Colors */
    --color-sports: #10b981;    /* Emerald */
    --color-news: #f97316;      /* Orange */
    --color-ent: #06b6d4;       /* Cyan */
    --color-kids: #ec4899;      /* Pink */
    --color-islamic: #8b5cf6;  /* Purple */
    --color-favs: #f59e0b;     /* Gold */
    
    /* Typography */
    --text-main: #f8fafc;
    --text-muted: #8292b0;
    
    /* Glass & Shadows */
    --glass-blur: blur(24px);
    --neon-glow: 0 0 20px rgba(var(--accent-cyan-rgb), 0.25);
    --card-shadow: 0 12px 40px 0 rgba(0, 0, 0, 0.4);
    
    --font-heading: 'Outfit', sans-serif;
    --font-body: 'Plus Jakarta Sans', sans-serif;
}

/* Base Resets */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    outline: none;
    -webkit-tap-highlight-color: transparent;
}

body {
    background-color: var(--bg-dark);
    color: var(--text-main);
    font-family: var(--font-body);
    height: 100vh;
    overflow: hidden;
    position: relative;
    display: flex;
    flex-direction: column;
    user-select: none;
    -webkit-user-select: none;
}

/* Dynamic Ambient Canvas Backlight */
.ambient-glow-canvas {
    position: absolute;
    top: -4%;
    left: -4%;
    width: 108%;
    height: 108%;
    filter: blur(50px) opacity(0);
    z-index: -1;
    pointer-events: none;
    transform: scale(1.04);
    border-radius: 20px;
    transition: opacity 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.video-window-outer.glowing .ambient-glow-canvas {
    opacity: 0.75;
}

/* Fallback Backdrop Layer (Secondary Glow Source) */
.ambient-glow-backdrop {
    position: absolute;
    top: 50%;
    left: 35%;
    transform: translate(-50%, -50%);
    width: 70vw;
    height: 70vw;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(var(--accent-cyan-rgb), 0.12) 0%, rgba(var(--accent-ruby-rgb), 0.04) 50%, transparent 100%);
    filter: blur(100px);
    pointer-events: none;
    z-index: 0;
    transition: background 1s ease;
}

/* Theater Mode Layer Overlay */
body.theater-mode::after {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(2, 3, 7, 0.9);
    pointer-events: none;
    z-index: 8;
    animation: fadeIn 0.4s forwards;
}

/* Header Component */
.app-header {
    height: 70px;
    padding: 0 30px;
    background: rgba(6, 9, 20, 0.8);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 10;
}

.header-brand {
    display: flex;
    align-items: center;
    gap: 15px;
}

.brand-logo {
    width: 46px;
    height: 46px;
    object-fit: contain;
    border-radius: 12px;
    box-shadow: 0 0 20px rgba(var(--accent-cyan-rgb), 0.35);
    border: 1px solid rgba(var(--accent-cyan-rgb), 0.4);
    animation: pulseGlow 4s infinite alternate;
}

.brand-details {
    display: flex;
    flex-direction: column;
}

.brand-title {
    font-family: var(--font-heading);
    font-size: 1.7rem;
    font-weight: 900;
    letter-spacing: -0.5px;
    background: linear-gradient(135deg, #ffffff 40%, var(--accent-cyan) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

.brand-badge {
    font-size: 0.65rem;
    font-weight: 900;
    color: var(--accent-ruby);
    letter-spacing: 3px;
    text-transform: uppercase;
    margin-top: -3px;
    text-shadow: 0 0 10px rgba(var(--accent-ruby-rgb), 0.6);
}

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

.live-clock {
    font-family: var(--font-heading);
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-main);
    background: rgba(255, 255, 255, 0.03);
    padding: 6px 16px;
    border-radius: 30px;
    border: 1px solid var(--border-color);
}

.status-indicator {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(var(--accent-cyan-rgb), 0.04);
    padding: 6px 16px;
    border-radius: 30px;
    border: 1px solid rgba(var(--accent-cyan-rgb), 0.15);
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: var(--accent-cyan);
    box-shadow: 0 0 10px var(--accent-cyan);
    animation: blink 2s infinite;
}

.status-text {
    font-size: 0.65rem;
    font-weight: 900;
    letter-spacing: 1.5px;
    color: var(--accent-cyan);
}

.header-actions {
    display: flex;
    gap: 10px;
}

.action-btn {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    width: 40px;
    height: 40px;
    border-radius: 12px;
    color: var(--text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.action-btn svg {
    width: 20px;
    height: 20px;
    fill: currentColor;
}

.action-btn:hover {
    background: rgba(var(--accent-cyan-rgb), 0.08);
    border-color: var(--accent-cyan);
    color: var(--accent-cyan);
    transform: translateY(-2px);
    box-shadow: var(--neon-shadow);
}

.action-btn.active {
    background: var(--accent-cyan);
    color: #060913;
    border-color: var(--accent-cyan);
    box-shadow: 0 0 15px rgba(var(--accent-cyan-rgb), 0.4);
}

/* App Main Layout */
.app-viewport {
    flex: 1;
    display: flex;
    height: calc(100vh - 105px); /* Header(70px) + Footer(35px) */
    position: relative;
    z-index: 1;
}

/* Left Section: Video Stage */
.player-stage {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 30px;
    justify-content: flex-start;
    gap: 18px;
    z-index: 9; /* Ensure player stays above theater darkness */
    position: relative;
}

.video-window-outer {
    position: relative;
    border-radius: 24px;
    padding: 1.5px;
    background: linear-gradient(135deg, var(--border-color) 0%, rgba(255, 255, 255, 0.05) 100%);
    box-shadow: var(--card-shadow);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.video-window-outer.glowing {
    background: linear-gradient(135deg, rgba(var(--accent-cyan-rgb), 0.4) 0%, rgba(var(--accent-ruby-rgb), 0.2) 100%);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6), 0 0 30px rgba(var(--accent-cyan-rgb), 0.15);
}

.video-window {
    position: relative;
    background: #000;
    width: 100%;
    aspect-ratio: 16/9;
    border-radius: 23px;
    overflow: hidden;
    box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.8);
}

video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Custom Player Overlay Controls */
.player-controls-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, rgba(4, 7, 17, 0.95) 0%, rgba(4, 7, 17, 0.5) 60%, transparent 100%);
    padding: 30px 24px 20px 24px;
    opacity: 0;
    transform: translateY(12px);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 5;
    pointer-events: none;
}

.video-window.show-controls .player-controls-overlay,
.video-window:focus-within .player-controls-overlay {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

.player-control-row {
    display: flex;
    align-items: center;
    gap: 18px;
    min-height: 60px;
    padding-right: 92px;
}

.stage-actions {
    position: absolute;
    right: 18px;
    bottom: 18px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 10px 8px;
    border-radius: 18px;
    background: linear-gradient(180deg, rgba(5, 10, 20, 0.82), rgba(8, 14, 28, 0.58));
    border: 1px solid rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    box-shadow: 0 16px 34px rgba(0, 0, 0, 0.32);
}

.ctrl-btn {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid var(--border-color);
    width: 44px;
    height: 44px;
    border-radius: 12px;
    color: var(--text-main);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.ctrl-btn svg {
    width: 22px;
    height: 22px;
    fill: currentColor;
}

.ctrl-btn:hover {
    background: rgba(var(--accent-cyan-rgb), 0.15);
    border-color: var(--accent-cyan);
    color: var(--accent-cyan);
    transform: scale(1.05);
}

.ctrl-btn.active {
    background: var(--accent-cyan);
    color: #040711;
    border-color: var(--accent-cyan);
}

.stage-action-btn {
    width: 52px;
    height: 52px;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.05);
    color: #d7e2ff;
    position: relative;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.stage-action-btn::after {
    content: attr(data-label);
    position: absolute;
    right: calc(100% + 10px);
    top: 50%;
    transform: translateY(-50%) translateX(6px);
    opacity: 0;
    pointer-events: none;
    padding: 6px 10px;
    border-radius: 999px;
    background: rgba(4, 7, 17, 0.92);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: var(--text-main);
    font-family: var(--font-heading);
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.7px;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.stage-action-btn:hover::after,
.stage-action-btn:focus-visible::after {
    opacity: 1;
    transform: translateY(-50%) translateX(0);
}

.stage-action-btn.active {
    box-shadow: 0 0 18px rgba(var(--accent-cyan-rgb), 0.24);
}

/* Buffering Spinner Overlay */
.buffer-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(4, 7, 17, 0.65);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 15px;
    z-index: 4;
}

.neon-spinner {
    width: 50px;
    height: 50px;
    border: 3px solid rgba(var(--accent-cyan-rgb), 0.1);
    border-top: 3px solid var(--accent-cyan);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    box-shadow: 0 0 15px rgba(var(--accent-cyan-rgb), 0.2);
}

.buffer-text {
    font-size: 0.75rem;
    font-weight: 800;
    letter-spacing: 2.5px;
    color: var(--accent-cyan);
    text-shadow: 0 0 8px rgba(var(--accent-cyan-rgb), 0.5);
}

/* Play Flash Icon Overlay */
.play-flash-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
    z-index: 4;
}

.flash-circle {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: rgba(var(--accent-cyan-rgb), 0.15);
    border: 1px solid rgba(var(--accent-cyan-rgb), 0.3);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--accent-cyan);
    opacity: 0;
    transform: scale(0.5);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.play-flash-overlay.animate .flash-circle {
    animation: flashCircleAnim 0.7s forwards;
}

.flash-circle svg {
    width: 38px;
    height: 38px;
    fill: currentColor;
}

/* Custom Styled Volume Input Slider */
.volume-slider-group {
    display: flex;
    align-items: center;
    gap: 12px;
    background: rgba(255, 255, 255, 0.04);
    padding: 0 15px 0 0;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    transition: all 0.25s ease;
}

.volume-slider-group:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.15);
}

.volume-slider {
    -webkit-appearance: none;
    appearance: none;
    width: 60px;
    height: 4px;
    border-radius: 2px;
    background: rgba(255, 255, 255, 0.12);
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.volume-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--accent-cyan);
    box-shadow: 0 0 8px var(--accent-cyan);
    cursor: pointer;
}

.volume-slider-group:hover .volume-slider {
    width: 90px;
}

.quality-selector-group {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0 12px;
    height: 46px;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    background: rgba(255, 255, 255, 0.04);
}

.quality-label {
    font-family: var(--font-heading);
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.7px;
    color: var(--text-muted);
    text-transform: uppercase;
}

.quality-select {
    min-width: 96px;
    border: none;
    outline: none;
    background: transparent;
    color: var(--text-main);
    font-family: var(--font-heading);
    font-size: 0.82rem;
    font-weight: 700;
    cursor: pointer;
}

.quality-select option {
    background: #08101f;
    color: #fff;
}

.channel-info-display {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 12px;
    overflow: hidden;
    min-width: 0;
}

.active-channel-name {
    font-family: var(--font-heading);
    font-size: 1.25rem;
    font-weight: 700;
    letter-spacing: -0.4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: #fff;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.4);
}

/* EPG Metadata Dashboard Panel */
.active-metadata-panel {
    background: var(--bg-panel);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border: 1px solid var(--border-color);
    border-radius: 22px;
    padding: 18px 24px;
    display: grid;
    grid-template-columns: minmax(0, 1.4fr) minmax(280px, 0.9fr);
    align-items: center;
    gap: 28px;
    box-shadow: var(--card-shadow);
}

.metadata-meta {
    display: flex;
    align-items: center;
    gap: 16px;
    min-width: 0;
}

.metadata-meta > div {
    min-width: 0;
}

.meta-logo {
    width: 52px;
    height: 52px;
    object-fit: contain;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.03);
    padding: 5px;
    border: 1px solid var(--border-color);
    box-shadow: 0 4px 15px rgba(0,0,0,0.15);
}

.meta-title {
    font-family: var(--font-heading);
    font-size: 1.2rem;
    font-weight: 800;
    letter-spacing: -0.5px;
    line-height: 1.1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin: 0;
}

.meta-tags {
    display: flex;
    gap: 8px;
    margin-top: 6px;
    flex-wrap: wrap;
}

.tag-badge {
    font-size: 0.7rem;
    font-weight: 800;
    color: var(--text-muted);
    background: rgba(255, 255, 255, 0.04);
    padding: 4px 12px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    letter-spacing: 0.5px;
}

.tag-badge.glow-red {
    border-color: rgba(var(--accent-ruby-rgb), 0.25);
    color: var(--accent-ruby);
    background: rgba(var(--accent-ruby-rgb), 0.05);
    text-shadow: 0 0 5px rgba(var(--accent-ruby-rgb), 0.3);
}

.metadata-epg {
    width: 100%;
    min-width: 0;
    justify-self: end;
}

.epg-progress-container {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.epg-label {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 16px;
    font-size: 0.75rem;
    letter-spacing: 0.3px;
    font-weight: 500;
}

.epg-label span:first-child {
    flex: 1;
    min-width: 0;
}

.epg-label b {
    color: #fff;
    font-weight: 700;
}

.epg-time {
    color: var(--accent-cyan);
    font-weight: 700;
    white-space: nowrap;
    flex-shrink: 0;
}

.epg-bar {
    height: 6px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 4px;
    overflow: hidden;
}

.epg-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--accent-cyan) 0%, var(--accent-ruby) 100%);
    border-radius: 4px;
    transition: width 0.8s ease;
}

/* Right Section: Sidebar Components */
.dashboard-sidebar {
    width: 400px;
    background: rgba(8, 12, 24, 0.7);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border-left: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow: hidden;
    box-shadow: -10px 0 30px rgba(0, 0, 0, 0.2);
}

.sidebar-shell {
    display: flex;
    flex-direction: column;
    height: 100%;
    background:
        radial-gradient(circle at top right, rgba(var(--accent-cyan-rgb), 0.12), transparent 32%),
        linear-gradient(180deg, rgba(255, 255, 255, 0.03), transparent 22%);
}

.sidebar-panel-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 14px;
    padding: 24px 24px 4px 24px;
}

.sidebar-eyebrow {
    display: inline-block;
    font-size: 0.68rem;
    font-weight: 800;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: var(--accent-cyan);
    margin-bottom: 6px;
}

.sidebar-heading {
    font-family: var(--font-heading);
    font-size: 1.35rem;
    font-weight: 800;
    letter-spacing: -0.4px;
}

.sidebar-mini-badge {
    padding: 8px 12px;
    border-radius: 999px;
    border: 1px solid rgba(var(--accent-ruby-rgb), 0.24);
    background: rgba(var(--accent-ruby-rgb), 0.08);
    color: #ffd8e3;
    font-size: 0.68rem;
    font-weight: 800;
    letter-spacing: 1.3px;
    text-transform: uppercase;
    white-space: nowrap;
}

.sidebar-search {
    padding: 24px 24px 12px 24px;
}

.search-box {
    position: relative;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    display: flex;
    align-items: center;
    padding: 0 18px;
    height: 56px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

.search-box:focus-within {
    border-color: var(--accent-cyan);
    box-shadow: 0 0 20px rgba(var(--accent-cyan-rgb), 0.15);
    background: rgba(255, 255, 255, 0.05);
}

.search-icon {
    font-size: 0.95rem;
    margin-right: 14px;
    opacity: 0.5;
}

.search-box input {
    background: transparent;
    border: none;
    color: #fff;
    font-size: 0.95rem;
    width: 100%;
    font-family: var(--font-body);
}

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

.clear-search-btn {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: var(--text-muted);
    width: 30px;
    height: 30px;
    border-radius: 999px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.clear-search-btn:hover {
    color: #fff;
    border-color: rgba(var(--accent-cyan-rgb), 0.3);
    background: rgba(var(--accent-cyan-rgb), 0.12);
}

/* Category Slider Nav */
.category-tabs {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    padding: 12px 24px;
    scrollbar-width: none; /* Hide scrollbar Firefox */
}

.category-tabs::-webkit-scrollbar {
    display: none; /* Hide scrollbar Chrome/Safari */
}

.tab-item {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    padding: 10px 18px;
    border-radius: 999px;
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--text-muted);
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

.tab-item:hover {
    border-color: var(--border-color-hover);
    color: #fff;
    background: rgba(255, 255, 255, 0.06);
    transform: translateY(-1px);
}

.tab-item.active {
    background: rgba(var(--accent-cyan-rgb), 0.12);
    border-color: var(--accent-cyan);
    color: var(--accent-cyan);
    box-shadow: 0 0 15px rgba(var(--accent-cyan-rgb), 0.2);
}

.tab-item.favs-tab.active {
    background: rgba(245, 158, 11, 0.12);
    border-color: var(--color-favs);
    color: var(--color-favs);
    box-shadow: 0 0 15px rgba(245, 158, 11, 0.2);
}

.tab-item.favs-tab:hover {
    color: var(--color-favs);
}

.sidebar-title-bar {
    padding: 18px 24px 8px 24px;
    font-size: 0.8rem;
    font-weight: 800;
    letter-spacing: 1.5px;
    color: var(--text-muted);
    text-transform: uppercase;
}

/* Channels List Grid Layout */
.channel-card-list {
    flex: 1;
    overflow-y: scroll;
    padding: 14px 24px 24px 24px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.05) transparent;
}

.channel-card-list::-webkit-scrollbar {
    width: 6px;
}

.channel-card-list::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.08);
    border-radius: 4px;
}

.channel-card-list::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.15);
}

/* Premium Dynamic Channel Cards */
.channel-card {
    background: linear-gradient(180deg, rgba(18, 26, 48, 0.72), rgba(10, 16, 31, 0.88));
    border: 1px solid rgba(255, 255, 255, 0.07);
    border-radius: 20px;
    padding: 14px 52px 14px 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    min-height: 60px;
}

.channel-card::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: var(--accent-cyan);
    opacity: 0;
    transition: opacity 0.2s ease;
}

.channel-card:hover {
    background: linear-gradient(180deg, rgba(27, 39, 69, 0.88), rgba(12, 20, 39, 0.94));
    border-color: rgba(var(--accent-cyan-rgb), 0.3);
    transform: translateY(-2px);
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.34), 0 0 14px rgba(var(--accent-cyan-rgb), 0.12);
}

.channel-card.active {
    background: linear-gradient(180deg, rgba(4, 35, 45, 0.92), rgba(8, 19, 34, 0.98));
    border-color: var(--accent-cyan);
    box-shadow: 0 0 20px rgba(var(--accent-cyan-rgb), 0.2);
}

.channel-card.active::before {
    opacity: 1;
}

.card-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    min-width: 0;
    width: 100%;
}

.card-logo {
    width: 42px;
    height: 42px;
    flex-shrink: 0;
    object-fit: contain;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.04);
    padding: 3px;
    border: 1px solid var(--border-color);
}

.card-name {
    flex: 1;
    min-width: 0;
    font-size: 0.95rem;
    font-weight: 800;
    line-height: 1.2;
    color: var(--text-main);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    letter-spacing: -0.2px;
}

.star-btn {
    position: absolute;
    top: 50%;
    right: 12px;
    transform: translateY(-50%);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 999px;
    border: 1px solid var(--border-color);
    background: rgba(255, 255, 255, 0.03);
    color: var(--text-muted);
    font-size: 1rem;
    font-weight: 900;
    line-height: 1;
    cursor: pointer;
    transition: all 0.2s ease;
    z-index: 2;
}

.star-btn:hover {
    color: #fff;
    border-color: rgba(var(--accent-cyan-rgb), 0.35);
    background: rgba(var(--accent-cyan-rgb), 0.08);
}

.star-btn.active {
    color: #ffd76a;
    border-color: rgba(255, 215, 106, 0.35);
    background: rgba(255, 215, 106, 0.08);
    box-shadow: 0 0 10px rgba(255, 215, 106, 0.12);
}

.card-num {
    flex-shrink: 0;
    background: rgba(255, 255, 255, 0.04);
    font-size: 0.72rem;
    padding: 7px 10px;
    border-radius: 999px;
    color: var(--text-muted);
    border: 1px solid var(--border-color);
    font-family: var(--font-heading);
    font-weight: 800;
    letter-spacing: 0.6px;
}

.channel-card.active .card-num {
    background: rgba(var(--accent-cyan-rgb), 0.15);
    color: var(--accent-cyan);
    border-color: rgba(var(--accent-cyan-rgb), 0.4);
    box-shadow: 0 0 10px rgba(var(--accent-cyan-rgb), 0.2);
}

.channel-empty-state {
    padding: 40px 20px;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.9rem;
    border: 1px dashed rgba(255, 255, 255, 0.08);
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.02);
}

/* Interactive Modals and Short-list items */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(3, 5, 12, 0.85);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
    animation: fadeIn 0.3s ease;
}

.modal-card {
    background: var(--bg-panel);
    border: 1px solid var(--border-color);
    width: 480px;
    max-width: 90%;
    border-radius: 24px;
    box-shadow: var(--card-shadow);
    overflow: hidden;
}

.modal-header {
    padding: 24px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    font-family: var(--font-heading);
    font-size: 1.35rem;
    font-weight: 800;
}

.close-modal-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 1.25rem;
    cursor: pointer;
}

.close-modal-btn:hover {
    color: #fff;
}

.modal-body {
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.shortcut-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
    padding-bottom: 12px;
}

.shortcut-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.key {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    padding: 4px 12px;
    border-radius: 8px;
    font-family: var(--font-heading);
    font-size: 0.75rem;
    font-weight: 800;
    color: var(--accent-cyan);
    box-shadow: 0 3px 6px rgba(0, 0, 0, 0.3);
}

/* Audio Unmute Overlay */
.unmute-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(4, 6, 14, 0.95);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 6;
    animation: fadeIn 0.3s ease;
}

.unmute-box {
    text-align: center;
    background: var(--bg-panel);
    border: 1px solid var(--border-color);
    padding: 35px 50px;
    border-radius: 24px;
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    box-shadow: var(--card-shadow);
}

.unmute-icon {
    font-size: 3rem;
    display: block;
    margin-bottom: 22px;
    animation: pulse 1.5s infinite;
}

.unmute-btn {
    background: linear-gradient(135deg, var(--accent-cyan) 0%, #00a4c5 100%);
    border: none;
    color: #040711;
    padding: 15px 32px;
    font-family: var(--font-heading);
    font-size: 1.15rem;
    font-weight: 900;
    border-radius: 12px;
    cursor: pointer;
    box-shadow: 0 6px 20px rgba(0, 242, 254, 0.4);
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.unmute-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 242, 254, 0.6);
}

/* Footer Section */
.app-footer {
    height: 35px;
    padding: 0 30px;
    background: #03050a;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.75rem;
    color: var(--text-muted);
    z-index: 10;
}

.footer-copy a {
    color: var(--text-muted);
    text-decoration: none;
    font-weight: 700;
    transition: all 0.2s ease;
    border-bottom: 1px dotted var(--text-muted);
    padding-bottom: 1px;
}

.footer-copy a:hover {
    color: var(--accent-cyan);
    border-bottom-color: var(--accent-cyan);
    text-shadow: 0 0 8px rgba(var(--accent-cyan-rgb), 0.3);
}

.visitor-dashboard {
    display: flex;
    align-items: center;
    gap: 8px;
}

.pulse-ring {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--accent-cyan);
    box-shadow: 0 0 8px var(--accent-cyan);
    animation: blink 2.5s infinite;
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

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

@keyframes pulseGlow {
    0% { box-shadow: 0 0 10px rgba(var(--accent-cyan-rgb), 0.25); }
    100% { box-shadow: 0 0 25px rgba(var(--accent-cyan-rgb), 0.5); }
}

@keyframes blink {
    0% { opacity: 0.2; }
    50% { opacity: 1; }
    100% { opacity: 0.2; }
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.08); }
    100% { transform: scale(1); }
}

@keyframes flashCircleAnim {
    0% { opacity: 0; transform: scale(0.5); }
    50% { opacity: 1; transform: scale(1.1); }
    100% { opacity: 0; transform: scale(1.3); }
}

/* ========================================================
   Responsive Media Queries (Fully Responsive Upgrades)
   ======================================================== */

/* Tablet & Smaller Screens (Horizontal collapsing) */
@media (max-width: 1024px) {
    body {
        overflow-y: auto;
        height: auto;
    }
    
    .app-viewport {
        flex-direction: column;
        height: auto;
        overflow: visible;
    }
    
    .player-stage {
        padding: 20px;
        height: auto;
    }
    
    .video-window-outer {
        border-radius: 20px;
    }
    
    .video-window {
        border-radius: 19px;
    }

    .stage-actions {
        right: 14px;
        bottom: 14px;
    }

    .quality-selector-group {
        height: 42px;
    }
    
    .active-metadata-panel {
        flex-direction: column;
        gap: 20px;
        align-items: flex-start;
        padding: 20px;
    }
    
    .metadata-epg {
        width: 100%;
    }
    
    .dashboard-sidebar {
        width: 100%;
        height: auto;
        border-left: none;
        border-top: 1px solid var(--border-color);
        background: rgba(6, 9, 20, 0.95);
        box-shadow: none;
    }

    .sidebar-search {
        padding: 20px 20px 10px 20px;
    }

    .sidebar-panel-head {
        padding: 20px 20px 0 20px;
    }

    .category-tabs {
        padding: 5px 20px 15px 20px;
    }

    /* Wrap cards in a multi-column responsive grid on tablet! */
    .channel-card-list {
        display: grid;
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
        gap: 12px;
        padding: 15px 20px 30px 20px;
        max-height: 600px;
        overflow-y: auto;
    }
}

/* Mobile Screens (Sticky video player design) */
@media (max-width: 640px) {
    .app-header {
        padding: 15px;
        height: auto;
        flex-direction: column;
        gap: 10px;
        align-items: center;
        text-align: center;
    }
    
    .header-brand {
        flex-direction: column;
        gap: 5px;
    }
    
    .header-meta {
        gap: 12px;
    }

    .app-viewport {
        margin-top: 0;
    }

    /* Make player container sticky at the top on mobile screens! */
    .player-stage {
        position: sticky;
        top: 0;
        z-index: 100;
        padding: 0;
        background: var(--bg-dark);
        box-shadow: 0 10px 30px rgba(0, 0, 0, 0.8);
    }

    .video-window-outer {
        border-radius: 0;
        padding: 0;
        border: none;
        background: none;
    }

    .video-window {
        border-radius: 0;
    }

    .stage-actions {
        right: 10px;
        bottom: 12px;
        gap: 8px;
        padding: 8px 6px;
        border-radius: 16px;
    }

    .quality-selector-group {
        display: none;
    }

    .stage-action-btn {
        width: 44px;
        height: 44px;
        border-radius: 14px;
    }

    .stage-action-btn::after {
        display: none;
    }

    /* Remove metadata details panel on small screen block to save height space */
    .active-metadata-panel {
        display: none;
    }

    .dashboard-sidebar {
        border-top: 1px solid var(--border-color);
    }

    .channel-card-list {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
        gap: 8px;
        padding: 10px;
        max-height: none;
    }

    .channel-card {
        padding: 8px 40px 8px 8px;
        border-radius: 12px;
        min-height: auto;
    }

    .card-meta {
        gap: 10px;
        width: 100%;
    }

    .card-logo {
        width: 28px;
        height: 28px;
        border-radius: 6px;
    }

    .card-name {
        font-size: 0.74rem;
    }

    .star-btn {
        right: 8px;
        width: 24px;
        height: 24px;
        font-size: 0.85rem;
    }

    .card-num {
        font-size: 0.55rem;
        padding: 3px 6px;
    }
    
    .app-footer {
        padding: 10px 15px;
        flex-direction: column;
        height: auto;
        gap: 6px;
    }
}
