/* ==========================================================================
   ShowPlus IPTV — main stylesheet
   Palette: late-night living room. Deep aubergine, screen glow, warm gold.
   Type: Changa (display) + Cairo (text).
   RTL-first; all spacing uses logical properties so LTR works too.
   ========================================================================== */

:root {
  --night:        #120b16;
  --night-deep:   #0b070e;
  --surface:      #1d1322;
  --surface-2:    #271a2e;
  --line:         rgba(255, 255, 255, .09);
  --line-strong:  rgba(255, 255, 255, .18);

  --ink:          #f8f2f6;
  --ink-soft:     #cbb9d2;
  --ink-mute:     #9c88a6;

  --coral:        #e64a4a;
  --plum:         #7a0b44;
  --gold:         #f2c14e;
  --glow:         linear-gradient(135deg, #e64a4a 0%, #7a0b44 100%);
  --glow-soft:    rgba(230, 74, 74, .14);

  --r-lg: 20px;
  --r-md: 14px;
  --r-sm: 9px;

  --shadow:     0 24px 50px -26px rgba(0, 0, 0, .85);
  --shadow-lift:0 30px 60px -24px rgba(122, 11, 68, .6);

  --shell: 1180px;
  --header-h: 72px;

  --font-display: 'Changa', system-ui, sans-serif;
  --font-text: 'Cairo', system-ui, -apple-system, 'Segoe UI', sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; scroll-padding-block-start: calc(var(--header-h) + 16px); }

body {
  margin: 0;
  background: var(--night);
  background-image:
    radial-gradient(1000px 520px at 88% -8%, rgba(230, 74, 74, .17), transparent 62%),
    radial-gradient(760px 460px at 4% 12%, rgba(122, 11, 68, .22), transparent 60%);
  background-repeat: no-repeat;
  color: var(--ink);
  font-family: var(--font-text);
  font-size: 16px;
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; }
button { font: inherit; }

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.25;
  margin: 0 0 .5em;
  letter-spacing: -.01em;
}
h1 { font-size: clamp(2rem, 1.3rem + 3vw, 3.5rem); }
h2 { font-size: clamp(1.5rem, 1.1rem + 1.6vw, 2.25rem); }
h3 { font-size: 1.15rem; }
p  { margin: 0 0 1rem; max-width: 68ch; }

:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 3px;
  border-radius: 4px;
}

.sr-only {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip-path: inset(50%); white-space: nowrap;
}

.skip-link {
  position: fixed; inset-block-start: 8px; inset-inline-start: -999px;
  z-index: 200; background: var(--gold); color: #24170a;
  padding: 10px 16px; border-radius: var(--r-sm); font-weight: 600;
}
.skip-link:focus { inset-inline-start: 8px; }

.shell {
  width: min(100% - 32px, var(--shell));
  margin-inline: auto;
}

/* ---------- Buttons ------------------------------------------------------ */

.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 13px 24px;
  border: 1px solid transparent;
  border-radius: 999px;
  font-family: var(--font-display);
  font-weight: 600; font-size: 1rem;
  cursor: pointer;
  transition: transform .18s ease, box-shadow .18s ease, background-color .18s ease, border-color .18s ease;
}
.btn:hover { transform: translateY(-2px); }
.btn-sm { padding: 9px 16px; font-size: .9rem; }

.btn-primary {
  background: var(--glow);
  color: #fff;
  box-shadow: 0 12px 26px -12px rgba(230, 74, 74, .8);
}
.btn-primary:hover { box-shadow: 0 18px 34px -12px rgba(230, 74, 74, .9); }

.btn-ghost {
  background: rgba(255, 255, 255, .04);
  border-color: var(--line-strong);
  color: var(--ink);
}
.btn-ghost:hover { background: rgba(255, 255, 255, .09); border-color: var(--coral); }

.ico { flex: none; }

/* ---------- Header ------------------------------------------------------- */

.site-header {
  position: sticky; inset-block-start: 0; z-index: 100;
  background: rgba(13, 8, 16, .72);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-block-end: 1px solid var(--line);
}
.site-header.is-stuck { box-shadow: 0 14px 34px -22px #000; }

.header-inner {
  min-height: var(--header-h);
  display: flex; align-items: center; gap: 18px;
}

.brand { display: inline-flex; align-items: center; gap: 10px; flex: none; }
.brand-mark { display: grid; place-items: center; }
.brand-text { display: flex; align-items: baseline; gap: 6px; font-family: var(--font-display); }
.brand-text strong { font-size: 1.28rem; font-weight: 700; letter-spacing: -.02em; }
.brand-text small {
  font-size: .62rem; font-weight: 600; letter-spacing: .22em;
  color: var(--gold); transform: translateY(-3px);
}
.brand-sm .brand-text strong { font-size: 1.1rem; }

.nav-toggle {
  margin-inline-start: auto;
  display: none;
  background: rgba(255, 255, 255, .05);
  border: 1px solid var(--line);
  color: var(--ink);
  border-radius: var(--r-sm);
  padding: 8px; cursor: pointer;
}

.site-nav {
  margin-inline-start: auto;
  display: flex; align-items: center; gap: 20px;
}

.nav-list {
  display: flex; align-items: center; gap: 2px;
  list-style: none; margin: 0; padding: 0;
}
.nav-link {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 9px 12px;
  border-radius: var(--r-sm);
  font-size: .92rem; color: var(--ink-soft);
  transition: color .16s ease, background-color .16s ease;
}
.nav-link .ico { color: var(--ink-mute); transition: color .16s ease; }
.nav-link:hover { color: var(--ink); background: rgba(255, 255, 255, .05); }
.nav-link:hover .ico { color: var(--coral); }
.nav-link.is-active { color: #fff; background: var(--glow-soft); }
.nav-link.is-active .ico { color: var(--coral); }

.nav-actions { display: flex; align-items: center; gap: 12px; }

.lang-switch select {
  background: rgba(255, 255, 255, .05);
  border: 1px solid var(--line-strong);
  color: var(--ink);
  border-radius: 999px;
  padding: 7px 10px;
  font-family: var(--font-display); font-size: .85rem;
  cursor: pointer;
}
.lang-switch select option { background: var(--surface); color: var(--ink); }

/* ---------- Sections ----------------------------------------------------- */

.section { padding-block: clamp(48px, 6vw, 80px); }
.section-head { margin-block-end: 28px; }
.section-head h2 { margin-block-end: 6px; }
.section-head p { color: var(--ink-mute); margin: 0; }

.section-head--rule {
  border-inline-start: 3px solid var(--coral);
  padding-inline-start: 16px;
}

.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow);
}

/* ---------- Hero --------------------------------------------------------- */

.hero { padding-block: clamp(40px, 6vw, 76px) 28px; }

.hero-grid {
  display: grid;
  grid-template-columns: 1.15fr .85fr;
  gap: 40px; align-items: center;
}

.hero h1 { margin-block-end: 14px; }
.hero h1 .line-2 { display: block; color: var(--gold); }
.hero-lede { color: var(--ink-soft); font-size: 1.08rem; max-width: 46ch; }

.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-block: 26px 28px; }

.hero-facts {
  display: flex; flex-wrap: wrap; gap: 10px;
  list-style: none; margin: 0; padding: 0;
}
.hero-facts li {
  display: inline-flex; align-items: center; gap: 7px;
  background: rgba(255, 255, 255, .04);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 7px 14px;
  font-size: .86rem; color: var(--ink-soft);
}
.hero-facts .ico { color: var(--gold); }

/* screen-glow card on the hero side */
.hero-screen {
  position: relative;
  aspect-ratio: 16 / 10;
  border-radius: var(--r-lg);
  border: 1px solid var(--line-strong);
  background:
    linear-gradient(160deg, rgba(230, 74, 74, .28), rgba(122, 11, 68, .5)),
    var(--surface-2);
  box-shadow: var(--shadow-lift);
  overflow: hidden;
  display: grid; place-items: center;
}
.hero-screen::after {
  content: "";
  position: absolute; inset: 0;
  background: repeating-linear-gradient(0deg, rgba(0, 0, 0, .14) 0 2px, transparent 2px 5px);
  opacity: .5; pointer-events: none;
}
.hero-screen-inner { text-align: center; padding: 20px; }
.hero-screen-inner strong {
  display: block;
  font-family: var(--font-display);
  font-size: clamp(2rem, 4vw, 3rem);
  line-height: 1.1;
}
.hero-screen-inner span { color: rgba(255, 255, 255, .78); font-size: .95rem; }
.hero-screen .live-dot {
  position: absolute; inset-block-start: 14px; inset-inline-end: 14px;
  display: inline-flex; align-items: center; gap: 7px;
  background: rgba(0, 0, 0, .45); border-radius: 999px;
  padding: 5px 12px; font-size: .78rem; letter-spacing: .04em;
}
.hero-screen .live-dot i {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--coral); animation: pulse 2s infinite;
}
@keyframes pulse { 50% { opacity: .25; } }

/* ---------- Horizontal rail (latest movies / legacy slide_show) ---------- */

.rail-head {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 16px; margin-block-end: 14px;
}
.rail-head h2 { margin: 0; font-size: clamp(1.25rem, 1rem + 1vw, 1.7rem); }
.rail-head a { color: var(--ink-mute); font-size: .9rem; }
.rail-head a:hover { color: var(--coral); }

.rail {
  overflow-x: auto; overflow-y: hidden;
  padding: 14px;
  scrollbar-width: thin;
  scrollbar-color: var(--coral) transparent;
}
.rail::-webkit-scrollbar { height: 9px; }
.rail::-webkit-scrollbar-track { background: rgba(255, 255, 255, .04); border-radius: 999px; }
.rail::-webkit-scrollbar-thumb { background: var(--glow); border-radius: 999px; }

/* ---------- Quick help links -------------------------------------------- */

.help-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 12px;
}
.help-card {
  display: flex; align-items: center; gap: 12px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: 16px 18px;
  color: var(--ink-soft);
  transition: border-color .16s ease, background-color .16s ease, color .16s ease;
}
.help-card:hover { border-color: var(--coral); background: var(--surface-2); color: var(--ink); }
.help-card .ico { color: var(--coral); }
.help-card span { font-family: var(--font-display); font-size: .96rem; }

/* ---------- Gallery ------------------------------------------------------ */

.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 14px;
}
.gallery figure {
  margin: 0; overflow: hidden;
  border-radius: var(--r-md);
  border: 1px solid var(--line);
  background: var(--surface);
  cursor: zoom-in;
}
.gallery img {
  width: 100%; aspect-ratio: 16 / 10; object-fit: cover;
  transition: transform .4s ease, opacity .2s ease;
}
.gallery figure:hover img { transform: scale(1.05); }

.lightbox {
  position: fixed; inset: 0; z-index: 300;
  display: grid; place-items: center;
  background: rgba(7, 4, 9, .92);
  padding: 24px;
}
.lightbox[hidden] { display: none; }
.lightbox img { max-width: min(1000px, 92vw); max-height: 86vh; border-radius: var(--r-md); }
.lightbox-close {
  position: absolute; inset-block-start: 18px; inset-inline-end: 18px;
  background: rgba(255, 255, 255, .08); border: 1px solid var(--line-strong);
  color: #fff; border-radius: 50%; padding: 10px; cursor: pointer;
}

/* ---------- Contact band ------------------------------------------------- */

.band {
  background:
    linear-gradient(135deg, rgba(230, 74, 74, .2), rgba(122, 11, 68, .35)),
    var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: var(--r-lg);
  padding: clamp(26px, 4vw, 44px);
  display: flex; flex-wrap: wrap; align-items: center;
  justify-content: space-between; gap: 22px;
}
.band h2 { margin: 0 0 6px; }
.band p { margin: 0; color: var(--ink-soft); }

/* ---------- Footer ------------------------------------------------------- */

.site-footer {
  margin-block-start: 60px;
  border-block-start: 1px solid var(--line);
  background: var(--night-deep);
  padding-block: 46px 20px;
}
.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: 34px;
}
.footer-about p { color: var(--ink-mute); font-size: .94rem; margin-block-start: 12px; }
.footer-social { display: flex; gap: 10px; flex-wrap: wrap; margin-block-start: 6px; }
.footer-social a {
  display: inline-flex; align-items: center; gap: 7px;
  border: 1px solid var(--line); border-radius: 999px;
  padding: 7px 14px; font-size: .88rem; color: var(--ink-soft);
}
.footer-social a:hover { border-color: var(--coral); color: var(--ink); }

.footer-links h3, .footer-cta h3 {
  font-size: 1rem; color: var(--ink);
  padding-block-end: 10px; margin-block-end: 12px;
  border-block-end: 1px solid var(--line);
}
.footer-links ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 9px; }
.footer-links a { color: var(--ink-mute); font-size: .93rem; }
.footer-links a:hover { color: var(--coral); }
.footer-cta p { color: var(--ink-mute); font-size: .93rem; }

.footer-bottom {
  margin-block-start: 34px; padding-block-start: 16px;
  border-block-start: 1px solid var(--line);
  display: flex; flex-wrap: wrap; gap: 12px;
  justify-content: space-between;
  color: var(--ink-mute); font-size: .85rem;
}
.to-top { display: inline-flex; align-items: center; gap: 6px; }
.to-top .ico { transform: rotate(90deg); }
.to-top:hover { color: var(--coral); }

.placeholder {
  color: var(--ink-mute); text-align: center;
  padding: 30px; margin: 0;
}

/* ---------- Legacy includes (pricing.php, box.php, news.php ...) ---------
   Light-touch normalising so old markup sits inside the new shell.       */

.legacy { padding: 8px; }
.legacy :where(table) { width: 100%; border-collapse: collapse; }
.legacy :where(td, th) { padding: 10px; border-block-end: 1px solid var(--line); }
.legacy :where(img) { border-radius: var(--r-sm); }
.legacy :where(.price) {
  border: 1px solid var(--line) !important;
  border-radius: var(--r-md);
  overflow: hidden;
  list-style: none;
}
.legacy :where(.price) li {
  background: var(--surface) !important;
  color: var(--ink) !important;
  border-block-end: 1px solid var(--line) !important;
}
.legacy :where(.price) .header {
  background: var(--glow) !important;
  font-family: var(--font-display);
}
.legacy :where(.button) {
  background: var(--glow) !important;
  border-radius: 999px !important;
  color: #fff !important;
  display: inline-block;
  padding: 10px 22px !important;
}

/* ---------- Responsive --------------------------------------------------- */

@media (max-width: 1000px) {
  .hero-grid { grid-template-columns: 1fr; }
  .hero-screen { order: -1; aspect-ratio: 16 / 9; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .footer-about { grid-column: 1 / -1; }
}

@media (max-width: 860px) {
  .nav-toggle { display: inline-flex; }

  .site-nav {
    position: fixed;
    inset-block-start: var(--header-h); inset-inline: 0;
    display: none;
    flex-direction: column; align-items: stretch; gap: 14px;
    background: var(--night-deep);
    border-block-end: 1px solid var(--line);
    padding: 18px 16px 24px;
    max-height: calc(100dvh - var(--header-h));
    overflow-y: auto;
  }
  .site-nav.is-open { display: flex; }

  .nav-list { flex-direction: column; align-items: stretch; gap: 4px; }
  .nav-link { padding: 12px 14px; font-size: 1rem; }
  .nav-actions { justify-content: space-between; }
  .nav-actions .btn { flex: 1; justify-content: center; }
}

@media (max-width: 560px) {
  .footer-grid { grid-template-columns: 1fr; }
  .band { flex-direction: column; align-items: flex-start; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .001ms !important;
    transition-duration: .001ms !important;
  }
}