/* LetsMeet-Here — Warm Minimalism */
@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@300;400;500;600;700;800&display=swap');

:root {
  --cream: #FAF7F2;
  --white: #FFFFFF;
  --grey: #4A4A5A;
  --grey-light: #8A8A9A;
  --grey-faint: #E8E6E2;
  --coral: #E8725A;
  --coral-dark: #D4603F;
  --coral-light: #FCEFEC;
  --amber: #D4914D;
  --amber-light: #FFF4E6;
  --green: #5CB85C;
  --green-light: #EAF7EA;
  --red: #E74C3C;
  --gold: #D4A84D;
  --diamond: #2C2C3A;
  --diamond-accent: #C9A84C;
  --radius-sm: 8px;
  --radius: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --radius-full: 999px;
  --shadow-sm: 0 1px 3px rgba(74,74,90,.06);
  --shadow: 0 4px 16px rgba(74,74,90,.08);
  --shadow-lg: 0 8px 32px rgba(74,74,90,.12);
  --font: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  --nav-h: 64px;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 16px; -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font);
  background: var(--cream);
  color: var(--grey);
  line-height: 1.5;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* ─── TOS GATE ─── */
.tos-overlay {
  position: fixed; inset: 0; z-index: 99999;
  background: var(--cream);
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
}
.tos-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 40px 32px;
  max-width: 420px; width: 100%;
  box-shadow: var(--shadow-lg);
  text-align: center;
}
.tos-card h1 { font-size: 24px; font-weight: 800; margin-bottom: 4px; }
.tos-card .subtitle { color: var(--grey-light); font-size: 14px; margin-bottom: 32px; }
.tos-card .tos-text {
  text-align: left; font-size: 13px; color: var(--grey-light);
  max-height: 200px; overflow-y: auto; margin-bottom: 24px;
  padding: 16px; background: var(--cream); border-radius: var(--radius);
  line-height: 1.7;
}
.tos-check { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; text-align: left; }
.tos-check input[type="checkbox"] {
  width: 20px; height: 20px; accent-color: var(--coral);
  border-radius: 4px; flex-shrink: 0; cursor: pointer;
}
.tos-check label { font-size: 14px; cursor: pointer; }
.tos-check a { color: var(--coral); text-decoration: underline; }

/* ─── BUTTONS ─── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 14px 28px; border: none; border-radius: var(--radius-xl);
  font-family: var(--font); font-size: 15px; font-weight: 600;
  cursor: pointer; transition: all .2s ease;
  text-decoration: none;
}
.btn-primary { background: var(--coral); color: white; }
.btn-primary:hover { background: var(--coral-dark); transform: translateY(-1px); box-shadow: var(--shadow); }
.btn-primary:disabled { background: var(--grey-faint); color: var(--grey-light); cursor: not-allowed; transform: none; }
.btn-secondary { background: var(--white); color: var(--grey); border: 1.5px solid var(--grey-faint); }
.btn-secondary:hover { border-color: var(--coral); color: var(--coral); }
.btn-ghost { background: transparent; color: var(--coral); padding: 8px 16px; }
.btn-sm { padding: 8px 16px; font-size: 13px; border-radius: var(--radius); }
.btn-block { width: 100%; }
.btn-gold { background: linear-gradient(135deg, var(--gold), var(--amber)); color: white; }
.btn-diamond { background: var(--diamond); color: var(--diamond-accent); }

/* ─── INPUTS ─── */
.input {
  width: 100%; padding: 14px 16px;
  border: 1.5px solid var(--grey-faint); border-radius: var(--radius);
  font-family: var(--font); font-size: 15px; color: var(--grey);
  background: var(--white); transition: border-color .2s;
  outline: none;
}
.input:focus { border-color: var(--coral); }
.input::placeholder { color: var(--grey-light); }
.form-group { margin-bottom: 16px; }
.form-group label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 6px; color: var(--grey); }

/* ─── AUTH SCREENS ─── */
.auth-screen {
  min-height: 100dvh; display: flex; align-items: center; justify-content: center;
  padding: 24px; background: var(--cream);
}
.auth-card {
  background: var(--white); border-radius: var(--radius-lg);
  padding: 40px 32px; max-width: 400px; width: 100%;
  box-shadow: var(--shadow-lg);
}
.auth-card h2 { font-size: 22px; font-weight: 800; margin-bottom: 4px; }
.auth-card .sub { color: var(--grey-light); font-size: 14px; margin-bottom: 28px; }
.auth-tabs {
  display: flex; gap: 0; margin-bottom: 28px;
  background: var(--cream); border-radius: var(--radius); overflow: hidden;
}
.auth-tab {
  flex: 1; padding: 10px; text-align: center; font-size: 14px; font-weight: 600;
  cursor: pointer; transition: all .2s; border: none; background: transparent; color: var(--grey-light);
}
.auth-tab.active { background: var(--coral); color: white; border-radius: var(--radius); }
.auth-msg {
  padding: 12px 16px; border-radius: var(--radius); font-size: 13px; margin-top: 16px;
}
.auth-msg.success { background: var(--green-light); color: #2d7a2d; }
.auth-msg.error { background: #fde8e8; color: var(--red); }

/* ─── APP SHELL ─── */
.app-container { display: none; flex-direction: column; height: 100dvh; background: var(--cream); }
.app-container.visible { display: flex; }

/* Top bar */
.top-bar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 20px; background: var(--white);
  border-bottom: 1px solid var(--grey-faint);
  position: sticky; top: 0; z-index: 100;
}
.top-bar .logo { font-size: 18px; font-weight: 800; color: var(--grey); }
.top-bar .logo span { color: var(--coral); }

/* Bottom nav */
.bottom-nav {
  display: flex; align-items: center; justify-content: space-around;
  padding: 8px 0 calc(8px + var(--safe-bottom));
  background: var(--white); border-top: 1px solid var(--grey-faint);
  position: sticky; bottom: 0; z-index: 100;
}
.nav-item {
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  padding: 6px 12px; font-size: 11px; color: var(--grey-light);
  cursor: pointer; transition: color .2s; border: none; background: none;
  font-family: var(--font);
}
.nav-item.active { color: var(--coral); }
.nav-item svg { width: 22px; height: 22px; stroke-width: 1.5; }
.nav-create {
  width: 48px; height: 48px; border-radius: 50%;
  background: var(--coral); color: white; border: none;
  display: flex; align-items: center; justify-content: center;
  font-size: 28px; cursor: pointer; box-shadow: var(--shadow);
  transition: transform .2s, background .2s;
  margin-top: -16px;
}
.nav-create:hover { transform: scale(1.08); background: var(--coral-dark); }

/* Main content area */
.main-content { flex: 1; overflow-y: auto; position: relative; }

/* ─── VIEW PANELS ─── */
.view { display: none; height: 100%; }
.view.active { display: flex; flex-direction: column; }

/* ─── MAP VIEW ─── */
#map-container { flex: 1; position: relative; }
#map { width: 100%; height: 100%; }

/* ─── DISCOVER / LIST VIEW ─── */
.discover-view { padding: 20px; gap: 12px; overflow-y: auto; }
.meetup-card {
  background: var(--white); border-radius: var(--radius-lg); padding: 16px;
  box-shadow: var(--shadow-sm); transition: box-shadow .2s, transform .15s;
  cursor: pointer;
}
.meetup-card:hover { box-shadow: var(--shadow); transform: translateY(-1px); }
.meetup-card .card-top { display: flex; gap: 12px; align-items: center; margin-bottom: 12px; }
.meetup-card .host-photo {
  width: 44px; height: 44px; border-radius: 50%; object-fit: cover;
  border: 2px solid var(--grey-faint);
}
.meetup-card .host-info h4 { font-size: 14px; font-weight: 600; }
.meetup-card .host-info .meta { font-size: 12px; color: var(--grey-light); }
.meetup-card .card-body { margin-bottom: 12px; }
.meetup-card .category-badge {
  display: inline-block; padding: 4px 10px; border-radius: var(--radius-full);
  font-size: 12px; font-weight: 600; background: var(--coral-light); color: var(--coral);
}
.meetup-card .vibe { font-size: 13px; color: var(--grey-light); margin-top: 6px; }
.meetup-card .card-footer {
  display: flex; justify-content: space-between; align-items: center;
  padding-top: 12px; border-top: 1px solid var(--grey-faint);
}
.meetup-card .spots { font-size: 12px; color: var(--grey-light); }
.meetup-card .distance { font-size: 12px; color: var(--amber); font-weight: 600; }

/* ─── PROFILE VIEW ─── */
.profile-view { padding: 24px; overflow-y: auto; gap: 20px; }
.profile-header { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 12px; }
.profile-photo-wrap {
  width: 96px; height: 96px; border-radius: 50%; overflow: hidden;
  border: 3px solid var(--coral); position: relative;
}
.profile-photo-wrap img { width: 100%; height: 100%; object-fit: cover; }
.profile-name { font-size: 20px; font-weight: 700; }
.profile-tier {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 4px 12px; border-radius: var(--radius-full);
  font-size: 12px; font-weight: 600;
}
.tier-bronze { background: #f0ece6; color: #8a7b6b; }
.tier-silver { background: #eef0f2; color: #6b7b8a; }
.tier-gold { background: var(--amber-light); color: var(--amber); }
.tier-diamond { background: var(--diamond); color: var(--diamond-accent); }

.profile-stats {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; width: 100%;
}
.stat-box {
  background: var(--white); border-radius: var(--radius); padding: 16px; text-align: center;
  box-shadow: var(--shadow-sm);
}
.stat-box .num { font-size: 22px; font-weight: 800; color: var(--coral); }
.stat-box .lbl { font-size: 11px; color: var(--grey-light); margin-top: 2px; }

.profile-section {
  background: var(--white); border-radius: var(--radius-lg); padding: 20px;
  box-shadow: var(--shadow-sm); width: 100%;
}
.profile-section h3 { font-size: 15px; font-weight: 700; margin-bottom: 12px; }

/* ─── RATING BAR ─── */
.rating-bar {
  height: 6px; border-radius: 3px; background: var(--grey-faint); overflow: hidden;
}
.rating-bar .fill { height: 100%; border-radius: 3px; transition: width .5s ease; }
.rating-bar .fill.high { background: var(--green); }
.rating-bar .fill.mid { background: var(--amber); }
.rating-bar .fill.low { background: var(--red); }

/* ─── ACTIVITY VIEW ─── */
.activity-view { padding: 20px; overflow-y: auto; gap: 12px; }
.activity-item {
  display: flex; gap: 12px; align-items: flex-start;
  padding: 14px; background: var(--white); border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}
.activity-dot {
  width: 8px; height: 8px; border-radius: 50%; margin-top: 6px; flex-shrink: 0;
}
.activity-dot.coral { background: var(--coral); }
.activity-dot.green { background: var(--green); }
.activity-dot.amber { background: var(--amber); }
.activity-text { font-size: 14px; line-height: 1.5; }
.activity-time { font-size: 11px; color: var(--grey-light); margin-top: 2px; }

/* ─── CREATE MEETUP MODAL ─── */
.modal-overlay {
  position: fixed; inset: 0; z-index: 500;
  background: rgba(74,74,90,.4); backdrop-filter: blur(4px);
  display: none; align-items: flex-end; justify-content: center;
}
.modal-overlay.open { display: flex; }
.modal-sheet {
  background: var(--white); border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  width: 100%; max-width: 500px; max-height: 85dvh; overflow-y: auto;
  padding: 24px 20px calc(24px + var(--safe-bottom));
  box-shadow: var(--shadow-lg);
  animation: slideUp .3s ease;
}
@keyframes slideUp { from { transform: translateY(100%); } to { transform: translateY(0); } }
.modal-handle {
  width: 40px; height: 4px; border-radius: 2px; background: var(--grey-faint);
  margin: 0 auto 20px;
}
.modal-sheet h2 { font-size: 20px; font-weight: 800; margin-bottom: 20px; }

/* Category grid */
.category-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 20px;
}
.cat-btn {
  padding: 10px 6px; border: 1.5px solid var(--grey-faint); border-radius: var(--radius);
  background: var(--white); font-size: 12px; font-weight: 500; color: var(--grey);
  cursor: pointer; transition: all .15s; text-align: center;
  font-family: var(--font);
}
.cat-btn:hover, .cat-btn.selected { border-color: var(--coral); background: var(--coral-light); color: var(--coral); }

/* Size picker */
.size-picker { display: flex; gap: 8px; margin-bottom: 16px; flex-wrap: wrap; }
.size-btn {
  width: 40px; height: 40px; border-radius: 50%; border: 1.5px solid var(--grey-faint);
  background: var(--white); font-size: 14px; font-weight: 600; color: var(--grey);
  cursor: pointer; transition: all .15s; font-family: var(--font);
}
.size-btn:hover, .size-btn.selected { border-color: var(--coral); background: var(--coral); color: white; }

/* Duration picker */
.duration-picker { display: flex; gap: 8px; margin-bottom: 16px; }
.dur-btn {
  flex: 1; padding: 10px; border: 1.5px solid var(--grey-faint); border-radius: var(--radius);
  background: var(--white); font-size: 13px; font-weight: 500; color: var(--grey);
  cursor: pointer; transition: all .15s; text-align: center; font-family: var(--font);
}
.dur-btn:hover, .dur-btn.selected { border-color: var(--coral); background: var(--coral-light); color: var(--coral); }

/* Toggle */
.toggle-row { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.toggle {
  width: 48px; height: 28px; border-radius: 14px; background: var(--grey-faint);
  position: relative; cursor: pointer; transition: background .2s; border: none;
}
.toggle::after {
  content: ''; position: absolute; top: 3px; left: 3px;
  width: 22px; height: 22px; border-radius: 50%; background: white;
  transition: transform .2s; box-shadow: var(--shadow-sm);
}
.toggle.on { background: var(--coral); }
.toggle.on::after { transform: translateX(20px); }

/* ─── CONFETTI ─── */
@keyframes confettiFall {
  0% { transform: translateY(-10px) rotate(0deg); opacity: 1; }
  100% { transform: translateY(100vh) rotate(720deg); opacity: 0; }
}
.confetti {
  position: fixed; top: 0; width: 8px; height: 8px; z-index: 9999;
  animation: confettiFall 2s ease-out forwards;
}

/* ─── POST-MEETUP SCREEN ─── */
.post-meetup {
  position: fixed; inset: 0; z-index: 600;
  background: var(--cream); display: flex; flex-direction: column;
  align-items: center; justify-content: center; padding: 32px; text-align: center;
  display: none;
}
.post-meetup.visible { display: flex; }
.post-meetup h2 { font-size: 24px; font-weight: 800; margin-bottom: 8px; }
.post-meetup .recap { color: var(--grey-light); font-size: 15px; margin-bottom: 32px; }
.sv-promo {
  background: linear-gradient(135deg, #1a1a2e, #16213e);
  color: white; padding: 24px; border-radius: var(--radius-lg);
  max-width: 340px; width: 100%;
}
.sv-promo h3 { font-size: 16px; font-weight: 700; margin-bottom: 4px; }
.sv-promo p { font-size: 13px; opacity: .8; margin-bottom: 16px; }
.sv-promo .btn { background: var(--gold); color: #1a1a2e; font-weight: 700; width: 100%; }

/* ─── INSTALL BANNER ─── */
.install-banner {
  position: fixed; bottom: calc(var(--nav-h) + 8px + var(--safe-bottom)); left: 16px; right: 16px;
  background: var(--white); border-radius: var(--radius-lg); padding: 14px 16px;
  box-shadow: var(--shadow-lg); display: flex; align-items: center; gap: 12px;
  z-index: 200; animation: slideUp .4s ease;
}
.install-banner.hidden { display: none; }
.install-banner .install-text { flex: 1; font-size: 13px; }
.install-banner .install-text strong { color: var(--coral); }

/* ─── LOADING / SPLASH ─── */
.splash {
  position: fixed; inset: 0; z-index: 99998;
  background: var(--cream); display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 16px;
  transition: opacity .5s;
}
.splash.fade { opacity: 0; pointer-events: none; }
.splash .logo-big { font-size: 32px; font-weight: 800; }
.splash .logo-big span { color: var(--coral); }
.splash .powered {
  font-size: 11px; color: var(--grey-light); margin-top: 24px;
  opacity: .7;
}
.spinner {
  width: 32px; height: 32px; border: 3px solid var(--grey-faint);
  border-top-color: var(--coral); border-radius: 50%;
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ─── EMPTY STATE ─── */
.empty-state {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 60px 32px; text-align: center; gap: 12px; flex: 1;
}
.empty-state .emoji { font-size: 48px; }
.empty-state h3 { font-size: 18px; font-weight: 700; }
.empty-state p { font-size: 14px; color: var(--grey-light); max-width: 280px; }

/* ─── MAP PINS ─── */
.map-pin {
  background: var(--coral); color: white; padding: 6px 12px;
  border-radius: var(--radius-full); font-size: 12px; font-weight: 600;
  box-shadow: var(--shadow); white-space: nowrap;
  transform: translate(-50%, -100%);
  cursor: pointer; transition: transform .15s;
}
.map-pin:hover { transform: translate(-50%, -100%) scale(1.08); }
.map-pin.seeded {
  background: var(--grey-faint); color: var(--grey-light);
  border: 1px dashed var(--grey-light);
}
.map-pin.hot { background: var(--coral); animation: pulse 2s infinite; }
@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(232,114,90,.4); }
  50% { box-shadow: 0 0 0 8px rgba(232,114,90,0); }
}

/* ─── TOAST ─── */
.toast {
  position: fixed; top: 20px; left: 50%; transform: translateX(-50%);
  background: var(--grey); color: white; padding: 12px 24px;
  border-radius: var(--radius-full); font-size: 14px; font-weight: 500;
  box-shadow: var(--shadow-lg); z-index: 10000;
  animation: toastIn .3s ease, toastOut .3s ease 2.7s forwards;
}
@keyframes toastIn { from { opacity: 0; transform: translateX(-50%) translateY(-20px); } }
@keyframes toastOut { to { opacity: 0; transform: translateX(-50%) translateY(-20px); } }

/* ─── RATING STARS ─── */
.star-rating { display: flex; gap: 4px; }
.star {
  width: 32px; height: 32px; cursor: pointer; fill: var(--grey-faint);
  transition: fill .15s, transform .15s;
}
.star:hover { transform: scale(1.15); }
.star.active { fill: var(--amber); animation: starPop .3s ease; }
@keyframes starPop { 50% { transform: scale(1.3); } }

/* ─── BADGE ICONS ─── */
.verified-badge { color: var(--coral); font-size: 14px; }
.purchaser-badge { color: var(--green); font-size: 14px; }

/* ─── RESPONSIVE ─── */
@media (min-width: 768px) {
  .modal-sheet { max-width: 480px; border-radius: var(--radius-lg); margin-bottom: 40px; }
  .modal-overlay { align-items: center; }
}

/* ─── WOMEN-ONLY BADGE ─── */
.women-only-badge {
  display: inline-block; padding: 2px 8px; border-radius: var(--radius-full);
  font-size: 11px; font-weight: 600; background: #FDE8F0; color: #C2185B;
}

/* ─── UTILITY ─── */
.hidden { display: none !important; }
.text-center { text-align: center; }
.mt-8 { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.mb-16 { margin-bottom: 16px; }
.gap-8 { gap: 8px; }
.gap-12 { gap: 12px; }
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
