/* ═══════════════════════════════════════════════════════════
   LiveTown — Design System
   Concept: Vibrant Minimal — bold gradients + clean white space
═══════════════════════════════════════════════════════════ */

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

/* ── Tokens ──
   Palette matches the app icon: warm sunset city, amber/orange neon sign. */
:root {
  --white:   #ffffff;
  --bg:      #fdf8f2;
  --surface: #ffffff;
  --border:  #f0e2ce;

  --ink-1: #241a10;
  --ink-2: #6b5645;
  --ink-3: #a4907c;

  /* Brand gradient — sunset: orange → amber → warm red */
  --g-brand:  linear-gradient(135deg, #fb923c 0%, #f59e0b 50%, #ef4444 100%);
  --g-brand2: linear-gradient(135deg, #f97316 0%, #ea580c 100%);
  --g-warm:   linear-gradient(135deg, #fa709a 0%, #fee140 100%);
  --g-cool:   linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
  --g-green:  linear-gradient(135deg, #43e97b 0%, #38f9d7 100%);
  --g-orange: linear-gradient(135deg, #f7971e 0%, #ffd200 100%);
  --g-red:    linear-gradient(135deg, #f5515f 0%, #9f041b 100%);

  --accent:  #f97316;
  --accent2: #f59e0b;
  --pink:    #ef4444;
  --teal:    #14b8a6;
  --amber:   #f59e0b;
  --green:   #22c55e;
  --red:     #ef4444;

  --radius-sm:  8px;
  --radius-md:  12px;
  --radius-lg:  18px;
  --radius-xl:  24px;

  --shadow-sm:  0 1px 3px rgba(36,26,16,.06), 0 1px 2px rgba(36,26,16,.04);
  --shadow-md:  0 4px 16px rgba(249,115,22,.14), 0 1px 4px rgba(36,26,16,.06);
  --shadow-lg:  0 12px 40px rgba(249,115,22,.2), 0 4px 12px rgba(36,26,16,.08);
  --shadow-glow: 0 0 0 3px rgba(249,115,22,.18);
}

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

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg);
  color: var(--ink-1);
  line-height: 1.6;
  min-height: 100vh;
}

a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
ul { list-style: none; }
button { font-family: inherit; cursor: pointer; }
input, textarea, select { font-family: inherit; }

/* ── Scrollbar ── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #d1cfe8; border-radius: 99px; }

/* ── Navbar ── */
.navbar {
  position: sticky;
  top: 0;
  z-index: 500;
  height: 60px;
  background: rgba(255,255,255,.88);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 28px;
  gap: 0;
}

.nav-logo {
  font-size: 18px;
  font-weight: 900;
  background: var(--g-brand);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: -.4px;
  white-space: nowrap;
}

.nav-right {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-left: auto;
}

.nav-link {
  padding: 7px 13px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 500;
  color: var(--ink-2);
  transition: background .15s;
}
.nav-link:hover { background: #f0eeff; color: var(--accent); }

.nav-btn-outline {
  padding: 7px 14px;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--border);
  background: var(--white);
  color: var(--ink-2);
  font-size: 14px;
  font-weight: 500;
  transition: all .15s;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
}
.nav-btn-outline:hover { border-color: var(--accent); color: var(--accent); }

.nav-btn-primary {
  padding: 7px 16px;
  border-radius: var(--radius-sm);
  background: var(--g-brand);
  color: #fff;
  border: none;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  transition: opacity .15s, transform .1s;
  box-shadow: 0 2px 10px rgba(108,99,255,.35);
}
.nav-btn-primary:hover { opacity: .9; transform: translateY(-1px); }

.nav-divider { width: 1px; height: 24px; background: var(--border); margin: 0 6px; }

.nav-msg-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px; height: 36px;
  border-radius: var(--radius-sm);
  background: #f0eeff;
  border: 1.5px solid #e0dbff;
  font-size: 16px;
  transition: all .15s;
  text-decoration: none;
}
.nav-msg-wrap:hover { background: #e8e3ff; }

.nav-msg-badge {
  position: absolute;
  top: -5px; right: -5px;
  background: var(--red);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  min-width: 16px; height: 16px;
  border-radius: 8px;
  padding: 0 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid #fff;
}

.nav-avatar {
  width: 32px; height: 32px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid transparent;
  background: var(--g-brand) padding-box, var(--g-brand) border-box;
  flex-shrink: 0;
}

.nav-username {
  font-size: 14px;
  font-weight: 600;
  color: var(--ink-1);
  max-width: 110px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.nav-user { display: flex; align-items: center; gap: 8px; }

/* ── Container ── */
.container { max-width: 800px; margin: 0 auto; padding: 0 20px; }

/* ── Buttons ── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 20px;
  border-radius: var(--radius-md);
  font-size: 14px;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: all .15s;
  text-decoration: none;
  white-space: nowrap;
}
.btn-primary {
  background: var(--g-brand);
  color: #fff;
  box-shadow: 0 3px 12px rgba(108,99,255,.35);
}
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 6px 20px rgba(108,99,255,.45); }
.btn-secondary {
  background: var(--white);
  color: var(--ink-2);
  border: 1.5px solid var(--border);
}
.btn-secondary:hover { border-color: var(--accent); color: var(--accent); background: #f0eeff; }
.btn-ghost { background: transparent; color: var(--ink-2); }
.btn-ghost:hover { background: #f5f4fa; }
.btn-danger { background: #fee2e2; color: var(--red); border: 1.5px solid #fecaca; }
.btn-danger:hover { background: #fecaca; }
.btn-success { background: #dcfce7; color: #16a34a; border: 1.5px solid #bbf7d0; }
.btn-warn    { background: #fff7ed; color: #ea580c; border: 1.5px solid #fed7aa; }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none !important; }

/* ── Cards ── */
.card {
  background: var(--white);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-md);
  border: 1px solid var(--border);
  overflow: hidden;
}
.card-pad { padding: 24px; }

/* ── Section title ── */
.sec-title {
  font-size: 18px;
  font-weight: 800;
  color: var(--ink-1);
  margin: 28px 0 14px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.sec-title::after {
  content: '';
  flex: 1;
  height: 2px;
  background: linear-gradient(90deg, var(--border), transparent);
  border-radius: 2px;
}

/* ── Form elements ── */
.field { display: flex; flex-direction: column; gap: 5px; margin-bottom: 16px; }
.field label { font-size: 13px; font-weight: 600; color: var(--ink-2); }
.field input,
.field textarea,
.field select {
  padding: 11px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  font-size: 14px;
  background: #fafafe;
  color: var(--ink-1);
  outline: none;
  transition: border .2s, box-shadow .2s;
}
.field input:focus,
.field textarea:focus,
.field select:focus {
  border-color: var(--accent);
  background: #fff;
  box-shadow: var(--shadow-glow);
}

/* ── Avatar ── */
.avatar {
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  display: block;
}
.avatar-ring {
  padding: 2px;
  background: var(--g-brand);
  border-radius: 50%;
}
.avatar-ring img { border: 2px solid #fff; border-radius: 50%; }

/* ── User row ── */
.user-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  background: #fafafe;
  border-radius: var(--radius-lg);
  border: 1.5px solid var(--border);
  margin-bottom: 8px;
  transition: border-color .15s;
}
.user-row:hover { border-color: #c8c3f5; }
.user-row img { width: 44px; height: 44px; border-radius: 50%; object-fit: cover; flex-shrink: 0; }
.user-row .name { font-weight: 700; font-size: 14px; color: var(--ink-1); }
.user-row .sub  { font-size: 12px; color: var(--ink-3); }

/* ── Status badges ── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: 99px;
  font-size: 12px;
  font-weight: 700;
}
.badge-now    { background: #fee2e2; color: #dc2626; }
.badge-soon   { background: #fff7ed; color: #ea580c; }
.badge-today  { background: #fefce8; color: #ca8a04; }
.badge-week   { background: #f0fdf4; color: #16a34a; }
.badge-month  { background: #eff6ff; color: #2563eb; }
.badge-ended  { background: #f3f4f6; color: #6b7280; }

/* ── Map ── */
#map {
  border-radius: var(--radius-xl);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
}

/* ── Modals ── */
.modal.hidden { display: none; }
.modal {
  position: fixed;
  inset: 0;
  background: rgba(15,14,23,.5);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 16px;
}
.modal-content {
  background: #fff;
  padding: 28px;
  border-radius: var(--radius-xl);
  min-width: 320px;
  max-width: 480px;
  width: 100%;
  position: relative;
  box-shadow: var(--shadow-lg);
}
.modal-close {
  position: absolute;
  right: 16px;
  top: 16px;
  border: none;
  background: #f0eeff;
  border-radius: 50%;
  width: 30px; height: 30px;
  font-size: 16px;
  cursor: pointer;
  color: var(--ink-3);
  display: flex;
  align-items: center;
  justify-content: center;
}
.modal-close:hover { background: #e0dbff; color: var(--ink-1); }

/* ── Auth pages ── */
.auth-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #fdf8f2 0%, #fef0dd 50%, #fde3d3 100%);
  padding: 20px;
}
.auth-card {
  background: #fff;
  border-radius: var(--radius-xl);
  padding: 40px 36px;
  width: 100%;
  max-width: 420px;
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border);
}
.auth-logo {
  font-size: 22px;
  font-weight: 900;
  background: var(--g-brand);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  text-align: center;
  margin-bottom: 24px;
  letter-spacing: -.5px;
}

/* Legacy form/button compat */
form { display: flex; flex-direction: column; }
input { flex: unset; }
button { background: var(--accent); color: #fff; border: none; border-radius: var(--radius-sm); padding: 8px 14px; }

/* ── Req-actions ── */
.req-actions { display: flex; gap: 6px; margin-left: auto; flex-shrink: 0; }
.btn-accept { padding: 6px 12px; background: #22c55e; color: #fff; border: none; border-radius: 8px; cursor: pointer; font-size: 13px; font-weight: 600; }
.btn-reject { padding: 6px 12px; background: #fee2e2; color: #dc2626; border: 1.5px solid #fecaca; border-radius: 8px; cursor: pointer; font-size: 13px; font-weight: 600; }

/* ── Empty note ── */
.empty-note { color: var(--ink-3); font-size: 14px; padding: 12px 0; }

/* ── Responsive ── */
@media (max-width: 520px) {
  .navbar { padding: 0 14px; }
  .nav-username { display: none; }
  .container { padding: 0 14px; }
}

/* ════════════════════════════════════════════════════════════
   THEMES  — applied via [data-theme] on <html>
════════════════════════════════════════════════════════════ */

/* ── DARK ── */
[data-theme="dark"] {
  --bg:      #0f0e17;
  --surface: #1a1828;
  --border:  #2e2b45;
  --ink-1:   #f0eeff;
  --ink-2:   #b8b5d0;
  --ink-3:   #55527a;
  --g-brand:  linear-gradient(135deg, #a78bfa 0%, #c084fc 50%, #f472b6 100%);
  --g-brand2: linear-gradient(135deg, #a78bfa 0%, #818cf8 100%);
  --accent:  #a78bfa;
  --accent2: #c084fc;
  --pink:    #f472b6;
  --shadow-sm: 0 1px 3px rgba(0,0,0,.4);
  --shadow-md: 0 4px 16px rgba(0,0,0,.4);
  --shadow-lg: 0 12px 40px rgba(0,0,0,.6);
  --shadow-glow: 0 0 0 3px rgba(167,139,250,.22);
}
[data-theme="dark"] body { background: #0f0e17; }
[data-theme="dark"] .card,
[data-theme="dark"] .modal-content { background: #1a1828; border-color: #2e2b45; }
[data-theme="dark"] .field input,
[data-theme="dark"] .field textarea,
[data-theme="dark"] .field select { background: #252338; border-color: #2e2b45; color: #f0eeff; }
[data-theme="dark"] .user-row { background: #1e1c2e; border-color: #2e2b45; }

/* ── OCEAN ── */
[data-theme="ocean"] {
  --bg:      #f0f9ff;
  --surface: #ffffff;
  --border:  #bae6fd;
  --ink-1:   #0c1e35;
  --ink-2:   #1e4976;
  --ink-3:   #6ba3c8;
  --g-brand:  linear-gradient(135deg, #0ea5e9 0%, #06b6d4 50%, #14b8a6 100%);
  --g-brand2: linear-gradient(135deg, #0ea5e9 0%, #0284c7 100%);
  --accent:  #0ea5e9;
  --accent2: #06b6d4;
  --pink:    #14b8a6;
  --shadow-md: 0 4px 16px rgba(14,165,233,.15);
  --shadow-lg: 0 12px 40px rgba(14,165,233,.2);
  --shadow-glow: 0 0 0 3px rgba(14,165,233,.18);
}
[data-theme="ocean"] body { background: #f0f9ff; }

/* ── NATURE ── */
[data-theme="nature"] {
  --bg:      #f1f8ee;
  --surface: #ffffff;
  --border:  #c6dfc0;
  --ink-1:   #1a2e18;
  --ink-2:   #2d5929;
  --ink-3:   #7aaa70;
  --g-brand:  linear-gradient(135deg, #22c55e 0%, #16a34a 50%, #15803d 100%);
  --g-brand2: linear-gradient(135deg, #22c55e 0%, #16a34a 100%);
  --accent:  #16a34a;
  --accent2: #22c55e;
  --pink:    #84cc16;
  --shadow-md: 0 4px 16px rgba(22,163,74,.12);
  --shadow-lg: 0 12px 40px rgba(22,163,74,.18);
  --shadow-glow: 0 0 0 3px rgba(22,163,74,.18);
}
[data-theme="nature"] body { background: #f1f8ee; }
[data-theme="nature"] .nav-msg-wrap { background: #f0fdf4; border-color: #bbf7d0; }
[data-theme="nature"] .nav-msg-wrap:hover { background: #dcfce7; }

/* ── SUNSET ── */
[data-theme="sunset"] {
  --bg:      #fff8f0;
  --surface: #ffffff;
  --border:  #fed7aa;
  --ink-1:   #2c1a00;
  --ink-2:   #7c3500;
  --ink-3:   #c2813a;
  --g-brand:  linear-gradient(135deg, #f97316 0%, #f59e0b 50%, #ef4444 100%);
  --g-brand2: linear-gradient(135deg, #f97316 0%, #ea580c 100%);
  --accent:  #f97316;
  --accent2: #f59e0b;
  --pink:    #ef4444;
  --shadow-md: 0 4px 16px rgba(249,115,22,.15);
  --shadow-lg: 0 12px 40px rgba(249,115,22,.2);
  --shadow-glow: 0 0 0 3px rgba(249,115,22,.18);
}
[data-theme="sunset"] body { background: #fff8f0; }
[data-theme="sunset"] .nav-msg-wrap { background: #fff7ed; border-color: #fed7aa; }
[data-theme="sunset"] .nav-msg-wrap:hover { background: #ffedd5; }

/* ── ROSE ── */
[data-theme="rose"] {
  --bg:      #fff0f6;
  --surface: #ffffff;
  --border:  #fbcfe8;
  --ink-1:   #3b0a1e;
  --ink-2:   #831843;
  --ink-3:   #c084a0;
  --g-brand:  linear-gradient(135deg, #ec4899 0%, #f43f5e 50%, #a855f7 100%);
  --g-brand2: linear-gradient(135deg, #ec4899 0%, #db2777 100%);
  --accent:  #ec4899;
  --accent2: #f43f5e;
  --pink:    #a855f7;
  --shadow-md: 0 4px 16px rgba(236,72,153,.15);
  --shadow-lg: 0 12px 40px rgba(236,72,153,.2);
  --shadow-glow: 0 0 0 3px rgba(236,72,153,.18);
}
[data-theme="rose"] body { background: #fff0f6; }
[data-theme="rose"] .nav-msg-wrap { background: #fdf2f8; border-color: #fbcfe8; }

/* ── Dark mode specific overrides (cards, inputs, etc.) ── */
[data-theme="dark"] .auth-wrap { background: linear-gradient(135deg,#0f0e17,#1a1828,#1e1c2e); }
[data-theme="dark"] .auth-card { background: #1a1828; border-color: #2e2b45; }
[data-theme="dark"] input,
[data-theme="dark"] textarea,
[data-theme="dark"] select { background: #252338 !important; border-color: #2e2b45 !important; color: #f0eeff !important; }
[data-theme="dark"] input::placeholder,
[data-theme="dark"] textarea::placeholder { color: #55527a; }
