/* StreamHub & Live TV - Premium Glassmorphism UI */
@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700;800;900&display=swap');

:root {
  --bg: #030712;
  --bg-gradient: radial-gradient(circle at 50% 0%, #051330 0%, #030712 100%);
  --surface: rgba(10, 20, 47, 0.4);
  --surface-hover: rgba(16, 32, 74, 0.65);
  --surface-active: rgba(22, 42, 94, 0.8);
  --border: rgba(255, 255, 255, 0.05);
  --border-hover: rgba(30, 64, 175, 0.5);
  --t: #f1f5f9;
  --d: #94a3b8;
  --d2: #475569;
  --dim: #475569;
  --accent: #1e40af; /* Bleu sombre distingué */
  --accent-grad: linear-gradient(135deg, #1e40af 0%, #67b1ef 100%); /* Bleu sombre royal vers Bleu ciel */
  --accent-glow: 0 0 25px rgba(30, 64, 175, 0.3);
  --live: #f43f5e;
  --green: #67b1ef;
  --green-glow: 0 0 15px rgba(103, 177, 239, 0.4);
  --gold: #eab308;
  --r: 16px;
  --r-sm: 10px;
  --r-lg: 24px;
  --shadow: 0 12px 40px rgba(0, 0, 0, 0.7);
}

[data-theme="light"] {
  --bg: #f8fafc;
  --bg-gradient: radial-gradient(circle at 50% 0%, #e2e8f0 0%, #f8fafc 100%);
  --surface: rgba(255, 255, 255, 0.7);
  --surface-hover: rgba(241, 245, 249, 0.9);
  --surface-active: rgba(226, 232, 240, 0.95);
  --border: rgba(0, 0, 0, 0.08);
  --border-hover: rgba(0, 188, 255, 0.5);
  --t: #0f172a;
  --d: #64748b;
  --d2: #94a3b8;
  --dim: #94a3b8;
  --accent: #0088cc;
  --accent-grad: linear-gradient(135deg, #0088cc 0%, #00a870 100%);
  --accent-glow: 0 0 20px rgba(0, 136, 204, 0.25);
  --shadow: 0 12px 30px rgba(0, 0, 0, 0.08);
}

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

*::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
*::-webkit-scrollbar-track {
  background: transparent;
}
*::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 10px;
}
*::-webkit-scrollbar-thumb:hover {
  background: var(--accent);
}

html {
  scroll-behavior: smooth;
}

body {
  background: var(--bg);
  background-image: var(--bg-gradient);
  color: var(--t);
  font-family: 'Outfit', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* Base App Layout */
#app {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Boot screen */
.boot {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100vh;
  gap: 24px;
}
.boot-logo {
  width: 72px;
  height: 72px;
  position: relative;
}
.boot-pulse {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: var(--accent-grad);
  animation: bootpulse 1.5s cubic-bezier(0.4, 0, 0.2, 1) infinite;
  box-shadow: var(--accent-glow);
}
@keyframes bootpulse {
  0%, 100% { transform: scale(0.85); opacity: 0.5; }
  50% { transform: scale(1.1); opacity: 1; filter: brightness(1.2); }
}
.boot-text {
  font-size: 1.6rem;
  font-weight: 900;
  letter-spacing: 3px;
  background: var(--accent-grad);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  text-transform: uppercase;
}

/* Loading Spindle */
.sp {
  width: 36px;
  height: 36px;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s cubic-bezier(0.5, 0.1, 0.1, 0.9) infinite;
}
.sp-lg {
  width: 48px;
  height: 48px;
  border-width: 3.5px;
}
@keyframes spin {

  to { transform: rotate(360deg); }
}

/* Header */
.hdr {
  position: sticky;
  top: 0;
  z-index: 200;
  background: rgba(5, 7, 15, 0.7);
  -webkit-backdrop-filter: blur(20px);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  padding: 0 24px;
  height: 70px;
  display: flex;
  align-items: center;
  gap: 16px;
}
[data-theme="light"] .hdr {
  background: rgba(248, 250, 252, 0.75);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
  flex-shrink: 0;
}
.brand-dot {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: var(--accent-grad);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  box-shadow: var(--accent-glow);
}
.brand-dot svg {
  width: 18px;
  height: 18px;
  color: #fff;
}
.brand-name {
  font-size: 1.3rem;
  font-weight: 900;
  letter-spacing: -0.5px;
  background: var(--accent-grad);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* Source Switcher Buttons */
.src-switch {
  display: flex;
  gap: 4px;
  background: var(--surface);
  padding: 4px;
  border-radius: 14px;
  border: 1px solid var(--border);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}
.src-btn {
  background: transparent;
  border: none;
  color: var(--d);
  padding: 8px 16px;
  border-radius: 10px;
  cursor: pointer;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  align-items: center;
  gap: 6px;
}
.src-btn:hover {
  color: var(--t);
  background: rgba(255, 255, 255, 0.03);
}
.src-btn.on {
  background: var(--accent-grad);
  color: #fff;
  box-shadow: var(--accent-glow);
}
.src-btn .src-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}

/* Search bar */
.search {
  flex: 1;
  max-width: 380px;
  position: relative;
}
.search input {
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 30px;
  padding: 10px 18px 10px 44px;
  color: var(--t);
  font-family: inherit;
  font-size: 0.88rem;
  font-weight: 500;
  outline: none;
  transition: all 0.25s ease;
}
.search input::placeholder {
  color: var(--d);
  opacity: 0.6;
}
.search input:focus {
  border-color: var(--accent);
  background: var(--surface-hover);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}
.search svg {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  width: 18px;
  height: 18px;
  color: var(--d);
  pointer-events: none;
}

/* Sync/Status */
.status {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--d);
  white-space:nowrap;
}
.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: var(--green-glow);
}
.status-dot.sync {
  background: var(--gold);
  box-shadow: 0 0 10px var(--gold);
  animation: blink 1.2s infinite;
}
.status-dot.err {
  background: var(--live);
  box-shadow: 0 0 10px var(--live);
}
@keyframes blink {
  50% { opacity: 0.3; }
}

/* Utility buttons */
.icon-btns {
  display: flex;
  gap: 6px;
}
.ibtn {
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--d);
  width: 38px;
  height: 38px;
  border-radius: 12px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}
.ibtn:hover {
  color: var(--t);
  border-color: var(--accent);
  background: var(--surface-hover);
}
.ibtn svg {
  width: 18px;
  height: 18px;
}

/* View tabs */
.view-tabs {
  display: flex;
  gap: 2px;
  background: var(--surface);
  padding: 4px;
  border-radius: 14px;
  border: 1px solid var(--border);
}
.vtab {
  background: transparent;
  border: none;
  color: var(--d);
  padding: 8px 18px;
  border-radius: 10px;
  cursor: pointer;
  font-size: 0.82rem;
  font-weight: 700;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  gap: 6px;
}
.vtab:hover {
  color: var(--t);
}
.vtab.on {
  background: var(--surface-active);
  color: var(--t);
  box-shadow: var(--shadow);
}

/* Content wrapper */
.content {
  max-width: 1600px;
  margin: 0 auto;
  padding: 30px 24px;
  width: 100%;
}
.section-title {
  font-size: 1.6rem;
  font-weight: 800;
  letter-spacing: -0.5px;
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  gap: 12px;
}
.section-title .count {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--d);
  background: var(--surface);
  padding: 3px 10px;
  border-radius: 20px;
  border: 1px solid var(--border);
}
.section-sub {
  font-size: 0.88rem;
  color: var(--d);
  margin-bottom: 24px;
}

/* Categories / Groups list */
.cat-bar {
  display: flex;
  gap: 8px;
  margin-bottom: 24px;
  overflow-x: auto;
  padding-bottom: 8px;
  scrollbar-width: thin;
}
.cat {
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--d);
  padding: 8px 18px;
  border-radius: 30px;
  cursor: pointer;
  font-size: 0.8rem;
  font-weight: 600;
  white-space: nowrap;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}
.cat:hover {
  color: var(--t);
  border-color: var(--border-hover);
  background: var(--surface-hover);
}
.cat.on {
  background: var(--accent-grad);
  border-color: transparent;
  color: #fff;
  box-shadow: var(--accent-glow);
}

/* Channels grids */
.grid, .cgrid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 16px;
}

.card, .ccard {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 20px 16px;
  cursor: pointer;
  text-align: center;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
}
.card:hover, .ccard:hover {
  background: var(--surface-hover);
  border-color: var(--accent);
  transform: translateY(-6px);
  box-shadow: var(--shadow), var(--accent-glow);
}
.card::before, .ccard::before {
  content: '';
  position: absolute;
  top: 0; left: 0; width: 100%; height: 100%;
  background: linear-gradient(180deg, rgba(255,255,255,0.03) 0%, transparent 100%);
  pointer-events: none;
}

.icon, .cicon {
  width: 50px;
  height: 50px;
  border-radius: 14px;
  background: var(--accent-grad);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 12px;
  font-size: 1.15rem;
  font-weight: 800;
  color: #fff;
  box-shadow: 0 4px 15px rgba(99, 102, 241, 0.3);
}
.clogo {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  object-fit: contain;
  background: rgba(255, 255, 255, 0.05);
  flex-shrink: 0;
}

.cname {
  font-size: 0.85rem;
  font-weight: 600;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  height: 2.8em;
}
.ctag {
  font-size: 0.68rem;
  color: var(--d);
  margin-top: 6px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* VOD / Movie Cards Grid */
.pgrid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 20px;
}
.pcard {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r);
  overflow: hidden;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  display: flex;
  flex-direction: column;
}
.pcard:hover {
  border-color: var(--accent);
  transform: translateY(-8px);
  box-shadow: var(--shadow), var(--accent-glow);
}
.pcard-poster {
  width: 100%;
  aspect-ratio: 2/3;
  background: var(--bg);
  object-fit: cover;
  display: block;
}
.pcard-poster-ph {
  width: 100%;
  aspect-ratio: 2/3;
  background: linear-gradient(135deg, rgba(255,255,255,0.02) 0%, rgba(255,255,255,0.06) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--d);
}
.pcard-info {
  padding: 12px 14px;
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}
.pcard-name {
  font-size: 0.85rem;
  font-weight: 600;
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: 6px;
  height: 2.7em;
}
.pcard-meta {
  font-size: 0.72rem;
  color: var(--d);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-weight: 500;
}
.pcard-meta .year {
  color: var(--accent);
  font-weight: 700;
}

.load-more-wrap {
  text-align: center;
  padding: 30px;
}
.load-more {
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--t);
  padding: 12px 36px;
  border-radius: 30px;
  cursor: pointer;
  font-size: 0.88rem;
  font-weight: 700;
  transition: all 0.2s ease;
}
.load-more:hover {
  border-color: var(--accent);
  background: var(--surface-hover);
}

/* Empty State */
.empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 100px 20px;
  gap: 16px;
  color: var(--d);
}

/* Overlay & Player */
.ov, .overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(5, 7, 15, 0.9);
  -webkit-backdrop-filter: blur(20px);
  backdrop-filter: blur(20px);
  z-index: 1000;
  justify-content: center;
  align-items: center;
  padding: 24px;
}
.ov.show, .overlay.show {
  display: flex;
}
.pc, .pcont {
  width: 100%;
  max-width: 1100px;
  background: rgba(13, 17, 33, 0.95);
  border-radius: var(--r-lg);
  overflow: hidden;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  max-height: 95vh;
  display: flex;
  flex-direction: column;
}
.pc-hdr, .phdr {
  padding: 14px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border);
  gap: 16px;
  flex-shrink: 0;
}
.pc-title, .ptitle {
  font-size: 1.05rem;
  font-weight: 700;
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.pc-actions {
  display: flex;
  gap: 6px;
}
.pc-btn, .pclose {
  background: var(--surface);
  border: none;
  color: var(--t);
  width: 36px;
  height: 36px;
  border-radius: 12px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
}
.pc-btn:hover, .pclose:hover {
  background: var(--accent-grad);
  color: #fff;
}
.pc-btn.danger:hover, .pclose:hover {
  background: var(--live);
}
.pc-btn svg {
  width: 18px;
  height: 18px;
}

.stage {
  position: relative;
  width: 100%;
  aspect-ratio: 16/9;
  background: #000;
  flex-shrink: 0;
  box-shadow: 0 10px 30px rgba(0,0,0,0.5);
}
.stage video {
  width: 100%;
  height: 100%;
  display: block;
}
.stage-ld, .loading {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  color: var(--d);
  font-size: 0.88rem;
  z-index: 5;
  background: rgba(5, 7, 15, 0.8);
  pointer-events: none; /* Empeche de bloquer les clics */
}
.stage-ld.hide {
  display: none;
}
.stage-err, .perror {
  position: absolute;
  inset: 0;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  color: var(--d);
  font-size: 0.88rem;
  text-align: center;
  padding: 20px;
  z-index: 5;
  background: rgba(5, 7, 15, 0.9);
}
.stage-err.show, .perror.show {
  display: flex;
}
.stage-err button, .perror button {
  background: var(--accent-grad);
  color: #fff;
  border: none;
  padding: 10px 24px;
  border-radius: 10px;
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 700;
}

.pc-body, .pbody {
  padding: 20px 24px;
  overflow-y: auto;
  flex: 1;
}
.pc-desc, .pdesc {
  font-size: 0.9rem;
  line-height: 1.7;
  color: var(--t);
  margin-bottom: 16px;
}
.pc-meta, .pmeta {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}
.pc-meta .mtag, .pmeta .tag {
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 4px 14px;
  border-radius: 20px;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--d);
}
.pc-meta .mtag.accent {
  color: var(--accent);
  border-color: var(--border-hover);
}

.sources, .lang-grid {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}
.sources-label {
  font-size: 0.78rem;
  color: var(--d);
  font-weight: 700;
  margin-right: 6px;
}
.src-pill, .lang-btn {
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--t);
  padding: 8px 16px;
  border-radius: 12px;
  cursor: pointer;
  font-size: 0.8rem;
  font-weight: 700;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  gap: 6px;
}
.src-pill:hover, .lang-btn:hover {
  border-color: var(--accent);
  background: var(--surface-hover);
}
.src-pill.on, .lang-btn.on {
  background: var(--accent-grad);
  color: #fff;
  border-color: transparent;
  box-shadow: var(--accent-glow);
}

/* Keyboard shortcuts hints */
.khints {
  padding: 10px 20px;
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  font-size: 0.65rem;
  color: var(--d);
  border-top: 1px solid var(--border);
  flex-shrink: 0;
  background: rgba(0, 0, 0, 0.2);
}
.khints kbd {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 2px 6px;
  font-family: monospace;
  font-weight: 700;
}

/* VPN Widget premium styles */
.vpn-w {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 16px;
  border-radius: 20px;
  background: var(--surface);
  border: 1px solid var(--border);
  cursor: pointer;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--d);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  white-space: nowrap;
}
.vpn-w:hover {
  border-color: var(--border-hover);
  color: var(--t);
  background: var(--surface-hover);
}
.vpn-w.on {
  border-color: var(--green);
  color: var(--green);
  box-shadow: var(--green-glow);
}
.vpn-w .vpn-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--d);
  transition: all 0.3s ease;
}
.vpn-w.on .vpn-dot {
  background: var(--green);
  box-shadow: 0 0 10px var(--green);
  animation: pulse 1.8s infinite;
}
.vpn-w.connecting .vpn-dot {
  background: var(--gold);
  animation: pulse 0.6s infinite;
}

@keyframes pulse {
  0%, 100% { transform: scale(0.8); opacity: 0.5; }
  50% { transform: scale(1.2); opacity: 1; }
}

.vpn-menu {
  display: none;
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  background: rgba(13, 17, 33, 0.95);
  -webkit-backdrop-filter: blur(20px);
  backdrop-filter: blur(20px);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 8px;
  min-width: 220px;
  z-index: 210;
  box-shadow: var(--shadow);
}
.vpn-menu.show {
  display: block;
  animation: slideup 0.2s ease-out;
}
.vpn-menu-title {
  font-size: 0.72rem;
  color: var(--d);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  padding: 8px 12px 6px;
  font-weight: 800;
}
.vpn-srv {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.82rem;
  color: var(--t);
  transition: all 0.15s ease;
}
.vpn-srv:hover {
  background: var(--surface-hover);
}
.vpn-srv.active {
  color: var(--green);
  font-weight: 700;
}
.vpn-srv .vpn-load {
  font-size: 0.7rem;
  color: var(--d);
}
.vpn-srv .vpn-flag {
  font-size: 0.95rem;
  margin-right: 8px;
}
.vpn-divider {
  height: 1px;
  background: var(--border);
  margin: 6px 0;
}
.vpn-btn {
  width: 100%;
  text-align: center;
  padding: 9px;
  border-radius: 10px;
  border: none;
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  color: #fff;
  transition: all 0.15s;
}
.vpn-btn.stop {
  background: var(--live);
}
.vpn-btn.stop:hover {
  opacity: 0.9;
  box-shadow: 0 4px 12px rgba(244, 63, 94, 0.3);
}

/* AdBlock Widget styles */
.adb-w {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 16px;
  border-radius: 20px;
  background: var(--surface);
  border: 1px solid var(--border);
  cursor: pointer;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--d);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  white-space: nowrap;
}
.adb-w:hover {
  border-color: var(--border-hover);
  color: var(--t);
  background: var(--surface-hover);
}
.adb-w.on {
  border-color: var(--green);
  color: var(--green);
  box-shadow: var(--green-glow);
}
.adb-w .adb-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--d);
  transition: all 0.3s ease;
}
.adb-w.on .adb-dot {
  background: var(--green);
  box-shadow: 0 0 10px var(--green);
  animation: pulse 1.8s infinite;
}
.adb-menu {
  display: none;
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  background: rgba(13, 17, 33, 0.95);
  -webkit-backdrop-filter: blur(20px);
  backdrop-filter: blur(20px);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 8px;
  min-width: 200px;
  z-index: 210;
  box-shadow: var(--shadow);
}
.adb-menu.show {
  display: block;
  animation: slideup 0.2s ease-out;
}
.adb-menu-title {
  font-size: 0.72rem;
  color: var(--d);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  padding: 8px 12px 6px;
  font-weight: 800;
}
.adb-srv {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.82rem;
  color: var(--t);
  transition: all 0.15s ease;
}
.adb-srv:hover {
  background: var(--surface-hover);
}
.adb-srv.active {
  color: var(--green);
  font-weight: 700;
}
.adb-btn {
  width: 100%;
  text-align: center;
  padding: 9px;
  border-radius: 10px;
  border: none;
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  color: #fff;
  transition: all 0.15s;
}
.adb-btn.on {
  background: #2ecc71;
  box-shadow: 0 0 10px rgba(46, 204, 113, 0.3);
}
.adb-btn.stop {
  background: var(--live);
}
.adb-btn:hover {
  opacity: 0.9;
}

/* Event layouts */
.event-day {
  margin-bottom: 30px;
}
.event-day-title {
  font-size: 1.1rem;
  font-weight: 800;
  margin-bottom: 14px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}
.event-cat {
  margin-bottom: 20px;
}
.event-cat-title {
  font-size: 0.82rem;
  font-weight: 800;
  color: var(--accent);
  margin-bottom: 10px;
  text-transform: uppercase;
  letter-spacing: 0.8px;
}
.event-row {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  padding: 14px 18px;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 16px;
  transition: all 0.2s;
}
.event-row:hover {
  border-color: var(--border-hover);
  background: var(--surface-hover);
}
.event-time {
  font-size: 0.76rem;
  font-weight: 800;
  color: var(--live);
  min-width: 50px;
}
.event-name {
  flex: 1;
  font-size: 0.88rem;
  font-weight: 600;
}

/* Responsive constraints */
@media (max-width: 1100px) {
  .src-switch .src-btn span { display: none; }
}
@media (max-width: 768px) {
  .hdr { padding: 0 16px; gap: 10px; height: 60px; }
  .brand-name { display: none; }
  .status { display: none; }
  .content { padding: 20px 16px; }
  .pgrid { grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 12px; }
  .grid, .cgrid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
  .pcard-name { font-size: 0.78rem; }
  .view-tabs .vtab span { display: none; }
  .search { max-width: none; }
  .src-switch { padding: 2px; }
  .src-btn { padding: 6px 12px; }
  .khints { display: none; }
}
@media (max-width: 480px) {
  .pgrid { grid-template-columns: repeat(2, 1fr); }
  .grid, .cgrid { grid-template-columns: repeat(2, 1fr); }
  .src-switch .src-btn { padding: 6px 10px; font-size: 0.74rem; }
  .view-tabs { order: 3; width: 100%; justify-content: center; margin-top: 10px; }
  .hdr { height: auto; flex-wrap: wrap; padding: 12px 16px; }
}

/* === Modern EPG & Favorites UI === */
.fav-section {
  margin-bottom: 35px;
  background: radial-gradient(135deg, rgba(13, 17, 33, 0.4) 0%, rgba(5, 7, 15, 0.4) 100%);
  border-radius: var(--r-lg);
  padding: 24px;
  border: 1px solid rgba(255, 255, 255, 0.04);
  box-shadow: inset 0 0 30px rgba(0, 102, 255, 0.05);
}
.fav-section-title {
  font-size: 1.1rem;
  font-weight: 800;
  letter-spacing: -0.3px;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--t);
}
.fav-section-title svg {
  color: #67b1ef; /* Bleu ciel pour l'icône de cœur */
  filter: drop-shadow(0 0 5px rgba(103, 177, 239, 0.5));
}

.fav-btn {
  position: absolute;
  top: 12px;
  right: 12px;
  background: rgba(13, 17, 33, 0.8);
  border: 1px solid var(--border);
  border-radius: 50%;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 10;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  color: var(--d);
}
.card:hover .fav-btn, .ccard:hover .fav-btn {
  opacity: 1;
  transform: scale(1.05);
}
.fav-btn:hover {
  background: var(--surface-hover);
  border-color: var(--accent);
  color: var(--t);
  transform: scale(1.15);
}
.fav-btn.is-fav {
  background: rgba(103, 177, 239, 0.15);
  border-color: rgba(103, 177, 239, 0.4);
  color: #67b1ef;
  box-shadow: 0 0 10px rgba(103, 177, 239, 0.25);
}
.fav-btn svg {
  width: 13px;
  height: 13px;
  fill: currentColor;
}

/* Card EPG Layout */
.card-epg {
  margin-top: 12px;
  font-size: 0.74rem;
  text-align: left;
  border-top: 1px solid rgba(255, 255, 255, 0.04);
  padding-top: 10px;
}
.epg-title {
  font-weight: 700;
  color: var(--t);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 4px;
}
.epg-time-info {
  display: flex;
  justify-content: space-between;
  font-size: 0.68rem;
  color: var(--d);
  font-weight: 500;
  margin-bottom: 6px;
}
.epg-progress {
  width: 100%;
  height: 4px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 2px;
  overflow: hidden;
  position: relative;
}
.epg-progress-bar {
  height: 100%;
  background: var(--accent-grad);
  border-radius: 2px;
  transition: width 0.4s ease;
}

/* EPG Grids in modal player */
.epg-tabs-title {
  font-size: 0.88rem;
  font-weight: 800;
  color: var(--t);
  margin: 18px 0 10px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  display: flex;
  align-items: center;
  gap: 8px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 6px;
}
.epg-tabs-title svg {
  width: 16px;
  height: 16px;
  color: var(--accent);
}
.epg-timeline {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 250px;
  overflow-y: auto;
  padding-right: 4px;
}
.epg-item-row {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  padding: 10px 14px;
  display: flex;
  align-items: center;
  gap: 12px;
  transition: all 0.2s;
}
.epg-item-row.active {
  background: rgba(0, 102, 255, 0.05);
  border-color: rgba(0, 102, 255, 0.25);
  box-shadow: inset 0 0 12px rgba(0, 102, 255, 0.05);
}
.epg-item-row.active .epg-row-time {
  color: #67b1ef;
  font-weight: 700;
}
.epg-row-time {
  font-size: 0.74rem;
  color: var(--d);
  font-weight: 600;
  min-width: 85px;
  white-space: nowrap;
}
.epg-row-details {
  flex: 1;
  text-align: left;
}
.epg-row-title {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--t);
  margin-bottom: 2px;
}
.epg-row-desc {
  font-size: 0.72rem;
  color: var(--d);
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.epg-live-badge {
  background: #f43f5e;
  color: #fff;
  font-size: 0.58rem;
  font-weight: 900;
  text-transform: uppercase;
  padding: 2px 6px;
  border-radius: 4px;
  letter-spacing: 0.5px;
  animation: blink 1.5s infinite;
}


/* ============================================
   STYLES COMPLEMENTS - Loading, Spinner, Series UI, Language badges
   ============================================ */

/* Spinner (loading circular) - used in .loading, .ls */
.spinner {
  width: 32px;
  height: 32px;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

/* slideup animation - used in .vpn-menu */
@keyframes slideup {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Loading state (.ls) - inline loader in content area */
.ls {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 120px 20px;
  gap: 18px;
  color: var(--d);
}
.ls .t {
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: 0.3px;
}

/* Empty state text */
.empty-text {
  font-size: 1rem;
  font-weight: 600;
  color: var(--d);
  text-align: center;
  letter-spacing: 0.3px;
}

/* Meta tags (used in VOD modal - .tag alongside .mtag) */
.pmeta .tag,
.pc-meta .tag {
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 4px 14px;
  border-radius: 20px;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--d);
  white-space: nowrap;
}

/* === Series UI (Seasons + Episodes) === */
.seasons-wrap {
  margin-top: 24px;
}
.season-tabs {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding-bottom: 10px;
  margin-bottom: 16px;
  scrollbar-width: thin;
}
.season-tab {
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--d);
  padding: 8px 18px;
  border-radius: 12px;
  cursor: pointer;
  font-size: 0.82rem;
  font-weight: 700;
  white-space: nowrap;
  transition: all 0.2s ease;
  flex-shrink: 0;
}
.season-tab:hover {
  color: var(--t);
  border-color: var(--border-hover);
  background: var(--surface-hover);
}
.season-tab.on {
  background: var(--accent-grad);
  color: #fff;
  border-color: transparent;
  box-shadow: var(--accent-glow);
}

/* Episode list */
.ep-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 8px;
  max-height: 320px;
  overflow-y: auto;
  padding-right: 4px;
}
.ep-item {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  padding: 10px 14px;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  gap: 10px;
}
.ep-item:hover {
  background: var(--surface-hover);
  border-color: var(--border-hover);
  transform: translateX(3px);
}
.ep-item.on {
  background: rgba(0, 102, 255, 0.08);
  border-color: var(--accent);
  box-shadow: inset 0 0 10px rgba(0, 102, 255, 0.05);
}
.ep-num {
  font-size: 0.74rem;
  font-weight: 800;
  color: var(--accent);
  background: var(--surface);
  padding: 3px 8px;
  border-radius: 6px;
  flex-shrink: 0;
  min-width: 38px;
  text-align: center;
}
.ep-item.on .ep-num {
  background: var(--accent-grad);
  color: #fff;
}
.ep-name {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--t);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
}

/* Language flags + badges */
.lang-flag {
  font-size: 0.9rem;
  line-height: 1;
  display: inline-block;
}
.lang-code {
  font-size: 0.68rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  background: var(--surface-active);
  color: var(--accent);
  padding: 2px 6px;
  border-radius: 4px;
  margin-right: 6px;
}

/* Language grid (in episode selection) */
.lang-grid {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

/* Iframe for VOD embed player */
#vodframe {
  width: 100%;
  height: 100%;
  border: none;
  display: block;
  position: absolute;
  inset: 0;
  z-index: 2;
  background: #000;
}

/* Loading overlay text */
.loading > div:last-child {
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.3px;
}

/* === Enhanced Header Polish === */
.hdr {
  transition: background 0.3s ease, box-shadow 0.3s ease;
}
.hdr.scrolled {
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.4);
}

/* Brand hover effect */
.brand:hover .brand-dot {
  transform: rotate(-8deg) scale(1.05);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Source button dot pulse when active */
.src-btn.on .src-dot {
  animation: pulse 2s infinite;
}

/* View tab icon sizing */
.vtab svg {
  width: 15px;
  height: 15px;
}

/* === Card polish === */
.card, .ccard {
  position: relative;
}
.card::after, .ccard::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: var(--r);
  padding: 1px;
  background: linear-gradient(135deg, transparent 50%, var(--accent) 100%);
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  mask-composite: exclude;
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
}
.card:hover::after, .ccard:hover::after {
  opacity: 1;
}

/* Movie/Series card hover overlay */
.pcard {
  position: relative;
}
.pcard::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: var(--r);
  box-shadow: inset 0 0 0 2px var(--accent);
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
  z-index: 3;
}
.pcard:hover::after {
  opacity: 1;
}

/* Play overlay on movie poster hover */
.pcard-poster-wrap {
  position: relative;
  overflow: hidden;
}
.pcard-play {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.5);
  opacity: 0;
  transition: opacity 0.3s ease;
  z-index: 2;
}
.pcard:hover .pcard-play {
  opacity: 1;
}
.pcard-play svg {
  width: 42px;
  height: 42px;
  color: #fff;
  filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.5));
}

/* === Player modal polish === */
.overlay {
  animation: fadeIn 0.25s ease-out;
}
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}
.pcont {
  animation: modalIn 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
@keyframes modalIn {
  from { opacity: 0; transform: scale(0.95) translateY(20px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

/* Error state text */
#perror-text {
  font-size: 0.92rem;
  line-height: 1.5;
  max-width: 320px;
}

/* Scrollbar in player body */
.pc-body::-webkit-scrollbar,
.pbody::-webkit-scrollbar {
  width: 5px;
}
.pc-body::-webkit-scrollbar-thumb,
.pbody::-webkit-scrollbar-thumb {
  background: var(--border-hover);
  border-radius: 10px;
}

/* === Responsive tuning === */
@media (max-width: 768px) {
  .ep-list {
    grid-template-columns: 1fr;
    max-height: 260px;
  }
  .season-tab {
    padding: 6px 14px;
    font-size: 0.76rem;
  }
  .lang-btn {
    padding: 7px 12px;
    font-size: 0.74rem;
  }
  .pcard-play svg {
    width: 32px;
    height: 32px;
  }
}

@media (max-width: 480px) {
  .ep-list {
    max-height: 220px;
  }
  .ls {
    padding: 80px 20px;
  }
}

/* === Selection color === */
::selection {
  background: var(--accent);
  color: #fff;
}

/* Focus visible for accessibility */
button:focus-visible,
input:focus-visible,
.cat:focus-visible,
.src-btn:focus-visible,
.vtab:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

/* === Events Page Styling === */
.event-day {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 24px;
  margin-bottom: 24px;
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  box-shadow: var(--shadow);
}
.event-day-title {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--t);
  margin-bottom: 20px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 8px;
}
.event-cat {
  margin-bottom: 20px;
}
.event-cat:last-child {
  margin-bottom: 0;
}
.event-cat-title {
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--green);
  background: rgba(103, 177, 239, 0.08);
  padding: 4px 10px;
  border-radius: 6px;
  display: inline-block;
  margin-bottom: 12px;
}
.event-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  background: rgba(255, 255, 255, 0.015);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  margin-bottom: 8px;
  gap: 16px;
  transition: all 0.2s ease;
}
.event-row:hover {
  background: var(--surface-hover);
  border-color: var(--border-hover);
  transform: translateX(4px);
}
.event-time {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--live);
  background: rgba(244, 63, 94, 0.1);
  padding: 4px 10px;
  border-radius: 6px;
  white-space: nowrap;
}
.event-name {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--t);
  flex: 1;
}

/* Event channel buttons styling */
.event-row .cat {
  background: rgba(255, 255, 255, 0.03) !important;
  border: 1px solid var(--border) !important;
  color: var(--t) !important;
  padding: 6px 14px !important;
  border-radius: 10px !important;
  font-size: 0.78rem !important;
  font-weight: 700 !important;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1) !important;
  box-shadow: none !important;
  margin: 2px !important;
}
.event-row .cat:hover {
  background: var(--accent-grad) !important;
  border-color: transparent !important;
  color: #fff !important;
  box-shadow: var(--accent-glow) !important;
  transform: scale(1.05);
}

@media (max-width: 768px) {
  .event-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }
  .event-row > div {
    width: 100%;
  }
  .event-name {
    width: 100%;
  }
}


/* Plyr Fixes */
.stage-ld, .stage-err { pointer-events: none !important; }

/* Channel Card Play Icon */
.cicon-wrap { position: relative; width: 100%; aspect-ratio: 16/9; background: #000; overflow: hidden; border-radius: var(--r) var(--r) 0 0; }
.cicon-wrap img { width: 100%; height: 100%; object-fit: cover; opacity: 0.8; transition: opacity 0.3s ease; }
.cicon-play { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); width: 48px; height: 48px; background: rgba(0,0,0,0.6); border-radius: 50%; display: flex; align-items: center; justify-content: center; z-index: 2; pointer-events: none; opacity: 0; transition: opacity 0.3s ease, transform 0.3s ease; }
.cicon-play svg { width: 24px; height: 24px; fill: #fff; }
.ccard:hover .cicon-wrap img { opacity: 0.5; }
.ccard:hover .cicon-play { opacity: 1; transform: translate(-50%, -50%) scale(1.1); }
