/* =============================================================================
 *  FIFA 2026 LIVE TV — custom styles
 *  (Tailwind handles layout; this file = Plyr neon skin, lightout, toasts, anims)
 * ========================================================================== */

:root {
  --neon: #38bdf8;
  --neon-2: #0ea5e9;

  /* ----- Plyr theme overrides → neon cyan player ----- */
  --plyr-color-main: var(--neon);
  --plyr-video-background: #000;
  --plyr-video-control-color: #e2e8f0;
  --plyr-video-control-color-hover: #ffffff;
  --plyr-control-radius: 9px;
  --plyr-range-track-height: 5px;
  --plyr-range-thumb-height: 14px;
  --plyr-tooltip-background: rgba(11, 15, 25, .92);
  --plyr-tooltip-color: #e2e8f0;
  --plyr-menu-background: rgba(17, 23, 38, .96);
  --plyr-menu-color: #e2e8f0;
  --plyr-font-family: "Inter", system-ui, sans-serif;
}

/* Rounded corners on the Plyr container so it matches our card */
.plyr {
  border-radius: 1rem;
  overflow: hidden;
}
.plyr--full-ui.plyr--video .plyr__control--overlaid {
  background: rgba(56, 189, 248, .9);
  box-shadow: 0 0 28px -2px rgba(56, 189, 248, .7);
}
.plyr__control.plyr__tab-focus,
.plyr__control:hover {
  background: var(--neon);
  color: #00121f;
}
.plyr__progress__buffer {
  color: rgba(148, 163, 184, .35);
}

/* =============================================================================
 *  SERVER BUTTONS
 * ========================================================================== */
.server-btn {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  width: 100%;
  padding: 0.7rem 0.85rem;
  border-radius: 0.85rem;
  border: 1px solid #1f2937;            /* line */
  background: #161d2e;                   /* panel2 */
  color: #cbd5e1;
  text-align: left;
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all .2s ease;
}
.server-btn:hover {
  border-color: rgba(56, 189, 248, .6);
  color: #fff;
  transform: translateY(-1px);
}
.server-btn .server-sub {
  font-size: 0.7rem;
  font-weight: 500;
  color: #64748b;
}
/* Active server = neon filled glow */
.server-btn.is-active {
  border-color: var(--neon);
  background: linear-gradient(135deg, rgba(56, 189, 248, .18), rgba(14, 165, 233, .08));
  color: #fff;
  box-shadow: 0 0 0 1px rgba(56, 189, 248, .5), 0 0 22px -4px rgba(56, 189, 248, .6);
}
.server-btn.is-active .server-sub { color: var(--neon); }

/* small dot indicator (live/loading/down) */
.server-btn .dot {
  position: absolute;
  top: 0.6rem;
  right: 0.7rem;
  width: 8px;
  height: 8px;
  border-radius: 9999px;
  background: #475569;
}
.server-btn.is-active .dot { background: var(--neon); box-shadow: 0 0 8px var(--neon); }
.server-btn.is-loading .dot { background: #f59e0b; animation: pulse 1s infinite; }
.server-btn.is-down .dot { background: #ef4444; }

@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: .3; } }

/* =============================================================================
 *  ACTION BUTTONS (Refresh / Lightout)
 * ========================================================================== */
.action-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.5rem 0.85rem;
  border-radius: 0.7rem;
  border: 1px solid #1f2937;
  background: #161d2e;
  color: #cbd5e1;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all .18s ease;
}
.action-btn:hover {
  border-color: rgba(56, 189, 248, .6);
  color: #fff;
  box-shadow: 0 0 18px -6px rgba(56, 189, 248, .7);
}
.action-btn.is-on {
  border-color: var(--neon);
  background: rgba(56, 189, 248, .15);
  color: var(--neon);
}

/* =============================================================================
 *  LIGHTOUT MODE — dim everything except the player wrapper
 * ========================================================================== */
body.lightout { overflow: hidden; }
body.lightout #lightoutBackdrop { display: block; }
/* lift player above the dark backdrop */
body.lightout #playerWrap {
  position: relative;
  z-index: 30;
}

/* =============================================================================
 *  MATCH CARDS
 * ========================================================================== */
.match-card {
  position: relative;
  display: flex;
  flex-direction: column;
  border-radius: 1rem;
  border: 1px solid #1f2937;
  background: linear-gradient(180deg, #111726, #0d1320);
  padding: 1.1rem;
  transition: transform .2s ease, border-color .2s ease, box-shadow .2s ease;
}
.match-card:hover {
  transform: translateY(-3px);
  border-color: rgba(56, 189, 248, .45);
  box-shadow: 0 14px 40px -18px rgba(56, 189, 248, .5);
}

/* =============================================================================
 *  LIVE TV CHANNEL CARDS
 * ========================================================================== */
.tv-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  padding: 0.85rem 0.6rem;
  border-radius: 0.9rem;
  border: 1px solid #1f2937;
  background: linear-gradient(180deg, #111726, #0d1320);
  color: #cbd5e1;
  cursor: pointer;
  text-align: center;
  transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease;
}
.tv-card:hover {
  transform: translateY(-3px);
  border-color: rgba(56, 189, 248, .55);
  box-shadow: 0 12px 32px -16px rgba(56, 189, 248, .6);
}
.tv-card .tv-logo {
  display: grid;
  place-items: center;
  width: 100%;
  height: 56px;
}
.tv-card .tv-logo img {
  max-height: 56px;
  max-width: 100%;
  object-fit: contain;
}
.tv-card .tv-fallback { font-size: 1.8rem; }
.tv-card .tv-name {
  font-size: 0.8rem;
  font-weight: 600;
  color: #e2e8f0;
  line-height: 1.2;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.tv-card .tv-group {
  font-size: 0.65rem;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: .04em;
}

/* =============================================================================
 *  TOASTS
 * ========================================================================== */
.toast {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  padding: 0.8rem 0.95rem;
  border-radius: 0.85rem;
  border: 1px solid rgba(56, 189, 248, .35);
  background: rgba(17, 23, 38, .96);
  color: #e2e8f0;
  font-size: 0.85rem;
  box-shadow: 0 14px 40px -12px rgba(0, 0, 0, .8), 0 0 0 1px rgba(56, 189, 248, .12);
  backdrop-filter: blur(8px);
  animation: toast-in .28s cubic-bezier(.16, 1, .3, 1);
}
.toast.toast-out { animation: toast-out .25s ease forwards; }
.toast.is-error { border-color: rgba(239, 68, 68, .5); }
.toast.is-success { border-color: rgba(34, 197, 94, .5); }
.toast .toast-icon { flex: none; margin-top: 1px; }

@keyframes toast-in {
  from { opacity: 0; transform: translateY(12px) scale(.96); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes toast-out {
  to { opacity: 0; transform: translateX(20px) scale(.96); }
}

/* =============================================================================
 *  MISC
 * ========================================================================== */
/* Buffering spinner shown over the video while a stream loads */
#bufferOverlay {
  position: absolute;
  inset: 0;
  display: none;
  place-items: center;
  background: rgba(0, 0, 0, .35);
  z-index: 10;
  pointer-events: none;
  border-radius: 1rem;
}
#bufferOverlay.show { display: grid; }
.spinner {
  width: 46px;
  height: 46px;
  border-radius: 9999px;
  border: 3px solid rgba(56, 189, 248, .25);
  border-top-color: var(--neon);
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Respect users who prefer reduced motion */
@media (prefers-reduced-motion: reduce) {
  * { animation-duration: .001ms !important; transition-duration: .001ms !important; }
}
