/*
 * Khela — Professional IPTV Player
 * Option D: Video-first immersive, overlay sidebar, auto-hide UI
 */

/* ════════════════════════════════════════════
   DESIGN TOKENS
════════════════════════════════════════════ */
:root {
  --accent: #39FF14;
  /* Neon Green */
  --accent-dim: rgba(57, 255, 20, 0.12);
  --accent-glow: rgba(57, 255, 20, 0.4);
  --panel-bg: rgba(5, 5, 5, 0.94);
  --sidebar-bg: rgba(7, 7, 7, 0.92);
  --glass: rgba(255, 255, 255, 0.05);
  --glass-hover: rgba(255, 255, 255, 0.1);
  --border: rgba(255, 255, 255, 0.08);
  --border-accent: rgba(57, 255, 20, 0.35);
  --text: #ffffff;
  --sub-text: rgba(255, 255, 255, 0.5);
  --sidebar-w: 320px;
  --strip-h: 56px;
  /* Slightly taller topbar */
  --radius: 12px;
  --ease: cubic-bezier(0.25, 1, 0.5, 1);
}

/* ════════════════════════════════════════════
   RESET & BASE
════════════════════════════════════════════ */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html,
body {
  width: 100%;
  height: 100%;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  background: #000;
  font-family: 'Poppins', 'Segoe UI', sans-serif;
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}

/* Lock scroll on watch page so user stays in fullscreen player */
body.is-logged-in {
  overflow: hidden;
  position: fixed;
  width: 100%;
  height: 100%;
}

/* ════════════════════════════════════════════
   WATCH LAYOUT — pure overlay, no grid
════════════════════════════════════════════ */
.watch-layout {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
}

/* ════════════════════════════════════════════
   PLAYER AREA — always fills 100% screen
════════════════════════════════════════════ */
.player-area {
  position: fixed;
  inset: 0;
  z-index: 1;
  background: #000;
}

.player-area video,
.player-area iframe {
  width: 100%;
  height: 100%;
  object-fit: fill;
  background: #000;
  border: none;
  display: block;
}

.spinner-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.55);
  z-index: 3;
}

.unavailable-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #000;
  z-index: 5;
}

.unavailable-overlay img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

/* ════════════════════════════════════════════
   TAP ZONES (invisible interaction areas)
════════════════════════════════════════════ */
.tap-zone {
  position: absolute;
  top: 0;
  bottom: 0;
  z-index: 4;
  width: 33.333%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.tap-zone-left {
  left: 0;
}

.tap-zone-mid {
  left: 33.333%;
}

.tap-zone-right {
  right: 0;
}

/* Double-tap ripple hint */
.tap-ripple {
  position: absolute;
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.15);
  animation: tapRipple 0.45s var(--ease) forwards;
  pointer-events: none;
}

@keyframes tapRipple {
  from {
    transform: scale(0.5);
    opacity: 1;
  }

  to {
    transform: scale(2);
    opacity: 0;
  }
}

/* Seek indicator */
.seek-indicator {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: rgba(0, 0, 0, 0.75);
  color: #fff;
  font-size: 16px;
  font-weight: 600;
  padding: 12px 22px;
  border-radius: 40px;
  display: none;
  align-items: center;
  gap: 6px;
  backdrop-filter: blur(6px);
  z-index: 10;
  white-space: nowrap;
  pointer-events: none;
  letter-spacing: 0.3px;
}

.seek-indicator.show {
  display: flex;
  animation: fadeInOut 0.8s ease forwards;
}

@keyframes fadeInOut {
  0% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.9);
  }

  20% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
  }

  80% {
    opacity: 1;
  }

  100% {
    opacity: 0;
  }
}

/* ════════════════════════════════════════════
   UI PANELS — shared auto-hide transition
════════════════════════════════════════════ */
.ui-panel {
  transition: opacity 0.3s var(--ease), transform 0.3s var(--ease);
  will-change: opacity, transform;
}

.ui-hidden {
  opacity: 0 !important;
  pointer-events: none !important;
}

/* ════════════════════════════════════════════
   PLAYER BUTTON RESET
   main.css has button { width:100%; background:gradient; border-radius:10px; padding:14px; margin-top:10px }
   Reset all player buttons so specific classes control their own look
════════════════════════════════════════════ */
.unified-topbar button,
.controls-area button,
.sidebar-header button,
.sidebar-close-btn,
.vol-btn {
  background: none !important;
  border: none !important;
  border-radius: 0 !important;
  padding: 0 !important;
  margin: 0 !important;
  width: auto !important;
  box-shadow: none !important;
  opacity: 1 !important;
  outline: none !important;
  position: relative;
  overflow: hidden;
  /* Prevent background/pseudo-element overlap */
}

/* Force hide any pseudo-elements from main.css */
.unified-topbar button::before,
.unified-topbar button::after,
.controls-area button::before,
.controls-area button::after,
.sidebar-close-btn::before,
.sidebar-close-btn::after {
  display: none !important;
  content: none !important;
}

/* ════════════════════════════════════════════
   UNIFIED TOPBAR — thin single bar
   hamburger | category tabs | user avatar
════════════════════════════════════════════ */
.unified-topbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--strip-h);
  z-index: 60;
  display: flex;
  align-items: stretch;
  background: rgba(8, 8, 18, 0.9);
  backdrop-filter: blur(24px) saturate(1.4);
  -webkit-backdrop-filter: blur(24px) saturate(1.4);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.unified-topbar.ui-hidden {
  transform: translateY(-100%);
}

.cats-scroll {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: stretch;
  justify-content: flex-start;
  /* Left aligned on mobile so items don't get cut off */
  gap: 24px;
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
  padding: 0 16px;
}

@media (min-width: 768px) {
  .cats-scroll {
    justify-content: flex-start;
    gap: 32px;
    padding: 0 16px;
  }
}

.cats-scroll::-webkit-scrollbar {
  display: none;
}

/* Category tab buttons — clean underline style */
.cat-btn {
  flex: 0 0 auto;
  width: auto !important;
  /* override main.css button { width:100% } */
  height: 100%;
  padding: 0 20px;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  color: rgba(255, 255, 255, 0.5);
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.22s var(--ease);
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 8px;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.4);
}

.cat-btn i {
  font-size: 11px;
  opacity: 0.7;
}

.cat-btn:hover {
  color: rgba(255, 255, 255, 0.85);
}

.cat-btn.active {
  color: var(--accent);
  font-weight: 700;
  border-bottom-color: var(--accent);
  text-shadow: 0 0 10px var(--accent-glow);
}

.cat-btn:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px var(--accent);
}

.hamburger-btn {
  width: 52px !important;
  height: 100% !important;
  border-right: 1px solid rgba(255, 255, 255, 0.05) !important;
  color: rgba(255, 255, 255, 0.7);
  font-size: 15px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.18s, color 0.18s;
  flex-shrink: 0;
}

.hamburger-btn:hover {
  background: var(--glass-hover) !important;
  color: #fff;
}

/* Live dot used in bottom controls */
.strip-live-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #ef4444;
  animation: livePulse 1.5s infinite;
  flex-shrink: 0;
}

@keyframes livePulse {

  0%,
  100% {
    opacity: 1;
    box-shadow: 0 0 4px #ef4444;
  }

  50% {
    opacity: 0.4;
    box-shadow: none;
  }
}

/* User avatar — flush right of topbar */
.strip-user {
  flex-shrink: 0;
  position: relative;
  display: flex;
  align-items: center;
  padding: 0 18px;
  /* Increased padding */
  border-left: 1px solid rgba(255, 255, 255, 0.05);
}

.strip-avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 800;
  color: #fff;
  cursor: pointer;
  border: 2px solid rgba(14, 165, 233, 0.35);
  transition: border-color 0.2s, transform 0.2s;
}

.strip-avatar:hover {
  border-color: var(--accent);
  transform: scale(1.08);
}

.logout-top-btn {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #f87171;
  /* Red color */
  font-size: 16px;
  cursor: pointer;
  transition: transform 0.2s, color 0.2s;
  margin-left: 12px;
}

.logout-top-btn:hover {
  color: #ef4444;
  transform: scale(1.15);
}

/* ════════════════════════════════════════════
   SIDEBAR OVERLAY — slides from left
════════════════════════════════════════════ */
/* Backdrop */
.sidebar-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
  z-index: 98;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.35s var(--ease);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
}

.watch-layout.sidebar-open .sidebar-backdrop {
  opacity: 1;
  pointer-events: auto;
}

/* Sidebar panel */
.ch-panel {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: var(--sidebar-w);
  z-index: 100;
  background: var(--sidebar-bg);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  transform: translateX(-100%);
  transition: transform 0.38s var(--ease);
  box-shadow: 4px 0 40px rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(30px) saturate(1.6);
  -webkit-backdrop-filter: blur(30px) saturate(1.6);
  will-change: transform;
}

.watch-layout.sidebar-open .ch-panel {
  transform: translateX(0);
}

/* Sidebar Header */
.sidebar-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.sidebar-logo img {
  height: 36px;
  width: auto;
  display: block;
}

.sidebar-close-btn {
  margin-left: auto !important;
  width: 28px !important;
  height: 28px !important;
  border-radius: 50% !important;
  /* Circle */
  background: #fff !important;
  /* White circle */
  border: none !important;
  color: #000 !important;
  /* Black arrow */
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform 0.2s;
  font-size: 13px;
  flex-shrink: 0;
}

.sidebar-close-btn:hover {
  transform: scale(1.1);
  opacity: 0.9 !important;
}

/* Category Tabs inside sidebar */
.sidebar-cats {
  display: flex;
  align-items: center;
  gap: 6px;
  overflow-x: auto;
  scrollbar-width: none;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.sidebar-cats::-webkit-scrollbar {
  display: none;
}

.cat-btn {
  flex: 0 0 auto;
  padding: 5px 14px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 600;
  font-family: inherit;
  color: rgba(255, 255, 255, 0.6);
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.09);
  cursor: pointer;
  transition: all 0.18s;
  white-space: nowrap;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.cat-btn:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.14);
  border-color: rgba(255, 255, 255, 0.2);
}

.cat-btn.active {
  color: var(--accent);
  background: var(--accent-dim);
  border-color: var(--border-accent);
  font-weight: 700;
}

/* Search */
.sidebar-search {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.sidebar-search input {
  width: 100%;
  background: var(--glass);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 12px 8px 38px;
  color: #fff;
  font-size: 13px;
  font-family: inherit;
  outline: none;
  transition: border-color 0.2s, background 0.2s;
}

.sidebar-search input:focus {
  border-color: var(--border-accent);
  background: rgba(255, 255, 255, 0.06);
}

.sidebar-search input::placeholder {
  color: var(--sub-text);
}

.sidebar-search-icon {
  position: relative;
}

.sidebar-search-icon i {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--sub-text);
  font-size: 12px;
  pointer-events: none;
}

/* Channel Scroll */
.ch-scroll {
  flex: 1;
  overflow-y: auto;
  padding: 6px;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.08) transparent;
}

.ch-scroll::-webkit-scrollbar {
  width: 3px;
}

.ch-scroll::-webkit-scrollbar-track {
  background: transparent;
}

.ch-scroll::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 4px;
}

/* Channel Row */
.ch-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 10px;
  margin-bottom: 2px;
  cursor: pointer;
  border: 1px solid transparent;
  transition: background 0.15s, border-color 0.15s;
  position: relative;
}

.ch-row:hover {
  background: var(--glass-hover);
}

.ch-row:focus {
  background: var(--glass-hover);
  border-color: var(--border-accent);
  outline: none;
}

.ch-row.active {
  background: linear-gradient(180deg, rgba(20, 20, 25, 0.95) 0%, rgba(5, 5, 10, 0.98) 100%);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-left: 4px solid var(--accent);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.7),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
  position: relative;
  z-index: 2;
}

.ch-row.active::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, rgba(255, 255, 255, 0.04), transparent);
  pointer-events: none;
  border-radius: inherit;
}

.ch-row.active .ch-name {
  color: var(--accent);
  text-shadow: 0 0 8px var(--accent-glow);
}

.ch-img {
  width: 45px;
  height: 32px;
  /* Matching mockup thumb size */
  object-fit: contain;
  border-radius: 4px;
  background: #111;
  flex-shrink: 0;
}

.ch-info {
  flex: 1;
  min-width: 0;
}

.ch-name {
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--text);
}

.ch-meta {
  display: none;
}

.live-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #ff4b4b;
  flex-shrink: 0;
  animation: neonPulse 1.5s infinite;
}

@keyframes neonPulse {
  0% {
    opacity: 1;
    box-shadow: 0 0 10px #ff4b4b;
  }

  50% {
    opacity: 0.4;
    box-shadow: none;
  }

  100% {
    opacity: 1;
    box-shadow: 0 0 10px #ff4b4b;
  }
}

/* Channel count badge */
.ch-count-badge {
  padding: 6px 12px 8px;
  font-size: 10px;
  font-weight: 700;
  color: var(--sub-text);
  text-transform: uppercase;
  letter-spacing: 1px;
  flex-shrink: 0;
  border-top: 1px solid var(--border);
  text-align: center;
}

/* ════════════════════════════════════════════
   BOTTOM CONTROLS — spans full width (no sidebar conflict)
════════════════════════════════════════════ */
.controls-area {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 55;
  background: linear-gradient(to top,
      rgba(0, 0, 0, 0.98) 0%,
      rgba(0, 0, 0, 0.85) 40%,
      rgba(0, 0, 0, 0.4) 75%,
      transparent 100%);
  padding: 0 24px 20px;
  pointer-events: none;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.controls-area>* {
  pointer-events: auto;
}

.controls-area.ui-hidden {
  transform: translateY(16px);
}

/* ─── Layout Structure ─── */
.controls-main {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 0;
}

.controls-left,
.controls-right {
  display: flex;
  align-items: center;
  gap: 24px;
}

/* ─── Buttons ─── */
.pc-btn {
  background: none !important;
  border: none !important;
  color: #fff;
  font-size: 22px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s var(--ease);
  opacity: 0.85;
}

.pc-btn:hover {
  opacity: 1;
  color: var(--accent);
  transform: scale(1.15);
  text-shadow: 0 0 15px var(--accent-glow);
}

/* ─── Volume ─── */
.volume-group {
  display: flex;
  align-items: center;
  gap: 12px;
}

.vol-btn {
  background: none;
  border: none;
  color: #fff;
  font-size: 16px;
  /* Slightly smaller for minimalism */
  cursor: pointer;
  opacity: 0.7;
  transition: all 0.2s var(--ease);
  width: 28px !important;
  /* Enforced rigid width */
  min-width: 28px !important;
  max-width: 28px !important;
  flex-shrink: 0 !important;
  display: flex;
  align-items: center;
  justify-content: center;
}

.vol-btn:hover {
  opacity: 1;
  color: var(--accent);
}

.vol-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 130px;
  height: 12px;
  /* Use a more robust gradient-stop approach instead of background-size manipulation */
  background-image:
    /* Layer 1: The "Gaps" (Segments) — placed on top to cut out segments */
    repeating-linear-gradient(to right, transparent 0, transparent 4px, #000 4px, #000 8px),
    /* Layer 2: The Green Fill — uses var(--vol-pct) for the hard stop */
    linear-gradient(to right, var(--accent) 0%, var(--accent) var(--vol-pct, 100%), transparent var(--vol-pct, 100%)),
    /* Layer 3: The subtle track line */
    linear-gradient(to right, rgba(255, 255, 255, 0.1) 0%, rgba(255, 255, 255, 0.1) 100%);
  background-size: 100% 100%, 100% 100%, 100% 1px;
  background-position: 0 0, 0 0, 0 6px;
  background-repeat: no-repeat;
  background-color: transparent !important;
  border: none !important;
  border-radius: 0;
  outline: none !important;
  box-shadow: none !important;
  cursor: pointer;
  transition: opacity 0.2s;
  margin-left: 10px;
}

.vol-slider:hover {
  opacity: 1;
}

.vol-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 0;
  height: 0;
  opacity: 0;
  /* Hide thumb for digital segmented look */
}

.vol-slider::-moz-range-thumb {
  width: 0;
  height: 0;
  opacity: 0;
  border: none;
}

/* ─── Live Status & Info ─── */
.live-status {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #ff4b4b;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 1px;
}

.now-playing-info {
  margin-left: 10px;
  border-left: 1px solid var(--border);
  padding-left: 20px;
}

.now-playing-info #now-playing-title {
  font-size: 15px;
  font-weight: 600;
  color: #fff;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.8);
}

/* ─── Progress Bar (Razor Thin Neon Line) ─── */
.progress-container {
  width: 100%;
  height: 2px;
  background: rgba(255, 255, 255, 0.1);
  cursor: pointer;
  position: relative;
  transition: height 0.2s;
}

.progress-container:hover {
  height: 4px;
}

.progress-fill {
  height: 100%;
  background: var(--accent);
  box-shadow: 0 0 12px var(--accent-glow);
  transition: width 0.3s ease;
}

.progress-fill::after {
  content: '';
  position: absolute;
  right: -5px;
  top: 50%;
  transform: translateY(-50%);
  width: 12px;
  height: 12px;
  background: var(--accent);
  border-radius: 50%;
  box-shadow: 0 0 8px var(--accent-glow);
  opacity: 0;
  transition: opacity 0.2s;
}

.progress-container:hover .progress-fill::after {
  opacity: 1;
}

/* Control Buttons */
.overlay-actions {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 8px 0 10px;
}

.btn-spacer {
  flex: 1;
}

.pc-btn {
  background: transparent !important;
  border: none !important;
  color: #fff;
  font-size: 20px;
  cursor: pointer;
  width: 46px !important;
  height: 46px !important;
  border-radius: 50% !important;
  /* Circular buttons look more modern */
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s var(--ease);
  flex-shrink: 0;
  line-height: 1 !important;
  backdrop-filter: blur(8px);
}

.pc-btn:hover,
.pc-btn:focus {
  background: transparent !important;
  border-color: transparent !important;
  transform: translateY(-2px);
  box-shadow: none !important;
  outline: none;
}

.pc-btn--primary {
  width: 64px !important;
  height: 64px !important;
  background: var(--accent) !important;
  border: none !important;
  color: #fff;
  font-size: 28px;
  box-shadow: 0 0 25px var(--accent-glow);
  border-radius: 50% !important;
  margin: 0 10px !important;
}

.pc-btn--primary:hover,
.pc-btn--primary:focus {
  background: #38bdf8 !important;
  transform: translateY(-3px) scale(1.08);
  box-shadow: 0 0 35px var(--accent-glow);
}

/* ════════════════════════════════════════════
   USER DROPDOWN
════════════════════════════════════════════ */
.user-dropdown-menu {
  position: fixed;
  top: calc(var(--strip-h) + 4px);
  right: 16px;
  width: 220px;
  background: #0e0e20;
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: 0 12px 48px rgba(0, 0, 0, 0.7);
  display: none;
  z-index: 200;
  overflow: hidden;
  animation: menuDown 0.22s var(--ease) both;
}

@keyframes menuDown {
  from {
    opacity: 0;
    transform: translateY(-8px) scale(0.97);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.user-dropdown-menu.show {
  display: block;
}

.dropdown-header {
  padding: 14px 16px;
  background: rgba(255, 255, 255, 0.02);
  border-bottom: 1px solid var(--border);
}

.dropdown-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  color: var(--text);
  text-decoration: none;
  font-size: 14px;
  transition: background 0.15s;
  cursor: pointer;
}

.dropdown-item i {
  width: 16px;
  text-align: center;
  opacity: 0.6;
}

.dropdown-item:hover {
  background: var(--glass-hover);
}

.dropdown-item.logout-btn {
  color: #f87171;
}

.divider {
  border: none;
  border-top: 1px solid var(--border);
}

/* ════════════════════════════════════════════
   TOAST NOTIFICATIONS
════════════════════════════════════════════ */
.toast {
  padding: 10px 16px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 500;
  background: rgba(12, 12, 24, 0.97);
  border: 1px solid var(--border);
  color: #fff;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  gap: 8px;
  backdrop-filter: blur(12px);
  transition: opacity 0.3s;
  max-width: 280px;
}

.toast.error {
  border-color: rgba(239, 68, 68, 0.35);
  color: #fca5a5;
}

.toast.success {
  border-color: rgba(34, 197, 94, 0.35);
  color: #86efac;
}

/* ════════════════════════════════════════════
   TV REMOTE FOCUS RING
════════════════════════════════════════════ */
:focus-visible {
  outline: 2px solid var(--accent) !important;
  outline-offset: 2px;
}

/* ════════════════════════════════════════════
   MOBILE — ph.modal-card {
  position: relative;
  background: linear-gradient(145deg, rgba(15, 15, 25, 0.98), rgba(5, 5, 10, 0.99));
  border: 1px solid var(--border-accent);
  border-radius: 24px;
  width: 92%;
  max-width: 440px;
  overflow: hidden;
  box-shadow: 0 30px 60px rgba(0, 0, 0, 0.8), 0 0 30px var(--accent-dim);
  animation: modalScaleUp 0.4s var(--ease);
}

@keyframes modalScaleUp {
  from { transform: scale(0.9); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

.modal-close {
  position: absolute;
  top: 18px;
  right: 18px;
  width: 32px !important;
  height: 32px !important;
  border-radius: 50% !important;
  background: rgba(255, 255, 255, 0.06) !important;
  border: 1px solid rgba(255, 255, 255, 0.1) !important;
  color: #fff !important;
  font-size: 20px !important;
  display: flex !important;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 10;
  transition: all 0.2s;
}

.modal-close:hover {
  background: rgba(255, 255, 255, 0.15) !important;
  transform: rotate(90deg);
}

.modal-header {
  padding: 24px 30px 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.modal-header h3 {
  font-size: 20px;
  font-weight: 800;
  color: #fff;
  letter-spacing: 0.5px;
  white-space: nowrap;
}

.modal-body {
  padding: 30px;
}

.modal-body p {
  color: var(--sub-text);
  margin-bottom: 24px;
  font-size: 14px;
  font-weight: 500;
}

.report-options {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.report-opt {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 20px 10px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 16px;
  color: #fff;
  cursor: pointer;
  transition: all 0.25s var(--ease);
}

.opt-icon {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(57, 255, 20, 0.08);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s;
}

.opt-icon i {
  font-size: 20px;
  color: var(--accent);
}

.report-opt span {
  font-size: 13px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.7);
}

.report-opt:hover {
  background: var(--accent-dim);
  border-color: var(--accent);
  transform: translateY(-4px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.4);
}

.report-opt:hover .opt-icon {
  background: var(--accent);
  transform: scale(1.1);
}

.report-opt:hover .opt-icon i {
  color: #000;
}

.report-opt:hover span {
  color: #fff;
}

.report-footer {
  margin-top: 30px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.report-footer label {
  font-size: 12px;
  font-weight: 700;
  color: var(--sub-text);
  text-transform: uppercase;
  letter-spacing: 1px;
}

.report-footer textarea {
  width: 100%;
  min-height: 80px;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  padding: 14px;
  color: #fff;
  font-family: inherit;
  font-size: 14px;
  resize: none;
  transition: all 0.2s;
}

.report-footer textarea:focus {
  outline: none;
  border-color: var(--accent);
  background: rgba(0, 0, 0, 0.5);
}
�═════════════════════════════════ */
@media (min-width: 768px) and (max-width: 1199px) {
  :root {
    --sidebar-w: 300px;
  }

  .now-playing-title {
    font-size: 18px;
  }
}

/* ════════════════════════════════════════════
   4K / LARGE SCREEN TV
════════════════════════════════════════════ */
@media (min-width: 1921px) {
  :root {
    --sidebar-w: 420px;
    --strip-h: 72px;
  }

  .ch-name {
    font-size: 18px;
  }

  .ch-img {
    width: 72px;
    height: 52px;
  }

  .cat-btn {
    font-size: 18px;
    padding: 0 32px;
  }

  .now-playing-info #now-playing-title {
    font-size: 28px;
  }

  .pc-btn {
    font-size: 32px;
  }

  .vol-slider {
    width: 150px;
  }
}

/* ════════════════════════════════════════════
   SIDEBAR CATEGORIES in old topbar structure
   (hide the old .topbar if still in DOM)
════════════════════════════════════════════ */
.topbar {
  display: none !important;
}

.user-menu-top {
  display: none !important;
}

/* ════════════════════════════════════════════
   REPORT MODAL
════════════════════════════════════════════ */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(10px);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: modalFadeIn 0.3s ease;
}

@keyframes modalFadeIn {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

.modal-card {
  background: rgba(15, 15, 25, 0.95);
  border: 1px solid var(--border-accent);
  border-radius: 20px;
  width: 100%;
  max-width: 400px;
  overflow: hidden;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5), 0 0 20px var(--accent-dim);
}

.modal-header {
  padding: 20px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-header h3 {
  font-size: 18px;
  font-weight: 700;
  color: #fff;
}

.modal-close {
  background: none;
  border: none;
  color: var(--sub-text);
  font-size: 28px;
  cursor: pointer;
  transition: color 0.2s;
}

.modal-close:hover {
  color: #fff;
}

.modal-body {
  padding: 24px;
}

.modal-body p {
  color: var(--sub-text);
  margin-bottom: 20px;
  font-size: 14px;
}

.report-options {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.report-opt {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 16px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
  border-radius: 12px;
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  width: 100% !important;
  /* override global button width */
  height: auto !important;
}

.report-opt i {
  font-size: 20px;
  color: var(--accent);
}

.report-opt:hover {
  background: var(--accent-dim);
  border-color: var(--accent);
  transform: translateY(-2px);
}

.modal-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
}

.modal-title-group {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  min-width: 0;
}

.modal-header h3 {
  font-size: 16px;
  font-weight: 700;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.modal-close {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.05) !important;
  border-radius: 50% !important;
  color: var(--sub-text) !important;
  font-size: 14px !important;
  cursor: pointer;
  transition: all 0.2s;
  flex-shrink: 0;
}

.modal-close:hover {
  background: rgba(239, 68, 68, 0.2) !important;
  color: #ef4444 !important;
  transform: rotate(90deg);
}

.opt-icon {
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.04);
  border-radius: 12px;
  font-size: 20px;
  color: #fff;
  transition: all 0.25s;
}

.report-opt:hover .opt-icon {
  background: var(--accent);
  color: #000;
  box-shadow: 0 0 15px var(--accent-glow);
}


.report-options {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

.report-opt {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 20px 10px;
  background: rgba(255, 255, 255, 0.03) !important;
  border: 1px solid var(--border) !important;
  border-radius: 16px !important;
  color: var(--sub-text) !important;
  font-size: 12px !important;
  font-weight: 600 !important;
  transition: all 0.25s var(--ease);
  width: 100% !important;
  height: auto !important;
}

.report-opt:hover {
  background: var(--accent-dim) !important;
  border-color: var(--accent) !important;
  color: #fff !important;
  transform: translateY(-4px);
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.3);
}

.modal-body p {
  color: var(--sub-text);
  margin-bottom: 24px;
  font-size: 13px;
  text-align: center;
}


/* FORCED MODAL FIXES */
.modal-header {
  display: flex !important;
  flex-direction: row !important;
  align-items: center !important;
  justify-content: space-between !important;
  padding: 20px !important;
  gap: 10px !important;
}

.modal-title-group {
  display: flex !important;
  flex-direction: row !important;
  align-items: center !important;
  gap: 12px !important;
  flex: 1 !important;
}

.modal-header h3 {
  margin: 0 !important;
  white-space: nowrap !important;
  font-size: 16px !important;
  line-height: 1 !important;
}

.modal-close {
  margin-left: auto !important;
  position: static !important;
}

@media (max-width: 480px) {
  .modal-card {
    width: 95% !important;
    margin: 10px !important;
  }

  .report-options {
    grid-template-columns: 1fr 1fr !important;
    gap: 8px !important;
  }

  .report-opt {
    padding: 15px 5px !important;
  }
}

/* Enforce uppercase channel names */
.ch-name,
.now-playing-info #now-playing-title,
#strip-channel-name {
  text-transform: uppercase !important;
}
/* Quality Menu Options */
.quality-opt { padding: 8px 16px; font-size: 13px; color: var(--text); cursor: pointer; transition: all 0.2s; font-weight: 500; }
.quality-opt:hover, .quality-opt:focus { background: rgba(255, 255, 255, 0.1); color: #fff; outline: none; }
.quality-opt.active { color: var(--accent); background: var(--accent-dim); font-weight: 700; }


/* Make controlbar buttons fully transparent */
.pc-btn { background: transparent !important; background-color: transparent !important; backdrop-filter: none !important; -webkit-backdrop-filter: none !important; box-shadow: none !important; }


/* Redesigned Quality Menu Options */
.quality-opt { padding: 10px 16px; font-size: 13px; color: #ccc; cursor: pointer; display: flex; align-items: center; gap: 12px; transition: all 0.2s; border-radius: 6px; margin: 2px 8px; }
.quality-opt:hover, .quality-opt:focus { background: rgba(255,255,255,0.08); color: #fff; outline: none; }
.quality-opt.active { color: var(--accent); font-weight: 700; background: rgba(0,0,0,0.2); }
.quality-opt.active .q-check i { opacity: 1 !important; }



/* Loading spinner solid background to hide previous frame */
.spinner-overlay { background: #000 !important; }
/* Hamburger icon neon hover */
.hamburger-btn:hover { background: rgba(0, 255, 136, 0.1) !important; color: var(--accent) !important; text-shadow: 0 0 10px var(--accent-glow) !important; }

/* Hide volume slider on smaller widths to ensure control bar buttons never overlap */
@media (max-width: 767px) {
  .vol-slider {
    display: none !important;
  }
  .controls-left {
    gap: 16px !important;
  }
  .controls-right {
    gap: 16px !important;
  }
}

/* Safe area padding for notch devices */
@supports (padding: env(safe-area-inset-left)) {
  .unified-topbar {
    padding-left: max(16px, env(safe-area-inset-left)) !important;
    padding-right: max(4px, env(safe-area-inset-right)) !important;
  }
  .controls-area {
    padding-left: max(16px, env(safe-area-inset-left)) !important;
    padding-right: max(16px, env(safe-area-inset-right)) !important;
    padding-bottom: max(16px, env(safe-area-inset-bottom)) !important;
  }
}
