/* ============================================================
   MINDSTATZ — site.css
   Additions for the Hostinger build: member modals, library,
   video detail view. Builds on the tokens in styles.css.
   ============================================================ */

[hidden] { display: none !important; }

.burger { background: none; border: none; }
.nav-btn { padding: 0.45rem 1.2rem; font-size: 0.65rem; }
.grid-note { grid-column: 1 / -1; text-align: center; color: var(--text-muted); padding: 2rem; font-size: 0.85rem; }

/* ── Cards ─────────────────────────────────────────────────── */
.clip-card { display: block; width: 100%; padding: 0; text-align: left; font: inherit; color: inherit; }
.clip-card .media-fill, .clip-card img, .clip-card video {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block;
}
.media-fill {
  background: radial-gradient(ellipse at 30% 30%, rgba(107,63,160,0.35), transparent 60%),
              radial-gradient(ellipse at 75% 80%, rgba(201,168,76,0.18), transparent 55%),
              var(--bg-elevated);
}
.clip-card .hover-trailer { opacity: 0; transition: opacity 0.3s; }
.clip-card:hover .hover-trailer { opacity: 1; }
.clip-badge.owned { background: rgba(79,212,138,0.14); border: 1px solid rgba(79,212,138,0.45); color: #8fe0b0; }
.clip-price { font-family: var(--font-display); font-size: 1.05rem; color: var(--gold-light); margin-left: auto; }
.clip-row { display: flex; align-items: baseline; gap: 0.75rem; }
.clip-card .clip-overlay { z-index: 2; }
.clip-card .clip-badge, .clip-card .play-btn-overlay { z-index: 3; }

/* ── Library ───────────────────────────────────────────────── */
.library-list { display: grid; gap: 1rem; }
.lib-item {
  display: grid; grid-template-columns: 160px minmax(0, 1fr) auto; gap: 1.25rem; align-items: center;
  background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-md); padding: 0.85rem;
}
.lib-thumb { position: relative; aspect-ratio: 16 / 10; border-radius: var(--radius-sm); overflow: hidden; }
.lib-thumb img, .lib-thumb .media-fill { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.lib-title { font-family: var(--font-display); font-size: 1.25rem; color: var(--text-primary); }
.lib-meta { font-size: 0.68rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--text-muted); margin-top: 0.2rem; }
.lib-actions { display: flex; gap: 0.5rem; flex-wrap: wrap; justify-content: flex-end; }
.lib-actions .btn { padding: 0.55rem 1.1rem; font-size: 0.62rem; }
.lib-empty { text-align: center; color: var(--text-secondary); padding: 2rem; border: 1px dashed var(--border); border-radius: var(--radius-md); }

/* ── Modals ────────────────────────────────────────────────── */
.modal {
  position: fixed; inset: 0; z-index: 9990; display: flex; align-items: center; justify-content: center;
  padding: 16px; background: rgba(8,8,8,0.9); backdrop-filter: blur(14px); overflow-y: auto;
}
.modal-box {
  position: relative; width: 100%; max-width: 420px; margin: auto;
  background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-lg);
  padding: 2.5rem 2rem 2rem; box-shadow: var(--glow-violet);
}
.modal-wide { max-width: 860px; padding: 0; overflow: hidden; display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); }
.modal-close {
  position: absolute; top: 0.75rem; right: 0.9rem; z-index: 5; background: rgba(8,8,8,0.55); border: none;
  color: var(--text-secondary); font-size: 1.5rem; line-height: 1; width: 2.2rem; height: 2.2rem; border-radius: 50%; cursor: pointer;
}
.modal-close:hover { color: var(--gold); }
.modal-head { text-align: center; margin-bottom: 1.5rem; }
.modal-head .nav-logo { font-size: 1.4rem; display: block; }
.modal-head h3 { font-size: 1.7rem; }
.modal-sub { font-size: 0.82rem; margin-top: 0.4rem; }
.modal-links { text-align: center; margin-top: 1.1rem; font-size: 0.75rem; color: var(--text-muted); display: grid; gap: 0.4rem; }
.modal-links button { background: none; border: none; color: var(--gold); font: inherit; cursor: pointer; padding: 0; text-decoration: underline; text-underline-offset: 3px; }
.btn-block { width: 100%; justify-content: center; }
.form-error { color: #f09595; font-size: 0.78rem; margin: 0 0 0.75rem; text-align: center; }
.check { display: flex; gap: 0.6rem; align-items: flex-start; font-size: 0.75rem; color: var(--text-secondary); margin: 0.25rem 0 1rem; line-height: 1.5; }
.check input { margin-top: 0.2rem; accent-color: var(--gold); }
#auth-form .form-group { margin-bottom: 0.75rem; }
.om-text { font-size: 0.88rem; margin-bottom: 1rem; }
.om-ref { font-size: 0.72rem; color: var(--text-muted); margin-bottom: 1.25rem; }
.om-ref code { color: var(--gold-light); user-select: all; }

/* Video detail */
.vm-media { position: relative; background: #000; min-height: 280px; }
.vm-media video, .vm-media img, .vm-media .media-fill { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.vm-media video { object-fit: contain; background: #000; }
.vm-body { padding: 2.25rem 1.75rem 1.75rem; display: flex; flex-direction: column; gap: 0.6rem; }
.vm-badges { display: flex; gap: 0.4rem; flex-wrap: wrap; }
.vm-badges .clip-badge { position: static; }
.vm-body h3 { font-size: 1.9rem; }
.vm-meta { font-size: 0.68rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--text-muted); }
.vm-desc { font-size: 0.88rem; white-space: pre-line; }
.vm-actions { display: grid; gap: 0.6rem; margin-top: auto; padding-top: 1rem; }
.vm-actions .btn { justify-content: center; }
.vm-price { font-family: var(--font-display); font-size: 1.6rem; color: var(--gold-light); }

/* Player */
.player-actions { display: flex; gap: 0.75rem; justify-content: center; flex-wrap: wrap; margin-top: 1.5rem; }
.vr-note { text-align: center; margin-top: 1.5rem; font-size: 0.72rem; letter-spacing: 0.1em; color: var(--text-muted); }
#paywall-overlay .btn { margin: 0 auto 0.6rem; }

/* Contact honeypot */
.hp-field { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

a:focus-visible, button:focus-visible, .clip-card:focus-visible, input:focus-visible, textarea:focus-visible {
  outline: 2px solid var(--gold); outline-offset: 3px;
}

@media (max-width: 768px) {
  .modal-wide { grid-template-columns: 1fr; }
  .vm-media { min-height: 0; aspect-ratio: 16 / 9; }
  .lib-item { grid-template-columns: 110px minmax(0, 1fr); }
  .lib-actions { grid-column: 1 / -1; justify-content: stretch; }
  .lib-actions .btn { flex: 1; justify-content: center; }
  .admin-grid-2 { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-delay: 0ms !important; transition-duration: 0.01ms !important; }
  .hero-eyebrow, .hero h1, .hero p, .hero-actions, .scroll-hint, .reveal { opacity: 1 !important; transform: none !important; }
}

/* Narrow phones: one card per row so badges and titles don't collide */
.clip-row { flex-wrap: wrap; row-gap: 0.1rem; }
@media (max-width: 560px) {
  .gallery-grid { grid-template-columns: 1fr; }
}

/* Age-locked (explicit) videos: lock overlay always visible, no play button */
.clip-card.age-locked .lock-overlay { opacity: 1; background: rgba(8,8,8,0.72); }
.clip-card.age-locked .play-btn-overlay { display: none; }
.grid-note.age-note { color: var(--text-secondary); font-size: 0.9rem; }


/* ── Clips4sale external hub button (top right, hides at the gallery) ── */
.c4s-float {
  position: fixed; top: 88px; right: 18px; z-index: 900;
  display: inline-flex; align-items: center; gap: 0.5rem;
  padding: 0.6rem 1.1rem; border-radius: 999px;
  font-size: 0.68rem; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--gold-light); background: rgba(8,8,8,0.78); border: 1px solid var(--border-hover);
  backdrop-filter: blur(10px); box-shadow: var(--glow-gold);
  transition: opacity 0.35s, transform 0.35s, background 0.2s, color 0.2s;
}
.c4s-float:hover, .c4s-float:focus-visible { background: var(--gold); color: #000; }
.c4s-float.is-hidden {
  opacity: 0; transform: translateY(-10px); pointer-events: none; visibility: hidden;
  transition: opacity 0.35s, transform 0.35s, visibility 0s 0.35s;
}
@media (max-width: 560px) { .c4s-float { top: 76px; right: 12px; padding: 0.5rem 0.85rem; font-size: 0.6rem; } }

/* ── Membership plan cards ── */
.plans-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 1.5rem; max-width: 980px; margin: 0 auto; }
.plan-card {
  position: relative; display: flex; flex-direction: column; gap: 0.75rem; padding: 2.25rem 1.5rem 1.5rem;
  background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-lg);
}
.plan-card.featured { border-color: var(--gold); box-shadow: var(--glow-gold); }
.plan-badge {
  position: absolute; top: -0.7rem; left: 50%; transform: translateX(-50%); white-space: nowrap;
  background: var(--gold); color: #000; font-size: 0.6rem; font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase;
  padding: 0.3rem 0.85rem; border-radius: 999px;
}
.plan-name { font-family: var(--font-display); font-size: 1.6rem; text-align: center; }
.plan-price { font-family: var(--font-display); font-size: 2.4rem; text-align: center; color: var(--gold-light); line-height: 1; }
.plan-price span { font-family: var(--font-body); font-size: 0.7rem; letter-spacing: 0.1em; color: var(--text-secondary); }
.plan-desc { text-align: center; font-size: 0.85rem; color: var(--text-secondary); }
.plan-features { list-style: none; display: grid; gap: 0.5rem; margin: 0.25rem 0 0.75rem; font-size: 0.82rem; color: var(--text-secondary); }
.plan-features li { position: relative; padding-left: 1.4rem; }
.plan-features li::before { content: '✓'; position: absolute; left: 0; color: var(--gold); }
.plan-card .btn { margin-top: auto; }


/* ── VR options row under the player (auto-hide switch) ── */
.vr-options { display: flex; justify-content: center; margin-top: 1.25rem; }
.vr-toggle { display: inline-flex; align-items: center; gap: 0.75rem; cursor: pointer; font-size: 0.78rem; letter-spacing: 0.06em; color: var(--text-secondary); user-select: none; }
.vr-toggle input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.vr-toggle-track { position: relative; flex: none; width: 42px; height: 24px; border-radius: 12px; background: rgba(255,255,255,0.14); border: 1px solid var(--border); transition: background 0.2s; }
.vr-toggle-track::after { content: ''; position: absolute; top: 2px; left: 2px; width: 18px; height: 18px; border-radius: 50%; background: #fff; transition: transform 0.2s; }
.vr-toggle input:checked + .vr-toggle-track { background: var(--gold); }
.vr-toggle input:checked + .vr-toggle-track::after { transform: translateX(18px); background: #000; }
.vr-toggle input:focus-visible + .vr-toggle-track { outline: 2px solid var(--gold-light); outline-offset: 2px; }


/* ── Pay with crypto (plan cards) ── */
.plan-crypto { margin-top: -0.25rem; }
.plan-crypto-note { text-align: center; font-size: 0.68rem; line-height: 1.4; color: var(--text-muted); margin: 0; }


/* ── Link-exchange banner (footer) ──
   The footer is a wrapping flexbox, so flex-basis:100% drops this onto its own row at the very bottom.
   The text styling below only ever shows if the remote image fails to load: the browser then renders the
   alt text, which is still a working link. */
.ex-banner {
  flex: 1 1 100%;    /* shrink allowed: flex-shrink:0 let the 468px image force the row wider than the footer */
  min-width: 0;      /* defeats a flex item's automatic minimum size, which is the image's intrinsic width */
  display: flex;
  justify-content: center;
  margin-top: 0.5rem;
  padding-top: 1.75rem;
  border-top: 1px solid var(--border);
  font-size: 0.68rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted);
  transition: color 0.2s;
}
.ex-banner:hover, .ex-banner:focus-visible { color: var(--gold); }
.ex-banner img {
  display: block;
  width: auto;
  /* Capped three ways so the banner cannot overflow even if the footer's own layout changes:
     its real size, the space inside the footer, and the viewport itself. */
  max-width: min(480px, 100%, calc(100vw - 5rem));   /* 480px is the banner's real width */
  height: auto;
  border: 0;
  border-radius: var(--radius-sm);
  opacity: 0.85;
  transition: opacity 0.2s;
}
.ex-banner:hover img, .ex-banner:focus-visible img { opacity: 1; }

/* Pre-existing footer bug, fixed here rather than in styles.css so it is easy to remove:
   .footer-links was flex with the default nowrap, so on a phone its six links forced the footer
   437px wide inside a 310px box. That let the whole page be panned sideways, and anything sized
   from the footer (the banner above) inherited the wrong width. Only narrow screens change. */
.footer-links {
  flex-wrap: wrap;
  justify-content: center;
  row-gap: 0.75rem;
}
