/* ============================================================
   M3U-EDIT.COM v2 — EPG Landing Page
   Location: assets/css/epg-page.css

   Loaded only by /epg.php. All selectors prefixed `.epg-` so the
   page is style-isolated from the rest of the site. Inlines a
   subset of the homepage.css design tokens so we don't have to
   load the full homepage stylesheet here.
   ============================================================ */

/* ---------- TOKEN SUBSET ---------- */
.epg-shell {
  --epg-gradient-primary: linear-gradient(135deg, #6366f1 0%, #8b5cf6 50%, #ec4899 100%);
  --epg-gradient-mesh:
    radial-gradient(at 0% 0%, rgba(99, 102, 241, 0.16) 0%, transparent 50%),
    radial-gradient(at 100% 100%, rgba(236, 72, 153, 0.13) 0%, transparent 50%),
    radial-gradient(at 50% 60%, rgba(6, 182, 212, 0.08) 0%, transparent 50%);
  --epg-shadow-glow: 0 0 32px rgba(99, 102, 241, 0.35);
  --epg-ease-back: cubic-bezier(0.34, 1.56, 0.64, 1);
  --epg-ease-expo: cubic-bezier(0.16, 1, 0.3, 1);
}
[data-theme="dark"] .epg-shell {
  --epg-gradient-mesh:
    radial-gradient(at 0% 0%, rgba(99, 102, 241, 0.26) 0%, transparent 50%),
    radial-gradient(at 100% 100%, rgba(236, 72, 153, 0.20) 0%, transparent 50%),
    radial-gradient(at 50% 60%, rgba(6, 182, 212, 0.12) 0%, transparent 50%);
  --epg-shadow-glow: 0 0 36px rgba(139, 92, 246, 0.50);
}

.epg-shell { color: var(--text); }

/* ============================================================
   HERO
   ============================================================ */
.epg-hero {
  position: relative;
  padding: 80px 24px 60px;
  isolation: isolate;
  overflow: hidden;
}
.epg-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--epg-gradient-mesh);
  z-index: -1;
  pointer-events: none;
}

.epg-hero-inner {
  max-width: 1180px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
  gap: 56px;
  align-items: center;
}
@media (max-width: 900px) {
  .epg-hero-inner { grid-template-columns: 1fr; gap: 36px; text-align: center; }
}

.epg-hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  background: rgba(99, 102, 241, 0.10);
  border: 1px solid rgba(99, 102, 241, 0.28);
  color: var(--primary);
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 18px;
}
[data-theme="dark"] .epg-hero-badge {
  background: rgba(139, 92, 246, 0.14);
  border-color: rgba(139, 92, 246, 0.38);
}

.epg-hero-title {
  font-family: 'Plus Jakarta Sans', 'Inter', sans-serif;
  font-size: clamp(30px, 4.6vw, 48px);
  font-weight: 800;
  line-height: 1.05;
  letter-spacing: -0.025em;
  color: var(--text);
  margin: 0 0 16px;
}
.epg-hero-title .epg-grad {
  background: var(--epg-gradient-primary);
  -webkit-background-clip: text;
          background-clip: text;
  -webkit-text-fill-color: transparent;
          color: transparent;
}

.epg-hero-sub {
  font-size: clamp(15px, 1.6vw, 18px);
  line-height: 1.65;
  color: var(--text-secondary);
  margin: 0 0 26px;
  max-width: 560px;
}
@media (max-width: 900px) {
  .epg-hero-sub { margin-left: auto; margin-right: auto; }
}

.epg-hero-cta {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 22px;
}
@media (max-width: 900px) {
  .epg-hero-cta { justify-content: center; }
}
.epg-hero-cta .btn {
  padding: 13px 24px;
  font-weight: 700;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  font-size: 14.5px;
  transition: transform 220ms var(--epg-ease-back), box-shadow 240ms var(--epg-ease-expo);
}
.epg-hero-cta .btn-primary {
  background: var(--epg-gradient-primary);
  color: #fff;
  box-shadow: 0 12px 30px -10px rgba(99, 102, 241, 0.50);
}
.epg-hero-cta .btn-primary:hover {
  transform: translateY(-3px);
  box-shadow: 0 18px 38px -8px rgba(139, 92, 246, 0.60), var(--epg-shadow-glow);
  color: #fff;
}
.epg-hero-cta .btn-ghost {
  background: var(--bg-card);
  border: 1.5px solid var(--border);
  color: var(--text);
}
.epg-hero-cta .btn-ghost:hover {
  border-color: var(--primary);
  color: var(--primary);
  transform: translateY(-2px);
}

.epg-hero-trust {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 16px 22px;
  font-size: 13px;
  color: var(--text-muted);
}
.epg-hero-trust span { display: inline-flex; align-items: center; gap: 6px; }

/* Visual diagram on the right of the hero */
.epg-diagram {
  display: flex;
  align-items: center;
  justify-content: center;
}
.epg-diagram-svg {
  width: 100%;
  max-width: 440px;
  height: auto;
  filter: drop-shadow(0 20px 50px rgba(99, 102, 241, 0.18));
}
[data-theme="dark"] .epg-diagram-svg {
  filter: drop-shadow(0 24px 56px rgba(0, 0, 0, 0.55));
}

/* ============================================================
   SHARED SECTION CHROME
   ============================================================ */
.epg-section {
  padding: 64px 24px;
}
.epg-section.is-alt {
  background: var(--bg-secondary);
}
.epg-section-inner {
  max-width: 1100px;
  margin: 0 auto;
}
.epg-section-header {
  max-width: 720px;
  margin: 0 auto 36px;
  text-align: center;
}
.epg-section-eyebrow {
  display: inline-block;
  padding: 4px 12px;
  background: rgba(99, 102, 241, 0.10);
  color: var(--primary);
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 12px;
}
.epg-section-title {
  font-family: 'Plus Jakarta Sans', 'Inter', sans-serif;
  font-size: clamp(24px, 3.2vw, 34px);
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -0.02em;
  color: var(--text);
  margin: 0 0 12px;
}
.epg-section-sub {
  font-size: 16px;
  line-height: 1.6;
  color: var(--text-secondary);
  margin: 0;
}

/* ============================================================
   "WHAT IS EPG?" PROSE
   ============================================================ */
.epg-prose {
  max-width: 760px;
  margin: 0 auto;
  font-size: 16px;
  line-height: 1.75;
  color: var(--text);
}
.epg-prose p { margin: 0 0 18px; color: var(--text); }
.epg-prose strong { color: var(--text); font-weight: 700; }
.epg-prose code {
  background: var(--bg-card);
  padding: 2px 8px;
  border-radius: 6px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.9em;
  color: var(--primary);
  border: 1px solid var(--border);
}

.epg-prose ol,
.epg-prose ul {
  margin: 0 0 18px;
  padding-left: 24px;
}
.epg-prose ol li,
.epg-prose ul li { margin-bottom: 8px; line-height: 1.65; }

/* ============================================================
   "HOW OUR TOOLS WORK" — 3 cards
   ============================================================ */
.epg-tools-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
}
@media (max-width: 860px) {
  .epg-tools-grid { grid-template-columns: 1fr; }
}

.epg-tool-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 28px 26px;
  display: flex;
  flex-direction: column;
  transition: transform 300ms var(--epg-ease-expo), box-shadow 300ms var(--epg-ease-expo), border-color 200ms ease;
}
.epg-tool-card:hover {
  transform: translateY(-4px);
  border-color: var(--primary);
  box-shadow: 0 18px 40px -16px rgba(99, 102, 241, 0.30);
}
.epg-tool-icon {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  background: var(--epg-gradient-primary);
  color: #fff;
  font-size: 26px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 18px;
  box-shadow: 0 8px 20px -6px rgba(99, 102, 241, 0.45);
}
.epg-tool-card h3 {
  font-family: 'Plus Jakarta Sans', 'Inter', sans-serif;
  font-size: 19px;
  font-weight: 700;
  letter-spacing: -0.015em;
  margin: 0 0 8px;
  color: var(--text);
}
.epg-tool-card p {
  font-size: 14.5px;
  line-height: 1.6;
  color: var(--text-secondary);
  margin: 0 0 16px;
  flex: 1;
}
.epg-tool-card-tag {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  align-self: flex-start;
}
.epg-tool-card-tag--free    { background: rgba(16, 185, 129, 0.14); color: var(--success); }
.epg-tool-card-tag--premium { background: rgba(99, 102, 241, 0.14); color: var(--primary); }

/* ============================================================
   SUPPORTED EPG SOURCES
   ============================================================ */
.epg-sources {
  max-width: 760px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
@media (max-width: 640px) {
  .epg-sources { grid-template-columns: 1fr; }
}
.epg-source {
  display: grid;
  grid-template-columns: 36px 1fr;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 14px;
  transition: border-color 200ms ease, transform 200ms var(--epg-ease-back);
}
.epg-source:hover {
  border-color: var(--primary);
  transform: translateX(2px);
}
.epg-source-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: linear-gradient(135deg, rgba(99,102,241,0.14), rgba(139,92,246,0.10));
  font-size: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.epg-source-name {
  font-weight: 700;
  font-size: 14px;
  color: var(--text);
  letter-spacing: -0.005em;
}
.epg-source-meta {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.4;
}
.epg-sources-note {
  max-width: 760px;
  margin: 18px auto 0;
  text-align: center;
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.6;
}

/* ============================================================
   SETUP GUIDE — numbered steps
   ============================================================ */
.epg-steps {
  max-width: 880px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 18px;
  counter-reset: epgstep;
}

.epg-step {
  position: relative;
  display: grid;
  grid-template-columns: 60px 1fr;
  gap: 20px;
  padding: 22px 24px 22px 22px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 18px;
  transition: border-color 200ms ease, box-shadow 240ms var(--epg-ease-expo);
}
.epg-step:hover {
  border-color: var(--primary);
  box-shadow: 0 14px 32px -16px rgba(99, 102, 241, 0.28);
}

.epg-step-num {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: var(--epg-gradient-primary);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: 'Plus Jakarta Sans', 'Inter', sans-serif;
  font-weight: 800;
  font-size: 18px;
  flex-shrink: 0;
  box-shadow: 0 6px 16px -6px rgba(99, 102, 241, 0.50);
}

.epg-step-body h3 {
  font-family: 'Plus Jakarta Sans', 'Inter', sans-serif;
  font-size: 18px;
  font-weight: 700;
  margin: 0 0 8px;
  color: var(--text);
}
.epg-step-body p {
  font-size: 14.5px;
  line-height: 1.65;
  color: var(--text-secondary);
  margin: 0;
}
.epg-step-body ul {
  margin: 10px 0 0;
  padding-left: 20px;
  list-style: disc;
}
.epg-step-body ul li {
  font-size: 14px;
  line-height: 1.65;
  color: var(--text-secondary);
  margin-bottom: 4px;
}
.epg-step-body code {
  background: var(--bg);
  padding: 2px 6px;
  border-radius: 4px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.88em;
  color: var(--primary);
  border: 1px solid var(--border);
}

/* ============================================================
   FAQ
   ============================================================ */
.epg-faq {
  max-width: 820px;
  margin: 0 auto;
}
.epg-faq-item {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 14px;
  margin-bottom: 12px;
  overflow: hidden;
  transition: border-color 200ms ease, box-shadow 240ms var(--epg-ease-expo);
}
.epg-faq-item:hover { border-color: rgba(99, 102, 241, 0.45); }
.epg-faq-item[open] {
  border-color: var(--primary);
  box-shadow: 0 8px 24px -10px rgba(99, 102, 241, 0.22),
              inset 3px 0 0 0 var(--primary);
}
.epg-faq-item summary {
  list-style: none;
  cursor: pointer;
  padding: 16px 56px 16px 20px;
  font-family: 'Plus Jakarta Sans', 'Inter', sans-serif;
  font-weight: 700;
  font-size: 15.5px;
  color: var(--text);
  position: relative;
  user-select: none;
}
.epg-faq-item summary::-webkit-details-marker { display: none; }
.epg-faq-item summary::marker { display: none; content: ''; }
.epg-faq-item summary::after {
  content: '+';
  position: absolute;
  right: 18px;
  top: 50%;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: rgba(99, 102, 241, 0.12);
  color: var(--primary);
  font-size: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  transform: translateY(-50%);
  font-weight: 700;
  line-height: 1;
  transition: transform 300ms var(--epg-ease-back), background 200ms ease, color 200ms ease;
}
.epg-faq-item[open] summary::after {
  transform: translateY(-50%) rotate(45deg);
  background: var(--primary);
  color: #fff;
}
.epg-faq-item .epg-faq-answer {
  padding: 0 20px 18px;
  font-size: 14.5px;
  line-height: 1.7;
  color: var(--text-secondary);
}

/* ============================================================
   BOTTOM CTA
   ============================================================ */
.epg-cta {
  margin: 24px auto 80px;
  padding: 60px 28px;
  max-width: 980px;
  background: var(--epg-gradient-primary);
  border-radius: 28px;
  text-align: center;
  color: #fff;
  position: relative;
  overflow: hidden;
  box-shadow: 0 30px 60px -20px rgba(99, 102, 241, 0.40);
}
.epg-cta::after {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 70% 70% at 50% 50%, rgba(15, 23, 42, 0.22), transparent 70%);
  pointer-events: none;
  z-index: 0;
}
.epg-cta-content {
  position: relative;
  z-index: 1;
}
.epg-cta h2 {
  font-family: 'Plus Jakarta Sans', 'Inter', sans-serif;
  font-size: clamp(24px, 3.5vw, 34px);
  font-weight: 800;
  margin: 0 0 10px;
  color: #fff;
  text-shadow: 0 2px 10px rgba(76, 29, 149, 0.55), 0 1px 3px rgba(15, 23, 42, 0.35);
}
.epg-cta p {
  font-size: 15px;
  line-height: 1.6;
  color: rgba(255, 255, 255, 0.95);
  margin: 0 0 22px;
  text-shadow: 0 1px 4px rgba(15, 23, 42, 0.20);
}
.epg-cta-actions {
  display: inline-flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
}
.epg-cta .btn {
  padding: 13px 26px;
  font-size: 15px;
  font-weight: 800;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  transition: transform 220ms var(--epg-ease-back), box-shadow 240ms var(--epg-ease-expo);
}
.epg-cta .btn-primary {
  background: #fff;
  color: var(--primary);
  box-shadow: 0 12px 30px -8px rgba(0,0,0,0.30);
}
.epg-cta .btn-primary:hover {
  background: #fff;
  color: #4c1d95;
  transform: translateY(-3px) scale(1.02);
  box-shadow: 0 20px 40px -10px rgba(0,0,0,0.45);
}
.epg-cta .btn-ghost {
  background: rgba(255,255,255,0.12);
  border: 1.5px solid rgba(255,255,255,0.55);
  color: #fff;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}
.epg-cta .btn-ghost:hover {
  background: rgba(255,255,255,0.22);
  border-color: #fff;
  transform: translateY(-3px) scale(1.02);
  color: #fff;
}

@media (max-width: 640px) {
  .epg-cta { padding: 44px 20px; margin: 20px 16px 60px; border-radius: 22px; }
  .epg-cta-actions { flex-direction: column; width: 100%; }
  .epg-cta-actions .btn { width: 100%; justify-content: center; }
}

/* ============================================================
   REVEAL — Lightweight CSS-only entrance on page load.
   We can't depend on IntersectionObserver here (homepage.js isn't
   loaded on this page), so we use a one-shot animation that runs
   on load. Items stay visible regardless of JS state.
   ============================================================ */
@keyframes epgRevealIn {
  from { opacity: 0; transform: translate3d(0, 18px, 0); }
  to   { opacity: 1; transform: translate3d(0, 0, 0); }
}
.epg-reveal {
  animation: epgRevealIn 600ms var(--epg-ease-expo) both;
  will-change: opacity, transform;
}
.epg-reveal.is-visible {
  /* IntersectionObserver (if ever loaded) can still toggle this — */
  /* no-op effectively, but keeps the class usable for future JS.  */
  opacity: 1;
  transform: translate3d(0, 0, 0);
}

@media (prefers-reduced-motion: reduce) {
  .epg-reveal,
  .epg-reveal.is-visible {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
  }
  .epg-tool-card,
  .epg-step,
  .epg-faq-item,
  .epg-hero-cta .btn,
  .epg-cta .btn,
  .epg-source {
    transition: none !important;
  }
  .epg-tool-card:hover,
  .epg-step:hover,
  .epg-source:hover { transform: none !important; }
}
