/*
  SF Food Truck Hub — Styles
  Palette:
    Golden Gate Red  #C0362C
    Ocean Blue       #0077B6
    Fog Gray         #E5E7EB
    Pastel accents   #FDE68A (soft yellow), #FBCFE8 (pink), #A7F3D0 (aqua)
  Fonts:
    Headings: Montserrat
    Body: Inter
    Accent: DM Serif Display
*/

:root {
  --red: #C0362C;
  --blue: #0077B6;
  --fog: #E5E7EB;
  --ink: #0f172a; /* slate-900 */
  --ink-70: #334155;
  --bg: #ffffff;
  --card: #ffffff;
  --muted: #6b7280;
  --pastel-yellow: #FDE68A;
  --pastel-pink: #FBCFE8;
  --pastel-aqua: #A7F3D0;
  --radius: 14px;
  --radius-lg: 18px;
  --shadow: 0 10px 25px rgba(15, 23, 42, 0.08);
}

* { box-sizing: border-box; }
html, body { height: 100%; }

body {
  margin: 0;
  font-family: Inter, system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  color: var(--ink);
  background: linear-gradient(180deg, #fff 0%, #f9fafb 100%);
}

img { max-width: 100%; display: block; }
a { color: var(--red); text-decoration: none; }
a:hover { text-decoration: underline; }

.container {
  width: min(1100px, 92vw);
  margin: 0 auto;
}

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 30;
  background: rgba(255,255,255,0.85);
  backdrop-filter: saturate(150%) blur(12px);
  border-bottom: 1px solid rgba(15, 23, 42, 0.06);
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 0;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  color: var(--ink);
}
.logo-dot {
  width: 14px; height: 14px; border-radius: 50%; background: var(--red);
  box-shadow: 0 0 0 6px rgba(192, 54, 44, 0.1);
}
.brand-text {
  font-family: Montserrat, Inter, sans-serif;
  letter-spacing: 0.2px;
}
.nav { display: flex; align-items: center; gap: 18px; }
.nav-link { color: var(--ink-70); padding: 8px 10px; border-radius: 10px; display: inline-flex; align-items: center; }
.nav-link.is-active, .nav-link:hover {
  background: var(--fog);
  text-decoration: none;
}
.nav-auth { display: inline-flex; gap: 12px; align-items: center; }
.nav-auth .btn { height: 34px; padding: 0 12px; }
.nav-auth .signup { background: var(--blue); color: #fff; border-color: transparent; }

/* Hero */
.hero { padding: 56px 0 26px; }
.hero-compact { padding: 32px 0 12px; }
.hero-inner { display: grid; grid-template-columns: 1.2fr 1fr; gap: 28px; align-items: center; }
@media (max-width: 900px) { .hero-inner { grid-template-columns: 1fr; } }
.hero-title {
  font-family: Montserrat, Inter, sans-serif;
  font-weight: 800;
  letter-spacing: -0.5px;
  font-size: clamp(28px, 4vw, 44px);
  margin: 0 0 8px;
}
.hero-subtitle { color: var(--ink-70); margin: 0 0 18px; }
.hero-actions { display: flex; gap: 12px; }
.hero-card {
  background: var(--card);
  border-radius: var(--radius-lg);
  padding: 16px;
  box-shadow: var(--shadow);
  border: 1px solid rgba(15, 23, 42, 0.06);
}

/* Forms */
.input, .select, .textarea {
  width: 100%;
  border: 1px solid rgba(15, 23, 42, 0.12);
  background: #fff;
  color: var(--ink);
  padding: 12px 14px;
  border-radius: var(--radius);
  outline: none;
  caret-color: var(--ink); /* ensure the blinking cursor is visible */
}
.input:focus, .select:focus, .textarea:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 4px rgba(0, 119, 182, 0.15);
}
.label { font-size: 14px; color: var(--muted); margin-bottom: 6px; display: block; }

/* Placeholder and autofill tweaks so caret and text remain visible */
.input::placeholder, .textarea::placeholder { color: var(--muted); opacity: 1; }

/* Chrome/Edge autofill styles */
input:-webkit-autofill, textarea:-webkit-autofill {
  -webkit-text-fill-color: var(--ink) !important;
  caret-color: var(--ink) !important;
}

.search { position: relative; display: flex; gap: 8px; align-items: center; }
.btn-icon { border: none; background: var(--fog); border-radius: 10px; height: 40px; width: 40px; cursor: pointer; }
.btn-icon:hover { background: #dbe1e8; }
.hint { color: var(--muted); font-size: 13px; margin-top: 10px; }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; height: 44px; padding: 0 16px; border-radius: 999px; border: 1px solid transparent; cursor: pointer; font-weight: 600; font-size: 15px; line-height: 1; text-decoration: none; }
.btn:hover { text-decoration: none; }
.btn-primary { background: var(--red); color: white; }
.btn-primary:hover { filter: brightness(0.95); }
.btn-ghost { background: transparent; color: var(--red); border-color: rgba(192, 54, 44, 0.35); }
.btn-ghost:hover { background: rgba(192, 54, 44, 0.08); }

/* Map */
.map-section { padding: 28px 0; }
.section-title { font-family: Montserrat, Inter, sans-serif; font-size: 22px; margin: 0 0 14px; }
.section-title.accent { font-family: "DM Serif Display", Georgia, "Times New Roman", serif; font-weight: 400; letter-spacing: 0.2px; }
.map { width: 100%; height: 420px; border-radius: var(--radius-lg); overflow: hidden; box-shadow: var(--shadow); border: 1px solid rgba(15, 23, 42, 0.06); }
.map-caption { color: var(--muted); font-size: 13px; margin-top: 8px; }

/* Cards */
.cards-section { padding: 18px 0 40px; }
.grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
@media (max-width: 1000px) { .grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 650px) { .grid { grid-template-columns: 1fr; } }
.card {
  background: var(--card);
  border-radius: 18px;
  padding: 14px;
  box-shadow: var(--shadow);
  border: 1px solid rgba(15, 23, 42, 0.06);
}
.card .title { font-weight: 700; margin: 8px 0 6px; font-family: Montserrat, Inter, sans-serif; }
.card .meta { color: var(--muted); font-size: 13px; }
.card .tag { display: inline-block; font-size: 12px; padding: 6px 10px; border-radius: 999px; background: var(--fog); margin-right: 6px; }
.card .actions { margin-top: 10px; display: flex; gap: 8px; }

/* Reviews */
.reviews-section { padding: 22px 0 40px; }
.reviews-layout { display: grid; grid-template-columns: 1fr 340px; gap: 22px; align-items: start; }
@media (max-width: 980px) { .reviews-layout { grid-template-columns: 1fr; } }
.reviews-main { display: grid; gap: 14px; }
.reviews-aside .sticky { position: sticky; top: 88px; }
.reviews-controls { display: flex; gap: 12px; align-items: end; margin-bottom: 8px; }
.reviews-list { display: grid; gap: 16px; margin-bottom: 22px; }
.review-item { display: grid; grid-template-columns: 1fr auto; gap: 6px 12px; padding: 10px 0; border-bottom: 1px dashed rgba(15, 23, 42, 0.08); }
.review-item:last-child { border-bottom: none; }
.review-text { margin: 0; color: var(--ink-70); }
.stars { display: inline-flex; gap: 4px; }
.star { font-size: 22px; color: #d1d5db; cursor: pointer; }
.star.filled { color: #f59e0b; }
.form { display: grid; gap: 12px; }
.form-row { display: grid; gap: 6px; }
.form-actions { display: flex; justify-content: flex-end; }

/* Truck header in reviews with average rating badge */
.truck-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.rating-badge { display: inline-flex; align-items: center; gap: 6px; padding: 6px 10px; border-radius: 999px; background: #fff7ed; color: #b45309; border: 1px solid #fed7aa; font-weight: 600; font-size: 14px; }
.rating-badge .star { font-size: 16px; color: #f59e0b; cursor: default; }

/* Ocean blue accent blocks */
.about-section { padding: 30px 0 60px; background: linear-gradient(180deg, rgba(0,119,182,0.06), rgba(0,119,182,0.02)); border-top: 1px solid rgba(0, 119, 182, 0.15); border-bottom: 1px solid rgba(0, 119, 182, 0.1); }
.about-section .section-title { color: #0c4a6e; }

/* Footer */
.site-footer { padding: 22px 0; border-top: 1px solid rgba(15, 23, 42, 0.06); background: #fff; }
.footer-inner { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.footer-nav { display: flex; gap: 12px; }
.heart { color: var(--red); }

/* Leaflet overrides */
.leaflet-container a { color: var(--blue); }
.leaflet-popup-content-wrapper { border-radius: 16px; }
.leaflet-control-zoom a { border-radius: 10px !important; }

/* Popup buttons inside Leaflet popups */
.leaflet-popup-content .btn { height: 34px; padding: 6px 10px; font-size: 14px; border-radius: 10px; }
.leaflet-popup-content .btn + .btn, .leaflet-popup-content a + .btn { margin-left: 8px; }

/* Hacker / secret aesthetic for admin page */
.admin-hacker {
  --hacker-bg: #071017; /* near-black teal */
  --hacker-panel: rgba(0, 0, 0, 0.45);
  --neon: #39ff14; /* neon green */
  --neon-dim: rgba(57,255,20,0.14);
  font-family: 'Fira Code', ui-monospace, SFMono-Regular, Menlo, Monaco, 'Roboto Mono', monospace;
  background: radial-gradient(1200px 400px at 10% 10%, rgba(57,255,20,0.03), transparent), var(--hacker-bg);
  color: var(--neon);
}
.admin-hacker .site-header { background: transparent; border-bottom: 1px solid rgba(57,255,20,0.07); }
.admin-hacker .brand-text { color: var(--neon); }
.admin-hacker .nav-link { color: rgba(57,255,20,0.8); }

/* Card panels in admin get a terminal-style look */
.admin-hacker .card { background: linear-gradient(180deg, rgba(0,0,0,0.35), rgba(0,0,0,0.25)); border: 1px solid rgba(57,255,20,0.08); box-shadow: none; }
.admin-hacker .section-title { color: var(--neon); }

/* Inputs and buttons */
.admin-hacker .input, .admin-hacker .textarea, .admin-hacker .select {
  background: linear-gradient(180deg, rgba(0,0,0,0.18), rgba(0,0,0,0.08));
  border: 1px solid rgba(57,255,20,0.12);
  color: var(--neon);
  caret-color: var(--neon);
}
.admin-hacker .input:focus, .admin-hacker .textarea:focus { box-shadow: 0 0 18px var(--neon-dim); border-color: var(--neon); }

/* Neon buttons */
.admin-hacker .btn-primary { background: transparent; color: var(--neon); border: 1px solid rgba(57,255,20,0.18); box-shadow: 0 6px 20px rgba(57,255,20,0.04); }
.admin-hacker .btn-ghost { background: transparent; color: rgba(57,255,20,0.9); border: 1px solid rgba(57,255,20,0.06); }

/* Scanline overlay */
.admin-hacker::after {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image: linear-gradient(rgba(0,0,0,0.02) 50%, rgba(255,255,255,0.01) 50%);
  background-size: 100% 4px;
  mix-blend-mode: overlay;
}

/* Animated cursor effect for title */
.admin-hacker .hero-title::after, .admin-hacker .brand-text::after {
  content: '|';
  margin-left: 8px;
  opacity: 0.9;
  animation: blink 1s steps(2, start) infinite;
}
@keyframes blink { 50% { opacity: 0; } }

/* Make admin action buttons look like terminal prompt */
.admin-hacker .btn { font-weight: 700; letter-spacing: 0.6px; }
