/* InterFilm — Lecteur Live (TV Direct + Sport) */
:root {
  --iflp-bg: #050508;
  --iflp-panel: #0c0c12;
  --iflp-line: rgba(255, 255, 255, 0.1);
  --iflp-text: #f4f4f7;
  --iflp-muted: rgba(244, 244, 247, 0.62);
  --iflp-live: #e8304a;
  --iflp-accent: #f5a623;
  --iflp-accent-2: #ff6b35;
}

.iflp-overlay {
  position: fixed;
  inset: 0;
  z-index: 130;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: calc(var(--header-h, 72px) + 12px) 16px 20px;
  background:
    radial-gradient(ellipse 80% 60% at 50% 40%, rgba(245, 166, 35, 0.08), transparent 55%),
    rgba(2, 2, 6, 0.78);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  animation: iflp-in 0.28s ease both;
}
@keyframes iflp-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

.iflp {
  --iflp-radius: 18px;
  position: relative;
  width: min(1180px, 96vw);
  background:
    linear-gradient(165deg, rgba(255,255,255,0.06) 0%, transparent 42%),
    var(--iflp-panel);
  border: 1px solid var(--iflp-line);
  border-radius: calc(var(--iflp-radius) + 6px);
  box-shadow:
    0 40px 100px rgba(0, 0, 0, 0.65),
    0 0 0 1px rgba(245, 166, 35, 0.06);
  overflow: hidden;
  transform-origin: center;
  animation: iflp-rise 0.34s cubic-bezier(.22, 1, .36, 1) both;
}
@keyframes iflp-rise {
  from { opacity: 0; transform: translateY(18px) scale(0.985); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.iflp-stage {
  position: relative;
  aspect-ratio: 16 / 9;
  max-height: min(70vh, 720px);
  background: #000;
  overflow: hidden;
}

.iflp-screen {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  background: #000;
}
.iflp-screen iframe,
.iflp-screen video {
  width: 100% !important;
  height: 100% !important;
  border: 0 !important;
  display: block;
  background: #000;
  object-fit: contain;
}

.iflp-shade {
  position: absolute;
  inset: 0;
  z-index: 4;
  pointer-events: none;
  background:
    linear-gradient(180deg, rgba(0,0,0,.72) 0%, transparent 26%),
    linear-gradient(0deg, rgba(0,0,0,.82) 0%, transparent 34%);
  opacity: 1;
  transition: opacity 0.28s ease;
}

.iflp-top,
.iflp-bottom {
  position: absolute;
  left: 0;
  right: 0;
  z-index: 8;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  transition: opacity 0.28s ease, transform 0.28s ease;
}
.iflp-top {
  top: 0;
  justify-content: space-between;
  align-items: flex-start;
}
.iflp-bottom {
  bottom: 0;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: flex-end;
  gap: 10px 14px;
  padding-bottom: 14px;
}

/* Pas de titre / logo / Live en haut à gauche (TV + Sport) — chrome actions seulement */
.iflp .iflp-meta {
  display: none !important;
}
.iflp .iflp-top {
  justify-content: flex-end;
}
.iflp-logo {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  overflow: hidden;
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.1);
  flex-shrink: 0;
  display: grid;
  place-items: center;
}
.iflp-logo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.iflp-logo[hidden] { display: none !important; }

.iflp-titles { min-width: 0; }
.iflp-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 6px;
}
.iflp-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #fff;
  padding: 4px 9px;
  border-radius: 999px;
}
.iflp-badge--live {
  background: var(--iflp-live);
  box-shadow: 0 0 0 0 rgba(232, 48, 74, 0.55);
  animation: iflp-pulse 1.8s ease infinite;
}
@keyframes iflp-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(232, 48, 74, 0.45); }
  50% { box-shadow: 0 0 0 6px rgba(232, 48, 74, 0); }
}
.iflp-badge--mode {
  background: rgba(255,255,255,.1);
  border: 1px solid rgba(255,255,255,.14);
  color: rgba(255,255,255,.88);
}
.iflp-title {
  margin: 0;
  font-size: clamp(1.05rem, 2.2vw, 1.35rem);
  font-weight: 800;
  color: var(--iflp-text);
  letter-spacing: -0.02em;
  text-shadow: 0 2px 14px rgba(0,0,0,.55);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: min(58vw, 520px);
}
.iflp-sub {
  margin: 2px 0 0;
  font-size: 12px;
  color: var(--iflp-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: min(58vw, 520px);
}

.iflp-actions {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}
.iflp-icon-btn {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,.12);
  background: rgba(8, 8, 14, 0.55);
  color: #fff;
  display: grid;
  place-items: center;
  cursor: pointer;
  backdrop-filter: blur(10px);
  transition: background 0.18s ease, transform 0.18s ease, border-color 0.18s ease;
}
.iflp-icon-btn:hover {
  background: rgba(255,255,255,.12);
  border-color: rgba(255,255,255,.22);
}
.iflp-icon-btn.active {
  color: var(--iflp-accent);
  border-color: rgba(245, 166, 35, 0.45);
}
.iflp-icon-btn svg { display: block; }

.iflp-close {
  border: 1px solid rgba(255,255,255,.14);
  background: rgba(8, 8, 14, 0.55);
  color: #fff;
  border-radius: 999px;
  padding: 10px 16px;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  cursor: pointer;
  backdrop-filter: blur(10px);
  transition: background 0.18s ease;
}
.iflp-close:hover { background: rgba(255,255,255,.12); }

.iflp-sources {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: flex-end;
  max-width: min(70vw, 640px);
}
.iflp-source-btn {
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 999px;
  padding: 8px 14px;
  font-size: 12px;
  font-weight: 700;
  color: rgba(255,255,255,.72);
  background: rgba(8, 8, 16, 0.55);
  cursor: pointer;
  backdrop-filter: blur(10px);
  transition: background 0.18s ease, color 0.18s ease, border-color 0.18s ease, transform 0.18s ease;
}
.iflp-source-btn:hover {
  color: #fff;
  background: rgba(255,255,255,.1);
}
.iflp-source-btn.active {
  color: #111;
  border-color: transparent;
  background: linear-gradient(135deg, var(--iflp-accent), var(--iflp-accent-2));
  box-shadow: 0 6px 22px rgba(245, 166, 35, 0.28);
}
.iflp-source-btn .iflp-source-kind {
  opacity: 0.7;
  font-weight: 600;
  margin-left: 4px;
  font-size: 10px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.iflp-source-btn.active .iflp-source-kind { opacity: 0.85; color: inherit; }

/* Contrôles HLS natifs InterFilm */
.iflp-media-bar {
  display: none;
  align-items: center;
  gap: 10px;
  width: 100%;
  order: -1;
  padding: 0 2px 4px;
}
.iflp.is-hls .iflp-media-bar { display: flex; }
.iflp-media-btn {
  width: 38px;
  height: 38px;
  border-radius: 11px;
  border: 1px solid rgba(255,255,255,.12);
  background: rgba(8,8,14,.55);
  color: #fff;
  display: grid;
  place-items: center;
  cursor: pointer;
  backdrop-filter: blur(8px);
}
.iflp-media-btn:hover { background: rgba(255,255,255,.12); }
.iflp-live-tag {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: rgba(255,255,255,.8);
}
.iflp-vol {
  width: min(120px, 22vw);
  accent-color: var(--iflp-accent);
  cursor: pointer;
}

.iflp-catcher {
  position: absolute;
  inset: 0;
  z-index: 6;
  pointer-events: none;
}
.iflp.iflp-chrome-hidden .iflp-catcher { pointer-events: auto; }

.iflp.iflp-chrome-hidden .iflp-top,
.iflp.iflp-chrome-hidden .iflp-bottom,
.iflp.iflp-chrome-hidden .iflp-shade {
  opacity: 0;
  pointer-events: none;
}
.iflp.iflp-chrome-hidden .iflp-top { transform: translateY(-8px); }
.iflp.iflp-chrome-hidden .iflp-bottom { transform: translateY(8px); }

.iflp:fullscreen,
.iflp:-webkit-full-screen {
  width: 100%;
  max-width: none;
  border-radius: 0;
  border: 0;
}
.iflp:fullscreen .iflp-stage,
.iflp:-webkit-full-screen .iflp-stage {
  max-height: none;
  height: 100vh;
  aspect-ratio: auto;
  border-radius: 0;
}

.iflp-loading {
  position: absolute;
  inset: 0;
  z-index: 3;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  color: rgba(255,255,255,.78);
  font-size: 14px;
  background: #000;
}
.iflp-spinner {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 3px solid rgba(255,255,255,.14);
  border-top-color: var(--iflp-accent);
  animation: iflp-spin 0.75s linear infinite;
}
@keyframes iflp-spin { to { transform: rotate(360deg); } }

.iflp-error {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  gap: 8px;
  text-align: center;
  padding: 24px;
  background: #000;
  color: #fff;
}
.iflp-error strong { font-size: 1.1rem; }
.iflp-error p { margin: 0; color: var(--iflp-muted); font-size: 13px; }

@media (max-width: 720px) {
  .iflp-overlay {
    padding: 12px 10px max(16px, env(safe-area-inset-bottom, 12px));
    align-items: center;
    justify-content: center;
  }
  .iflp { width: min(1180px, 96vw); border-radius: 16px; }
  .iflp-stage { max-height: min(56vh, 480px); }
  .iflp-title { max-width: 52vw; font-size: 1rem; }
  .iflp-logo { width: 36px; height: 36px; border-radius: 10px; }
  .iflp-bottom { padding: 12px; }
  .iflp-sources { max-width: 100%; justify-content: flex-start; }
  .iflp-vol { width: 72px; }
}

/* Compat anciens sélecteurs utilisés par tv.js */
.tv-pro-player-wrap.iflp-overlay { /* alias */ }
.tv-cinema.iflp { /* alias */ }
body.tv-player-open { overflow: hidden !important; }
body.tv-player-open .mobile-bottom-bar,
body.tv-player-open .mobile-nav-sheet { display: none !important; }
