/* Redesign for /watch/{movie,series,anime,sport}/:id/links (views/watch-links.ejs).
   Scoped to body.links-page so the template's own inline styles stay the fallback. */

body.links-page {
  --lk-accent: #e50914;
  --lk-accent-soft: rgba(229, 9, 20, 0.16);
  --lk-pad: clamp(16px, 4vw, 48px);
  background: #07070a;
}
body.links-page--series, body.links-page--tv { --lk-accent: #3b82f6; --lk-accent-soft: rgba(59, 130, 246, 0.16); }
body.links-page--anime { --lk-accent: #a855f7; --lk-accent-soft: rgba(168, 85, 247, 0.18); }
body.links-page--sport { --lk-accent: #ef4444; --lk-accent-soft: rgba(239, 68, 68, 0.16); }

/* Full-bleed backdrop behind the hero, fading into the page. */
.links-page .lk-backdrop {
  position: absolute; z-index: 0; top: 0; left: 0; right: 0; height: min(78vh, 760px);
  overflow: hidden; pointer-events: none;
}
.links-page .lk-backdrop img {
  display: block; width: 100%; height: 100% !important; object-fit: cover; object-position: center 25%;
  opacity: 0.55;
}
.links-page .lk-backdrop::after {
  content: ""; position: absolute; top: 0; right: 0; bottom: 0; left: 0;
  background:
    linear-gradient(180deg, rgba(7, 7, 10, 0.7) 0%, rgba(7, 7, 10, 0.2) 30%, rgba(7, 7, 10, 0.75) 70%, #07070a 100%),
    linear-gradient(90deg, rgba(7, 7, 10, 0.85) 0%, rgba(7, 7, 10, 0.2) 60%);
}

.links-page .stream-links-container {
  position: relative; z-index: 1; max-width: 1240px; padding: 104px var(--lk-pad) 40px;
}
.links-page .back-nav { margin-bottom: 18px; }
.links-page .back-btn {
  background: rgba(0, 0, 0, 0.45); border: 1px solid rgba(255, 255, 255, 0.14); border-radius: 999px;
  padding: 8px 16px; color: #fff;
}

/* Hero: poster + info, no boxed card */
.links-page .content-preview {
  display: flex; align-items: flex-end; margin-bottom: 30px; padding: 0;
  background: none !important; border: 0 !important; box-shadow: none !important;
}
.links-page .content-image {
  flex: 0 0 auto; width: 240px; margin-right: 34px; border-radius: 14px; overflow: hidden;
  box-shadow: 0 22px 60px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(255, 255, 255, 0.08);
}
.links-page .content-image img { display: block; width: 100%; height: auto !important; }
.links-page--sport .content-image { width: 380px; }
.links-page .content-info { min-width: 0; }
.links-page .content-title {
  margin: 0 0 12px; font-size: clamp(2rem, 4.6vw, 3.6rem); line-height: 1.04; font-weight: 800;
  letter-spacing: -0.02em; text-shadow: 0 2px 24px rgba(0, 0, 0, 0.5);
}
.links-page .content-description {
  max-width: 720px; margin: 0 0 16px; font-size: 1rem; line-height: 1.6; color: rgba(255, 255, 255, 0.85);
  display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden;
}
.links-page .content-meta { display: flex; flex-wrap: wrap; margin-bottom: 18px; }
.links-page .meta-tag {
  margin: 0 8px 8px 0; padding: 6px 12px; border-radius: 999px; font-size: 0.82rem; font-weight: 700;
  color: #fff !important; background: rgba(255, 255, 255, 0.1) !important; border: 1px solid rgba(255, 255, 255, 0.12);
}
.links-page .lk-actions { display: flex; flex-wrap: wrap; }
.links-page .lk-btn {
  display: inline-flex; align-items: center; min-height: 48px; margin: 0 12px 10px 0; padding: 0 22px;
  border-radius: 10px; font-weight: 750; font-size: 0.98rem; text-decoration: none; color: #fff;
  transition: transform 0.15s ease, background-color 0.15s ease;
}
.links-page .lk-btn svg { width: 20px; height: 20px; margin-right: 8px; fill: currentColor; }
.links-page .lk-btn:hover { transform: translateY(-1px); }
.links-page .lk-btn:focus-visible { outline: 3px solid #fff; outline-offset: 3px; }
.links-page .lk-btn--primary { background: var(--lk-accent); }
.links-page .lk-btn--ghost { background: rgba(255, 255, 255, 0.14); }
.links-page .lk-btn--ghost:hover { background: rgba(255, 255, 255, 0.24); }
.links-page .lk-anchor { position: relative; top: -110px; }

/* Download bar */
.links-page .watch-download-bar {
  margin: 0 0 26px; padding: 18px 20px; border-radius: 14px;
  background: linear-gradient(135deg, var(--lk-accent-soft), rgba(255, 255, 255, 0.03)) !important;
  border: 1px solid rgba(255, 255, 255, 0.1) !important;
}
.links-page .watch-download-cta { background: var(--lk-accent) !important; border-color: transparent !important; border-radius: 10px; }

/* Servers: compact cards */
.links-page .sources-header { margin: 8px 0 14px; border: 0; padding: 0; scroll-margin-top: 110px; }
.links-page .sources-title span { font-size: 1.35rem; font-weight: 800; }
.links-page .sources-grid { grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); grid-gap: 12px; }
.links-page .source-card {
  padding: 14px 16px; border-radius: 12px; background: rgba(255, 255, 255, 0.05) !important;
  border: 1px solid rgba(255, 255, 255, 0.08) !important; box-shadow: none !important;
  transition: border-color 0.15s ease, transform 0.15s ease;
}
.links-page .source-card:hover { transform: translateY(-2px); border-color: var(--lk-accent) !important; }
.links-page .source-card.is-default { background: var(--lk-accent-soft) !important; border-color: var(--lk-accent) !important; }
.links-page .source-icon { background: var(--lk-accent) !important; }
.links-page .source-description { font-size: 0.8rem; }
.links-page .source-name-wrapper { min-width: 0; }
.links-page .source-name { white-space: normal; overflow: visible; text-overflow: clip; line-height: 1.25; }
.links-page .source-header { flex-wrap: wrap; }

/* Cast: horizontal scroller instead of a tall grid */
.links-page .cast-section, .links-page .additional-info-section { margin-top: 36px; }
.links-page .cast-grid {
  display: flex !important; overflow-x: auto; scroll-snap-type: x proximity; padding-bottom: 10px;
  scrollbar-width: thin;
}
.links-page .cast-card {
  flex: 0 0 140px; margin-right: 12px; scroll-snap-align: start; padding: 0 !important;
  background: none !important; border: 0 !important;
}
.links-page .cast-image-wrapper { border-radius: 12px; overflow: hidden; aspect-ratio: 2 / 3; }
.links-page .cast-image-wrapper img { width: 100%; height: 100% !important; object-fit: cover; }

/* Details: neat fact grid */
.links-page .additional-info-grid { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); grid-gap: 10px; }
.links-page .info-item { border-radius: 12px; background: rgba(255, 255, 255, 0.04) !important; border: 1px solid rgba(255, 255, 255, 0.07) !important; }

@media (max-width: 760px) {
  .links-page .stream-links-container { padding-top: 88px; }
  .links-page .content-preview { flex-direction: column; align-items: flex-start; text-align: left; }
  .links-page .content-info, .links-page .content-title, .links-page .content-description { text-align: left !important; }
  .links-page .content-meta { justify-content: flex-start !important; }
  .links-page .content-image { width: 150px; margin: 0 0 18px; }
  .links-page--sport .content-image { width: 100%; }
  .links-page .lk-backdrop { height: 560px; }
  .links-page .lk-btn { flex: 1 1 auto; justify-content: center; }
  .links-page .sources-grid { grid-template-columns: 1fr 1fr; }
  .links-page .cast-card { flex-basis: 112px; }
}
@media (prefers-reduced-motion: reduce) {
  .links-page .lk-btn, .links-page .source-card { transition: none; }
}
