/**
 * Star TV Web Portal — Standalone Production Stylesheet
 * Self-contained CSS guaranteeing 100% responsiveness and styling on all devices:
 * Android TV Box Chrome, Smart TVs, Mobile, Tablets & Desktop Browsers.
 * Zero external CDN dependencies.
 */

/* ── 1. Reset & Global Box Sizing ── */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    color-scheme: dark;
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

body {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background-color: #020617; /* slate-950 */
    color: #f1f5f9; /* slate-100 */
    font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
}

/* Image constraints - prevents ANY image from overflowing */
img, svg, video {
    max-width: 100%;
    height: auto;
    display: block;
}

/* Brand logo constraint guarantees no blown-out logo */
.brand-logo-wrap,
.w-\[52px\] {
    width: 52px !important;
    height: 52px !important;
    min-width: 52px !important;
    min-height: 52px !important;
}

.brand-logo-wrap img,
.w-\[52px\] img,
img[alt*="Star TV Logo"] {
    width: 52px !important;
    height: 52px !important;
    max-width: 52px !important;
    max-height: 52px !important;
    object-fit: contain;
}

a {
    color: inherit;
    text-decoration: none;
}

button {
    font-family: inherit;
    font-size: inherit;
    line-height: inherit;
    color: inherit;
    border: none;
    background: none;
    cursor: pointer;
}

input {
    font-family: inherit;
    font-size: inherit;
    line-height: inherit;
    color: inherit;
}

/* ── 2. Color Palette Tokens ── */
:root {
    --slate-950: #020617;
    --slate-900: #0f172a;
    --slate-850: #141f36;
    --slate-800: #1e293b;
    --slate-700: #334155;
    --slate-600: #475569;
    --slate-500: #64748b;
    --slate-400: #94a3b8;
    --slate-300: #cbd5e1;
    --slate-200: #e2e8f0;
    --slate-100: #f1f5f9;

    --brand-500: #f43f5e;
    --brand-600: #e11d48;
    --brand-700: #be123c;
    --brand-900: #881337;

    --emerald-400: #34d399;
    --emerald-500: #10b981;
    --emerald-600: #059669;

    --amber-300: #fcd34d;
    --amber-400: #fbbf24;
    --amber-500: #f59e0b;

    --cyan-400: #22d3ee;
    --violet-400: #a78bfa;
}

/* ── 3. Layout Utilities ── */
.w-full { width: 100%; }
.h-full { height: 100%; }
.min-h-screen { min-height: 100vh; }
.max-w-7xl { max-width: 80rem; margin-left: auto; margin-right: auto; }
.max-w-xl { max-width: 36rem; }
.max-w-sm { max-width: 24rem; }
.max-w-xs { max-width: 20rem; }
.flex-1 { flex: 1 1 0%; }
.flex-shrink-0 { flex-shrink: 0; }
.min-w-0 { min-width: 0px; }

.block { display: block; }
.inline-block { display: inline-block; }
.inline-flex { display: inline-flex; }
.flex { display: flex; }
.grid { display: grid; }
.hidden { display: none !important; }

.flex-col { flex-direction: column; }
.flex-row { flex-direction: row; }
.flex-wrap { flex-wrap: wrap; }
.items-center { align-items: center; }
.items-start { align-items: flex-start; }
.items-end { align-items: flex-end; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.justify-start { justify-content: flex-start; }
.justify-end { justify-content: flex-end; }

/* Grid columns */
.grid-cols-1 { grid-template-columns: repeat(1, minmax(0, 1fr)); }

/* Positions */
.relative { position: relative; }
.absolute { position: absolute; }
.sticky { position: sticky; }
.fixed { position: fixed; }
.top-0 { top: 0px; }
.inset-0 { top: 0px; right: 0px; bottom: 0px; left: 0px; }
.right-3 { right: 0.75rem; }
.left-3 { left: 0.75rem; }
.left-3\.5 { left: 0.875rem; }
.top-1\/2 { top: 50%; }
.-translate-y-1\/2 { transform: translateY(-50%); }

.z-10 { z-index: 10; }
.z-20 { z-index: 20; }
.z-30 { z-index: 30; }
.z-40 { z-index: 40; }
.z-50 { z-index: 50; }

/* Gaps */
.gap-0\.5 { gap: 0.125rem; }
.gap-1 { gap: 0.25rem; }
.gap-1\.5 { gap: 0.375rem; }
.gap-2 { gap: 0.5rem; }
.gap-2\.5 { gap: 0.625rem; }
.gap-3 { gap: 0.75rem; }
.gap-3\.5 { gap: 0.875rem; }
.gap-4 { gap: 1rem; }
.gap-5 { gap: 1.25rem; }
.gap-6 { gap: 1.5rem; }

/* Spacing */
.p-1 { padding: 0.25rem; }
.p-1\.5 { padding: 0.375rem; }
.p-2 { padding: 0.5rem; }
.p-2\.5 { padding: 0.625rem; }
.p-3 { padding: 0.75rem; }
.p-3\.5 { padding: 0.875rem; }
.p-4 { padding: 1rem; }
.p-5 { padding: 1.25rem; }
.p-6 { padding: 1.5rem; }
.p-12 { padding: 3rem; }

.px-1\.5 { padding-left: 0.375rem; padding-right: 0.375rem; }
.px-2 { padding-left: 0.5rem; padding-right: 0.5rem; }
.px-2\.5 { padding-left: 0.625rem; padding-right: 0.625rem; }
.px-3 { padding-left: 0.75rem; padding-right: 0.75rem; }
.px-3\.5 { padding-left: 0.875rem; padding-right: 0.875rem; }
.px-4 { padding-left: 1rem; padding-right: 1rem; }
.px-6 { padding-left: 1.5rem; padding-right: 1.5rem; }
.px-8 { padding-left: 2rem; padding-right: 2rem; }

.py-0\.5 { padding-top: 0.125rem; padding-bottom: 0.125rem; }
.py-1 { padding-top: 0.25rem; padding-bottom: 0.25rem; }
.py-1\.5 { padding-top: 0.375rem; padding-bottom: 0.375rem; }
.py-2 { padding-top: 0.5rem; padding-bottom: 0.5rem; }
.py-2\.5 { padding-top: 0.625rem; padding-bottom: 0.625rem; }
.py-3 { padding-top: 0.75rem; padding-bottom: 0.75rem; }

.pl-9 { padding-left: 2.25rem; }
.pr-3 { padding-right: 0.75rem; }
.pr-8 { padding-right: 2rem; }
.pt-1 { padding-top: 0.25rem; }
.pt-3 { padding-top: 0.75rem; }
.pb-1 { padding-bottom: 0.25rem; }
.pl-2 { padding-left: 0.5rem; }

.m-auto { margin: auto; }
.mx-auto { margin-left: auto; margin-right: auto; }
.my-12 { margin-top: 3rem; margin-bottom: 3rem; }
.mb-1 { margin-bottom: 0.25rem; }
.mb-1\.5 { margin-bottom: 0.375rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-3 { margin-bottom: 0.75rem; }
.mb-3\.5 { margin-bottom: 0.875rem; }
.mb-4 { margin-bottom: 1rem; }
.mb-5 { margin-bottom: 1.25rem; }
.mb-8 { margin-bottom: 2rem; }
.mt-0\.5 { margin-top: 0.125rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-3\.5 { margin-top: 0.875rem; }
.ml-0\.5 { margin-left: 0.125rem; }
.ml-1 { margin-left: 0.25rem; }

.space-y-3\.5 > * + * { margin-top: 0.875rem; }
.space-y-4 > * + * { margin-top: 1rem; }
.space-y-6 > * + * { margin-top: 1.5rem; }

/* ── 4. Dimensions & Sizing Utilities ── */
.w-1 { width: 0.25rem; }
.w-1\.5 { width: 0.375rem; }
.w-2 { width: 0.5rem; }
.w-2\.5 { width: 0.625rem; }
.w-3 { width: 0.75rem; }
.w-3\.5 { width: 0.875rem; }
.w-4 { width: 1rem; }
.w-5 { width: 1.25rem; }
.w-6 { width: 1.5rem; }
.w-7 { width: 1.75rem; }
.w-8 { width: 2rem; }
.w-9 { width: 2.25rem; }
.w-10 { width: 2.5rem; }
.w-12 { width: 3rem; }
.w-14 { width: 3.5rem; }
.w-16 { width: 4rem; }

.h-1\.5 { height: 0.375rem; }
.h-2 { height: 0.5rem; }
.h-2\.5 { height: 0.625rem; }
.h-3 { height: 0.75rem; }
.h-3\.5 { height: 0.875rem; }
.h-4 { height: 1rem; }
.h-5 { height: 1.25rem; }
.h-6 { height: 1.5rem; }
.h-7 { height: 1.75rem; }
.h-8 { height: 2rem; }
.h-9 { height: 2.25rem; }
.h-10 { height: 2.5rem; }
.h-12 { height: 3rem; }
.h-14 { height: 3.5rem; }
.h-16 { height: 4rem; }
.h-\[520px\] { height: 520px; }

/* ── 5. Video Player Aspect Ratio & Cinema Display ── */
.aspect-video {
    aspect-ratio: 16 / 9;
    width: 100%;
    position: relative;
    background: #000;
    min-height: 220px;
}

/* Fallback for older Android TV Box browsers that lack CSS aspect-ratio */
@supports not (aspect-ratio: 16 / 9) {
    .aspect-video {
        height: 0;
        padding-bottom: 56.25%;
        position: relative;
    }
    .aspect-video > * {
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
    }
}

#liveVideoPlayer {
    width: 100%;
    height: 100%;
    object-fit: contain;
    background: #000;
}

/* Video Error & Offline Overlay */
#videoErrorOverlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    height: 100%;
    background: rgba(2, 6, 23, 0.94);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    text-align: center;
    z-index: 20;
}

#videoErrorOverlay.hidden {
    display: none !important;
}

/* Suppress native browser video loading/buffering arc */
video::-webkit-media-controls-overlay-enclosure {
    display: none !important;
}
video::-webkit-media-controls-loading-panel {
    display: none !important;
}
video::-webkit-media-controls-spinner {
    display: none !important;
}

#videoSpinner {
    position: absolute;
    inset: 0;
    background: rgba(2, 6, 23, 0.95);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
    z-index: 25;
}

#videoSpinner.hidden {
    display: none !important;
}

/* ── 6. Borders & Rounded Corners ── */
.rounded { border-radius: 0.25rem; }
.rounded-md { border-radius: 0.375rem; }
.rounded-lg { border-radius: 0.5rem; }
.rounded-xl { border-radius: 0.75rem; }
.rounded-2xl { border-radius: 1rem; }
.rounded-3xl { border-radius: 1.5rem; }
.rounded-full { border-radius: 9999px; }
.rounded-t { border-top-left-radius: 0.25rem; border-top-right-radius: 0.25rem; }

.border { border: 1px solid var(--slate-800); }
.border-t { border-top: 1px solid var(--slate-800); }
.border-b { border-bottom: 1px solid var(--slate-800); }
.border-slate-800 { border-color: rgba(30, 41, 59, 0.8); }
.border-slate-800\/80 { border-color: rgba(30, 41, 59, 0.8); }
.border-slate-800\/60 { border-color: rgba(30, 41, 59, 0.6); }
.border-slate-700 { border-color: #334155; }
.border-slate-700\/80 { border-color: rgba(51, 65, 85, 0.8); }
.border-slate-700\/70 { border-color: rgba(51, 65, 85, 0.7); }
.border-slate-700\/60 { border-color: rgba(51, 65, 85, 0.6); }
.border-brand-500 { border-color: var(--brand-500); }
.border-rose-500\/20 { border-color: rgba(244, 63, 94, 0.2); }
.border-rose-500\/30 { border-color: rgba(244, 63, 94, 0.3); }
.border-emerald-500\/30 { border-color: rgba(16, 185, 129, 0.3); }
.border-emerald-500\/20 { border-color: rgba(16, 185, 129, 0.2); }
.border-amber-500\/30 { border-color: rgba(245, 158, 11, 0.3); }
.border-amber-500\/40 { border-color: rgba(245, 158, 11, 0.4); }
.border-cyan-500\/20 { border-color: rgba(34, 211, 238, 0.2); }
.border-violet-500\/20 { border-color: rgba(167, 139, 250, 0.2); }
.border-transparent { border-color: transparent; }
.border-l-4 { border-left-width: 4px; }

/* ── 7. Background Colors ── */
.bg-slate-950 { background-color: #020617; }
.bg-slate-950\/90 { background-color: rgba(2, 6, 23, 0.9); }
.bg-slate-950\/92 { background-color: rgba(2, 6, 23, 0.92); }
.bg-slate-950\/98 { background-color: rgba(2, 6, 23, 0.98); }
.bg-slate-900 { background-color: #0f172a; }
.bg-slate-900\/95 { background-color: rgba(15, 23, 42, 0.95); }
.bg-slate-900\/90 { background-color: rgba(15, 23, 42, 0.9); }
.bg-slate-900\/80 { background-color: rgba(15, 23, 42, 0.8); }
.bg-slate-900\/60 { background-color: rgba(15, 23, 42, 0.6); }
.bg-slate-800 { background-color: #1e293b; }
.bg-slate-800\/80 { background-color: rgba(30, 41, 59, 0.8); }
.bg-slate-800\/60 { background-color: rgba(30, 41, 59, 0.6); }
.bg-slate-800\/40 { background-color: rgba(30, 41, 59, 0.4); }
.bg-slate-700 { background-color: #334155; }
.bg-black { background-color: #000000; }
.bg-black\/40 { background-color: rgba(0, 0, 0, 0.4); }

.bg-brand-600 { background-color: #e11d48; }
.bg-brand-500 { background-color: #f43f5e; }
.bg-rose-500 { background-color: #f43f5e; }
.bg-rose-600 { background-color: #e11d48; }
.bg-rose-500\/10 { background-color: rgba(244, 63, 94, 0.1); }
.bg-rose-500\/15 { background-color: rgba(244, 63, 94, 0.15); }

.bg-emerald-500 { background-color: #10b981; }
.bg-emerald-600 { background-color: #059669; }
.bg-emerald-500\/15 { background-color: rgba(16, 185, 129, 0.15); }
.bg-emerald-500\/20 { background-color: rgba(16, 185, 129, 0.2); }

.bg-amber-400 { background-color: #fbbf24; }
.bg-amber-500 { background-color: #f59e0b; }
.bg-amber-500\/20 { background-color: rgba(245, 158, 11, 0.2); }

.bg-cyan-500\/15 { background-color: rgba(34, 211, 238, 0.15); }
.bg-violet-500\/15 { background-color: rgba(167, 139, 250, 0.15); }

/* ── 8. Text & Typography ── */
.text-white { color: #ffffff; }
.text-slate-100 { color: #f1f5f9; }
.text-slate-200 { color: #e2e8f0; }
.text-slate-300 { color: #cbd5e1; }
.text-slate-400 { color: #94a3b8; }
.text-slate-500 { color: #64748b; }
.text-slate-600 { color: #475569; }
.text-slate-950 { color: #020617; }

.text-brand-400 { color: #fb7185; }
.text-brand-500 { color: #f43f5e; }
.text-rose-400 { color: #fb7185; }
.text-rose-500 { color: #f43f5e; }
.text-red-400 { color: #f87171; }
.text-emerald-300 { color: #6ee7b7; }
.text-emerald-400 { color: #34d399; }
.text-amber-300 { color: #fcd34d; }
.text-amber-400 { color: #fbbf24; }
.text-cyan-400 { color: #22d3ee; }
.text-violet-400 { color: #a78bfa; }

.text-\[8px\] { font-size: 8px; }
.text-\[9px\] { font-size: 9px; }
.text-\[10px\] { font-size: 10px; }
.text-\[11px\] { font-size: 11px; }
.text-xs { font-size: 0.75rem; line-height: 1rem; }
.text-sm { font-size: 0.875rem; line-height: 1.25rem; }
.text-base { font-size: 1rem; line-height: 1.5rem; }
.text-lg { font-size: 1.125rem; line-height: 1.75rem; }
.text-xl { font-size: 1.25rem; line-height: 1.75rem; }
.text-2xl { font-size: 1.5rem; line-height: 2rem; }

.font-medium { font-weight: 500; }
.font-semibold { font-weight: 600; }
.font-bold { font-weight: 700; }
.font-black { font-weight: 900; }
.font-mono { font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace; }

.text-center { text-align: center; }
.truncate {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.whitespace-nowrap { white-space: nowrap; }
.uppercase { text-transform: uppercase; }
.tracking-wide { letter-spacing: 0.025em; }
.tracking-tight { letter-spacing: -0.025em; }

/* ── 9. Cards, Glassmorphism & Shadows ── */
.card-glass {
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(20px) saturate(160%);
    -webkit-backdrop-filter: blur(20px) saturate(160%);
    border: 1px solid rgba(255, 255, 255, 0.07);
    box-shadow: 0 8px 32px rgba(0,0,0,0.3), inset 0 1px 0 rgba(255,255,255,0.04);
}

/* Cinematic Player Frame — gradient border glow */
.player-cinema-frame {
    position: relative;
    border-radius: 1rem;
    overflow: hidden;
}
.player-cinema-frame::before {
    content: '';
    position: absolute;
    inset: -1px;
    border-radius: 1rem;
    padding: 1px;
    background: linear-gradient(135deg, rgba(244,63,94,0.3), rgba(34,211,238,0.15), rgba(167,139,250,0.1));
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    pointer-events: none;
    z-index: 1;
}
.player-cinema-frame::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 1rem;
    box-shadow: 0 0 60px rgba(244,63,94,0.08), 0 0 120px rgba(34,211,238,0.04);
    pointer-events: none;
    z-index: 0;
}

.shadow-sm { box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05); }
.shadow { box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px -1px rgba(0, 0, 0, 0.1); }
.shadow-md { box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1); }
.shadow-lg { box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1); }
.shadow-2xl { box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5); }
.shadow-inner { box-shadow: inset 0 2px 4px 0 rgba(0, 0, 0, 0.25); }

.overflow-hidden { overflow: hidden; }
.overflow-x-auto { overflow-x: auto; }
.overflow-y-auto { overflow-y: auto; }

/* Custom Scrollbars */
.custom-scroll {
    scrollbar-width: thin;
    scrollbar-color: #334155 rgba(15, 23, 42, 0.6);
}
.custom-scroll::-webkit-scrollbar { width: 5px; height: 5px; }
.custom-scroll::-webkit-scrollbar-track { background: rgba(15, 23, 42, 0.6); }
.custom-scroll::-webkit-scrollbar-thumb { background: #334155; border-radius: 4px; }
.custom-scroll::-webkit-scrollbar-thumb:hover { background: #f43f5e; }

/* ── 10. Interactive & Hover States ── */
.hover\:bg-slate-800:hover { background-color: #1e293b; }
.hover\:bg-slate-700:hover { background-color: #334155; }
.hover\:bg-slate-800\/40:hover { background-color: rgba(30, 41, 59, 0.4); }
.hover\:bg-brand-500:hover { background-color: #f43f5e; }
.hover\:bg-emerald-500:hover { background-color: #10b981; }
.hover\:bg-amber-400:hover { background-color: #fbbf24; }
.hover\:bg-amber-500\/30:hover { background-color: rgba(245, 158, 11, 0.3); }

.hover\:text-white:hover { color: #ffffff; }
.hover\:text-slate-100:hover { color: #f1f5f9; }
.hover\:text-slate-200:hover { color: #e2e8f0; }
.hover\:text-slate-300:hover { color: #cbd5e1; }
.hover\:text-brand-400:hover { color: #fb7185; }
.hover\:text-amber-400:hover { color: #fbbf24; }
.hover\:text-orange-400:hover { color: #fb923c; }

.hover\:border-slate-700:hover { border-color: #334155; }
.hover\:border-emerald-500\/40:hover { border-color: rgba(16, 185, 129, 0.4); }

.transition-all { transition-property: all; transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1); transition-duration: 150ms; }
.transition-colors { transition-property: color, background-color, border-color; transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1); transition-duration: 150ms; }
.transition-transform { transition-property: transform; transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1); transition-duration: 150ms; }

/* Active Channel in List */
.active-channel {
    background: linear-gradient(90deg, rgba(244, 63, 94, 0.18) 0%, rgba(244, 63, 94, 0.03) 100%) !important;
    border-left-color: #f43f5e !important;
    box-shadow: inset 4px 0 12px rgba(244,63,94,0.1);
}
.active-channel .channel-name {
    color: #f43f5e !important;
    font-weight: 700;
}

/* Channel Card Hover Glow */
.channel-card {
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
}
.channel-card:hover {
    background: rgba(30, 41, 59, 0.5) !important;
    transform: translateX(4px);
    box-shadow: 0 0 20px rgba(244,63,94,0.1), 0 4px 12px rgba(0,0,0,0.2);
}
.channel-card:hover .channel-name {
    color: #fb7185 !important;
}
.channel-card:active {
    transform: translateX(2px) scale(0.995);
}

/* Animations */
@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}
.animate-spin {
    animation: spin 1s linear infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}
.animate-pulse {
    animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

/* ── 11. Responsive Breakpoints ── */
@media (min-width: 640px) {
    .sm\:block { display: block !important; }
    .sm\:flex { display: flex !important; }
    .sm\:flex-row { flex-direction: row !important; }
    .sm\:items-center { align-items: center !important; }
    .sm\:px-6 { padding-left: 1.5rem !important; padding-right: 1.5rem !important; }
    .sm\:p-5 { padding: 1.25rem !important; }
    .sm\:p-6 { padding: 1.5rem !important; }
    .sm\:text-sm { font-size: 0.875rem !important; line-height: 1.25rem !important; }
    .sm\:text-lg { font-size: 1.125rem !important; line-height: 1.75rem !important; }
    .sm\:w-14 { width: 3.5rem !important; }
    .sm\:h-14 { height: 3.5rem !important; }
}

@media (min-width: 768px) {
    .md\:block { display: block !important; }
    .md\:flex { display: flex !important; }
    .md\:hidden { display: none !important; }
}

@media (min-width: 1024px) {
    #appsPromoBanner { display: block !important; }
    .lg\:block { display: block !important; }
    .lg\:flex { display: flex !important; }
    .lg\:hidden { display: none !important; }
    .lg\:static { position: static !important; }
    .lg\:grid-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)) !important; }
    .lg\:col-span-2 { grid-column: span 2 / span 2 !important; }
    .lg\:col-span-1 { grid-column: span 1 / span 1 !important; }
    .lg\:p-8 { padding: 2rem !important; }
    .lg\:px-8 { padding-left: 2rem !important; padding-right: 2rem !important; }
    .lg\:mx-0 { margin-left: 0px !important; margin-right: 0px !important; }
    .lg\:px-0 { padding-left: 0px !important; padding-right: 0px !important; }
    .lg\:py-0 { padding-top: 0px !important; padding-bottom: 0px !important; }
    .lg\:border-b-0 { border-bottom-width: 0px !important; }
    .lg\:bg-transparent { background-color: transparent !important; }
}

/* ── 12. Smart TV & Android TV Box Enhancements ── */
@media screen and (min-width: 960px) and (max-height: 800px) and (orientation: landscape) {
    /* TV Screen viewing mode optimizations */
    .max-w-7xl {
        max-width: 96% !important;
    }
    .h-\[520px\] {
        height: 60vh !important;
    }
}

/* TV Device notification banner */
.tv-device-banner {
    background: linear-gradient(135deg, rgba(136, 19, 55, 0.95), rgba(15, 23, 42, 0.95), rgba(30, 27, 75, 0.95));
    border-bottom: 1px solid rgba(244, 63, 94, 0.4);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.6);
    position: relative;
    z-index: 50;
}

/* ── 13. Specific Utilities ── */
.-mx-4 { margin-left: -1rem; margin-right: -1rem; }
.-mx-2 { margin-left: -0.5rem; margin-right: -0.5rem; }
.top-\[57px\] { top: 57px; }

/* ── 14. Mobile & Touch Screen Responsive Optimizations (<= 768px) ── */
@media (max-width: 768px) {
    /* Compact header */
    header .max-w-7xl {
        padding: 6px 10px !important;
    }
    .brand-logo-wrap,
    .w-\[52px\] {
        width: 36px !important;
        height: 36px !important;
        min-width: 36px !important;
        min-height: 36px !important;
    }
    .brand-logo-wrap img,
    .w-\[52px\] img,
    img[alt*="Star TV Logo"] {
        width: 36px !important;
        height: 36px !important;
        max-width: 36px !important;
        max-height: 36px !important;
    }

    /* Sub-bar touch scroll */
    .custom-scroll {
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }
    .custom-scroll::-webkit-scrollbar {
        display: none;
    }

    /* Main Container Padding */
    main {
        padding: 6px 8px 16px 8px !important;
    }
    main.space-y-6 {
        gap: 8px !important;
    }

    /* Sticky video player on mobile */
    .sticky.top-\[57px\] {
        top: 48px !important;
        margin-left: -8px !important;
        margin-right: -8px !important;
        padding-left: 8px !important;
        padding-right: 8px !important;
        padding-top: 4px !important;
        padding-bottom: 4px !important;
        background: rgba(2, 6, 23, 0.98) !important;
        box-shadow: 0 8px 20px rgba(0, 0, 0, 0.65);
    }

    /* Video player maintains natural 16:9 ratio and size as is */
    .aspect-video {
        aspect-ratio: 16 / 9 !important;
        width: 100% !important;
    }

    /* Channel info & control buttons layout - compact on mobile */
    #playerMetaWrap,
    .p-4.sm\:p-5.bg-slate-900\/60 {
        padding: 8px 10px !important;
    }

    #currentLogoWrap {
        width: 36px !important;
        height: 36px !important;
        min-width: 36px !important;
    }
    #currentLogoWrap img {
        max-width: 30px !important;
        max-height: 30px !important;
    }
    #currentLogoFallback {
        width: 20px !important;
        height: 20px !important;
    }

    #currentName {
        font-size: 13.5px !important;
        line-height: 1.25 !important;
    }
    #currentCategory {
        font-size: 10.5px !important;
        margin-top: 1px !important;
    }

    /* Multi-server switcher pills */
    #serverSwitcherWrap {
        margin-top: 4px !important;
        padding-top: 3px !important;
    }
    .server-pill {
        padding: 2px 7px !important;
        font-size: 9.5px !important;
        border-radius: 6px !important;
    }

    /* Quick action buttons row for player */
    .player-action-buttons {
        width: 100% !important;
        display: flex !important;
        align-items: center !important;
        justify-content: space-between !important;
        gap: 4px !important;
        margin-top: 6px !important;
        padding-top: 6px !important;
        border-top: 1px solid rgba(255, 255, 255, 0.08) !important;
    }
    .player-action-buttons button,
    .player-action-buttons a {
        flex: 1 !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        height: 30px !important;
        padding: 0 !important;
        border-radius: 7px !important;
    }
    .player-action-buttons svg,
    .player-action-buttons i {
        width: 14px !important;
        height: 14px !important;
    }

    /* Hide large promo banner in right column on mobile to maximize channel list space */
    #appsPromoBanner,
    .lg\:col-span-1 > a[href="/apps"],
    a[href="/apps"].group {
        display: none !important;
    }

    /* Category pills */
    #categoryPillContainer {
        padding-bottom: 4px !important;
        margin-bottom: 2px !important;
        -webkit-overflow-scrolling: touch;
    }
    .cat-pill {
        padding: 4px 8px !important;
        font-size: 10.5px !important;
        border-radius: 8px !important;
    }

    /* Mobile search input */
    #mobileSearchInput {
        padding-top: 5px !important;
        padding-bottom: 5px !important;
        font-size: 12px !important;
        border-radius: 10px !important;
    }

    /* Right column gap */
    .space-y-3\.5 > :not([hidden]) ~ :not([hidden]),
    .space-y-2 > :not([hidden]) ~ :not([hidden]) {
        margin-top: 6px !important;
    }

    /* ── Channels List: Fill all remaining vertical gap on mobile ── */
    .card-glass.h-\[520px\],
    .h-\[520px\] {
        height: auto !important;
        min-height: calc(100vh - 350px) !important;
        max-height: none !important;
        display: flex !important;
        flex-direction: column !important;
        margin-bottom: 0 !important;
    }
    #channelListWrap {
        flex: 1 1 auto !important;
        height: auto !important;
        max-height: none !important;
        overflow-y: visible !important;
    }

    /* Eliminate huge bottom gap before footer on mobile */
    main {
        padding-bottom: 8px !important;
    }
    footer {
        margin-top: 16px !important;
    }
    footer > div {
        padding-top: 20px !important;
        padding-bottom: 20px !important;
    }

    /* Channel card layout & visibility */
    .channel-card {
        padding: 7px 10px !important;
        min-height: 46px !important;
        display: flex !important;
        align-items: center !important;
        justify-content: space-between !important;
    }
    .channel-card .channel-name {
        display: block !important;
        visibility: visible !important;
        opacity: 1 !important;
        color: #e2e8f0 !important;
        font-size: 12.5px !important;
        font-weight: 600 !important;
        line-height: 1.25 !important;
        max-width: 100% !important;
    }
    .active-channel .channel-name {
        color: #f43f5e !important;
        font-weight: 700 !important;
    }

    /* Channel card right action buttons */
    .channel-card-actions {
        width: auto !important;
        margin: 0 !important;
        padding: 0 0 0 6px !important;
        border: none !important;
        flex-shrink: 0 !important;
        display: flex !important;
        align-items: center !important;
        gap: 4px !important;
    }
    .channel-card-actions button,
    .channel-card-actions .fav-btn {
        flex: none !important;
        width: 26px !important;
        height: 26px !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        padding: 0 !important;
    }

    /* Apps Download Hub Hero & Cards on Mobile */
    h1.text-3xl {
        font-size: 24px !important;
        line-height: 1.25 !important;
    }
    .app-card {
        padding: 14px !important;
        border-radius: 16px !important;
    }
    .app-filter-pill {
        flex-shrink: 0 !important;
        white-space: nowrap !important;
    }

    /* Hide TV Device banner on mobile phones */
    #tvDeviceBanner {
        display: none !important;
    }

    /* Apps Hub (/apps/) Mobile Responsive Refinements */
    #appShowcase {
        padding: 24px 0 !important;
    }
    #videoOverlay {
        padding: 10px !important;
        gap: 8px !important;
    }
    #videoOverlay .w-12 {
        width: 44px !important;
        height: 44px !important;
    }
    #videoOverlay svg {
        width: 18px !important;
        height: 18px !important;
    }
    .guide-tab-btn {
        flex-shrink: 0 !important;
        white-space: nowrap !important;
        padding: 8px 12px !important;
        font-size: 11px !important;
    }
}
