/* =========================================================
   FMTV — Core Stylesheet
   Design tokens + layout for Header, Hero Slider, and
   horizontal-scroll content rows (Live TV / Movies / Sports / Series)
   ========================================================= */

:root {
  --fmtv-bg: #0b0c10;
  --fmtv-bg-elevated: #15171c;
  --fmtv-card: #1c1f26;
  --fmtv-text: #f5f6f7;
  --fmtv-text-muted: #a3a8b3;
  --fmtv-border: #2a2e37;
  --fmtv-accent: #ff3b5c;
  --fmtv-accent-2: #ff7a45;
  --fmtv-accent-grad: linear-gradient(135deg, var(--fmtv-accent), var(--fmtv-accent-2));
  --fmtv-success: #2ecc71;
  --fmtv-radius: 12px;
  --fmtv-header-h: 72px;
  --fmtv-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
  --fmtv-transition: 0.25s ease;
}

/* Light mode overrides (toggled via body.light-mode) */
body.light-mode {
  --fmtv-bg: #f4f5f7;
  --fmtv-bg-elevated: #ffffff;
  --fmtv-card: #ffffff;
  --fmtv-text: #14161a;
  --fmtv-text-muted: #5b606b;
  --fmtv-border: #e2e4e9;
  --fmtv-shadow: 0 8px 24px rgba(20, 22, 26, 0.08);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--fmtv-bg);
  color: var(--fmtv-text);
  font-family: "Segoe UI", Roboto, "Noto Sans Bengali", Arial, sans-serif;
  scroll-behavior: smooth;
  transition: background var(--fmtv-transition), color var(--fmtv-transition);
}

a { text-decoration: none; color: inherit; }
img { max-width: 100%; display: block; }
button { font-family: inherit; cursor: pointer; }

.container-fluid-fmtv {
  padding-left: 4vw;
  padding-right: 4vw;
}

/* ---------- Header ---------- */
.fmtv-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 1000;
  height: var(--fmtv-header-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 4vw;
  /* Was a gradient fading to transparent (only solid once scrolled) — now a
     flat solid color always, so the navbar reads clearly on every page. Change
     this one line to any color/hex you want. */
  background: var(--fmtv-bg-elevated);
  transition: background var(--fmtv-transition), box-shadow var(--fmtv-transition);
}
.fmtv-header.scrolled {
  background: var(--fmtv-bg-elevated);
  box-shadow: var(--fmtv-shadow);
}
body.light-mode .fmtv-header {
  background: var(--fmtv-bg-elevated);
}
body.light-mode .fmtv-header.scrolled {
  background: var(--fmtv-bg-elevated);
}

.fmtv-logo img { height: 36px; width: auto; }

.fmtv-nav {
  display: flex;
  align-items: center;
  gap: 28px;
  list-style: none;
  margin: 0;
  padding: 0;
}
.fmtv-nav a {
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--fmtv-text-muted);
  display: flex;
  align-items: center;
  gap: 6px;
  transition: color var(--fmtv-transition);
  white-space: nowrap;
}
.fmtv-nav a:hover, .fmtv-nav a.active { color: var(--fmtv-text); }
.fmtv-nav a.active { color: var(--fmtv-accent); }

.fmtv-header-actions {
  display: flex;
  align-items: center;
  gap: 16px;
}

.fmtv-icon-btn {
  background: transparent;
  border: none;
  color: var(--fmtv-text);
  font-size: 1.15rem;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--fmtv-transition);
}
.fmtv-icon-btn:hover { background: var(--fmtv-border); }

.fmtv-avatar {
  width: 38px; height: 38px;
  border-radius: 50%;
  background: var(--fmtv-accent-grad);
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; color: #fff; font-size: 0.9rem;
  flex-shrink: 0;
}

/* Shows the logged-in user's actual name next to the avatar bubble instead
   of leaving it only visible as a hover tooltip. Hidden on narrow screens
   (burger menu takes over there) to avoid crowding the header. */
.fmtv-user-name {
  color: var(--fmtv-text);
  font-size: 0.9rem;
  font-weight: 600;
  white-space: nowrap;
  max-width: 140px;
  overflow: hidden;
  text-overflow: ellipsis;
}
@media (max-width: 992px) {
  .fmtv-user-name { display: none; }
}

.fmtv-burger {
  display: none;
  background: transparent; border: none; color: var(--fmtv-text); font-size: 1.5rem;
}

/* Mobile nav drawer */
@media (max-width: 992px) {
  .fmtv-nav {
    position: fixed;
    top: var(--fmtv-header-h);
    right: -100%;
    width: 78%;
    max-width: 320px;
    height: calc(100vh - var(--fmtv-header-h));
    background: var(--fmtv-bg-elevated);
    flex-direction: column;
    align-items: flex-start;
    padding: 24px;
    gap: 20px;
    box-shadow: var(--fmtv-shadow);
    transition: right var(--fmtv-transition);
    overflow-y: auto;
  }
  .fmtv-nav.open { right: 0; }
  .fmtv-burger { display: block; }
}

/* ---------- Hero Slider ---------- */
.fmtv-hero {
  position: relative;
  width: 100%;
  height: 92vh;
  min-height: 420px;
  overflow: hidden;
}
.fmtv-hero-slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.8s ease;
}

/* FMTV video intro slide — full-bleed clip + tap-to-unmute button (browsers
   block autoplay-with-sound, so it always starts muted). */
.fmtv-hero-video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.fmtv-hero-unmute {
  position: absolute;
  right: 4vw;
  bottom: 12%;
  z-index: 3;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,0.35);
  background: rgba(11,12,16,0.55);
  color: #fff;
  font-size: 1.2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(6px);
  transition: transform var(--fmtv-transition), background var(--fmtv-transition);
}
.fmtv-hero-unmute:hover { transform: scale(1.08); background: rgba(11,12,16,0.8); }
.fmtv-hero-slide.active { opacity: 1; visibility: visible; z-index: 1; }
.fmtv-hero-slide img {
  width: 100%; height: 100%; object-fit: cover;
}
.fmtv-hero-overlay {
  position: absolute; inset: 0;
  background: linear-gradient(
    to top,
    var(--fmtv-bg) 0%,
    rgba(11,12,16,0.55) 45%,
    rgba(11,12,16,0.15) 75%
  );
}
body.light-mode .fmtv-hero-overlay {
  background: linear-gradient(to top, var(--fmtv-bg) 0%, rgba(244,245,247,0.55) 45%, rgba(244,245,247,0.1) 75%);
}

/* FMTV's own brand/promo hero slide (always slide #1) — a gradient in the
   logo's blue/red brand colors instead of a content poster, with the logo
   itself as the focal point rather than a title/thumbnail. */
.fmtv-hero-brand-bg {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 15% 20%, rgba(212,17,31,0.35) 0%, transparent 45%),
    radial-gradient(circle at 85% 80%, rgba(18,58,138,0.45) 0%, transparent 50%),
    linear-gradient(135deg, #0a1128 0%, #101a3d 55%, #1a0f2e 100%);
}
.fmtv-hero-content-brand {
  left: 0; right: 0;
  bottom: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  max-width: 720px;
  margin: 0 auto;
  padding-bottom: 14%;
}
.fmtv-hero-brand-logo {
  width: min(280px, 60vw) !important;
  height: auto !important;
  object-fit: contain !important;
  margin-bottom: 20px;
  filter: drop-shadow(0 8px 30px rgba(0,0,0,0.45));
}
.fmtv-hero-brand-tagline {
  font-size: clamp(1.1rem, 2.4vw, 1.6rem);
  font-weight: 700;
  margin: 0 0 10px;
  background: linear-gradient(90deg, #3aa0ff 0%, #d4111f 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.fmtv-hero-content-brand .fmtv-hero-desc {
  -webkit-line-clamp: 2;
  max-width: 560px;
}
.fmtv-hero-content-brand .fmtv-hero-actions { justify-content: center; }

.fmtv-hero-content {
  position: absolute;
  left: 4vw; right: 4vw;
  bottom: 12%;
  max-width: 640px;
  z-index: 2;
}
.fmtv-hero-badge {
  display: inline-block;
  background: var(--fmtv-accent-grad);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  padding: 4px 12px;
  border-radius: 100px;
  margin-bottom: 14px;
  text-transform: uppercase;
}
.fmtv-hero-title {
  font-size: clamp(1.8rem, 4vw, 3.2rem);
  font-weight: 800;
  margin: 0 0 12px;
  line-height: 1.15;
}
.fmtv-hero-desc {
  color: var(--fmtv-text-muted);
  font-size: 1rem;
  margin-bottom: 22px;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.fmtv-hero-actions { display: flex; gap: 14px; flex-wrap: wrap; }

.fmtv-btn {
  border: none;
  border-radius: 8px;
  padding: 12px 26px;
  font-weight: 700;
  font-size: 0.95rem;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: transform var(--fmtv-transition), opacity var(--fmtv-transition);
}
.fmtv-btn:hover { transform: translateY(-2px); }
.fmtv-btn-primary { background: var(--fmtv-accent-grad); color: #fff; }
.fmtv-btn-secondary { background: rgba(255,255,255,0.12); color: var(--fmtv-text); backdrop-filter: blur(6px); }
body.light-mode .fmtv-btn-secondary { background: rgba(20,22,26,0.08); }

.fmtv-hero-dots {
  position: absolute;
  right: 4vw; bottom: 12%;
  z-index: 2;
  display: flex; gap: 8px;
}
.fmtv-hero-dots button {
  width: 10px; height: 10px; border-radius: 50%;
  border: none; background: rgba(255,255,255,0.35);
  padding: 0;
}
.fmtv-hero-dots button.active { background: var(--fmtv-accent); width: 26px; border-radius: 6px; }

.fmtv-hero-arrow {
  position: absolute;
  top: 50%; transform: translateY(-50%);
  z-index: 3;
  background: rgba(0,0,0,0.35);
  color: #fff;
  border: none;
  width: 44px; height: 44px;
  border-radius: 50%;
  font-size: 1.1rem;
  display: flex; align-items: center; justify-content: center;
  opacity: 0;
  transition: opacity var(--fmtv-transition);
}
.fmtv-hero:hover .fmtv-hero-arrow { opacity: 1; }
.fmtv-hero-arrow.prev { left: 20px; }
.fmtv-hero-arrow.next { right: 20px; }

/* ---------- Content Rows (Live TV / Movies / Sports / Series) ---------- */
.fmtv-section {
  padding: 34px 0 8px;
}
.fmtv-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 4vw;
  margin-bottom: 16px;
}
.fmtv-section-title {
  font-size: 1.4rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 10px;
}
.fmtv-section-link {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--fmtv-accent);
}

.fmtv-row {
  display: flex;
  gap: 16px;
  overflow-x: auto;
  padding: 4px 4vw 18px;
  scroll-snap-type: x mandatory;
  scrollbar-width: thin;
}
.fmtv-row::-webkit-scrollbar { height: 6px; }
.fmtv-row::-webkit-scrollbar-thumb { background: var(--fmtv-border); border-radius: 6px; }

.fmtv-card {
  flex: 0 0 auto;
  width: 200px;
  scroll-snap-align: start;
  border-radius: var(--fmtv-radius);
  overflow: hidden;
  background: var(--fmtv-card);
  border: 1px solid var(--fmtv-border);
  transition: transform var(--fmtv-transition), box-shadow var(--fmtv-transition);
  position: relative;
}
.fmtv-card:hover { transform: translateY(-6px) scale(1.02); box-shadow: var(--fmtv-shadow); z-index: 2; }
.fmtv-card-thumb { width: 100%; aspect-ratio: 2/3; object-fit: cover; background: var(--fmtv-border); }
.fmtv-card.is-channel .fmtv-card-thumb,
.fmtv-card.is-sport .fmtv-card-thumb { aspect-ratio: 16/9; }
.fmtv-card-live {
  position: absolute; top: 8px; left: 8px;
  background: var(--fmtv-accent);
  color: #fff; font-size: 0.65rem; font-weight: 800;
  padding: 3px 8px; border-radius: 4px; letter-spacing: 0.05em;
  display: flex; align-items: center; gap: 4px;
}
.fmtv-card-live::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: #fff; }
.fmtv-card-body { padding: 10px 12px; }
.fmtv-card-title {
  font-size: 0.88rem; font-weight: 600;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.fmtv-card-meta { font-size: 0.75rem; color: var(--fmtv-text-muted); margin-top: 2px; }
.fmtv-card-play {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  background: rgba(0,0,0,0.35);
  opacity: 0; transition: opacity var(--fmtv-transition);
  color: #fff; font-size: 2rem;
}
.fmtv-card:hover .fmtv-card-play { opacity: 1; }

/* ---------- Footer ---------- */
.fmtv-footer {
  margin-top: 48px;
  padding: 40px 4vw 24px;
  background: var(--fmtv-bg-elevated);
  border-top: 1px solid var(--fmtv-border);
  color: var(--fmtv-text-muted);
  font-size: 0.9rem;
}
.fmtv-footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 24px;
  margin-bottom: 24px;
}
.fmtv-footer-grid h5 { color: var(--fmtv-text); font-size: 0.95rem; margin-bottom: 12px; }
.fmtv-footer-grid ul { list-style: none; padding: 0; margin: 0; }
.fmtv-footer-grid li { margin-bottom: 8px; }
.fmtv-footer-bottom {
  display: flex; justify-content: space-between; align-items: center;
  border-top: 1px solid var(--fmtv-border);
  padding-top: 16px;
  flex-wrap: wrap; gap: 10px;
}
@media (max-width: 768px) {
  .fmtv-footer-grid { grid-template-columns: 1fr 1fr; }
}

/* ---------- Utility ---------- */
.fmtv-skeleton {
  background: linear-gradient(90deg, var(--fmtv-border) 25%, var(--fmtv-card) 50%, var(--fmtv-border) 75%);
  background-size: 200% 100%;
  animation: fmtv-shimmer 1.4s infinite;
}
@keyframes fmtv-shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}
