/**
 * Spontydex "Night Feed" — shared backdrop + glass treatment
 *
 * Brings the home page's drifting card-wall background and dark glass look to
 * the secondary pages (privacy / terms / community-guidelines / 404).
 * Load AFTER theme.css so the overrides below win.
 *
 * Markup each page needs:
 *   <div class="card-wall" aria-hidden="true"></div>   (filled by /scripts/cardwall.js)
 *   <div class="night-scrim" aria-hidden="true"></div>
 *   <nav class="site-nav">…</nav>
 * Also requires the MDI icon font stylesheet.
 */

/* ===== Keyframes ===== */
@keyframes feedUp { from { transform: translateY(0); } to { transform: translateY(-50%); } }
@keyframes livePulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.5); } 50% { box-shadow: 0 0 0 8px rgba(239, 68, 68, 0); } }

/* ===== Fixed card wall (site-wide backdrop) ===== */
.card-wall {
  position: fixed;
  inset: -12%;
  z-index: 0;
  display: flex;
  justify-content: center;
  gap: 22px;
  transform: rotate(-4deg) scale(1.08);
  pointer-events: none;
  opacity: 0.9;
}
.wall-col { width: 330px; flex-shrink: 0; overflow: hidden; }
.wall-track { display: flex; flex-direction: column; animation: feedUp 70s linear infinite; }
.wall-col:nth-child(2) .wall-track { animation-duration: 86s; animation-delay: -30s; }
.wall-col:nth-child(3) .wall-track { animation-duration: 62s; animation-delay: -14s; }
/* margin (not flex gap) so the -50% loop point lands exactly on the copy */
.wall-card { width: 330px; margin-bottom: 22px; }

/* Dark fill over the drifting card wall so foreground text stays readable.
   Mirrors the home page's flat rgba(0,0,0,0.6) hero/post-hero fill. */
.night-scrim {
  position: fixed;
  inset: 0;
  z-index: 0;
  background: rgba(0, 0, 0, 0.62);
  pointer-events: none;
}

/* ===== MeetupCard (static recreation of the app card) ===== */
.mcard {
  border-radius: 16px;
  border: 0.5px solid rgba(153, 246, 228, 0.12);
  background: rgba(8, 14, 16, 0.85);
  padding: 12px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.mcard-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 24px; }
.mcard-top-left { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; }
.mcard-top-right { display: flex; align-items: center; gap: 6px; }
.mcard-countdown { font-size: 13px; font-weight: 600; line-height: 16px; color: #FBBF24; }
.mcard-title-row { display: flex; align-items: center; gap: 10px; }
.mcard-emoji { font-size: 22px; line-height: 28px; width: 28px; text-align: center; flex-shrink: 0; }
.mcard-title { margin: 0; font-size: 19px; font-weight: 600; line-height: 26px; color: #F7F9FA; }
.mcard-meta { display: flex; align-items: center; gap: 5px; font-size: 12.5px; line-height: 16px; color: #9ca3af; }
.mcard-meta .mdi { font-size: 14px; line-height: 1; }
.mcard-cats { display: flex; flex-wrap: wrap; gap: 6px; }
.mcard-bottom { display: flex; align-items: center; justify-content: space-between; }
.sheet-hint { display: flex; flex-direction: column; align-items: center; gap: 2px; }
.sheet-handle { width: 22px; height: 3px; border-radius: 2px; background: #374151; }
.sheet-hint .mdi { font-size: 16px; line-height: 1; color: #9ca3af; }

/* ===== Pills ===== */
.pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 500;
  line-height: 16px;
  white-space: nowrap;
}
.pill .mdi { font-size: 12px; line-height: 1; }
.pill--group { background: rgba(45, 212, 191, 0.12); border: 1px solid rgba(45, 212, 191, 0.3); color: #2DD4BF; }
.pill--cat { background: #1f2937; color: #F7F9FA; }

/* LIVE badge */
.badge-live {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 6px;
  border-radius: 12px;
  background: #EF4444;
  color: #ffffff;
  font-size: 9px;
  font-weight: 600;
  line-height: 12px;
}
.badge-live-dot { width: 6px; height: 6px; border-radius: 3px; background: #ffffff; }

/* ===== Avatars ===== */
.avatar-stack { display: flex; align-items: center; }
.avatar {
  position: relative;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 1.5px solid #121212;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 800;
  color: #0b0f10;
  flex-shrink: 0;
}
.avatar + .avatar, .avatar + .avatar-more { margin-left: -8px; }
.avatar--host { border-color: #4ADE80; }
.avatar-crown {
  position: absolute;
  top: -5px;
  left: 50%;
  margin-left: -5px;
  width: 10px;
  height: 10px;
  border-radius: 5px;
  background: #4ADE80;
  border: 1px solid #121212;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1;
}
.avatar-crown .mdi { font-size: 6px; line-height: 1; color: #000000; }
.avatar-more {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #374151;
  border: 1.5px solid #121212;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 600;
  color: #ffffff;
  flex-shrink: 0;
}

/* ===== Top nav — sits at the top of the page and scrolls away (not pinned) ===== */
.site-nav {
  position: absolute;
  top: 0; left: 0; right: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 24px;
}
.nav-brand { display: flex; align-items: center; gap: 13px; text-decoration: none; }
.nav-brand:hover { text-decoration: none; }
.nav-brand img { width: 62px; height: 62px; display: block; filter: drop-shadow(0 0 16px rgba(45, 212, 191, 0.55)); }
.nav-brand span { font-size: 31px; font-weight: 800; letter-spacing: -0.7px; color: #F7F9FA; text-shadow: 0 2px 18px rgba(0, 0, 0, 0.6); }
/* Same pill as the mobile login buttons / home-page store buttons. */
.nav-cta {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 9px 18px;
  border-radius: 999px;
  background: rgba(10, 16, 18, 0.98);
  border: 0.5px solid rgba(153, 246, 228, 0.35);
  color: #F7F9FA;
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  box-shadow: 0 0 14px rgba(45, 212, 191, 0.22);
  transition: all 0.25s ease;
}
.nav-cta .mdi { font-size: 14px; line-height: 1; color: #F7F9FA; }
.nav-cta:hover {
  transform: translateY(-1px);
  box-shadow: 0 0 20px rgba(45, 212, 191, 0.32);
  color: #F7F9FA;
  text-decoration: none;
}

/* ===== Legal-page layout over the night feed ===== */
.app-container {
  position: relative;
  z-index: 2;
  padding-top: 116px;
}

.page-header {
  border-bottom: none;
  padding-bottom: var(--spacing-md);
}
.page-title {
  font-size: 30px;
  letter-spacing: -0.5px;
  text-shadow: 0 2px 24px rgba(0, 0, 0, 0.7);
}

/* Content card → frosted glass like the app's MeetupCard */
.card {
  background: rgba(8, 14, 16, 0.78);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border: 1px solid rgba(45, 212, 191, 0.16);
  border-radius: 16px;
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.45);
}

/* Contact / alert boxes already use teal tint — deepen so they read on glass */
.contact-box, .alert-info {
  background: rgba(45, 212, 191, 0.08);
  border-color: rgba(45, 212, 191, 0.22);
}

.page-footer {
  position: relative;
  z-index: 2;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

@media (max-width: 640px) {
  .app-container { padding-top: 96px; }
  .site-nav { padding: 14px 18px; }
  .nav-brand { gap: 10px; }
  .nav-brand img { width: 46px; height: 46px; }
  .nav-brand span { font-size: 23px; letter-spacing: -0.5px; }
  .page-title { font-size: 25px; }
}
