/* ============================================
   Toffee Live TV — Premium Glassmorphism UI
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&family=Outfit:wght@300;400;500;600;700;800&display=swap');

/* --- Design Tokens --- */
:root {
    --bg-primary: #0a0a1a;
    --bg-secondary: #0d0d2b;
    --bg-gradient-1: #0f0c29;
    --bg-gradient-2: #302b63;
    --bg-gradient-3: #24243e;

    --glass-bg: rgba(255, 255, 255, 0.04);
    --glass-bg-hover: rgba(255, 255, 255, 0.08);
    --glass-bg-active: rgba(255, 255, 255, 0.12);
    --glass-border: rgba(255, 255, 255, 0.08);
    --glass-border-hover: rgba(255, 255, 255, 0.18);
    --glass-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);

    --accent-primary: #6c63ff;
    --accent-secondary: #ff6584;
    --accent-tertiary: #00d4aa;
    --accent-glow: rgba(108, 99, 255, 0.4);

    --text-primary: #ffffff;
    --text-secondary: rgba(255, 255, 255, 0.7);
    --text-muted: rgba(255, 255, 255, 0.4);

    --live-red: #ff3b5c;
    --live-glow: rgba(255, 59, 92, 0.5);

    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 20px;
    --radius-2xl: 28px;
    --radius-full: 9999px;

    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-fast: all 0.15s ease;
    --transition-spring: all 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);

    --font-primary: 'Outfit', sans-serif;
    --font-body: 'Inter', sans-serif;

    --header-height: 68px;
}

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

html {
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
}

body {
    font-family: var(--font-body);
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
    -webkit-tap-highlight-color: transparent;
    -webkit-touch-callout: none;
    overscroll-behavior: none;
    padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
}

/* --- Animated Background --- */
body::before {
    content: '';
    position: fixed;
    inset: 0;
    background:
        radial-gradient(ellipse at 20% 50%, rgba(108, 99, 255, 0.1) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 20%, rgba(255, 101, 132, 0.07) 0%, transparent 50%),
        radial-gradient(ellipse at 50% 80%, rgba(0, 212, 170, 0.05) 0%, transparent 50%),
        linear-gradient(135deg, var(--bg-gradient-1), var(--bg-gradient-2), var(--bg-gradient-3));
    z-index: -2;
    animation: bgShift 25s ease-in-out infinite alternate;
}

@keyframes bgShift {
    0% {
        filter: hue-rotate(0deg);
    }

    50% {
        filter: hue-rotate(12deg);
    }

    100% {
        filter: hue-rotate(0deg);
    }
}

.orb {
    position: fixed;
    border-radius: 50%;
    filter: blur(100px);
    z-index: -1;
    opacity: 0.3;
    animation: orbFloat 20s ease-in-out infinite;
}

.orb-1 {
    width: 500px;
    height: 500px;
    background: var(--accent-primary);
    top: -150px;
    right: -150px;
}

.orb-2 {
    width: 350px;
    height: 350px;
    background: var(--accent-secondary);
    bottom: -100px;
    left: -100px;
    animation-delay: -7s;
}

.orb-3 {
    width: 280px;
    height: 280px;
    background: var(--accent-tertiary);
    top: 50%;
    left: 40%;
    animation-delay: -14s;
}

@keyframes orbFloat {

    0%,
    100% {
        transform: translate(0, 0) scale(1);
    }

    33% {
        transform: translate(40px, -50px) scale(1.08);
    }

    66% {
        transform: translate(-30px, 30px) scale(0.95);
    }
}

/* --- Scrollbar --- */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.12);
    border-radius: var(--radius-full);
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.22);
}

/* ===========================================
   NAVBAR
   =========================================== */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--header-height);
    background: rgba(10, 10, 26, 0.8);
    backdrop-filter: blur(30px);
    -webkit-backdrop-filter: blur(30px);
    border-bottom: 1px solid var(--glass-border);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 28px;
}

.navbar-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    color: inherit;
}

.navbar-logo {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-md);
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 20px var(--accent-glow);
    position: relative;
    overflow: hidden;
}

.navbar-logo::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, transparent 40%, rgba(255, 255, 255, 0.2));
}

.navbar-logo svg {
    width: 22px;
    height: 22px;
    fill: white;
    z-index: 1;
}

.navbar-title {
    font-family: var(--font-primary);
    font-size: 22px;
    font-weight: 800;
    background: linear-gradient(135deg, #fff, rgba(255, 255, 255, 0.8));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.navbar-subtitle {
    font-size: 10px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 2px;
    font-weight: 500;
}

.navbar-center {
    display: flex;
    align-items: center;
}

.search-box {
    position: relative;
    width: 380px;
}

.search-box input {
    width: 100%;
    padding: 10px 18px 10px 42px;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-full);
    color: var(--text-primary);
    font-family: var(--font-body);
    font-size: 13px;
    outline: none;
    transition: var(--transition);
}

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

.search-box input:focus {
    background: var(--glass-bg-hover);
    border-color: var(--accent-primary);
    box-shadow: 0 0 20px var(--accent-glow);
}

.search-box .search-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    pointer-events: none;
}

.navbar-right {
    display: flex;
    align-items: center;
    gap: 14px;
}

.live-indicator {
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 5px 14px;
    background: rgba(255, 59, 92, 0.1);
    border: 1px solid rgba(255, 59, 92, 0.2);
    border-radius: var(--radius-full);
    font-size: 11px;
    font-weight: 700;
    color: var(--live-red);
    text-transform: uppercase;
    letter-spacing: 1.5px;
}

.live-dot {
    width: 7px;
    height: 7px;
    background: var(--live-red);
    border-radius: 50%;
    animation: livePulse 1.5s ease-in-out infinite;
    box-shadow: 0 0 6px var(--live-glow);
}

@keyframes livePulse {

    0%,
    100% {
        opacity: 1;
        transform: scale(1);
    }

    50% {
        opacity: 0.3;
        transform: scale(0.7);
    }
}

.channel-count {
    font-size: 13px;
    color: var(--text-secondary);
    font-weight: 500;
}

.channel-count span {
    color: var(--accent-primary);
    font-weight: 700;
}

/* ===========================================
   MAIN CONTENT
   =========================================== */
.main-content {
    margin-top: var(--header-height);
    min-height: calc(100vh - var(--header-height));
    display: flex;
    flex-direction: column;
}

/* ===========================================
   PREMIUM VIDEO PLAYER
   =========================================== */
.player-section {
    padding: 20px 28px 8px;
}

.player-container {
    display: flex;
    gap: 20px;
    align-items: stretch;
    max-width: 1600px;
    margin: 0 auto;
}

.player-wrapper {
    flex: 1;
    position: relative;
    border-radius: var(--radius-2xl);
    overflow: hidden;
    background: #000;
    border: 1px solid rgba(255, 255, 255, 0.06);
    box-shadow:
        0 20px 60px rgba(0, 0, 0, 0.5),
        0 0 80px rgba(108, 99, 255, 0.08),
        inset 0 1px 0 rgba(255, 255, 255, 0.05);
    aspect-ratio: 16 / 9;
    cursor: pointer;
    isolation: isolate;
    touch-action: none;
}

.player-wrapper video {
    width: 100%;
    height: 100%;
    object-fit: contain;
    background: #000;
    display: block;
}

/* === HIDE ALL NATIVE BROWSER VIDEO CONTROLS === */
.player-wrapper video::-webkit-media-controls {
    display: none !important;
}

.player-wrapper video::-webkit-media-controls-enclosure {
    display: none !important;
}

.player-wrapper video::-webkit-media-controls-panel {
    display: none !important;
}

.player-wrapper video::-webkit-media-controls-play-button {
    display: none !important;
}

.player-wrapper video::-webkit-media-controls-volume-slider {
    display: none !important;
}

.player-wrapper video::-webkit-media-controls-mute-button {
    display: none !important;
}

.player-wrapper video::-webkit-media-controls-timeline {
    display: none !important;
}

.player-wrapper video::-webkit-media-controls-current-time-display {
    display: none !important;
}

.player-wrapper video::-webkit-media-controls-time-remaining-display {
    display: none !important;
}

.player-wrapper video::-webkit-media-controls-fullscreen-button {
    display: none !important;
}

.player-wrapper video::-moz-range-track {
    display: none !important;
}

.player-wrapper video::--moz-range-thumb {
    display: none !important;
}

/* --- Player Placeholder --- */
.player-placeholder {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 3;
}

.placeholder-bg {
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, #0f0c29 0%, #1a1345 40%, #302b63 70%, #1a1345 100%);
    animation: placeholderShimmer 8s ease-in-out infinite;
}

@keyframes placeholderShimmer {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.8;
    }
}

.placeholder-content {
    position: relative;
    z-index: 1;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
}

.placeholder-icon {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: linear-gradient(135deg, rgba(108, 99, 255, 0.2), rgba(255, 101, 132, 0.2));
    border: 2px solid rgba(108, 99, 255, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    animation: breathe 4s ease-in-out infinite;
}

.placeholder-icon svg {
    width: 32px;
    height: 32px;
    fill: rgba(255, 255, 255, 0.5);
}

@keyframes breathe {

    0%,
    100% {
        transform: scale(1);
        box-shadow: 0 0 30px rgba(108, 99, 255, 0.2);
    }

    50% {
        transform: scale(1.05);
        box-shadow: 0 0 50px rgba(108, 99, 255, 0.3);
    }
}

.placeholder-content h2 {
    font-family: var(--font-primary);
    font-size: 20px;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.6);
}

.placeholder-content p {
    font-size: 13px;
    color: var(--text-muted);
}

.placeholder-dots {
    display: flex;
    gap: 6px;
    margin-top: 8px;
}

.placeholder-dots span {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: rgba(108, 99, 255, 0.4);
    animation: dotBounce 1.4s ease-in-out infinite;
}

.placeholder-dots span:nth-child(2) {
    animation-delay: 0.2s;
}

.placeholder-dots span:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes dotBounce {

    0%,
    80%,
    100% {
        transform: scale(0.6);
        opacity: 0.4;
    }

    40% {
        transform: scale(1);
        opacity: 1;
    }
}

/* --- Player Loading --- */
.player-loading {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(8px);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 24px;
    z-index: 5;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
}

.player-loading.visible {
    opacity: 1;
    visibility: visible;
}

.loading-wave {
    display: flex;
    align-items: center;
    gap: 4px;
    height: 40px;
}

.loading-wave span {
    width: 4px;
    height: 16px;
    background: var(--accent-primary);
    border-radius: var(--radius-full);
    animation: waveAnim 1s ease-in-out infinite;
}

.loading-wave span:nth-child(2) {
    animation-delay: -0.9s;
}

.loading-wave span:nth-child(3) {
    animation-delay: -0.8s;
}

.loading-wave span:nth-child(4) {
    animation-delay: -0.7s;
}

.loading-wave span:nth-child(5) {
    animation-delay: -0.6s;
}

@keyframes waveAnim {

    0%,
    100% {
        height: 12px;
        opacity: 0.4;
    }

    50% {
        height: 36px;
        opacity: 1;
    }
}

.player-loading p {
    font-size: 13px;
    color: var(--text-secondary);
    font-weight: 500;
}

/* --- Player Error --- */
.player-error {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.9);
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    z-index: 6;
    text-align: center;
    padding: 20px;
}

.player-error.visible {
    display: flex;
}

.error-icon-wrapper {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: rgba(255, 59, 92, 0.1);
    border: 1px solid rgba(255, 59, 92, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--live-red);
}

.player-error h3 {
    font-family: var(--font-primary);
    font-size: 18px;
    font-weight: 700;
}

.player-error p {
    font-size: 13px;
    color: var(--text-muted);
    max-width: 300px;
}

.retry-btn {
    margin-top: 8px;
    padding: 10px 28px;
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    border: none;
    border-radius: var(--radius-full);
    color: white;
    font-family: var(--font-primary);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: 0 4px 16px var(--accent-glow);
}

.retry-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px var(--accent-glow);
}

/* ===========================================
   PROFESSIONAL CUSTOM PLAYER CONTROLS
   (Netflix / YouTube inspired)
   =========================================== */
.player-controls {
    position: absolute;
    inset: 0;
    z-index: 4;
    opacity: 0;
    transition: opacity 0.35s ease;
    pointer-events: none;
}

.player-wrapper:hover .player-controls,
.player-controls.visible {
    opacity: 1;
}

/* --- Top gradient overlay for channel name --- */
.controls-gradient-top {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 90px;
    background: linear-gradient(180deg, rgba(0, 0, 0, 0.75) 0%, rgba(0, 0, 0, 0.15) 60%, transparent 100%);
    pointer-events: none;
}

/* --- Bottom gradient overlay for controls --- */
.controls-gradient-bottom {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 140px;
    background: linear-gradient(0deg, rgba(0, 0, 0, 0.85) 0%, rgba(0, 0, 0, 0.4) 50%, transparent 100%);
    pointer-events: none;
}

/* --- Top bar: LIVE badge + channel name --- */
.controls-top {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    padding: 16px 20px;
    pointer-events: auto;
}

.controls-channel-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.controls-live-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 12px;
    background: var(--live-red);
    border-radius: var(--radius-full);
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 1.2px;
    color: white;
    text-transform: uppercase;
    box-shadow: 0 2px 10px rgba(255, 59, 92, 0.5);
}

.live-dot-sm {
    width: 6px;
    height: 6px;
    background: white;
    border-radius: 50%;
    animation: livePulse 1.5s ease-in-out infinite;
}

.controls-channel-name {
    font-family: var(--font-primary);
    font-size: 15px;
    font-weight: 600;
    color: white;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.6);
}

/* --- Bottom controls bar --- */
.controls-bottom {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 16px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    pointer-events: auto;
}

.controls-left,
.controls-right {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* --- Control Buttons (all buttons in the bar) --- */
.ctrl-btn {
    width: 40px;
    height: 40px;
    border: none;
    background: transparent;
    border-radius: 50%;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    padding: 0;
    line-height: 0;
    flex-shrink: 0;
    position: relative;
}

.ctrl-btn::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0);
    transition: background 0.2s ease;
}

.ctrl-btn:hover::before {
    background: rgba(255, 255, 255, 0.15);
}

.ctrl-btn:active::before {
    background: rgba(255, 255, 255, 0.25);
}

.ctrl-btn svg {
    width: 24px;
    height: 24px;
    fill: white;
    display: block;
    flex-shrink: 0;
    position: relative;
    z-index: 1;
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.3));
}

/* --- Volume Control Group --- */
.volume-control-group {
    display: flex;
    align-items: center;
    position: relative;
}

/* --- Desktop Volume Slider --- */
.volume-slider-wrapper.desktop-volume {
    width: 0;
    overflow: hidden;
    transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.volume-control-group:hover .volume-slider-wrapper.desktop-volume {
    width: 80px;
    margin-left: 2px;
}

.volume-slider {
    -webkit-appearance: none;
    appearance: none;
    width: 80px;
    height: 4px;
    background: rgba(255, 255, 255, 0.25);
    border-radius: var(--radius-full);
    outline: none;
    cursor: pointer;
    transition: background 0.2s ease;
}

.volume-slider:hover {
    background: rgba(255, 255, 255, 0.4);
}

.volume-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: white;
    cursor: pointer;
    box-shadow: 0 0 6px rgba(0, 0, 0, 0.35);
    transition: transform 0.15s ease;
}

.volume-slider::-webkit-slider-thumb:hover {
    transform: scale(1.4);
}

.volume-slider::-moz-range-thumb {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: white;
    cursor: pointer;
    box-shadow: 0 0 6px rgba(0, 0, 0, 0.35);
    border: none;
}

/* --- Mobile Volume Popup (Vertical) --- */
.mobile-volume-popup {
    display: none;
    position: absolute;
    bottom: 54px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(15, 12, 41, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(108, 99, 255, 0.25);
    border-radius: 16px;
    padding: 16px 12px 10px;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    z-index: 20;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.6), 0 0 20px rgba(108, 99, 255, 0.1);
    opacity: 0;
    transform: translateX(-50%) translateY(8px) scale(0.95);
    transition: opacity 0.25s ease, transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
    pointer-events: none;
}

.mobile-volume-popup.visible {
    display: flex;
    opacity: 1;
    transform: translateX(-50%) translateY(0) scale(1);
    pointer-events: auto;
}

.mobile-volume-track {
    width: 36px;
    height: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.mobile-volume-slider {
    -webkit-appearance: slider-vertical;
    appearance: slider-vertical;
    writing-mode: vertical-lr;
    direction: rtl;
    width: 6px;
    height: 110px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: var(--radius-full);
    outline: none;
    cursor: pointer;
}

.mobile-volume-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    cursor: pointer;
    box-shadow: 0 0 8px rgba(108, 99, 255, 0.5);
}

.mobile-volume-slider::-moz-range-thumb {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    cursor: pointer;
    box-shadow: 0 0 8px rgba(108, 99, 255, 0.5);
    border: none;
}

.mobile-volume-label {
    font-size: 11px;
    font-weight: 700;
    color: var(--accent-primary);
    text-align: center;
    padding: 2px 8px;
    border-radius: 8px;
    background: rgba(108, 99, 255, 0.1);
    min-width: 36px;
}

/* --- Quality Selector --- */
.quality-selector-wrapper {
    position: relative;
}

.quality-menu {
    display: none;
    position: absolute;
    bottom: 50px;
    right: 0;
    min-width: 200px;
    background: rgba(15, 12, 41, 0.97);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border: 1px solid rgba(108, 99, 255, 0.2);
    border-radius: 14px;
    padding: 6px;
    z-index: 20;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.6), 0 0 30px rgba(108, 99, 255, 0.08);
    opacity: 0;
    transform: translateY(8px) scale(0.95);
    transition: opacity 0.2s ease, transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
    pointer-events: none;
}

.quality-menu.visible {
    display: block;
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: auto;
}

.quality-menu-header {
    padding: 10px 14px 8px;
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: var(--text-muted);
    font-weight: 700;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    margin-bottom: 4px;
}

.quality-item {
    display: flex;
    align-items: center;
    width: 100%;
    padding: 10px 14px;
    border: none;
    background: none;
    color: var(--text-secondary);
    font-family: var(--font-body);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    border-radius: 8px;
    transition: all 0.15s ease;
    gap: 8px;
    text-align: left;
}

.quality-item:hover {
    background: rgba(108, 99, 255, 0.1);
    color: white;
}

.quality-item.active {
    color: white;
    background: rgba(108, 99, 255, 0.15);
}

.quality-item .quality-label {
    font-weight: 600;
    flex-shrink: 0;
}

.quality-item .quality-badge {
    font-size: 9px;
    font-weight: 800;
    letter-spacing: 0.8px;
    padding: 2px 6px;
    border-radius: 4px;
    text-transform: uppercase;
}

.quality-badge.hd {
    background: linear-gradient(135deg, rgba(108, 99, 255, 0.3), rgba(255, 101, 132, 0.3));
    color: var(--accent-primary);
    border: 1px solid rgba(108, 99, 255, 0.3);
}

.quality-badge.sd {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-muted);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.quality-badge.auto {
    background: rgba(0, 255, 136, 0.1);
    color: #00ff88;
    border: 1px solid rgba(0, 255, 136, 0.2);
    font-size: 8px;
}

.quality-item .quality-bitrate {
    font-size: 11px;
    color: var(--text-muted);
    margin-left: auto;
}

.quality-item .quality-check {
    width: 16px;
    height: 16px;
    fill: var(--accent-primary);
    margin-left: auto;
    opacity: 0;
    transition: opacity 0.15s ease;
    flex-shrink: 0;
}

.quality-item.active .quality-check {
    opacity: 1;
}

/* Active quality gear icon glow */
#qualityBtn.quality-active svg {
    fill: var(--accent-primary);
    filter: drop-shadow(0 0 6px rgba(108, 99, 255, 0.5));
}

/* ==========================================
   PLAY / PAUSE BUTTON — Main control
   YouTube-style: Larger, more prominent
   ========================================== */
.ctrl-play-pause {
    width: 48px !important;
    height: 48px !important;
}

/* Both icons sit in same position, toggled via opacity */
.ctrl-play-pause .pp-icon {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 26px;
    height: 26px;
    fill: white;
    transition: opacity 0.2s ease, transform 0.2s ease;
    filter: drop-shadow(0 1px 3px rgba(0, 0, 0, 0.4));
    z-index: 1;
}

/* Default state: play visible, pause hidden */
.ctrl-play-pause .pp-play {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
}

.ctrl-play-pause .pp-pause {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.5);
}

/* When playing: swap icons */
.ctrl-play-pause.is-playing .pp-play {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.5);
}

.ctrl-play-pause.is-playing .pp-pause {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
}

/* ==========================================
   CENTER PLAY/PAUSE ANIMATION INDICATOR
   YouTube-style ripple when tapping play/pause
   ========================================== */
.center-play-indicator {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.6);
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 5;
    pointer-events: none;
    opacity: 0;
    transition: none;
}

.center-play-indicator svg {
    width: 36px;
    height: 36px;
    fill: white;
    position: absolute;
    filter: drop-shadow(0 1px 3px rgba(0, 0, 0, 0.4));
}

/* Default: both hidden */
.center-play-indicator .cpi-play,
.center-play-indicator .cpi-pause {
    opacity: 0;
}

/* When triggered — animate in and out */
.center-play-indicator.show-play {
    animation: cpiPop 0.5s ease forwards;
}

.center-play-indicator.show-play .cpi-play {
    opacity: 1;
    margin-left: 3px;
}

.center-play-indicator.show-pause {
    animation: cpiPop 0.5s ease forwards;
}

.center-play-indicator.show-pause .cpi-pause {
    opacity: 1;
}

@keyframes cpiPop {
    0% {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.6);
    }

    20% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1.1);
    }

    40% {
        transform: translate(-50%, -50%) scale(1);
        opacity: 1;
    }

    100% {
        opacity: 0;
        transform: translate(-50%, -50%) scale(1.3);
    }
}

/* ==========================================
   BIG CENTER PLAY BUTTON
   ONLY shows when autoplay is blocked — first interaction
   ========================================== */
.big-play-btn {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(1);
    width: 76px;
    height: 76px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.2);
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    color: white;
    cursor: pointer;
    z-index: 6;
    transition: all 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
}

.big-play-btn:hover {
    transform: translate(-50%, -50%) scale(1.12);
    background: rgba(0, 0, 0, 0.75);
    border-color: rgba(255, 255, 255, 0.35);
    box-shadow: 0 12px 50px rgba(0, 0, 0, 0.6);
}

.big-play-btn:active {
    transform: translate(-50%, -50%) scale(0.95);
}

.big-play-btn svg {
    width: 34px;
    height: 34px;
    fill: white;
    margin-left: 4px;
    filter: drop-shadow(0 1px 3px rgba(0, 0, 0, 0.3));
}

/* --- Now Playing Sidebar --- */
.now-playing-sidebar {
    width: 280px;
    flex-shrink: 0;
    background: var(--glass-bg);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-2xl);
    padding: 24px;
    box-shadow: var(--glass-shadow);
    display: none;
    flex-direction: column;
}

.now-playing-sidebar.visible {
    display: flex;
    animation: slideInRight 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(20px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.np-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}

.np-label {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: var(--accent-primary);
    font-weight: 700;
}

.np-live-dot {
    width: 8px;
    height: 8px;
    background: var(--live-red);
    border-radius: 50%;
    animation: livePulse 1.5s ease-in-out infinite;
    box-shadow: 0 0 8px var(--live-glow);
}

.np-channel-logo {
    width: 100%;
    aspect-ratio: 16/10;
    border-radius: var(--radius-lg);
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--glass-border);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    margin-bottom: 18px;
}

.np-channel-logo img {
    width: 64px;
    height: 64px;
    object-fit: contain;
}

.np-channel-name {
    font-family: var(--font-primary);
    font-size: 17px;
    font-weight: 700;
    margin-bottom: 4px;
}

.np-category {
    font-size: 12px;
    color: var(--text-muted);
}

.np-divider {
    height: 1px;
    background: var(--glass-border);
    margin: 16px 0;
}

.np-stats {
    display: flex;
    gap: 12px;
}

.np-stat {
    flex: 1;
    text-align: center;
    padding: 10px 0;
    background: rgba(0, 0, 0, 0.2);
    border-radius: var(--radius-md);
    border: 1px solid var(--glass-border);
}

.np-stat-label {
    display: block;
    font-size: 9px;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-muted);
    margin-bottom: 4px;
}

.np-stat-value {
    font-family: var(--font-primary);
    font-size: 13px;
    font-weight: 700;
    color: var(--text-primary);
}

.np-status-live {
    color: var(--accent-tertiary) !important;
}

.np-actions {
    display: flex;
    gap: 8px;
    margin-top: auto;
}

.np-btn {
    flex: 1;
    padding: 10px 8px;
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-md);
    background: var(--glass-bg);
    color: var(--text-secondary);
    font-size: 11px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    font-family: var(--font-body);
}

.np-btn:hover {
    background: var(--glass-bg-hover);
    border-color: var(--accent-primary);
    color: var(--text-primary);
}

/* ===========================================
   CHANNELS GRID
   =========================================== */
.channels-section {
    padding: 8px 28px 40px;
    flex: 1;
}

.category-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 16px;
    margin-top: 28px;
}

.category-header:first-child {
    margin-top: 12px;
}

.category-icon {
    width: 34px;
    height: 34px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 15px;
    flex-shrink: 0;
}

.category-icon.live {
    background: rgba(255, 59, 92, 0.12);
}

.category-icon.news {
    background: rgba(108, 99, 255, 0.12);
}

.category-icon.entertainment {
    background: rgba(0, 212, 170, 0.12);
}

.category-icon.sports {
    background: rgba(255, 101, 132, 0.12);
}

.category-icon.default {
    background: rgba(255, 255, 255, 0.06);
}

.category-title {
    font-family: var(--font-primary);
    font-size: 16px;
    font-weight: 700;
}

.category-count {
    font-size: 11px;
    color: var(--text-muted);
    background: var(--glass-bg);
    padding: 2px 9px;
    border-radius: var(--radius-full);
    border: 1px solid var(--glass-border);
}

.category-divider {
    flex: 1;
    height: 1px;
    background: linear-gradient(90deg, var(--glass-border), transparent);
    margin-left: 8px;
}

/* --- Category Tabs Wrapper --- */
.category-tabs-wrapper {
    position: relative;
    z-index: 10;
    background: transparent;
    padding: 16px 0;
    margin: 0;
}

.category-tabs {
    display: flex;
    gap: 12px;
    overflow-x: auto;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
    align-items: center;
    padding: 4px 28px;
}

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

.category-tab {
    padding: 9px 22px;
    border-radius: var(--radius-full);
    background: rgba(255, 255, 255, 0.04);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
    border: 1px solid rgba(255, 255, 255, 0.08);
    /* Dark subtle border */
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.category-tab:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
    border-color: rgba(255, 255, 255, 0.25);
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.3);
}

.category-tab:active {
    transform: translateY(0);
}

.category-tab.active {
    background: linear-gradient(135deg, var(--live-red), var(--accent-secondary));
    color: #ffffff;
    border-color: transparent;
    box-shadow: 0 6px 20px rgba(255, 59, 92, 0.5);
    transform: translateY(-2px);
}

.category-tab .tab-icon {
    font-size: 14px;
    opacity: 0.8;
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.category-tab.active .tab-icon {
    opacity: 1;
    transform: scale(1.15);
}

/* Hide old header */
.category-header {
    display: none;
}

/* --- Channel Cards --- */
.channels-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 12px;
}

.channel-card {
    position: relative;
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    padding: 18px 12px;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    overflow: hidden;
}

.channel-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--accent-primary), var(--accent-secondary));
    opacity: 0;
    transition: var(--transition);
}

.channel-card:hover {
    background: var(--glass-bg-hover);
    border-color: var(--glass-border-hover);
    transform: translateY(-3px);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.3), 0 0 20px rgba(108, 99, 255, 0.08);
}

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

.channel-card.active {
    background: var(--glass-bg-active);
    border-color: var(--accent-primary);
    box-shadow: 0 0 24px var(--accent-glow);
}

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

.channel-logo-wrapper {
    width: 64px;
    height: 64px;
    border-radius: var(--radius-lg);
    overflow: hidden;
    background: rgba(0, 0, 0, 0.25);
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--glass-border);
    transition: var(--transition);
    flex-shrink: 0;
}

.channel-card:hover .channel-logo-wrapper {
    border-color: rgba(108, 99, 255, 0.25);
}

.channel-logo-wrapper img {
    width: 48px;
    height: 48px;
    object-fit: contain;
}

.channel-name {
    font-family: var(--font-primary);
    font-size: 12px;
    font-weight: 600;
    text-align: center;
    color: var(--text-primary);
    line-height: 1.3;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.channel-badge {
    position: absolute;
    top: 8px;
    right: 8px;
    font-size: 8px;
    padding: 2px 7px;
    border-radius: var(--radius-full);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.channel-badge.vip {
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.2), rgba(255, 165, 0, 0.2));
    color: #ffd700;
    border: 1px solid rgba(255, 215, 0, 0.25);
}

/* Play overlay */
.channel-play-overlay {
    position: absolute;
    inset: 0;
    background: rgba(108, 99, 255, 0.08);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: var(--transition);
}

.channel-card:hover .channel-play-overlay {
    opacity: 1;
}

.play-btn-mini {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 16px var(--accent-glow);
    transform: scale(0.7);
    transition: var(--transition-spring);
}

.channel-card:hover .play-btn-mini {
    transform: scale(1);
}

.play-btn-mini svg {
    width: 16px;
    height: 16px;
    fill: white;
    margin-left: 2px;
}

/* ===========================================
   LOADING SCREEN
   =========================================== */
.loading-screen {
    position: fixed;
    inset: 0;
    background: var(--bg-primary);
    z-index: 9999;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 28px;
    transition: opacity 0.5s ease, visibility 0.5s ease;
}

.loading-screen.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.loader {
    width: 50px;
    height: 50px;
    position: relative;
}

.loader-ring {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    border: 3px solid transparent;
    animation: loaderSpin 1.2s linear infinite;
}

.loader-ring:nth-child(1) {
    border-top-color: var(--accent-primary);
}

.loader-ring:nth-child(2) {
    inset: 6px;
    border-right-color: var(--accent-secondary);
    animation-duration: 1.5s;
    animation-direction: reverse;
}

.loader-ring:nth-child(3) {
    inset: 12px;
    border-bottom-color: var(--accent-tertiary);
    animation-duration: 0.9s;
}

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

.loading-text {
    font-family: var(--font-primary);
    font-size: 14px;
    color: var(--text-secondary);
    font-weight: 500;
}

/* ===========================================
   ERROR & NO RESULTS
   =========================================== */
.error-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    gap: 12px;
    text-align: center;
}

.error-state .error-icon {
    font-size: 40px;
}

.error-state h3 {
    font-family: var(--font-primary);
    font-size: 20px;
    font-weight: 700;
}

.error-state p {
    color: var(--text-muted);
    font-size: 13px;
}

.no-results {
    text-align: center;
    padding: 50px 20px;
    color: var(--text-muted);
}

.no-results .emoji {
    font-size: 40px;
    margin-bottom: 12px;
}

.no-results h3 {
    font-family: var(--font-primary);
    font-size: 16px;
    color: var(--text-secondary);
    margin-bottom: 6px;
}

/* ===========================================
   FOOTER (Modern Grid)
   =========================================== */
.footer {
    padding: 60px 4% 30px;
    background: rgba(10, 10, 26, 0.8);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-top: 1px solid rgba(108, 99, 255, 0.15);
    position: relative;
    margin-top: auto;
}

.footer::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--accent-primary), var(--accent-secondary), transparent);
    opacity: 0.1;
}

/* --- Skip Indicator Overlays (Double tap) --- */
.skip-indicator {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 35%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: white;
    z-index: 5;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.2s ease;
    overflow: hidden;
}

.skip-indicator.active {
    opacity: 1;
}

.skip-indicator.skip-left {
    left: 0;
    border-top-right-radius: 50%;
    border-bottom-right-radius: 50%;
}

.skip-indicator.skip-right {
    right: 0;
    border-top-left-radius: 50%;
    border-bottom-left-radius: 50%;
}

.skip-bg {
    position: absolute;
    inset: 0;
    background: rgba(255, 255, 255, 0.15);
    border-radius: inherit;
    transform: scale(0);
    transition: transform 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.skip-indicator.active .skip-bg {
    transform: scale(1.5);
}

.skip-content {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    z-index: 1;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
    transform: translateY(10px);
    transition: transform 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.skip-indicator.active .skip-content {
    transform: translateY(0);
}

.skip-content svg {
    width: 32px;
    height: 32px;
    fill: white;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.5));
}

.skip-content span {
    font-family: var(--font-primary);
    font-size: 14px;
    font-weight: 700;
}

.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 40px;
    max-width: 1200px;
    margin: 0 auto 50px;
}

/* Brand Column */
.footer-brand-col {
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding-right: 40px;
}

.footer-logo {
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--text-primary);
    font-family: var(--font-primary);
    font-size: 20px;
    font-weight: 800;
    letter-spacing: -0.5px;
}

.footer-logo svg {
    color: var(--accent-primary);
    filter: drop-shadow(0 0 10px rgba(108, 99, 255, 0.5));
}

.footer-about-text {
    font-family: var(--font-body);
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.6;
    max-width: 320px;
}

/* Link Columns */
.footer-heading {
    color: white;
    font-family: var(--font-primary);
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 20px;
    letter-spacing: 0.5px;
}

.footer-links-col ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.footer-links-col a {
    color: var(--text-secondary);
    font-family: var(--font-body);
    font-size: 14px;
    text-decoration: none;
    transition: all 0.3s ease;
    display: inline-block;
}

.footer-links-col a:hover {
    color: var(--accent-primary);
    transform: translateX(4px);
}

/* Footer Bottom (Credits & Socials) */
.footer-bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
    padding-top: 30px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.footer-meta {
    display: flex;
    align-items: center;
    gap: 16px;
}

.footer-credit {
    font-family: var(--font-body);
    font-size: 13px;
    color: var(--text-secondary);
}

.footer-credit strong {
    font-weight: 700;
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.footer-version {
    font-family: var(--font-body);
    font-size: 11px;
    padding: 2px 8px;
    border-radius: var(--radius-sm);
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-muted);
}

/* Social icons */
.footer-socials {
    display: flex;
    gap: 12px;
}

.social-icon {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.social-icon:hover {
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    border-color: transparent;
    color: white;
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 5px 15px rgba(108, 99, 255, 0.3);
}

/* ===========================================
   MOBILE RESPONSIVE 
   =========================================== */
.mobile-search-toggle {
    display: none;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    padding: 6px 10px;
    cursor: pointer;
    transition: var(--transition);
    font-size: 14px;
    flex-shrink: 0;
}

.mobile-search {
    display: none;
    padding: 0 16px 8px;
}

.mobile-search.visible {
    display: block;
}

.mobile-search input {
    width: 100%;
    padding: 12px 18px;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-full);
    color: var(--text-primary);
    font-family: var(--font-body);
    font-size: 14px;
    outline: none;
    transition: var(--transition);
}

.mobile-search input:focus {
    border-color: var(--accent-primary);
    box-shadow: 0 0 16px var(--accent-glow);
}

/* --- Mobile Now Playing Bar (shown below player on small screens) --- */
.mobile-now-playing {
    display: none;
    padding: 20px 16px 9px;
}

.mobile-np-bar {
    background: linear-gradient(145deg, rgba(255, 255, 255, 0.06) 0%, rgba(255, 255, 255, 0.01) 100%);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: var(--radius-2xl);
    padding: 16px 18px;
    display: flex;
    align-items: center;
    gap: 16px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.05);
    transition: transform 0.3s ease;
}

.mobile-np-logo {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-md);
    overflow: hidden;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--glass-border);
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.mobile-np-logo img {
    width: 36px;
    height: 36px;
    object-fit: contain;
}

.mobile-np-info {
    flex: 1;
    min-width: 0;
}

.mobile-np-name {
    font-family: var(--font-primary);
    font-size: 14px;
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.mobile-np-cat {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 2px;
}

.mobile-np-badges {
    display: flex;
    gap: 6px;
    flex-shrink: 0;
}

.mobile-np-badge {
    padding: 4px 10px;
    border-radius: var(--radius-full);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.5px;
}

.mobile-np-badge.quality {
    background: rgba(108, 99, 255, 0.15);
    color: var(--accent-primary);
    border: 1px solid rgba(108, 99, 255, 0.25);
}

.mobile-np-badge.status {
    background: rgba(0, 212, 170, 0.12);
    color: var(--accent-tertiary);
    border: 1px solid rgba(0, 212, 170, 0.2);
}

/* ========= LARGE TABLET (max-width: 1200px) ========= */
@media (max-width: 1200px) {
    .now-playing-sidebar {
        display: none !important;
    }
}

/* ========= TABLET (max-width: 1024px) ========= */
@media (max-width: 1024px) {
    .navbar {
        padding: 0 16px;
    }

    .search-box {
        width: 280px;
    }

    .player-section {
        padding: 14px 16px 6px;
    }

    .channels-section {
        padding: 4px 16px 32px;
    }

    .channels-grid {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
        gap: 10px;
    }
}

/* ========= MOBILE (max-width: 768px) ========= */
@media (max-width: 768px) {
    :root {
        --header-height: 56px;
    }

    /* --- Navbar mobile --- */
    .navbar {
        padding: 0 12px;
        gap: 8px;
    }

    .navbar-brand {
        gap: 8px;
        flex-shrink: 0;
    }

    .navbar-logo {
        width: 34px;
        height: 34px;
    }

    .navbar-logo svg {
        width: 18px;
        height: 18px;
    }

    .navbar-title {
        font-size: 18px;
    }

    .navbar-subtitle {
        display: none;
    }

    .navbar-center {
        display: none;
    }

    .navbar-right {
        gap: 8px;
        flex-shrink: 0;
    }

    .live-indicator {
        padding: 3px 10px;
        font-size: 9px;
        gap: 5px;
    }

    .live-dot {
        width: 5px;
        height: 5px;
    }

    .channel-count {
        font-size: 11px;
    }

    .mobile-search-toggle {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 34px;
        height: 34px;
        padding: 0;
        border-radius: 50%;
        font-size: 16px;
    }

    /* --- Player mobile: native app feel --- */
    .player-section {
        padding: 0;
        position: sticky;
        top: var(--header-height);
        z-index: 50;
        background: var(--bg-primary);
    }

    .player-container {
        gap: 0;
    }

    .player-wrapper {
        border-radius: 0;
        border: none;
        box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
        aspect-ratio: 16 / 9;
    }

    /* Show mobile now playing */
    .mobile-now-playing.visible {
        display: block;
        margin-top: 4px;
    }

    /* Allow controls to fade out on mobile instead of forcing opacity: 1 */

    .controls-gradient-top {
        height: 50px;
    }

    .controls-gradient-bottom {
        height: 70px;
    }

    .controls-top {
        padding: 10px 12px;
    }

    .controls-live-badge {
        font-size: 8px;
        padding: 2px 7px;
    }

    .controls-channel-name {
        font-size: 12px;
    }

    .controls-bottom {
        padding: 10px 10px;
    }

    .controls-left,
    .controls-right {
        gap: 6px;
    }

    .ctrl-btn {
        width: 36px;
        height: 36px;
    }

    .ctrl-btn svg {
        width: 18px;
        height: 18px;
    }

    #playPauseBtn {
        width: 42px;
        height: 42px;
    }

    #playPauseBtn svg {
        width: 22px;
        height: 22px;
    }

    /* Desktop volume slider hidden on mobile, popup works instead */
    .volume-slider-wrapper.desktop-volume {
        display: none !important;
    }

    /* Volume control group needs position for popup */
    .volume-control-group {
        position: relative;
    }

    /* Quality menu mobile adjustments */
    .quality-menu {
        right: -40px;
        min-width: 180px;
    }

    .quality-item {
        padding: 10px 12px;
        font-size: 13px;
    }

    .controls-bottom {
        padding-bottom: calc(14px + env(safe-area-inset-bottom));
        padding-left: calc(10px + env(safe-area-inset-left));
        padding-right: calc(10px + env(safe-area-inset-right));
    }

    .big-play-btn {
        width: 52px;
        height: 52px;
    }

    .big-play-btn svg {
        width: 22px;
        height: 22px;
    }

    /* Placeholder on mobile */
    .placeholder-icon {
        width: 60px;
        height: 60px;
    }

    .placeholder-icon svg {
        width: 24px;
        height: 24px;
    }

    .placeholder-content h2 {
        font-size: 16px;
    }

    .placeholder-content p {
        font-size: 12px;
    }

    /* --- Channels grid mobile --- */
    .channels-section {
        padding: 4px 8px 24px;
    }

    .category-header {
        margin-top: 20px;
        margin-bottom: 10px;
        gap: 8px;
    }

    .category-icon {
        width: 28px;
        height: 28px;
        font-size: 13px;
    }

    .category-title {
        font-size: 14px;
    }

    .category-count {
        font-size: 10px;
        padding: 1px 7px;
    }

    .channels-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 8px;
    }

    .channel-card {
        padding: 14px 8px;
        gap: 8px;
        border-radius: var(--radius-md);
    }

    .channel-card::before {
        height: 2px;
    }

    .channel-logo-wrapper {
        width: 50px;
        height: 50px;
        border-radius: var(--radius-md);
    }

    .channel-logo-wrapper img {
        width: 38px;
        height: 38px;
    }

    .channel-name {
        font-size: 11px;
    }

    .channel-badge {
        top: 5px;
        right: 5px;
        font-size: 7px;
        padding: 1px 5px;
    }

    .channel-play-overlay {
        display: none;
    }

    /* Footer mobile */
    .footer {
        padding: 40px 20px 20px;
    }

    .footer-grid {
        grid-template-columns: 1fr;
        gap: 30px;
        text-align: center;
    }

    .footer-brand-col {
        align-items: center;
        padding-right: 0;
    }

    .footer-links-col {
        align-items: center;
    }

    .footer-bottom {
        flex-direction: column;
        gap: 20px;
        text-align: center;
    }

    .footer-shortcuts {
        display: none;
    }
}

/* ========= SMALL MOBILE (max-width: 420px) ========= */
@media (max-width: 420px) {
    .navbar-title {
        font-size: 16px;
    }

    .live-indicator {
        display: none;
    }

    .channels-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 6px;
    }

    .channel-card {
        padding: 10px 4px;
        gap: 6px;
    }

    .channel-logo-wrapper {
        width: 42px;
        height: 42px;
    }

    .channel-logo-wrapper img {
        width: 32px;
        height: 32px;
    }

    .channel-name {
        font-size: 10px;
    }

    .mobile-np-bar {
        padding: 10px 12px;
        gap: 10px;
    }

    .mobile-np-logo {
        width: 40px;
        height: 40px;
    }

    .mobile-np-logo img {
        width: 30px;
        height: 30px;
    }

    .mobile-np-name {
        font-size: 13px;
    }

    .mobile-np-badges {
        flex-direction: column;
        gap: 4px;
    }

    .ctrl-btn {
        width: 32px;
        height: 32px;
    }

    .ctrl-btn svg {
        width: 16px;
        height: 16px;
    }

    #playPauseBtn {
        width: 38px;
        height: 38px;
    }

    #playPauseBtn svg {
        width: 20px;
        height: 20px;
    }
}

/* --- Staggered category animations --- */
.category-section {
    animation: fadeInUp 0.4s ease forwards;
    opacity: 0;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(16px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.category-section:nth-child(1) {
    animation-delay: 0.05s;
}

.category-section:nth-child(2) {
    animation-delay: 0.1s;
}

.category-section:nth-child(3) {
    animation-delay: 0.15s;
}

.category-section:nth-child(4) {
    animation-delay: 0.2s;
}

.category-section:nth-child(5) {
    animation-delay: 0.25s;
}

.category-section:nth-child(6) {
    animation-delay: 0.3s;
}

.category-section:nth-child(7) {
    animation-delay: 0.35s;
}

.category-section:nth-child(8) {
    animation-delay: 0.4s;
}

/* ===========================================
   NAV ICON BUTTONS (Sleep Timer, Shortcuts)
   =========================================== */
.nav-icon-btn {
    width: 34px;
    height: 34px;
    border: 1px solid var(--glass-border);
    border-radius: 50%;
    background: var(--glass-bg);
    color: var(--text-secondary);
    display: none;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition);
    position: relative;
    padding: 0;
}

@media (min-width: 769px) {
    .nav-icon-btn {
        display: flex;
    }
}

.nav-icon-btn:hover {
    background: var(--glass-bg-hover);
    border-color: var(--accent-primary);
    color: white;
}

.sleep-timer-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    font-size: 8px;
    font-weight: 800;
    background: var(--accent-primary);
    color: white;
    padding: 1px 5px;
    border-radius: 8px;
    min-width: 18px;
    text-align: center;
    display: none;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px var(--accent-glow);
}

/* ===========================================
   FAVORITE STAR ON CHANNEL CARD
   =========================================== */
.fav-star-btn {
    position: absolute;
    top: 6px;
    right: 6px;
    width: 26px;
    height: 26px;
    border: none;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border-radius: 50%;
    color: rgba(255, 255, 255, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.25s ease;
    z-index: 3;
    opacity: 0;
    transform: scale(0.8);
    padding: 0;
}

.channel-card:hover .fav-star-btn {
    opacity: 1;
    transform: scale(1);
}

.fav-star-btn.is-fav {
    opacity: 1;
    transform: scale(1);
    color: var(--accent-secondary);
    background: rgba(255, 101, 132, 0.2);
}

.fav-star-btn:hover {
    color: var(--accent-secondary);
    background: rgba(255, 101, 132, 0.3);
    transform: scale(1.15);
}

/* Favorites category icon */
.category-icon.favorites {
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.2), rgba(255, 101, 132, 0.2));
    border: 1px solid rgba(255, 215, 0, 0.3);
}

/* Recent category icon */
.category-icon.recent {
    background: linear-gradient(135deg, rgba(0, 212, 170, 0.2), rgba(108, 99, 255, 0.2));
    border: 1px solid rgba(0, 212, 170, 0.3);
}

/* Sidebar Favorite Button */
.np-fav-btn {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-md);
    background: var(--glass-bg);
    color: var(--text-secondary);
    font-family: var(--font-body);
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 8px;
}

.np-fav-btn:hover {
    background: var(--glass-bg-hover);
    border-color: var(--accent-secondary);
    color: white;
}

.np-fav-btn.is-fav {
    border-color: rgba(255, 101, 132, 0.3);
    background: rgba(255, 101, 132, 0.08);
    color: var(--accent-secondary);
}


/* ===========================================
   MODAL OVERLAY (shared)
   =========================================== */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.modal-overlay.visible {
    opacity: 1;
    visibility: visible;
}

.modal-card {
    background: rgba(15, 12, 41, 0.98);
    border: 1px solid rgba(108, 99, 255, 0.2);
    border-radius: 20px;
    width: 90%;
    max-width: 400px;
    padding: 0;
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.6), 0 0 40px rgba(108, 99, 255, 0.08);
    transform: scale(0.9) translateY(20px);
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    overflow: hidden;
}

.modal-overlay.visible .modal-card {
    transform: scale(1) translateY(0);
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.modal-header h3 {
    font-family: var(--font-primary);
    font-size: 17px;
    font-weight: 700;
    color: white;
    margin: 0;
}

.modal-close {
    width: 32px;
    height: 32px;
    border: none;
    background: rgba(255, 255, 255, 0.06);
    border-radius: 50%;
    color: var(--text-muted);
    font-size: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition);
    padding: 0;
}

.modal-close:hover {
    background: rgba(255, 255, 255, 0.12);
    color: white;
}

.modal-body {
    padding: 20px;
}

.modal-desc {
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 16px;
}

/* ===========================================
   SLEEP TIMER
   =========================================== */
.sleep-timer-options {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
}

.sleep-option {
    padding: 12px;
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-md);
    background: var(--glass-bg);
    color: var(--text-secondary);
    font-family: var(--font-body);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    text-align: center;
}

.sleep-option:hover {
    background: rgba(108, 99, 255, 0.12);
    border-color: var(--accent-primary);
    color: white;
}

.sleep-timer-active {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
}

.sleep-countdown-ring {
    width: 120px;
    height: 120px;
    position: relative;
}

.sleep-countdown-ring svg {
    width: 100%;
    height: 100%;
    transform: rotate(-90deg);
}

.sleep-countdown-ring .ring-bg {
    fill: none;
    stroke: rgba(255, 255, 255, 0.06);
    stroke-width: 4;
}

.sleep-countdown-ring .ring-progress {
    fill: none;
    stroke: var(--accent-primary);
    stroke-width: 4;
    stroke-linecap: round;
    transition: stroke-dashoffset 1s linear;
    filter: drop-shadow(0 0 8px var(--accent-glow));
}

.sleep-countdown-text {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-primary);
    font-size: 28px;
    font-weight: 800;
    color: white;
    letter-spacing: 1px;
}

.sleep-timer-label {
    font-size: 12px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.sleep-cancel-btn {
    padding: 10px 28px;
    border: 1px solid rgba(255, 59, 92, 0.3);
    border-radius: var(--radius-full);
    background: rgba(255, 59, 92, 0.08);
    color: var(--live-red);
    font-family: var(--font-body);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

.sleep-cancel-btn:hover {
    background: rgba(255, 59, 92, 0.18);
    border-color: var(--live-red);
}

/* ===========================================
   KEYBOARD SHORTCUTS MODAL
   =========================================== */
.shortcuts-card {
    max-width: 500px;
}

.shortcuts-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
}

.shortcut-group h4 {
    font-family: var(--font-primary);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: var(--accent-primary);
    margin-bottom: 10px;
    font-weight: 700;
}

.shortcut-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 6px 0;
}

.shortcut-row kbd {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 28px;
    padding: 4px 10px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    font-family: var(--font-body);
    font-size: 11px;
    font-weight: 600;
    color: var(--text-secondary);
}

.shortcut-row span {
    font-size: 13px;
    color: var(--text-muted);
}

/* ===========================================
   STREAM STATS OVERLAY
   =========================================== */
.stream-stats-overlay {
    position: absolute;
    top: 12px;
    left: 12px;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(108, 99, 255, 0.2);
    border-radius: 12px;
    padding: 12px 16px;
    z-index: 15;
    min-width: 200px;
    font-family: var(--font-body);
}

.stats-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 11px;
    font-weight: 700;
    color: var(--accent-primary);
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.stats-close-btn {
    width: 22px;
    height: 22px;
    border: none;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 50%;
    color: var(--text-muted);
    font-size: 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition-fast);
    padding: 0;
}

.stats-close-btn:hover {
    background: rgba(255, 255, 255, 0.18);
    color: white;
}

.stats-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px 16px;
}

.stat-item {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    padding: 3px 0;
}

.stat-key {
    font-size: 10px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stat-val {
    font-size: 11px;
    color: var(--text-primary);
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}

/* ===========================================
   CHANNEL SWITCH ANIMATION (player-only)
   =========================================== */
.channel-switch-overlay {
    position: absolute;
    inset: 0;
    z-index: 12;
    pointer-events: none;
    opacity: 0;
    background: rgba(0, 0, 0, 0.8);
    border-radius: inherit;
}

.channel-switch-overlay.active {
    animation: channelSwitch 0.3s ease-out forwards;
}

@keyframes channelSwitch {
    0% {
        opacity: 0.85;
    }

    50% {
        opacity: 0.4;
    }

    100% {
        opacity: 0;
    }
}

.switch-glitch-lines {
    position: absolute;
    inset: 0;
    background: repeating-linear-gradient(0deg,
            transparent,
            transparent 2px,
            rgba(255, 255, 255, 0.015) 2px,
            rgba(255, 255, 255, 0.015) 4px);
    animation: glitchScan 0.3s linear;
    border-radius: inherit;
}

@keyframes glitchScan {
    from {
        transform: translateY(-50%);
    }

    to {
        transform: translateY(50%);
    }
}

.switch-channel-name {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-family: var(--font-primary);
    font-size: 18px;
    font-weight: 700;
    color: white;
    text-shadow: 0 0 20px rgba(108, 99, 255, 0.3);
    white-space: nowrap;
    animation: switchNameFade 0.3s ease forwards;
}

@keyframes switchNameFade {
    0% {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.9);
    }

    30% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }

    100% {
        opacity: 0;
    }
}



/* ===========================================
   MOBILE RESPONSIVE — NEW FEATURES
   =========================================== */
@media (max-width: 768px) {
    .modal-card {
        width: 92%;
        max-width: 380px;
        border-radius: 16px;
    }

    .shortcuts-grid {
        grid-template-columns: 1fr;
    }

    .sleep-timer-options {
        grid-template-columns: repeat(2, 1fr);
    }

    .stream-stats-overlay {
        top: 8px;
        left: 8px;
        right: 8px;
        min-width: auto;
        font-size: 10px;
    }

    .switch-channel-name {
        font-size: 18px;
    }
}

/* ===========================================
   PAGE LOADER
   =========================================== */
.page-loader {
    position: fixed;
    inset: 0;
    z-index: 10000;
    background: var(--bg-primary);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 24px;
    transition: opacity 0.5s ease, visibility 0.5s ease;
}

.page-loader.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.loader-logo {
    width: 64px;
    height: 64px;
    border-radius: 18px;
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-primary);
    font-size: 32px;
    font-weight: 800;
    color: white;
    animation: loaderPulse 1.2s ease-in-out infinite;
    box-shadow: 0 0 40px var(--accent-glow);
}

@keyframes loaderPulse {

    0%,
    100% {
        transform: scale(1);
        box-shadow: 0 0 30px var(--accent-glow);
    }

    50% {
        transform: scale(1.08);
        box-shadow: 0 0 50px var(--accent-glow);
    }
}

.loader-bar {
    width: 160px;
    height: 3px;
    background: rgba(255, 255, 255, 0.06);
    border-radius: 3px;
    overflow: hidden;
}

.loader-progress {
    width: 0%;
    height: 100%;
    background: linear-gradient(90deg, var(--accent-primary), var(--accent-secondary));
    border-radius: 3px;
    animation: loaderFill 1.2s ease-in-out forwards;
}

@keyframes loaderFill {
    0% {
        width: 0%;
    }

    60% {
        width: 80%;
    }

    100% {
        width: 100%;
    }
}

/* ===========================================
   SCROLL-REVEAL ANIMATIONS
   =========================================== */
.category-section {
    opacity: 0;
    transform: translateY(24px);
    animation: revealUp 0.5s ease forwards;
}

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

/* Stagger each section */
.category-section:nth-child(1) {
    animation-delay: 0.05s;
}

.category-section:nth-child(2) {
    animation-delay: 0.1s;
}

.category-section:nth-child(3) {
    animation-delay: 0.14s;
}

.category-section:nth-child(4) {
    animation-delay: 0.18s;
}

.category-section:nth-child(5) {
    animation-delay: 0.22s;
}

.category-section:nth-child(6) {
    animation-delay: 0.26s;
}

.category-section:nth-child(7) {
    animation-delay: 0.3s;
}

.category-section:nth-child(8) {
    animation-delay: 0.34s;
}

/* ===========================================
   ENHANCED CHANNEL CARD ANIMATIONS
   =========================================== */
.channel-card {
    transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1),
        box-shadow 0.35s ease,
        border-color 0.3s ease,
        background 0.3s ease;
    will-change: transform;
}

.channel-card::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background: linear-gradient(135deg,
            rgba(108, 99, 255, 0) 0%,
            rgba(108, 99, 255, 0.04) 50%,
            rgba(255, 101, 132, 0) 100%);
    opacity: 0;
    transition: opacity 0.4s ease;
    pointer-events: none;
    z-index: 1;
}

.channel-card:hover::after {
    opacity: 1;
}

.channel-card:hover {
    transform: translateY(-6px) scale(1.02);
    box-shadow:
        0 14px 40px rgba(0, 0, 0, 0.35),
        0 0 25px rgba(108, 99, 255, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.channel-card:active {
    transform: translateY(-2px) scale(0.98);
    transition-duration: 0.1s;
}

/* Active card glow pulse */
.channel-card.active {
    animation: activeCardGlow 2s ease-in-out infinite;
}

@keyframes activeCardGlow {

    0%,
    100% {
        box-shadow: 0 0 20px var(--accent-glow);
    }

    50% {
        box-shadow: 0 0 30px var(--accent-glow), 0 0 60px rgba(108, 99, 255, 0.08);
    }
}

/* Logo hover lift */
.channel-card:hover .channel-logo-wrapper {
    transform: scale(1.05);
    border-color: rgba(108, 99, 255, 0.3);
    box-shadow: 0 4px 16px rgba(108, 99, 255, 0.15);
}

.channel-logo-wrapper {
    transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1),
        border-color 0.3s ease,
        box-shadow 0.3s ease;
}

/* ===========================================
   NAVBAR SCROLL EFFECT (enhance)
   =========================================== */
.navbar {
    transition: background 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
}

.navbar.scrolled {
    background: rgba(10, 10, 26, 0.95);
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.5);
    border-bottom-color: rgba(108, 99, 255, 0.15);
}

/* ===========================================
   BUTTON HOVER MICRO-ANIMATIONS
   =========================================== */
.nav-icon-btn,
.quality-btn,
.mobile-volume-toggle {
    transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1),
        background 0.2s ease,
        border-color 0.2s ease,
        color 0.2s ease;
}

.nav-icon-btn:hover,
.quality-btn:hover {
    transform: scale(1.1);
}

.nav-icon-btn:active,
.quality-btn:active {
    transform: scale(0.92);
    transition-duration: 0.08s;
}

/* Live badge pulse */
.live-badge {
    animation: livePulse 2.5s ease-in-out infinite;
}

@keyframes livePulse {

    0%,
    100% {
        box-shadow: 0 0 8px var(--live-glow);
    }

    50% {
        box-shadow: 0 0 16px var(--live-glow), 0 0 30px rgba(255, 59, 92, 0.15);
    }
}

/* ===========================================
   CATEGORY HEADER ANIMATIONS
   =========================================== */
.category-icon {
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.category-section:hover .category-icon {
    transform: scale(1.15) rotate(-5deg);
}

.category-divider {
    background: linear-gradient(90deg, rgba(108, 99, 255, 0.3), transparent);
    animation: dividerShimmer 3s ease infinite;
}

@keyframes dividerShimmer {

    0%,
    100% {
        opacity: 0.5;
    }

    50% {
        opacity: 1;
    }
}

/* ===========================================
   SEARCH INPUT FOCUS ANIMATION
   =========================================== */
.search-container:focus-within {
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(108, 99, 255, 0.15), 0 0 20px rgba(108, 99, 255, 0.08);
    transform: scale(1.01);
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* ===========================================
   SIDEBAR NOW PLAYING ANIMATION
   =========================================== */
.sidebar-channel-info {
    animation: fadeSlideIn 0.4s ease;
}

@keyframes fadeSlideIn {
    from {
        opacity: 0;
        transform: translateX(-10px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.np-channel-name {
    background: linear-gradient(90deg, white, rgba(255, 255, 255, 0.8));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}


/* ===========================================
   CONTENT PROTECTION
   =========================================== */
body {
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

/* Allow selection in inputs and textareas */
input,
textarea {
    -webkit-user-select: text;
    -moz-user-select: text;
    -ms-user-select: text;
    user-select: text;
}

/* Disable image dragging */
img {
    -webkit-user-drag: none;
    user-drag: none;
    pointer-events: none;
}

/* ===========================================
   SMOOTH SKELETON SHIMMER (loading states)
   =========================================== */
@keyframes shimmer {
    0% {
        background-position: -200% 0;
    }

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

.skeleton-shimmer {
    background: linear-gradient(90deg,
            rgba(255, 255, 255, 0.02) 25%,
            rgba(255, 255, 255, 0.06) 50%,
            rgba(255, 255, 255, 0.02) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s ease infinite;
}