/* =============================================================
   Mountain Wubz — Admin & status-page styles
   Used by views/layout.js (admin pages, ticket detail, order
   confirmation, launch-soon). Public EJS pages use site.css.
   Palette mirrors site.css so the two surfaces feel like one
   product even though they share no markup.
   ============================================================= */

:root {
  --mw-cyan: #00E5FF;
  --mw-magenta: #FF26AF;
  --mw-pink: #EB1F79;
  --mw-purple: #B200FE;
  --mw-dark: #0a0a0a;
  --mw-dark-card: #101010;
  --mw-dark-card-hi: #131318;
  --mw-dark-border: #1f1f24;
  --mw-text: #e6e8ef;
  --mw-text-muted: #9aa0c4;
  --mw-radius: 0.75rem;
  --mw-radius-sm: 0.5rem;
  --mw-shadow-cyan: 0 8px 30px rgba(0, 229, 255, 0.18);
  --mw-shadow-magenta: 0 8px 30px rgba(235, 31, 121, 0.20);
}

/* --- Body / base ---
   Background gradient stays — the night-sky.css star layer is fixed at
   z-index:0 and adds atmospheric stars on top of this base. Keep body
   bg pure --mw-dark so the static dust shows clearly; the radial wash
   used to live here but is now provided by .mw-night-sky::after. */
body.mw-admin {
  background: var(--mw-dark);
  color: var(--mw-text);
}

/* Promote admin shell content above the fixed star layer.
   z-index:1 puts cards/sidebars above the stars (which sit at z-index:0
   inside .mw-night-sky). Dark card backgrounds (--mw-dark-card) are
   opaque so data is never obscured by a passing star. */
body.mw-admin .mw-admin-sidebar,
body.mw-admin .mw-admin-main,
body.mw-admin .mw-admin-topbar,
body.mw-admin .card,
body.mw-admin .tier-card,
body.mw-admin .admin-table,
body.mw-admin .mw-admin-nav {
  position: relative;
  z-index: 1;
}

/* Strengthen card opacity in admin so a shooting star passing behind a
   card never bleeds through. Card backgrounds were already solid; this
   is a guard for any future card variant that uses transparency. */
body.mw-admin .card {
  background: var(--mw-dark-card);
}
body.mw-admin a { color: var(--mw-cyan); }
body.mw-admin a:hover { color: #fff; }
body.mw-admin h1, body.mw-admin h2, body.mw-admin h3, body.mw-admin h4 {
  color: #fff;
  font-family: 'DM Sans', system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  font-weight: 700;
  letter-spacing: 0.2px;
}

/* =============================================================
   ADMIN TOP BAR (rendered in layout.js)
   ============================================================= */
.mw-admin-topbar {
  background: var(--mw-dark-card);
  border-bottom: 1px solid var(--mw-dark-border);
  padding: 14px 16px;
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(6px);
}
.mw-admin-topbar-inner {
  max-width: 1240px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.mw-admin-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: #fff;
  font-family: 'DM Sans', system-ui, sans-serif;
  font-weight: 700;
  font-size: 1.15rem;
  text-transform: uppercase;
  letter-spacing: 1.5px;
}
.mw-admin-brand img {
  height: 36px;
  width: auto;
  filter: drop-shadow(0 0 8px rgba(0, 229, 255, 0.35));
}
.mw-admin-brand:hover { color: var(--mw-cyan); }
.mw-admin-topbar-meta {
  color: var(--mw-text-muted);
  font-size: 0.85rem;
  letter-spacing: 1px;
  text-transform: uppercase;
}

.mw-admin-footer {
  text-align: center;
  color: #555;
  font-size: 0.8rem;
  padding: 32px 16px 24px;
  border-top: 1px solid var(--mw-dark-border);
  margin-top: 48px;
}

/* =============================================================
   ADMIN SIDEBAR SHELL (rendered by lib/adminNav.js + views/layout.js)
   2-column layout: fixed-width sidebar on the left, main scrolls on
   the right. Below ~900px the sidebar slides in as an overlay
   triggered by the .mw-admin-menu-btn hamburger.
   ============================================================= */
body.mw-admin-shell {
  display: flex;
  min-height: 100vh;
  margin: 0;
}
/* Hide the legacy single-column footer when we're in the sidebar
   shell. body.mw-admin-shell is display:flex, so the <footer> element
   that views/layout.js renders as a sibling of <main> ends up
   stretched as a flex item to the right of the main column — it
   surfaces as a stray "© 2026 Mountain Wubz Festival · All sales are
   final." string in the upper-right of admin pages. The footer
   belongs to the legacy ticket-detail / launching-soon path, not the
   sidebar shell, so suppress it here. */
body.mw-admin-shell .mw-admin-footer {
  display: none;
}

.mw-admin-sidebar {
  width: 240px;
  flex-shrink: 0;
  background: #0d1024;
  border-right: 1px solid rgba(255, 255, 255, 0.05);
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  padding: 22px 0 16px;
  z-index: 60;
}
.mw-side-brand {
  text-align: center;
  padding: 0 16px 14px;
}
.mw-side-brand-link {
  display: inline-block;
  text-decoration: none;
}
.mw-side-brand img {
  height: 44px;
  width: auto;
  filter: drop-shadow(0 0 10px rgba(0, 229, 255, 0.35));
}
.mw-side-brand-meta {
  margin-top: 8px;
  color: var(--mw-text-muted);
  font-size: 0.7rem;
  letter-spacing: 1.5px;
  text-transform: uppercase;
}
.mw-side-divider {
  height: 1px;
  background: rgba(255, 255, 255, 0.05);
  margin: 0 16px;
}
.mw-side-nav {
  flex: 1;
  padding: 14px 10px 4px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.mw-side-group {
  margin-top: 14px;
}
.mw-side-group:first-child { margin-top: 0; }
.mw-side-grouplabel {
  font-family: 'DM Sans', system-ui, sans-serif;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: #6b7090;
  padding: 6px 14px;
  margin: 4px 0 4px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}
.mw-side-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 14px;
  border-left: 3px solid transparent;
  color: var(--mw-text-muted);
  text-decoration: none;
  font-size: 0.88rem;
  font-weight: 500;
  border-radius: 0 6px 6px 0;
  transition: color 0.15s, background 0.15s, border-color 0.15s;
}
.mw-side-link:hover {
  color: #fff;
  background: rgba(0, 229, 255, 0.06);
}
.mw-side-link.active {
  color: #fff;
  background: rgba(0, 229, 255, 0.10);
  border-left-color: var(--mw-cyan);
}
.mw-side-top {
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  font-size: 0.82rem;
  margin-bottom: 4px;
}
.mw-side-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  color: var(--mw-cyan);
  flex-shrink: 0;
}
.mw-side-link.active .mw-side-icon { color: var(--mw-cyan); }
.mw-side-sub {
  padding-left: 22px;
}
.mw-side-dot {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.18);
  flex-shrink: 0;
  transition: background 0.15s;
}
.mw-side-link:hover .mw-side-dot { background: var(--mw-cyan); }
.mw-side-link.active .mw-side-dot { background: var(--mw-cyan); }

.mw-side-foot {
  padding: 10px 14px 6px;
}
.mw-side-logout {
  width: 100%;
  background: transparent;
  border: 1px solid rgba(255, 38, 175, 0.25);
  color: var(--mw-text-muted);
  padding: 8px 12px;
  border-radius: 8px;
  font-family: inherit;
  font-size: 0.82rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s, background 0.15s;
}
.mw-side-logout:hover {
  color: #fff;
  background: rgba(255, 38, 175, 0.10);
  border-color: var(--mw-magenta);
}

/* Main content column */
.mw-admin-main {
  flex: 1;
  min-width: 0;
  padding: 32px 36px 24px;
}

/* Mobile hamburger + backdrop (hidden on desktop) */
.mw-admin-menu-btn {
  display: none;
  position: fixed;
  top: 14px;
  left: 14px;
  width: 42px;
  height: 42px;
  align-items: center;
  justify-content: center;
  background: var(--mw-dark-card);
  border: 1px solid var(--mw-dark-border);
  color: var(--mw-cyan);
  border-radius: 8px;
  cursor: pointer;
  z-index: 70;
}
.mw-admin-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  z-index: 55;
}
.mw-admin-backdrop.is-open { display: block; }

@media (max-width: 900px) {
  .mw-admin-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    transform: translateX(-100%);
    transition: transform 0.25s ease;
    box-shadow: 6px 0 24px rgba(0, 0, 0, 0.5);
  }
  .mw-admin-sidebar.is-open { transform: translateX(0); }
  .mw-admin-menu-btn { display: inline-flex; }
  .mw-admin-main { padding: 72px 18px 24px; }
}
@media (min-width: 901px) {
  .mw-admin-menu-btn, .mw-admin-backdrop { display: none !important; }
}

/* =============================================================
   ADMIN SUB-NAV — legacy top-bar pill row, kept for any remaining
   call site that hasn't migrated. New admin chrome uses .mw-admin-
   sidebar above. Safe to delete once we're sure nothing renders
   the old <nav class="mw-admin-nav"> markup.
   ============================================================= */
/* =============================================================
   ADMIN SUB-NAV (rendered by adminLayout in admin*.js)
   Each anchor uses .btn-secondary today; we style a .mw-admin-nav
   wrapper for the active state. Pages can opt in by wrapping the
   nav strip with class="mw-admin-nav".
   ============================================================= */
.mw-admin-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 28px;
  padding: 10px 12px;
  background: var(--mw-dark-card);
  border: 1px solid var(--mw-dark-border);
  border-radius: var(--mw-radius);
}
.mw-admin-nav a {
  color: var(--mw-text-muted);
  text-decoration: none;
  font-size: 0.82rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  padding: 7px 12px;
  border-radius: 999px;
  transition: color 0.2s, background 0.2s;
}
.mw-admin-nav a:hover {
  color: #fff;
  background: rgba(0, 229, 255, 0.10);
}
.mw-admin-nav a.active {
  color: var(--mw-dark);
  background: var(--mw-cyan);
}
.mw-admin-nav .mw-admin-nav-spacer { flex: 1; }
.mw-admin-nav button {
  color: var(--mw-text-muted);
  background: transparent;
  border: 0;
  font-size: 0.82rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  cursor: pointer;
  padding: 7px 12px;
  border-radius: 999px;
}
.mw-admin-nav button:hover { color: var(--mw-magenta); }

/* =============================================================
   BUTTONS
   ============================================================= */
.btn-primary {
  background: linear-gradient(135deg, var(--mw-magenta), var(--mw-cyan));
  color: #0a0a0a;
  padding: 0.7rem 1.75rem;
  border-radius: 9999px;
  font-weight: 700;
  border: none;
  cursor: pointer;
  display: inline-block;
  text-decoration: none;
  text-align: center;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-size: 0.85rem;
  transition: transform 0.15s, box-shadow 0.2s, opacity 0.2s;
}
.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: var(--mw-shadow-cyan);
  color: #0a0a0a;
}
.btn-primary:disabled { opacity: 0.5; cursor: not-allowed; transform: none; box-shadow: none; }

.btn-secondary {
  background: rgba(255, 255, 255, 0.04);
  color: var(--mw-text);
  padding: 0.5rem 1.1rem;
  border-radius: 9999px;
  font-weight: 600;
  border: 1px solid var(--mw-dark-border);
  cursor: pointer;
  display: inline-block;
  text-decoration: none;
  text-align: center;
  font-size: 0.85rem;
  transition: border-color 0.2s, color 0.2s, background 0.2s;
}
.btn-secondary:hover {
  border-color: var(--mw-cyan);
  color: var(--mw-cyan);
  background: rgba(0, 229, 255, 0.06);
}

.btn-danger {
  background: rgba(235, 31, 121, 0.12);
  color: #ff7eb6;
  padding: 0.5rem 1.1rem;
  border-radius: 9999px;
  font-weight: 600;
  border: 1px solid rgba(235, 31, 121, 0.4);
  cursor: pointer;
  display: inline-block;
  text-decoration: none;
  font-size: 0.85rem;
  transition: background 0.2s, color 0.2s;
}
.btn-danger:hover { background: var(--mw-pink); color: #fff; }

/* =============================================================
   CARDS
   ============================================================= */
.card {
  background: var(--mw-dark-card);
  border: 1px solid var(--mw-dark-border);
  border-radius: var(--mw-radius);
  padding: 1.5rem;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}
.card h2, .card h3 { margin-top: 0; }

.tier-card {
  background: var(--mw-dark-card);
  border: 1px solid var(--mw-dark-border);
  border-radius: var(--mw-radius);
  padding: 1.5rem;
  transition: border-color 0.2s, transform 0.15s;
}
.tier-card:hover { border-color: var(--mw-purple); transform: translateY(-2px); }
.tier-card.selected {
  border-color: var(--mw-cyan);
  box-shadow: 0 0 0 2px rgba(0, 229, 255, 0.25);
}

/* =============================================================
   STATUS PILLS
   ============================================================= */
.badge {
  display: inline-block;
  padding: 0.18rem 0.65rem;
  border-radius: 9999px;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border: 1px solid transparent;
}
.badge-green {
  background: rgba(34, 197, 94, 0.12);
  color: #6ee7b7;
  border-color: rgba(34, 197, 94, 0.35);
}
.badge-yellow {
  background: rgba(234, 179, 8, 0.12);
  color: #fde68a;
  border-color: rgba(234, 179, 8, 0.35);
}
.badge-red {
  background: rgba(235, 31, 121, 0.12);
  color: #ff7eb6;
  border-color: rgba(235, 31, 121, 0.4);
}
.badge-cyan {
  background: rgba(0, 229, 255, 0.12);
  color: var(--mw-cyan);
  border-color: rgba(0, 229, 255, 0.4);
}
.badge-purple {
  background: rgba(178, 0, 254, 0.12);
  color: #d18bff;
  border-color: rgba(178, 0, 254, 0.4);
}
.badge-gray {
  background: rgba(255, 255, 255, 0.05);
  color: var(--mw-text-muted);
  border-color: var(--mw-dark-border);
}
.badge-orange {
  background: rgba(249, 115, 22, 0.12);
  color: #fdba74;
  border-color: rgba(249, 115, 22, 0.4);
}
.badge-magenta {
  background: rgba(255, 38, 175, 0.12);
  color: #ff7eb6;
  border-color: rgba(255, 38, 175, 0.45);
}

/* =============================================================
   TOGGLE SWITCH (boolean settings UI)
   ============================================================= */
.mw-toggle {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  user-select: none;
}
/* Visually hide the underlying checkbox without removing it from the
   accessibility tree or breaking form submission. clip-path: inset(50%)
   plus zero size is the canonical pattern; appearance: none on top
   makes sure no native chrome leaks through on browsers that ignore
   the visibility tricks (some Safari / Brave configurations). */
.mw-toggle input[type="checkbox"] {
  appearance: none;
  -webkit-appearance: none;
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  border: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  clip-path: inset(50%);
  white-space: nowrap;
  pointer-events: none;
}
.mw-toggle-track {
  position: relative;
  width: 44px;
  height: 24px;
  background: #2a2a35;
  border: 1px solid var(--mw-dark-border);
  border-radius: 999px;
  flex-shrink: 0;
  transition: background 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}
.mw-toggle-track::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #c9cbe0;
  transition: transform 0.18s ease, background 0.18s ease;
}
.mw-toggle input:checked + .mw-toggle-track {
  background: var(--mw-cyan);
  border-color: var(--mw-cyan);
}
.mw-toggle input:checked + .mw-toggle-track::after {
  transform: translateX(20px);
  background: #0a0a0a;
}
.mw-toggle input:focus-visible + .mw-toggle-track {
  box-shadow: 0 0 0 3px rgba(0, 229, 255, 0.30);
}
.mw-toggle-label {
  font-size: 0.92rem;
  color: var(--mw-text);
}
.mw-toggle-help {
  display: block;
  font-size: 0.78rem;
  color: var(--mw-text-muted);
  margin-top: 2px;
}

/* =============================================================
   FORM INPUTS
   ============================================================= */
input[type="text"],
input[type="email"],
input[type="number"],
input[type="password"],
input[type="date"],
input[type="datetime-local"],
input[type="time"],
input[type="search"],
input[type="url"],
input[type="tel"],
select,
textarea {
  background: #0d0d12;
  border: 1px solid var(--mw-dark-border);
  color: #fff;
  border-radius: var(--mw-radius-sm);
  padding: 0.55rem 0.8rem;
  width: 100%;
  font-family: 'DM Sans', system-ui, sans-serif;
  font-size: 0.95rem;
  transition: border-color 0.15s, box-shadow 0.15s;
}
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--mw-cyan);
  box-shadow: 0 0 0 3px rgba(0, 229, 255, 0.20);
}
input::placeholder, textarea::placeholder { color: #5a5d72; }

label {
  color: var(--mw-text-muted);
  font-size: 0.85rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* =============================================================
   ADMIN TABLES
   ============================================================= */
.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
}
.admin-table thead th {
  text-align: left;
  padding: 0.85rem 0.9rem;
  color: var(--mw-cyan);
  background: rgba(0, 229, 255, 0.05);
  border-bottom: 1px solid var(--mw-dark-border);
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
}
.admin-table tbody td {
  padding: 0.75rem 0.9rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  color: var(--mw-text);
}
.admin-table tbody tr:nth-child(even) td {
  background: rgba(255, 255, 255, 0.015);
}
.admin-table tbody tr:hover td {
  background: rgba(0, 229, 255, 0.05);
}
.admin-table tbody tr:last-child td { border-bottom: 0; }

/* =============================================================
   QR
   ============================================================= */
.qr-container {
  background: white;
  border-radius: 1rem;
  padding: 1.5rem;
  display: inline-block;
}

/* =============================================================
   HOVER TOOLTIPS
   ============================================================= */
.tip {
  display: inline-block;
  position: relative;
  margin-left: 6px;
  color: var(--mw-text-muted);
  cursor: help;
  font-size: 0.875rem;
  line-height: 1;
  vertical-align: middle;
}
.tip:hover { color: var(--mw-cyan); }
.tip-content {
  position: absolute;
  left: 0;
  bottom: 100%;
  margin-bottom: 6px;
  background: var(--mw-dark-card);
  color: #fff;
  font-size: 12px;
  font-weight: 400;
  line-height: 1.4;
  padding: 6px 10px;
  border: 1px solid var(--mw-dark-border);
  border-radius: 4px;
  max-width: 260px;
  width: max-content;
  opacity: 0;
  pointer-events: none;
  transition: opacity 150ms ease-in-out;
  z-index: 50;
  white-space: normal;
}
.tip:hover .tip-content,
.tip:focus .tip-content,
.tip:focus-within .tip-content {
  opacity: 1;
}
.tip-right .tip-content {
  left: auto;
  right: 0;
}

/* =============================================================
   RESPONSIVE
   ============================================================= */
@media (max-width: 768px) {
  .mw-admin-topbar-meta { display: none; }
  .mw-admin-nav { padding: 8px; }
  .mw-admin-nav a, .mw-admin-nav button { font-size: 0.75rem; padding: 6px 10px; }
  .admin-table { font-size: 0.85rem; }
  .admin-table thead th, .admin-table tbody td { padding: 0.55rem 0.6rem; }
}
