/* ==========================================================================
   OrcaTV - Dark Cinema Premium Design System
   ========================================================================== */

:root {
  --bg-page: #070b14;
  --bg-surface: #0d1322;
  --bg-surface-elevated: #131c31;
  --bg-surface-hover: #1b2641;
  --border-color: rgba(255, 255, 255, 0.08);
  --border-focus: rgba(56, 189, 248, 0.5);

  --accent-cyan: #38bdf8;
  --accent-indigo: #6366f1;
  --accent-gradient: linear-gradient(135deg, #38bdf8 0%, #6366f1 100%);
  --accent-live: #ef4444;

  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-full: 9999px;

  --shadow-cinema: 0 20px 45px -10px rgba(0, 0, 0, 0.7), 0 0 35px -5px rgba(56, 189, 248, 0.12);
  --transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background-color: var(--bg-page);
  color: var(--text-primary);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

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

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: none;
}

/* Custom Scrollbars */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: var(--bg-page);
}

::-webkit-scrollbar-thumb {
  background: #1e293b;
  border-radius: var(--radius-full);
}

::-webkit-scrollbar-thumb:hover {
  background: #334155;
}

.container {
  max-width: 1440px;
  margin: 0 auto;
  padding: 0 1.25rem;
}

/* ==========================================================================
   Header & Navbar
   ========================================================================== */

.navbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(7, 11, 20, 0.88);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border-color);
}

.nav-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  height: 64px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-shrink: 0;
}

.brand-icon {
  width: 32px;
  height: 32px;
  display: block;
}

.brand-text {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.brand-name {
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: -0.5px;
}

.accent-text {
  color: var(--accent-cyan);
}

.badge-live {
  font-size: 0.65rem;
  font-weight: 800;
  background: var(--accent-live);
  color: #fff;
  padding: 0.15rem 0.45rem;
  border-radius: var(--radius-sm);
  letter-spacing: 0.5px;
}

.pulse-dot {
  animation: pulse 1.8s infinite;
}

@keyframes pulse {
  0% {
    transform: scale(0.95);
    opacity: 0.8;
  }

  50% {
    transform: scale(1.15);
    opacity: 1;
  }

  100% {
    transform: scale(0.95);
    opacity: 0.8;
  }
}

/* Sidebar Search Input */
.sidebar-search {
  padding: 0.65rem 0.85rem;
  border-bottom: 1px solid var(--border-color);
  background: rgba(13, 19, 34, 0.4);
}

.search-box {
  position: relative;
  width: 100%;
}

.search-icon {
  position: absolute;
  left: 0.8rem;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  color: var(--text-muted);
}

.search-box input {
  width: 100%;
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  font-size: 0.82rem;
  padding: 0.48rem 2rem 0.48rem 2.2rem;
  border-radius: var(--radius-full);
  outline: none;
  transition: var(--transition);
}

.search-box input:focus {
  border-color: var(--accent-cyan);
  background: var(--bg-surface-hover);
  box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.15);
}

.clear-btn {
  position: absolute;
  right: 0.7rem;
  top: 50%;
  transform: translateY(calc(-50% - 2px));
  display: flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  line-height: 1;
  padding: 0;
  color: var(--text-muted);
  font-size: 1.1rem;
  cursor: pointer;
  border-radius: var(--radius-full);
  transition: var(--transition);
}

.clear-btn:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.1);
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-shrink: 0;
}

/* Category Pills Bar */
.category-bar {
  border-top: 1px solid rgba(255, 255, 255, 0.04);
  background: rgba(13, 19, 34, 0.6);
  padding: 0.5rem 0;
}

.category-container {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  overflow-x: auto;
  white-space: nowrap;
  scrollbar-width: none;
}

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

.cat-pill {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-secondary);
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  padding: 0.4rem 0.9rem;
  border-radius: var(--radius-full);
  transition: var(--transition);
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.cat-pill:hover {
  color: var(--text-primary);
  border-color: rgba(255, 255, 255, 0.2);
  background: var(--bg-surface-elevated);
}

.cat-pill.active {
  color: #070b14;
  background: var(--accent-cyan);
  border-color: var(--accent-cyan);
  font-weight: 700;
  box-shadow: 0 2px 10px rgba(56, 189, 248, 0.3);
}

.live-dot-pulse {
  position: relative;
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background-color: #ef4444;
  box-shadow: 0 0 6px rgba(239, 68, 68, 0.8);
  margin-right: 0.15rem;
  flex-shrink: 0;
}

.live-dot-pulse::after {
  content: '';
  position: absolute;
  top: -3.5px;
  left: -3.5px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: rgba(239, 68, 68, 0.5);
  animation: liveDotRings 1.8s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

@keyframes liveDotRings {
  0% {
    transform: scale(0.5);
    opacity: 1;
  }

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

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-weight: 600;
  border-radius: var(--radius-md);
  transition: var(--transition);
}

.btn-sm {
  padding: 0.45rem 0.85rem;
  font-size: 0.82rem;
}

.btn-primary {
  background: var(--accent-gradient);
  color: #fff;
  box-shadow: 0 4px 15px rgba(56, 189, 248, 0.25);
}

.btn-primary:hover {
  opacity: 0.92;
  transform: translateY(-1px);
}

.btn-secondary {
  background: var(--bg-surface);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
}

.btn-secondary:hover {
  background: var(--bg-surface-elevated);
  border-color: rgba(255, 255, 255, 0.2);
}

.btn-icon {
  width: 16px;
  height: 16px;
}

/* ==========================================================================
   Main Layout Grid
   ========================================================================== */

.main-content {
  padding: 1rem 0 2.5rem;
}

.layout-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 450px;
  grid-template-areas:
    "player sidebar"
    "seo    sidebar";
  gap: 1.35rem;
  align-items: start;
}

.player-section {
  grid-area: player;
  width: 100%;
  min-width: 0;
}

.sidebar-section {
  grid-area: sidebar;
  width: 100%;
  min-width: 0;
}

.seo-article {
  grid-area: seo;
  padding: 1.5rem;
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-cinema);
}

@media (min-width: 1440px) {
  .layout-grid {
    grid-template-columns: minmax(0, 1fr) 480px;
  }
}

@media (max-width: 1200px) and (min-width: 1025px) {
  .layout-grid {
    grid-template-columns: minmax(0, 1fr) 410px;
  }
}

.layout-grid.theater-active {
  grid-template-columns: 1fr;
  grid-template-areas:
    "player"
    "sidebar"
    "seo";
}

.layout-grid.theater-active .sidebar-card {
  height: auto;
  max-height: 540px;
  position: static;
}

.sidebar-section {
  width: 100%;
  min-width: 0;
}

/* ==========================================================================
   Player Section (Left)
   ========================================================================== */

.player-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  overflow: visible;
  box-shadow: var(--shadow-cinema);
}

/* Fluid 16:9 Video Container */
.video-container {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #070b14;
  overflow: hidden;
  border-top-left-radius: var(--radius-lg);
  border-top-right-radius: var(--radius-lg);
}

.layout-grid.theater-active .video-container {
  max-height: 70vh;
}

.video-container video {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
}

.player-overlay {
  position: absolute;
  inset: 0;
  background: rgba(7, 11, 20, 0.94);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  z-index: 10;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  padding: 1rem;
  box-sizing: border-box;
  overflow-y: auto;
  scrollbar-width: none;
}

.player-overlay::-webkit-scrollbar {
  display: none;
}

/* Hide background status pill when overlay is actively displayed */
.player-overlay:not([style*="display: none"])~.player-live-badge {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.overlay-content {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

#overlayMessage {
  font-size: 0.95rem;
  color: #e2e8f0;
  line-height: 1.6;
  text-align: center;
  max-width: 480px;
  white-space: pre-line;
}

.spinner {
  width: 44px;
  height: 44px;
  border: 3px solid rgba(56, 189, 248, 0.2);
  border-top-color: var(--accent-cyan);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

.player-live-badge {
  position: absolute;
  top: 1rem;
  left: 1rem;
  z-index: 5;
  background: rgba(15, 23, 42, 0.85);
  border: 1px solid rgba(239, 68, 68, 0.4);
  backdrop-filter: blur(8px);
  padding: 0.35rem 0.75rem;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 700;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 0.45rem;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4);
  transition: all 0.3s ease;
}

.player-live-badge.badge-status-upcoming {
  border-color: rgba(245, 158, 11, 0.5);
  background: rgba(30, 27, 20, 0.9);
  color: #fde68a;
}

.player-live-badge.badge-status-upcoming .pulse-beacon {
  background: #f59e0b;
  box-shadow: 0 0 10px #f59e0b;
}

.player-live-badge.badge-status-24h {
  border-color: rgba(56, 189, 248, 0.4);
  background: rgba(15, 23, 42, 0.9);
  color: #bae6fd;
}

.player-live-badge.badge-status-24h .pulse-beacon {
  background: #38bdf8;
  box-shadow: 0 0 10px #38bdf8;
}

.player-live-badge.badge-status-offline {
  border-color: rgba(148, 163, 184, 0.4);
  background: rgba(15, 23, 42, 0.9);
  color: #94a3b8;
}

.player-live-badge.badge-status-offline .pulse-beacon {
  background: #64748b;
  box-shadow: none;
  animation: none;
}

.pulse-beacon {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent-live);
  box-shadow: 0 0 10px var(--accent-live);
  animation: pulse 1.5s infinite;
}

/* ==========================================================================
   Match Schedule Card (Upcoming Fixture)
   ========================================================================== */
.schedule-card {
  width: 100%;
  max-width: 460px;
  background: rgba(15, 23, 42, 0.94);
  border: 1px solid rgba(56, 189, 248, 0.3);
  border-radius: 14px;
  padding: 0.85rem 1.3rem;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6), 0 0 20px rgba(56, 189, 248, 0.1);
  backdrop-filter: blur(12px);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 0.55rem;
  animation: fadeInScale 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes fadeInScale {
  from {
    opacity: 0;
    transform: scale(0.96);
  }

  to {
    opacity: 1;
    transform: scale(1);
  }
}

.schedule-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  padding-bottom: 0.45rem;
}

.schedule-tournament {
  font-size: 0.82rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--accent-cyan);
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.schedule-badge-status {
  background: rgba(245, 158, 11, 0.15);
  border: 1px solid rgba(245, 158, 11, 0.35);
  color: #fde68a;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.25rem 0.65rem;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.schedule-fixture {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.85rem;
  width: 100%;
  margin: 0.2rem 0;
}

.schedule-team {
  flex: 1;
  font-size: 1.15rem;
  font-weight: 700;
  color: #fff;
  line-height: 1.3;
}

.schedule-team.home {
  text-align: right;
}

.schedule-team.away {
  text-align: left;
}

.schedule-vs {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(56, 189, 248, 0.15);
  border: 1px solid rgba(56, 189, 248, 0.4);
  color: var(--accent-cyan);
  font-size: 0.75rem;
  font-weight: 900;
  flex-shrink: 0;
  box-shadow: 0 0 12px rgba(56, 189, 248, 0.25);
}

.schedule-datetime-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(30, 41, 59, 0.75);
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 0.35rem 0.85rem;
  border-radius: var(--radius-full);
  font-size: 0.85rem;
  color: #cbd5e1;
  font-weight: 600;
}

.schedule-countdown-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
  margin-top: 0.15rem;
  width: 100%;
}

.schedule-countdown-label {
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
}

.schedule-countdown-grid {
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

.countdown-box {
  background: rgba(13, 19, 34, 0.85);
  border: 1px solid rgba(56, 189, 248, 0.3);
  border-radius: 8px;
  padding: 0.4rem 0.6rem;
  min-width: 52px;
  display: flex;
  flex-direction: column;
  align-items: center;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.5);
}

.countdown-number {
  font-size: 1.25rem;
  font-weight: 800;
  color: #38bdf8;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  line-height: 1.1;
}

.countdown-unit {
  font-size: 0.62rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  margin-top: 2px;
}

.countdown-separator {
  font-size: 1.15rem;
  font-weight: 700;
  color: rgba(56, 189, 248, 0.5);
  margin-bottom: 0.65rem;
}

.schedule-notice {
  font-size: 0.78rem;
  color: var(--text-secondary);
  line-height: 1.4;
}

.schedule-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-top: 0.25rem;
}

.btn-try-stream {
  background: rgba(56, 189, 248, 0.15);
  border: 1px solid var(--accent-cyan);
  color: #38bdf8;
  padding: 0.45rem 1rem;
  font-size: 0.8rem;
  font-weight: 700;
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: var(--transition);
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.btn-try-stream:hover {
  background: var(--accent-cyan);
  color: #070b14;
  box-shadow: 0 0 15px rgba(56, 189, 248, 0.4);
}

/* ==========================================================================
   Standby Screen (Initial Welcome State)
   ========================================================================== */
.standby-card {
  width: 100%;
  max-width: 400px;
  background: rgba(15, 23, 42, 0.92);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 14px;
  padding: 1.25rem 1.4rem;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(12px);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 0.6rem;
  animation: fadeInScale 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.standby-icon {
  font-size: 2.2rem;
  line-height: 1;
  filter: drop-shadow(0 0 16px rgba(56, 189, 248, 0.4));
  margin-bottom: 0.1rem;
}

.standby-title {
  font-size: 1.2rem;
  font-weight: 800;
  color: #fff;
  letter-spacing: -0.02em;
}

.standby-desc {
  font-size: 0.82rem;
  color: var(--text-secondary);
  line-height: 1.45;
  margin: 0;
}

.standby-hint {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(56, 189, 248, 0.1);
  border: 1px solid rgba(56, 189, 248, 0.25);
  color: var(--accent-cyan);
  padding: 0.3rem 0.75rem;
  border-radius: var(--radius-full);
  font-size: 0.78rem;
  font-weight: 600;
  margin-top: 0.2rem;
}

/* ==========================================================================
   Offline Stream Card (When Provider Stream is Dead)
   ========================================================================== */
.offline-card {
  width: 100%;
  max-width: 420px;
  background: rgba(15, 23, 42, 0.94);
  border: 1px solid rgba(239, 68, 68, 0.3);
  border-radius: 14px;
  padding: 1.25rem 1.4rem;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(12px);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 0.65rem;
  animation: fadeInScale 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.offline-icon {
  font-size: 2.2rem;
  line-height: 1;
  filter: drop-shadow(0 0 16px rgba(239, 68, 68, 0.4));
  margin-bottom: 0.1rem;
}

.offline-title {
  font-size: 1.15rem;
  font-weight: 800;
  color: #fff;
  letter-spacing: -0.02em;
}

.offline-desc {
  font-size: 0.82rem;
  color: var(--text-secondary);
  line-height: 1.45;
  margin: 0;
}

.offline-desc strong {
  color: #f87171;
}

.offline-notice {
  font-size: 0.76rem;
  color: #94a3b8;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  padding: 0.5rem 0.75rem;
  line-height: 1.4;
  margin-top: 0.2rem;
}

.offline-notice strong {
  color: #38bdf8;
}

.offline-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-top: 0.3rem;
}

/* Info Bar */
.player-info-bar {
  padding: 0.85rem 1.25rem;
  border-bottom: 0px solid var(--border-color);
  border-bottom-left-radius: var(--radius-lg);
  border-bottom-right-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.channel-details {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.channel-header-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.channel-avatar {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-color);
  object-fit: contain;
  padding: 3px;
}

.channel-title {
  font-size: 1.15rem;
  font-weight: 700;
  line-height: 1.2;
}

.channel-tagline {
  font-size: 0.82rem;
  color: var(--text-secondary);
  margin-top: 0.15rem;
}

.player-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.server-switch-group {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  background: var(--bg-surface-elevated);
  padding: 0.25rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
}

.server-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 600;
  padding: 0 0.35rem;
}

.server-btn {
  font-size: 0.78rem;
  font-weight: 600;
  padding: 0.3rem 0.65rem;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  transition: var(--transition);
}

.server-btn:hover {
  color: var(--text-primary);
}

.server-btn.active {
  background: var(--accent-cyan);
  color: #070b14;
  font-weight: 700;
}

/* Custom Video Quality Menu */
.quality-selector-group {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.quality-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.35rem 0.65rem;
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
}

.quality-btn:hover {
  background: var(--bg-surface-hover);
  border-color: rgba(56, 189, 248, 0.4);
}

.quality-btn.active,
.quality-btn.open {
  border-color: var(--accent-cyan);
  box-shadow: 0 0 10px rgba(56, 189, 248, 0.2);
}

.quality-icon {
  width: 14px;
  height: 14px;
  color: var(--accent-cyan);
}

.quality-label {
  color: var(--text-primary);
  font-weight: 600;
}

.chevron-icon {
  width: 12px;
  height: 12px;
  color: var(--text-muted);
  transition: transform 0.2s ease;
}

.quality-btn.open .chevron-icon {
  transform: rotate(180deg);
}

.quality-dropdown {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  min-width: 165px;
  background: rgba(15, 23, 42, 0.98);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: var(--radius-md);
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.8), 0 0 15px rgba(56, 189, 248, 0.15);
  padding: 0.35rem 0;
  z-index: 120;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  display: none;
}

.quality-dropdown.show {
  display: block;
}

.quality-dropdown-header {
  padding: 0.4rem 0.8rem 0.3rem;
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  margin-bottom: 0.2rem;
}

.quality-options-list {
  display: flex;
  flex-direction: column;
  max-height: 200px;
  overflow-y: auto;
}

.quality-option-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.45rem 0.8rem;
  font-size: 0.78rem;
  color: var(--text-secondary);
  cursor: pointer;
  transition: var(--transition);
  border: none;
  background: transparent;
  width: 100%;
  text-align: left;
}

.quality-option-item:hover {
  background: rgba(56, 189, 248, 0.12);
  color: #fff;
}

.quality-option-item.active {
  color: var(--accent-cyan);
  font-weight: 700;
  background: rgba(56, 189, 248, 0.08);
}

.quality-check-icon {
  width: 13px;
  height: 13px;
  opacity: 0;
  color: var(--accent-cyan);
}

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

.action-buttons {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.icon-btn {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-md);
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
}

.icon-btn:hover {
  color: var(--text-primary);
  border-color: rgba(255, 255, 255, 0.25);
  background: var(--bg-surface-hover);
}

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

/* SEO Article Section Below Player */
/* SEO Article Section Below Player */
.seo-article {
  padding: 1.5rem;
  background: rgba(13, 19, 34, 0.45);
  border-top: 1px solid var(--border-color);
}

.seo-article h2 {
  font-size: 1.12rem;
  font-weight: 700;
  margin-bottom: 0.85rem;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.seo-desc-content {
  display: flex;
  flex-direction: column;
  gap: 1.15rem;
}

.seo-lead {
  font-size: 0.88rem;
  color: #cbd5e1;
  line-height: 1.7;
}

.seo-lead strong {
  color: #f8fafc;
}

.seo-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.85rem;
}

.seo-card {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.85rem 1rem;
  background: rgba(19, 28, 49, 0.5);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  transition: var(--transition);
}

.seo-card:hover {
  background: rgba(19, 28, 49, 0.75);
  border-color: rgba(56, 189, 248, 0.25);
}

.seo-card-icon {
  font-size: 1.35rem;
  flex-shrink: 0;
  line-height: 1;
  margin-top: 2px;
}

.seo-card-body h3 {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 0.25rem;
}

.seo-card-body p {
  font-size: 0.8rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

.seo-guide-section {
  padding: 1rem 1.15rem;
  background: rgba(19, 28, 49, 0.35);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
}

.seo-guide-section h3 {
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--accent-cyan);
  margin-bottom: 0.65rem;
}

.seo-tips-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.seo-tips-list li {
  font-size: 0.82rem;
  color: var(--text-secondary);
  line-height: 1.55;
  position: relative;
  padding-left: 1.25rem;
}

.seo-tips-list li::before {
  content: "•";
  position: absolute;
  left: 0.35rem;
  color: var(--accent-cyan);
  font-size: 1.1rem;
  line-height: 1;
}

.seo-tips-list code {
  background: rgba(255, 255, 255, 0.08);
  padding: 0.15rem 0.4rem;
  border-radius: 4px;
  color: #38bdf8;
  font-size: 0.78rem;
}

.feature-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1rem;
}

.feature-tag {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--accent-cyan);
  background: rgba(56, 189, 248, 0.08);
  border: 1px solid rgba(56, 189, 248, 0.2);
  padding: 0.25rem 0.65rem;
  border-radius: var(--radius-full);
}

/* ==========================================================================
   Sidebar Channel Directory (Right)
   ========================================================================== */

.sidebar-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  display: flex;
  flex-direction: column;
  height: var(--video-container-height, 460px);
  max-height: var(--video-container-height, 460px);
  position: sticky;
  top: 120px;
}

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

.sidebar-title {
  font-size: 1.05rem;
  font-weight: 700;
}

.channel-count {
  font-size: 0.75rem;
  color: var(--accent-cyan);
  font-weight: 600;
}

.pill-filter {
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.25rem 0.65rem;
  border-radius: var(--radius-full);
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  transition: var(--transition);
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  cursor: pointer;
}

.pill-filter:hover {
  background: var(--bg-surface-hover);
  color: #fff;
}

.pill-filter.active {
  background: rgba(34, 197, 94, 0.12);
  border-color: rgba(34, 197, 94, 0.4);
  color: #86efac;
}

/* Scrollable Channel List */
.channel-list {
  flex: 1;
  overflow-y: auto;
  padding: 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.channel-item {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.65rem 0.85rem;
  border-radius: var(--radius-md);
  background: var(--bg-surface-elevated);
  border: 1px solid transparent;
  cursor: pointer;
  transition: var(--transition);
  text-align: left;
  width: 100%;
}

.channel-item:hover {
  background: var(--bg-surface-hover);
  border-color: rgba(255, 255, 255, 0.12);
  transform: translateX(2px);
}

.channel-item.active {
  background: rgba(56, 189, 248, 0.12);
  border-color: var(--accent-cyan);
}

.channel-item.item-offline {
  opacity: 0.55;
  filter: grayscale(0.2);
}

.channel-item.item-offline:hover {
  opacity: 0.9;
  filter: none;
}

.channel-item-logo {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  background: #070b14;
  object-fit: contain;
  padding: 3px;
  flex-shrink: 0;
}

.channel-item-info {
  flex: 1;
  min-width: 0;
}

.channel-item-title {
  font-size: 0.88rem;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--text-primary);
}

.channel-item-tagline {
  font-size: 0.75rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 2px;
}

.channel-item-badge {
  font-size: 0.68rem;
  font-weight: 700;
  padding: 0.2rem 0.45rem;
  border-radius: var(--radius-sm);
  background: rgba(56, 189, 248, 0.15);
  color: var(--accent-cyan);
  flex-shrink: 0;
}

.channel-item-badge.badge-online {
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.channel-item-badge.badge-live-now {
  background: rgba(239, 68, 68, 0.2);
  color: #fca5a5;
  border: 1px solid rgba(239, 68, 68, 0.5);
  animation: pulse 1.8s infinite;
}

.channel-item-badge.badge-upcoming {
  background: rgba(245, 158, 11, 0.15);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.35);
  font-weight: 700;
}

.channel-item-badge.badge-24h {
  background: rgba(56, 189, 248, 0.15);
  color: var(--accent-cyan);
  border: 1px solid rgba(56, 189, 248, 0.3);
}

.channel-item-badge.badge-ended {
  background: rgba(100, 116, 139, 0.15);
  color: #94a3b8;
  border: 1px solid rgba(100, 116, 139, 0.3);
}

.channel-item-badge.badge-offline {
  background: rgba(239, 68, 68, 0.12);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.25);
  opacity: 0.8;
}

/* Loading & Empty State */
.loading-state,
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 3rem 1rem;
  color: var(--text-muted);
  font-size: 0.88rem;
  gap: 0.75rem;
  text-align: center;
}

/* ==========================================================================
   Android Integration Modal
   ========================================================================== */

.modal {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(8px);
}

.modal-card {
  position: relative;
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  max-width: 540px;
  width: 100%;
  padding: 1.5rem;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.8);
  animation: modalEnter 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes modalEnter {
  from {
    opacity: 0;
    transform: scale(0.95);
  }

  to {
    opacity: 1;
    transform: scale(1);
  }
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}

.modal-title {
  font-size: 1.15rem;
  font-weight: 700;
}

.modal-close {
  font-size: 1.5rem;
  color: var(--text-muted);
}

.modal-close:hover {
  color: var(--text-primary);
}

.modal-desc {
  font-size: 0.88rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

.m3u-box {
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1rem;
  margin: 1.25rem 0;
}

.m3u-label {
  display: block;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--accent-cyan);
  margin-bottom: 0.5rem;
}

.m3u-input-row {
  display: flex;
  gap: 0.5rem;
}

.m3u-input-row input {
  flex: 1;
  background: #070b14;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: 0.8rem;
  padding: 0.5rem 0.75rem;
  outline: none;
}

.integration-tips {
  background: rgba(99, 102, 241, 0.08);
  border: 1px solid rgba(99, 102, 241, 0.2);
  border-radius: var(--radius-md);
  padding: 0.85rem 1rem;
  font-size: 0.82rem;
}

.integration-tips h4 {
  font-size: 0.88rem;
  font-weight: 700;
  color: #a5b4fc;
  margin-bottom: 0.4rem;
}

.integration-tips ol {
  padding-left: 1.2rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

/* Toast */
.toast {
  position: fixed;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: #10b981;
  color: #fff;
  font-weight: 600;
  font-size: 0.85rem;
  padding: 0.65rem 1.25rem;
  border-radius: var(--radius-full);
  box-shadow: 0 10px 25px rgba(16, 185, 129, 0.4);
  z-index: 300;
  opacity: 0;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  pointer-events: none;
}

.toast.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

/* Footer */
.footer {
  border-top: 1px solid var(--border-color);
  padding: 2rem 0;
  margin-top: 2rem;
  font-size: 0.82rem;
  color: var(--text-muted);
}

.footer-content {
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.disclaimer {
  font-size: 0.75rem;
  max-width: 800px;
  margin: 0 auto;
}

/* ==========================================================================
   Responsive Breakpoints
   ========================================================================== */

/* Tablet & Intermediate Screens (<= 1024px) */
@media (max-width: 1024px) {
  .layout-grid {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
  }

  /* Solution 1: Player (1) -> Sidebar / Channel Directory (2) -> SEO Article (3) */
  .player-section {
    order: 1;
  }

  .sidebar-section {
    order: 2;
  }

  .seo-article {
    order: 3;
    border-radius: var(--radius-md);
    margin-top: 0;
  }

  .sidebar-card {
    height: auto;
    max-height: 520px;
    position: static;
  }
}

/* Medium Tablets & Phablets (<= 860px) */
@media (max-width: 860px) {
  .nav-container {
    gap: 0.85rem;
  }

  .nav-actions span {
    display: none;
  }

  .nav-actions .btn-sm {
    padding: 0.5rem;
    border-radius: var(--radius-md);
  }
}

/* Mobile & Small Tablets (<= 700px) */
@media (max-width: 700px) {
  .container {
    padding: 0 1rem;
  }

  .main-content {
    padding: 0.75rem 0 2rem;
  }

  /* Clean 1-Row Mobile Navbar */
  .nav-container {
    height: 56px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
  }

  .nav-actions {
    gap: 0.45rem;
  }

  .sidebar-search {
    padding: 0.5rem 0.75rem;
  }

  .sidebar-search .search-box input {
    padding: 0.42rem 1.8rem 0.42rem 2.1rem;
    font-size: 0.8rem;
  }

  /* Category pills smooth touch scrolling */
  .category-container {
    gap: 0.4rem;
    -webkit-overflow-scrolling: touch;
    scroll-padding: 0 1rem;
  }

  .cat-pill {
    padding: 0.35rem 0.75rem;
    font-size: 0.78rem;
  }

  /* Player Card */
  .player-card {
    border-radius: var(--radius-md);
  }

  /* Player Info Bar Responsive Layout */
  .player-info-bar {
    padding: 0.75rem 0.85rem;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0.65rem;
  }

  .channel-details {
    width: 100%;
  }

  .channel-header-row {
    flex: 1;
    min-width: 0;
    gap: 0.65rem;
  }

  .channel-avatar {
    width: 38px;
    height: 38px;
    flex-shrink: 0;
  }

  .channel-title {
    font-size: 1rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .channel-tagline {
    font-size: 0.75rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .player-actions {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
  }

  .server-switch-group {
    flex: 1;
    display: flex;
    justify-content: center;
    gap: 0.25rem;
  }

  .server-label {
    display: none;
  }

  .server-btn {
    flex: 1;
    text-align: center;
    padding: 0.35rem 0.4rem;
    font-size: 0.72rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  /* Hide Theater mode button on mobile */
  #theaterBtn {
    display: none;
  }

  .action-buttons {
    flex-shrink: 0;
    gap: 0.35rem;
  }

  .icon-btn {
    width: 34px;
    height: 34px;
  }

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

  /* ==========================================================================
     Compact Responsive Player Overlays on Mobile (<= 700px)
     ========================================================================== */
  .player-overlay {
    padding: 0.45rem 0.65rem;
    gap: 0.35rem;
  }

  .spinner {
    width: 32px;
    height: 32px;
    border-width: 2.5px;
  }

  #overlayMessage {
    font-size: 0.8rem;
    padding: 0 0.5rem;
    max-width: 280px;
    line-height: 1.4;
  }

  /* Standby Card on Mobile */
  .standby-card {
    max-width: 94%;
    padding: 0.5rem 0.75rem;
    gap: 0.3rem;
    border-radius: var(--radius-md);
  }

  .standby-icon {
    font-size: 1.45rem;
    margin-bottom: 0;
    filter: drop-shadow(0 0 10px rgba(56, 189, 248, 0.3));
  }

  .standby-title {
    font-size: 0.95rem;
    font-weight: 700;
    line-height: 1.25;
  }

  .standby-desc {
    font-size: 0.72rem;
    line-height: 1.35;
    max-width: 290px;
  }

  .standby-hint {
    padding: 0.2rem 0.55rem;
    font-size: 0.68rem;
    margin-top: 0.05rem;
  }

  /* Offline & Error Stream Card on Mobile */
  .offline-card,
  .player-error-card {
    padding: 0.5rem 0.75rem;
    gap: 0.3rem;
    max-width: 94%;
    border-radius: var(--radius-md);
  }

  .offline-icon {
    font-size: 1.45rem;
    margin-bottom: 0;
  }

  .offline-title {
    font-size: 0.95rem;
    line-height: 1.25;
  }

  .offline-desc {
    font-size: 0.72rem;
    line-height: 1.35;
    max-width: 300px;
  }

  .offline-notice {
    display: none;
  }

  .offline-actions {
    margin-top: 0.15rem;
  }

  /* Schedule Card on Mobile */
  .schedule-card {
    padding: 0.4rem 0.65rem;
    gap: 0.25rem;
    max-width: 96%;
    border-radius: var(--radius-md);
  }

  .schedule-tournament {
    font-size: 0.7rem;
  }

  .schedule-badge-status {
    padding: 0.15rem 0.45rem;
    font-size: 0.65rem;
  }

  .schedule-fixture {
    margin: 0.05rem 0;
    gap: 0.4rem;
  }

  .schedule-team {
    font-size: 0.82rem;
    line-height: 1.2;
  }

  .schedule-vs {
    width: 24px;
    height: 24px;
    font-size: 0.62rem;
  }

  .schedule-datetime-pill {
    padding: 0.15rem 0.5rem;
    font-size: 0.68rem;
  }

  .schedule-countdown-label {
    font-size: 0.65rem;
    margin-bottom: 0;
  }

  .countdown-box {
    padding: 0.15rem 0.35rem;
    min-width: 32px;
  }

  .countdown-box .countdown-number,
  .countdown-box .countdown-value {
    font-size: 0.8rem;
  }

  .countdown-box .countdown-unit {
    font-size: 0.5rem;
  }

  .countdown-separator {
    font-size: 0.85rem;
    margin-bottom: 0.35rem;
  }

  .schedule-notice {
    display: none;
  }

  .schedule-actions {
    margin-top: 0.1rem;
  }

  .btn-try-stream {
    padding: 0.25rem 0.65rem;
    font-size: 0.72rem;
  }

  /* SEO article on mobile */
  .seo-article {
    padding: 0.85rem 1rem;
    margin-top: 0.75rem;
  }

  .seo-article h2 {
    font-size: 0.95rem;
  }

  .seo-grid {
    grid-template-columns: 1fr;
    gap: 0.65rem;
  }

  .seo-card {
    padding: 0.75rem 0.85rem;
  }

  .seo-guide-section {
    padding: 0.85rem;
  }

  .feature-badges {
    margin-top: 0.5rem;
    gap: 0.3rem;
  }

  .feature-tag {
    font-size: 0.68rem;
    padding: 0.15rem 0.45rem;
  }

  /* Sidebar Card on Mobile */
  .sidebar-card {
    border-radius: var(--radius-md);
    max-height: 480px;
  }

  .sidebar-header {
    padding: 0.75rem 0.85rem;
  }

  .sidebar-title {
    font-size: 0.95rem;
  }

  .channel-list {
    padding: 0.5rem;
    gap: 0.4rem;
  }

  .channel-item {
    padding: 0.5rem 0.65rem;
    gap: 0.65rem;
  }

  .channel-item-logo {
    width: 34px;
    height: 34px;
  }

  .channel-item-title {
    font-size: 0.82rem;
  }

  .channel-item-tagline {
    font-size: 0.7rem;
  }

  .channel-item-badge {
    font-size: 0.62rem;
    padding: 0.15rem 0.35rem;
  }

  /* Modal on Mobile */
  .modal-card {
    padding: 1.15rem;
    max-width: 94%;
    max-height: 90vh;
    overflow-y: auto;
  }

  .m3u-input-row {
    flex-direction: column;
    gap: 0.4rem;
  }

  .m3u-input-row .btn {
    width: 100%;
    justify-content: center;
  }
}

/* Extra small mobile (< 380px) */
@media (max-width: 380px) {
  .brand-name {
    font-size: 1.15rem;
  }

  .brand-icon {
    width: 28px;
    height: 28px;
  }

  .badge-live {
    font-size: 0.58rem;
    padding: 0.1rem 0.35rem;
  }

  .standby-card,
  .offline-card,
  .player-error-card,
  .schedule-card {
    padding: 0.35rem 0.55rem;
    gap: 0.2rem;
  }

  .standby-icon,
  .offline-icon {
    font-size: 1.25rem;
  }

  .standby-title,
  .offline-title {
    font-size: 0.85rem;
  }

  .standby-desc,
  .offline-desc {
    font-size: 0.65rem;
    line-height: 1.25;
  }
}
