/* assets/cookie-consent.css
 * Path: assets/cookie-consent.css
 *
 * Description:
 *   Combined Age Gate (18+) + GDPR Cookie Consent dialog styles.
 *   Reuses the site's existing glassmorphism design language.
 *   s dark and light themes via html[data-theme].
 *
 * Created: 2026-03-12
 */

/* ── Gate overlay ───────────────────────────────────────── */
/* CLS fix: compensate for scrollbar width when locking scroll to prevent layout shift */
body.ageGateOpen {
  overflow: hidden;
  padding-right: var(--scrollbar-w, 0px);
}

#ugGate {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(0,0,0,.60);
  backdrop-filter: blur(12px) saturate(120%);
  -webkit-backdrop-filter: blur(12px) saturate(120%);
  transition: opacity .3s ease;
}

#ugGate[hidden] { display: none !important; }

#ugGate.is-fading {
  opacity: 0;
  pointer-events: none;
}

/* Legal page non-blocking mode */
#ugGate.is-legal-page {
  background: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  pointer-events: none;
  align-items: flex-end;
}
#ugGate.is-legal-page #ugGateCard {
  pointer-events: auto;
  box-shadow: 0 -8px 40px rgba(0,0,0,.50), 0 0 0 1px rgba(0,0,0,.30);
  margin-bottom: 0;
  border-bottom-left-radius: 0;
  border-bottom-right-radius: 0;
}

/* ── Card ───────────────────────────────────────────────── */
#ugGateCard {
  position: relative;
  width: min(720px, 100%);
  max-height: calc(100vh - 48px);
  overflow-y: auto;
  border-radius: 12px;
  padding: 22px 24px 18px;
  background: rgba(15,15,15,.92);
  border: 1px solid rgba(255,255,255,.14);
  box-shadow:
    0 18px 60px rgba(0,0,0,.60),
    0 0 0 1px rgba(0,0,0,.35);
}

#ugGateCard::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  background: linear-gradient(to bottom, rgba(255,255,255,.08), rgba(255,255,255,0) 40%);
}

html[data-theme="light"] #ugGateCard {
  background: rgba(255,255,255,.96);
  border-color: rgba(0,0,0,.10);
  box-shadow: 0 20px 60px rgba(0,0,0,.15), 0 0 0 1px rgba(0,0,0,.06);
}
html[data-theme="light"] #ugGateCard::before {
  background: linear-gradient(to bottom, rgba(0,0,0,.02), rgba(0,0,0,0) 35%);
}

/* ── Logo ───────────────────────────────────────────────── */
.ugcLogo {
  display: block;
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -.02em;
  color: rgba(255,255,255,.90);
  margin-bottom: 14px;
}
html[data-theme="light"] .ugcLogo { color: rgba(0,0,0,.88); }

/* ── Age section ────────────────────────────────────────── */
#ugGateAge h2 {
  margin: 0 0 8px;
  font-size: 22px;
  line-height: 1.2;
  color: rgba(255,255,255,.92);
}
#ugGateAge p {
  margin: 0 0 12px;
  font-size: 13.5px;
  line-height: 1.55;
  color: rgba(255,255,255,.70);
}
#ugGateAge[hidden] { display: none; }

html[data-theme="light"] #ugGateAge h2 { color: rgba(0,0,0,.88); }
html[data-theme="light"] #ugGateAge p { color: rgba(0,0,0,.60); }

/* ── Cookie intro text ──────────────────────────────────── */
.ugGateCookieIntro {
  margin: 0 0 8px;
  font-size: 13px;
  line-height: 1.55;
  color: rgba(255,255,255,.60);
  border-top: 1px solid rgba(255,255,255,.08);
  padding-top: 12px;
}
html[data-theme="light"] .ugGateCookieIntro {
  color: rgba(0,0,0,.55);
  border-top-color: rgba(0,0,0,.08);
}

/* ── Scrollable content / links ─────────────────────────── */
.ugcScrollContent p { margin: 0 0 8px; font-size: 13px; line-height: 1.5; color: rgba(255,255,255,.60); }
html[data-theme="light"] .ugcScrollContent p { color: rgba(0,0,0,.55); }

.ugcScrollContent a,
.ugcLearnMore a { color: #5aa0ff; text-decoration: underline; text-underline-offset: 2px; }
.ugcScrollContent a:hover,
.ugcLearnMore a:hover { color: #7db8ff; }
html[data-theme="light"] .ugcScrollContent a,
html[data-theme="light"] .ugcLearnMore a { color: #2a72d6; }

.ugcLearnMore { font-size: 12px; color: rgba(255,255,255,.45); }
.ugcLearnMore p { font-size: 12px; margin: 0; }
html[data-theme="light"] .ugcLearnMore { color: rgba(0,0,0,.45); }

/* ── Action buttons ─────────────────────────────────────── */
.ugcActions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 16px; }

.ugcBtn {
  flex: 1 1 auto;
  min-width: 140px;
  padding: 11px 16px;
  border-radius: 10px;
  border: 1px solid transparent;
  font-size: 14px;
  font-weight: 700;
  text-align: center;
  cursor: pointer;
  transition: filter .15s ease;
  font-family: inherit;
  line-height: 1.2;
}
.ugcBtn:hover { filter: brightness(1.1); }

.ugcBtnAcceptAll {
  background: rgba(80,140,255,.22);
  border-color: rgba(80,140,255,.55);
  color: rgba(255,255,255,.93);
}
html[data-theme="light"] .ugcBtnAcceptAll { background: #2a72d6; border-color: #2a72d6; color: #fff; }

.ugcBtnEssential {
  background: rgba(255,255,255,.06);
  border-color: rgba(255,255,255,.16);
  color: rgba(255,255,255,.80);
}
html[data-theme="light"] .ugcBtnEssential { background: rgba(0,0,0,.04); border-color: rgba(0,0,0,.14); color: rgba(0,0,0,.70); }

.ugcBtnCustomize {
  background: transparent;
  border-color: rgba(255,255,255,.12);
  color: rgba(255,255,255,.65);
}
html[data-theme="light"] .ugcBtnCustomize { border-color: rgba(0,0,0,.12); color: rgba(0,0,0,.55); }

/* ── Leave link ─────────────────────────────────────────── */
.ugGateLeave {
  text-align: center;
  margin-top: 14px;
}
.ugGateLeave[hidden] { display: none; }
.ugGateLeave a {
  color: rgba(255,80,80,.80);
  text-decoration: underline;
  text-underline-offset: 2px;
  font-size: 13px;
  font-weight: 600;
}
.ugGateLeave a:hover { color: rgba(255,80,80,1); }
html[data-theme="light"] .ugGateLeave a { color: #c0392b; }

/* ── Fine print ─────────────────────────────────────────── */
.ageGateFine {
  margin-top: 10px;
  font-size: 11.5px;
  line-height: 1.35;
  color: rgba(255,255,255,.40);
  text-align: center;
}
.ageGateFine[hidden] { display: none; }
html[data-theme="light"] .ageGateFine { color: rgba(0,0,0,.40); }

/* ── Customize  ────────────────────────────────────── */
.ugcCustomize {
  display: none;
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid rgba(255,255,255,.08);
}
html[data-theme="light"] .ugcCustomize { border-top-color: rgba(0,0,0,.08); }
.ugcCustomize.is-open { display: block; }
.ugcCustomize h3 { margin: 0 0 10px; font-size: 15px; font-weight: 700; color: rgba(255,255,255,.88); }
html[data-theme="light"] .ugcCustomize h3 { color: rgba(0,0,0,.85); }

/* Category rows */
.ugcCatRow { display: flex; align-items: flex-start; gap: 12px; padding: 10px 0; border-bottom: 1px solid rgba(255,255,255,.06); }
html[data-theme="light"] .ugcCatRow { border-bottom-color: rgba(0,0,0,.06); }
.ugcCatRow:last-of-type { border-bottom: none; }
.ugcCatInfo { flex: 1 1 auto; }
.ugcCatName { font-size: 13.5px; font-weight: 600; color: rgba(255,255,255,.88); }
html[data-theme="light"] .ugcCatName { color: rgba(0,0,0,.82); }
.ugcCatDesc { margin-top: 3px; font-size: 12px; line-height: 1.45; color: rgba(255,255,255,.50); }
html[data-theme="light"] .ugcCatDesc { color: rgba(0,0,0,.50); }

/* Toggle switch */
.ugcToggle { flex: 0 0 auto; position: relative; width: 42px; height: 24px; margin-top: 2px; }
.ugcToggle input { opacity: 0; width: 0; height: 0; position: absolute; }
.ugcToggleTrack {
  position: absolute; inset: 0; border-radius: 12px;
  background: rgba(255,255,255,.12); cursor: pointer; transition: background .2s ease;
}
.ugcToggleTrack::after {
  content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px;
  border-radius: 50%; background: rgba(255,255,255,.70); transition: transform .2s ease, background .2s ease;
}
.ugcToggle input:checked + .ugcToggleTrack { background: rgba(90,160,255,.50); }
.ugcToggle input:checked + .ugcToggleTrack::after { transform: translateX(18px); background: #5aa0ff; }
.ugcToggle input:disabled + .ugcToggleTrack { opacity: .5; cursor: not-allowed; }

html[data-theme="light"] .ugcToggleTrack { background: rgba(0,0,0,.12); }
html[data-theme="light"] .ugcToggleTrack::after { background: rgba(0,0,0,.50); }
html[data-theme="light"] .ugcToggle input:checked + .ugcToggleTrack { background: rgba(42,114,214,.40); }
html[data-theme="light"] .ugcToggle input:checked + .ugcToggleTrack::after { background: #2a72d6; }

/* Always active label */
.ugcAlwaysOn { display: inline-block; font-size: 11px; font-weight: 600; color: rgba(90,160,255,.80); margin-top: 2px; }
html[data-theme="light"] .ugcAlwaysOn { color: #2a72d6; }

/* Save button */
.ugcBtnSave {
  margin-top: 14px; width: 100%; padding: 11px 16px; border-radius: 10px;
  border: 1px solid rgba(90,160,255,.55); background: rgba(90,160,255,.20);
  color: rgba(255,255,255,.93); font-size: 14px; font-weight: 700;
  cursor: pointer; font-family: inherit; transition: filter .15s ease;
}
.ugcBtnSave:hover { filter: brightness(1.1); }
html[data-theme="light"] .ugcBtnSave { background: #2a72d6; border-color: #2a72d6; color: #fff; }

/* Manage cookies link (footer) */
.ugcManageLink { cursor: pointer; color: inherit; text-decoration: underline; text-underline-offset: 2px; background: none; border: none; font: inherit; padding: 0; }
.ugcManageLink:hover { color: #5aa0ff; }

/* ── Responsive ─────────────────────────────────────────── */
@media (max-width: 560px) {
  #ugGateCard { margin: 0 8px; padding: 16px 16px 14px; border-radius: 12px; }
  .ugcActions { flex-direction: column; }
  .ugcBtn { min-width: 100%; }
}
