@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@600;700;800;900&family=Inter:wght@400;500;600;700&display=swap');

:root {
  --navy-deep:  #13294a;
  --navy:       #1f3b67;
  --navy-soft:  #274a80;
  --navy-card:  #24466f;
  --teal:       #65cbb5;
  --teal-strong:#3fb89e;
  --lime:       #bbdf34;
  --pink:       #f13ea4;
  --indigo:     #7b82d9;
  --gray:       #b5b5b4;
  --white:      #ffffff;
  --ink:        #ffffff;
  --ink-soft:   rgba(255, 255, 255, 0.68);
  --ink-faint:  rgba(255, 255, 255, 0.45);
  --border:     rgba(255, 255, 255, 0.14);
  --border-soft:rgba(255, 255, 255, 0.08);
  --radius-lg:  22px;
  --radius-md:  14px;
  --radius-sm:  10px;
  --shadow:     0 10px 30px rgba(9, 18, 36, 0.45);
  --shadow-hover: 0 18px 44px rgba(9, 18, 36, 0.55);
  --glow-teal:  0 10px 30px rgba(101, 203, 181, 0.35);
  --glow-pink:  0 10px 34px rgba(241, 62, 164, 0.4);
  --safe-b:     env(safe-area-inset-bottom, 0px);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { -webkit-text-size-adjust: 100%; }
html, body { margin: 0; padding: 0; }
body {
  background:
    radial-gradient(1100px 560px at 12% -8%, rgba(101, 203, 181, 0.16), transparent 60%),
    radial-gradient(900px 520px at 105% 8%, rgba(241, 62, 164, 0.14), transparent 55%),
    var(--navy-deep);
  color: var(--ink);
  font-family: 'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif;
  font-size: 15px;
  line-height: 1.5;
  min-height: 100vh;
}
h1, h2, h3, .font-display { font-family: 'Poppins', 'Inter', sans-serif; }
img { max-width: 100%; }
a { color: inherit; }

/* ---------------------------------------------------------------------
   Chevron texture (brand motif) — subtle, decorative only
--------------------------------------------------------------------- */
.chevron-field {
  position: absolute; inset: 0; pointer-events: none; overflow: hidden;
  opacity: 0.5;
  -webkit-mask-image: linear-gradient(to bottom, black, transparent 92%);
          mask-image: linear-gradient(to bottom, black, transparent 92%);
}
.chevron-field::before {
  content: ""; position: absolute; inset: -20px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='90' viewBox='0 0 120 90'%3E%3Cpath d='M14 34 L26 22 L38 34' fill='none' stroke='%23ffffff' stroke-width='5' stroke-linecap='round' stroke-linejoin='round' opacity='0.5'/%3E%3Cpath d='M74 14 L86 2 L98 14' fill='none' stroke='%2365cbb5' stroke-width='5' stroke-linecap='round' stroke-linejoin='round' opacity='0.8'/%3E%3Cpath d='M44 64 L56 52 L68 64' fill='none' stroke='%23ffffff' stroke-width='5' stroke-linecap='round' stroke-linejoin='round' opacity='0.5'/%3E%3Cpath d='M4 84 L16 72 L28 84' fill='none' stroke='%23f13ea4' stroke-width='5' stroke-linecap='round' stroke-linejoin='round' opacity='0.7'/%3E%3Cpath d='M94 74 L106 62 L118 74' fill='none' stroke='%23bbdf34' stroke-width='5' stroke-linecap='round' stroke-linejoin='round' opacity='0.7'/%3E%3C/svg%3E");
  background-size: 200px 150px;
}

/* ---------------------------------------------------------------------
   Topbar
--------------------------------------------------------------------- */
.topbar {
  position: sticky; top: 0; z-index: 40;
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px max(18px, env(safe-area-inset-left)) 14px max(18px, env(safe-area-inset-right));
  background: rgba(19, 41, 74, 0.82);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border-soft);
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: inherit; }
.brand-mark { width: 30px; height: auto; display: block; filter: drop-shadow(0 2px 6px rgba(0,0,0,0.35)); }
.brand-word { font-family: 'Poppins', sans-serif; font-weight: 800; font-size: 16px; letter-spacing: 0.2px; line-height: 1.1; }
.brand-word b { color: var(--teal); font-weight: 800; }
.brand-tagline { display: block; font-size: 9px; font-weight: 600; letter-spacing: 1.4px; color: var(--ink-faint); text-transform: uppercase; margin-top: 1px; }
.topbar-strip { height: 3px; display: flex; }
.topbar-strip span { flex: 1; }
.topbar-strip span:nth-child(1){ background: var(--gray); }
.topbar-strip span:nth-child(2){ background: var(--indigo); }
.topbar-strip span:nth-child(3){ background: var(--pink); }
.topbar-strip span:nth-child(4){ background: var(--lime); }
.topbar-strip span:nth-child(5){ background: var(--teal); }

/* ---------------------------------------------------------------------
   Layout
--------------------------------------------------------------------- */
.page { max-width: 1120px; margin: 0 auto; padding: 0 20px calc(70px + var(--safe-b)); position: relative; }
.page-title { font-size: clamp(22px, 5vw, 30px); font-weight: 800; margin: 0 0 6px; }

/* ---------------------------------------------------------------------
   Hero (events index)
--------------------------------------------------------------------- */
.hero { position: relative; padding: 44px 0 34px; overflow: hidden; }
.hero-inner { position: relative; z-index: 1; text-align: center; max-width: 640px; margin: 0 auto; }
.hero-eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: 'Poppins', sans-serif; font-weight: 700; font-size: 11px; letter-spacing: 1.6px;
  text-transform: uppercase; color: var(--teal);
  background: rgba(101, 203, 181, 0.12); border: 1px solid rgba(101, 203, 181, 0.35);
  padding: 7px 14px; border-radius: 100px; margin-bottom: 18px;
}
.hero-eyebrow .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--lime); box-shadow: 0 0 0 4px rgba(187, 223, 52, 0.22); }
.hero h1 {
  font-size: clamp(28px, 7vw, 46px); font-weight: 900; line-height: 1.08; margin: 0 0 14px;
  letter-spacing: -0.5px;
}
.hero h1 .accent {
  background: linear-gradient(100deg, var(--teal), var(--lime));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hero p { color: var(--ink-soft); font-size: clamp(14px, 3.6vw, 17px); margin: 0 auto 4px; max-width: 480px; }

.hero-features { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin-top: 26px; }
.hero-feature {
  display: flex; align-items: center; gap: 8px;
  background: rgba(255,255,255,0.05); border: 1px solid var(--border);
  padding: 9px 14px; border-radius: 100px; font-size: 12.5px; font-weight: 600; color: var(--ink-soft);
}
.hero-feature .emoji { font-size: 15px; }

/* ---------------------------------------------------------------------
   Buttons
--------------------------------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 13px 22px; border-radius: 100px;
  border: 1px solid transparent; font-family: 'Poppins', sans-serif; font-size: 13.5px; font-weight: 700;
  cursor: pointer; text-decoration: none; white-space: nowrap;
  transition: transform .12s ease, box-shadow .2s ease, filter .15s ease;
}
.btn:active { transform: scale(0.96); }
.btn-primary {
  background: linear-gradient(120deg, var(--teal), var(--teal-strong));
  color: #0c2237; box-shadow: var(--glow-teal);
}
.btn-primary:hover { filter: brightness(1.06); box-shadow: 0 14px 36px rgba(101, 203, 181, 0.45); }
.btn-secondary {
  background: rgba(255,255,255,0.06); color: var(--ink); border-color: var(--border);
}
.btn-secondary:hover { background: rgba(255,255,255,0.12); }
.btn-block { width: 100%; }
.btn-lg { padding: 16px 26px; font-size: 15px; }

.btn-selfie {
  background: linear-gradient(120deg, var(--pink), var(--indigo));
  color: #fff; box-shadow: var(--glow-pink);
  position: relative;
}
.btn-selfie::after {
  content: ""; position: absolute; inset: -3px; border-radius: 100px;
  background: linear-gradient(120deg, var(--pink), var(--indigo));
  opacity: 0.55; filter: blur(10px); z-index: -1;
  animation: pulse-glow 2.6s ease-in-out infinite;
}
@keyframes pulse-glow {
  0%, 100% { opacity: 0.35; transform: scale(0.98); }
  50% { opacity: 0.65; transform: scale(1.04); }
}
@media (prefers-reduced-motion: reduce) {
  .btn-selfie::after { animation: none; }
}

/* ---------------------------------------------------------------------
   Event cards grid
--------------------------------------------------------------------- */
.section-label {
  font-family: 'Poppins', sans-serif; font-weight: 700; font-size: 11px; letter-spacing: 1.4px;
  text-transform: uppercase; color: var(--ink-faint); margin: 8px 2px 14px;
}
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 16px; margin-top: 6px; }
.card {
  background: var(--navy-card);
  border: 1px solid var(--border-soft); border-radius: var(--radius-lg);
  overflow: hidden; text-decoration: none; color: inherit; box-shadow: var(--shadow);
  transition: box-shadow .2s ease, transform .2s ease, border-color .2s ease;
  display: flex; flex-direction: column; cursor: pointer;
}
.card:hover { box-shadow: var(--shadow-hover); transform: translateY(-4px); border-color: rgba(101,203,181,0.4); }
.card-accent { height: 4px; width: 100%; }
.grid .card:nth-child(5n+1) .card-accent { background: linear-gradient(90deg, var(--teal), var(--teal-strong)); }
.grid .card:nth-child(5n+2) .card-accent { background: linear-gradient(90deg, var(--pink), #ff7dc4); }
.grid .card:nth-child(5n+3) .card-accent { background: linear-gradient(90deg, var(--lime), #d8ef7a); }
.grid .card:nth-child(5n+4) .card-accent { background: linear-gradient(90deg, var(--indigo), #a3a9ec); }
.grid .card:nth-child(5n+5) .card-accent { background: linear-gradient(90deg, var(--gray), #e2e2e1); }
.card-cover {
  height: 150px; background: linear-gradient(135deg, rgba(255,255,255,0.06), rgba(255,255,255,0.02));
  display: flex; align-items: center; justify-content: center; font-size: 30px; overflow: hidden; position: relative;
}
.card-cover img { width: 100%; height: 100%; object-fit: cover; transition: transform .35s ease; }
.card:hover .card-cover img { transform: scale(1.06); }
.card-body { padding: 13px 15px 15px; font-weight: 700; font-size: 14px; font-family: 'Poppins', sans-serif; display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.card-body .arrow { color: var(--teal); font-size: 16px; flex: none; transition: transform .2s ease; }
.card:hover .card-body .arrow { transform: translateX(3px); }

/* ---------------------------------------------------------------------
   Event page header
--------------------------------------------------------------------- */
.event-header { padding-top: 30px; }
.event-eyebrow {
  display: inline-flex; align-items: center; gap: 6px; font-size: 11px; font-weight: 700;
  letter-spacing: 1.2px; text-transform: uppercase; color: var(--ink-faint); margin-bottom: 8px;
}
.event-eyebrow a { color: var(--teal); text-decoration: none; }
.event-header h1.page-title { margin-bottom: 18px; }

.selfie-promo {
  position: relative; border-radius: var(--radius-lg); overflow: hidden; margin-bottom: 26px;
  padding: 26px 22px; text-align: center;
  background: linear-gradient(150deg, rgba(241, 62, 164, 0.16), rgba(123, 130, 217, 0.16)), var(--navy-card);
  border: 1px solid rgba(241, 62, 164, 0.28);
}
.selfie-promo .emoji-badge { font-size: 30px; margin-bottom: 10px; display: block; }
.selfie-promo h2 {
  font-size: clamp(18px, 4.6vw, 23px); font-weight: 800; margin: 0 0 6px;
}
.selfie-promo p { color: var(--ink-soft); font-size: 13.5px; margin: 0 0 18px; max-width: 420px; margin-inline: auto; }
.selfie-promo .actions { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; }

.event-actions-row { display: flex; justify-content: flex-end; margin-bottom: 8px; }

.breadcrumbs { display: flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--ink-soft); margin: 6px 0 16px; flex-wrap: wrap; }
.breadcrumbs .crumb { cursor: pointer; padding: 5px 10px; border-radius: 100px; font-weight: 600; }
.breadcrumbs .crumb:hover { background: rgba(255,255,255,0.08); color: var(--ink); }
.breadcrumbs .crumb.current { color: var(--navy-deep); font-weight: 700; cursor: default; background: var(--teal); }
.breadcrumbs .sep { color: var(--ink-faint); }

/* ---------------------------------------------------------------------
   Photo grid + lightbox
--------------------------------------------------------------------- */
.photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 10px; margin-top: 14px; }
.photo-tile {
  position: relative; border-radius: var(--radius-sm); overflow: hidden; background: rgba(255,255,255,0.04);
  aspect-ratio: 1 / 1; border: 1px solid var(--border-soft); cursor: pointer;
}
.photo-tile img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .3s ease; }
.photo-tile:hover img { transform: scale(1.08); }
.photo-tile .score-badge {
  position: absolute; bottom: 6px; inset-inline-end: 6px;
  background: linear-gradient(120deg, var(--teal), var(--lime)); color: #0c2237;
  font-family: 'Poppins', sans-serif; font-weight: 800; font-size: 10px; padding: 3px 7px; border-radius: 100px;
}

.empty-state { text-align: center; padding: 60px 20px; color: var(--ink-faint); font-size: 13.5px; }

.overlay {
  position: fixed; inset: 0; background: rgba(10, 18, 34, 0.7);
  backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center; z-index: 50; padding: 16px;
}
.overlay[hidden] { display: none; }
.modal {
  background: var(--navy-card); border: 1px solid var(--border); border-radius: var(--radius-lg);
  width: 460px; max-width: 100%;
  max-height: 88vh; overflow-y: auto; padding: 26px; box-shadow: 0 24px 60px rgba(0,0,0,0.5);
}
.modal h2 { margin: 0 0 8px; font-size: 18px; font-weight: 800; }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 18px; }
.hint { font-size: 12.5px; color: var(--ink-soft); line-height: 1.55; }

.selfie-steps { display: flex; gap: 10px; margin: 16px 0; }
.selfie-steps .step { flex: 1; text-align: center; }
.selfie-steps .step .circle {
  width: 34px; height: 34px; border-radius: 50%; margin: 0 auto 6px;
  display: flex; align-items: center; justify-content: center; font-size: 15px;
  background: rgba(255,255,255,0.06); border: 1px solid var(--border);
}
.selfie-steps .step span.label { display: block; font-size: 10.5px; color: var(--ink-faint); font-weight: 600; }

.file-picker {
  display: flex; align-items: center; justify-content: center; text-align: center;
  border: 2px dashed rgba(101, 203, 181, 0.4); border-radius: var(--radius-md);
  padding: 26px 16px; margin: 14px 0; cursor: pointer; font-weight: 700; color: var(--teal);
  font-family: 'Poppins', sans-serif; font-size: 13.5px;
  background: rgba(101, 203, 181, 0.06); transition: background .15s ease, border-color .15s ease;
}
.file-picker:hover { border-color: var(--teal); background: rgba(101, 203, 181, 0.12); }

#searchStatus:not(:empty) { display: block; padding: 4px 2px; }

.lightbox-inner { display: flex; flex-direction: column; align-items: center; gap: 12px; max-width: 94vw; }
.lightbox-inner img { max-width: 94vw; max-height: 80vh; border-radius: 14px; box-shadow: 0 20px 60px rgba(0,0,0,.5); }

/* ---------------------------------------------------------------------
   QR panel (used on event page inline if needed) + footer
--------------------------------------------------------------------- */
.footer-note {
  text-align: center; color: var(--ink-faint); font-size: 11.5px; padding: 30px 20px 10px;
}

/* ---------------------------------------------------------------------
   Admin page
--------------------------------------------------------------------- */
.admin-intro { color: var(--ink-soft); font-size: 13.5px; max-width: 640px; margin: 0 0 22px; }
.admin-token-input {
  padding: 12px 16px; border-radius: 100px; border: 1px solid var(--border);
  background: rgba(255,255,255,0.05); color: var(--ink); width: 100%; max-width: 300px;
  margin-bottom: 22px; font-family: inherit; font-size: 13.5px;
}
.admin-token-input::placeholder { color: var(--ink-faint); }
.admin-row {
  display: flex; align-items: center; gap: 12px; padding: 14px 4px;
  border-bottom: 1px solid var(--border-soft); flex-wrap: wrap;
}
.admin-row .name { flex: 1; min-width: 140px; font-weight: 700; font-family: 'Poppins', sans-serif; }
.admin-row .hint { font-size: 12px; }

/* ---------------------------------------------------------------------
   Mobile
--------------------------------------------------------------------- */
@media (max-width: 560px) {
  .page { padding-left: 16px; padding-right: 16px; }
  .hero { padding: 30px 0 24px; }
  .hero-features { gap: 8px; }
  .selfie-promo .actions { flex-direction: column; }
  .selfie-promo .actions .btn { width: 100%; }
  .event-actions-row { justify-content: stretch; }
  .event-actions-row .btn { flex: 1; }

  .overlay { padding: 0; align-items: flex-end; }
  .modal {
    width: 100%; max-width: 100%; border-radius: 22px 22px 0 0;
    max-height: 92vh; padding: 22px 18px calc(22px + var(--safe-b));
    animation: sheet-up .22s ease;
  }
  @keyframes sheet-up { from { transform: translateY(24px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }

  .brand-tagline { display: none; }
}

@media (max-width: 380px) {
  .grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
  .photo-grid { grid-template-columns: repeat(auto-fill, minmax(105px, 1fr)); }
}
