/* ═══════════════════════════════════════════════════
   FitnessNearMe.in — style.css
   Theme: Dark Athletic / Neon Lime
   Fonts: Bebas Neue (display) + DM Sans (body)
═══════════════════════════════════════════════════ */

/* ─── CSS VARIABLES ──────────────────────────────── */
:root {
  --bg:            #090909;
  --surface:       #111111;
  --card:          #161616;
  --card-hover:    #1c1c1c;
  --border:        #1f1f1f;
  --border-soft:   #2a2a2a;

  --accent:        #c8ff00;
  --accent-dim:    rgba(200, 255, 0, 0.08);
  --accent-glow:   rgba(200, 255, 0, 0.15);
  --danger:        #ff4d1c;

  --text:          #f2f2f2;
  --text-muted:    #555;
  --text-faint:    #333;

  /* Category colours */
  --c-gym:     #c8ff00;
  --c-yoga:    #00d4ff;
  --c-dance:   #ff4d1c;
  --c-zumba:   #ff8c00;
  --c-protein: #a855f7;
  --c-martial: #ef4444;

  --radius-card:  12px;
  --radius-pill:  50px;
  --header-h:     60px;

  --transition: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ─── RESET ───────────────────────────────────────── */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'DM Sans', sans-serif;
  font-size: 16px;
  line-height: 1.5;
  min-height: 100vh;
  overflow-x: hidden;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
button { cursor: pointer; font-family: inherit; }

/* Noise texture overlay */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  background-image:
    url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.035'/%3E%3C/svg%3E");
  pointer-events: none;
  z-index: 0;
}


/* ─── HEADER ─────────────────────────────────────── */
#site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--header-h);
  background: rgba(9, 9, 9, 0.92);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border-bottom: 1px solid var(--border);
  padding: 0 2.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 1.75rem;
  letter-spacing: 0.04em;
  color: var(--text);
}
.logo-accent { color: var(--accent); }
.logo-domain { color: var(--text-muted); font-size: 0.85em; }

.header-badge {
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-muted);
  border: 1px solid var(--border-soft);
  padding: 5px 12px;
  border-radius: var(--radius-pill);
}


/* ─── HERO ───────────────────────────────────────── */
.hero {
  position: relative;
  z-index: 2;
  padding: 5rem 2rem 2.5rem;
  text-align: center;
  overflow: hidden;
}

.hero-bg-text {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -55%);
  font-family: 'Bebas Neue', sans-serif;
  font-size: clamp(9rem, 30vw, 26rem);
  color: rgba(200, 255, 0, 0.025);
  letter-spacing: -0.02em;
  white-space: nowrap;
  user-select: none;
  pointer-events: none;
  z-index: 0;
}

.hero-content {
  position: relative;
  z-index: 2;
  max-width: 760px;
  margin: 0 auto;
}

.hero-eyebrow {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 1.2rem;
}
.eyebrow-line {
  display: inline-block;
  width: 36px;
  height: 1px;
  background: var(--accent);
  opacity: 0.5;
}

.hero-title {
  font-family: 'Bebas Neue', sans-serif;
  font-size: clamp(3.8rem, 10vw, 7.5rem);
  line-height: 0.92;
  letter-spacing: 0.02em;
  margin-bottom: 1.2rem;
  animation: fadeUp 0.7s ease both;
}
.hero-title em {
  font-style: normal;
  color: var(--accent);
  display: block;
}

.hero-sub {
  font-size: 1rem;
  font-weight: 300;
  color: var(--text-muted);
  max-width: 500px;
  margin: 0 auto 2.5rem;
  line-height: 1.65;
  animation: fadeUp 0.7s 0.1s ease both;
}

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}


/* ─── SEARCH BAR ─────────────────────────────────── */
.search-bar {
  display: flex;
  align-items: center;
  max-width: 620px;
  margin: 0 auto 0.8rem;
  background: var(--surface);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-pill);
  overflow: hidden;
  transition: border-color var(--transition), box-shadow var(--transition);
  animation: fadeUp 0.7s 0.2s ease both;
}
.search-bar:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-glow);
}

.search-icon {
  padding: 0 0 0 1.3rem;
  font-size: 1rem;
  pointer-events: none;
}

#location-input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  padding: 0 0.8rem;
  font-size: 0.95rem;
  font-family: 'DM Sans', sans-serif;
  color: var(--text);
  height: 58px;
}
#location-input::placeholder { color: var(--text-muted); }

.btn-gps {
  background: none;
  border: none;
  color: var(--text-muted);
  padding: 0 0.8rem;
  height: 58px;
  font-size: 1.25rem;
  display: flex;
  align-items: center;
  transition: color var(--transition), transform var(--transition);
}
.btn-gps:hover {
  color: var(--accent);
  transform: scale(1.15);
}

.btn-search {
  background: var(--accent);
  color: #000;
  border: none;
  padding: 0 1.8rem;
  height: 58px;
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  transition: background var(--transition), transform var(--transition);
  white-space: nowrap;
  flex-shrink: 0;
}
.btn-search:hover { background: #d5ff33; transform: scale(1.02); }
.btn-search:active { transform: scale(0.98); }

.search-hint {
  font-size: 0.75rem;
  color: var(--text-faint);
  margin-bottom: 2rem;
  animation: fadeUp 0.7s 0.25s ease both;
}


/* ─── CATEGORY PILLS ─────────────────────────────── */
.categories {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.45rem;
  margin-bottom: 1.4rem;
  animation: fadeUp 0.7s 0.3s ease both;
}

.cat-pill {
  border: 1px solid var(--border-soft);
  background: var(--surface);
  color: var(--text-muted);
  border-radius: var(--radius-pill);
  padding: 8px 18px;
  font-size: 0.82rem;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 5px;
  letter-spacing: 0.01em;
  transition: all var(--transition);
}
.cat-pill:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-dim);
}
.cat-pill.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #000;
  font-weight: 700;
}

/* Per-category active colours */
.cat-pill[data-cat="gym"].active    { --accent: var(--c-gym); background: var(--c-gym); border-color: var(--c-gym); color: #000; }
.cat-pill[data-cat="yoga"].active   { background: var(--c-yoga);    border-color: var(--c-yoga);    color: #000; }
.cat-pill[data-cat="dance"].active  { background: var(--c-dance);   border-color: var(--c-dance);   color: #fff; }
.cat-pill[data-cat="zumba"].active  { background: var(--c-zumba);   border-color: var(--c-zumba);   color: #000; }
.cat-pill[data-cat="protein"].active{ background: var(--c-protein); border-color: var(--c-protein); color: #fff; }
.cat-pill[data-cat="martial"].active{ background: var(--c-martial); border-color: var(--c-martial); color: #fff; }


/* ─── RADIUS SLIDER ──────────────────────────────── */
.radius-control {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.9rem;
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
  animation: fadeUp 0.7s 0.35s ease both;
}

#radius-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 160px;
  height: 3px;
  background: var(--border-soft);
  border-radius: 2px;
  outline: none;
  cursor: pointer;
}
#radius-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 15px;
  height: 15px;
  border-radius: 50%;
  background: var(--accent);
  cursor: pointer;
  transition: transform var(--transition);
}
#radius-slider::-webkit-slider-thumb:hover { transform: scale(1.3); }
#radius-slider::-moz-range-thumb {
  width: 15px; height: 15px;
  border-radius: 50%;
  background: var(--accent);
  border: none;
  cursor: pointer;
}

#radius-label {
  color: var(--accent);
  font-weight: 600;
  min-width: 48px;
  text-align: left;
}


/* ─── MAIN GRID ───────────────────────────────────── */
.main-grid {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: 400px 1fr;
  margin: 0 2rem 2.5rem;
  border: 1px solid var(--border);
  border-radius: 16px;
  overflow: hidden;
  min-height: 520px;
  max-height: 660px;
}


/* ─── RESULTS PANEL ──────────────────────────────── */
.results-panel {
  background: var(--surface);
  border-right: 1px solid var(--border);
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}

/* Custom scrollbar */
.results-panel::-webkit-scrollbar { width: 4px; }
.results-panel::-webkit-scrollbar-track { background: transparent; }
.results-panel::-webkit-scrollbar-thumb { background: var(--border-soft); border-radius: 2px; }

.results-header {
  padding: 1rem 1.4rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  background: var(--surface);
  z-index: 5;
  flex-shrink: 0;
}

.results-count {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 1rem;
  letter-spacing: 0.06em;
  color: var(--text);
}
.results-count strong { color: var(--accent); }

.sort-select {
  background: var(--card);
  border: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 0.72rem;
  font-family: 'DM Sans', sans-serif;
  padding: 5px 10px;
  border-radius: 8px;
  outline: none;
  cursor: pointer;
  transition: border-color var(--transition);
}
.sort-select:focus { border-color: var(--accent); }


/* ─── STATE BOXES ────────────────────────────────── */
.state-box {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2.5rem 2rem;
  text-align: center;
  gap: 0.8rem;
}

.state-icon { font-size: 2.8rem; opacity: 0.35; }

.state-title {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 1.35rem;
  letter-spacing: 0.06em;
  color: var(--text-muted);
}

.state-desc {
  font-size: 0.8rem;
  color: var(--text-muted);
  opacity: 0.65;
  max-width: 240px;
  line-height: 1.55;
}

/* Spinner */
.spinner {
  width: 34px;
  height: 34px;
  border: 3px solid var(--border-soft);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.75s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }


/* ─── RESULT CARD ────────────────────────────────── */
.result-card {
  display: flex;
  align-items: flex-start;
  gap: 0.9rem;
  padding: 1rem 1.4rem;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: background var(--transition);
  animation: slideIn 0.3s ease both;
}
.result-card:last-child { border-bottom: none; }

@keyframes slideIn {
  from { opacity: 0; transform: translateX(-10px); }
  to   { opacity: 1; transform: translateX(0); }
}

.result-card:hover   { background: var(--accent-dim); }
.result-card.active  {
  background: rgba(200,255,0,0.06);
  border-left: 3px solid var(--accent);
}

.card-icon {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  flex-shrink: 0;
}

.card-body { flex: 1; min-width: 0; }

.card-name {
  font-size: 0.9rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 4px;
}

.card-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  font-size: 0.73rem;
  color: var(--text-muted);
}

.card-tag {
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 2px 8px;
  border-radius: var(--radius-pill);
}

.card-dist { display: flex; align-items: center; gap: 3px; }

.card-address {
  font-size: 0.72rem;
  color: var(--text-muted);
  opacity: 0.6;
  margin-top: 5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Direction button */
.card-dir {
  flex-shrink: 0;
  background: none;
  border: 1px solid var(--border-soft);
  color: var(--text-muted);
  border-radius: 8px;
  padding: 6px 10px;
  font-size: 0.8rem;
  align-self: center;
  transition: all var(--transition);
}
.card-dir:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-dim);
}


/* ─── MAP ─────────────────────────────────────────── */
#map {
  background: #0c0c0c;
  min-height: 400px;
}

/* Override Leaflet popup to match dark theme */
.leaflet-popup-content-wrapper {
  background: var(--card);
  color: var(--text);
  border: 1px solid var(--border-soft);
  border-radius: 10px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.6);
}
.leaflet-popup-tip { background: var(--card); }
.leaflet-popup-content {
  font-family: 'DM Sans', sans-serif;
  font-size: 0.82rem;
  line-height: 1.5;
  margin: 10px 14px;
}
.popup-name {
  font-weight: 700;
  font-size: 0.9rem;
  margin-bottom: 4px;
  color: var(--text);
}
.popup-tag {
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 2px 8px;
  border-radius: 20px;
  display: inline-block;
  margin-bottom: 6px;
}
.popup-dist { color: var(--text-muted); font-size: 0.75rem; margin-top: 4px; }
.popup-addr { color: var(--text-muted); font-size: 0.72rem; opacity: 0.7; }
.popup-link {
  display: inline-block;
  margin-top: 8px;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--accent);
}


/* ─── STATS STRIP ────────────────────────────────── */
.stats-strip {
  position: relative;
  z-index: 2;
  display: flex;
  justify-content: stretch;
  margin: 0 2rem 3rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  overflow: hidden;
}

.stat-item {
  flex: 1;
  padding: 1.4rem 1rem;
  text-align: center;
  border-right: 1px solid var(--border);
  transition: background var(--transition);
}
.stat-item:last-child { border-right: none; }
.stat-item:hover { background: var(--accent-dim); }

.stat-num {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 2.4rem;
  color: var(--accent);
  letter-spacing: 0.02em;
  line-height: 1;
  margin-bottom: 4px;
}

.stat-label {
  font-size: 0.7rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-weight: 500;
}


/* ─── FOOTER ─────────────────────────────────────── */
.site-footer {
  position: relative;
  z-index: 2;
  border-top: 1px solid var(--border);
  padding: 2rem 2.5rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.8rem;
}

.footer-logo {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 1.35rem;
  letter-spacing: 0.04em;
}

.footer-copy {
  font-size: 0.75rem;
  color: var(--text-muted);
}


/* ─── TOAST ──────────────────────────────────────── */
#toast {
  position: fixed;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%) translateY(90px);
  background: var(--surface);
  border: 1px solid var(--border-soft);
  color: var(--text);
  padding: 0.75rem 1.6rem;
  border-radius: var(--radius-pill);
  font-size: 0.85rem;
  font-weight: 500;
  z-index: 9999;
  transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
  white-space: nowrap;
  box-shadow: 0 8px 40px rgba(0,0,0,0.6);
  pointer-events: none;
}
#toast.show          { transform: translateX(-50%) translateY(0); }
#toast.toast-error   { border-color: var(--danger);  color: var(--danger); }
#toast.toast-success { border-color: var(--accent);  color: var(--accent); }


/* ─── LEAFLET CUSTOM MARKER ──────────────────────── */
.custom-marker {
  width: 32px;
  height: 32px;
  border-radius: 50% 50% 50% 0;
  transform: rotate(-45deg);
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid rgba(255,255,255,0.15);
  box-shadow: 0 4px 12px rgba(0,0,0,0.5);
}
.custom-marker span {
  transform: rotate(45deg);
  font-size: 0.95rem;
  line-height: 1;
}

/* User location pulse */
.user-pulse {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 0 var(--accent-glow);
  animation: pulse 1.8s ease-in-out infinite;
}
@keyframes pulse {
  0%   { box-shadow: 0 0 0 0   rgba(200,255,0,0.5); }
  70%  { box-shadow: 0 0 0 14px rgba(200,255,0,0); }
  100% { box-shadow: 0 0 0 0   rgba(200,255,0,0); }
}


/* ─── RESPONSIVE ─────────────────────────────────── */
@media (max-width: 960px) {
  .main-grid {
    grid-template-columns: 1fr;
    grid-template-rows: 300px minmax(300px, auto);
    margin: 0 1rem 2rem;
    max-height: none;
  }
  #map { grid-row: 1; min-height: 300px; }
  .results-panel { grid-row: 2; max-height: 50vh; }

  .stats-strip { margin: 0 1rem 2rem; flex-wrap: wrap; }
  .stat-item { min-width: 100px; border-right: 1px solid var(--border); border-bottom: 1px solid var(--border); }

  .hero { padding: 3.5rem 1.2rem 2rem; }
}

@media (max-width: 600px) {
  #site-header { padding: 0 1.2rem; }
  .header-badge { display: none; }
  .search-bar { border-radius: 12px; }
  .btn-search { padding: 0 1.2rem; font-size: 0.78rem; }
  .site-footer { flex-direction: column; text-align: center; }
}

/* ─── AUTH PAGES (LOGIN / PROFILE) ───────────────── */

.auth-wrapper {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle at top, #111 0%, #090909 60%);
}

.auth-card {
  background: var(--card);
  border: 1px solid var(--border);
  padding: 2.5rem;
  border-radius: 16px;
  width: 100%;
  max-width: 360px;
  text-align: center;
  box-shadow: 0 20px 60px rgba(0,0,0,0.6);
  animation: fadeUp 0.6s ease;
}

.auth-title {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 2.5rem;
  margin-bottom: 0.5rem;
}

.auth-sub {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-bottom: 1.5rem;
}

.auth-card input {
  width: 100%;
  padding: 12px;
  margin-bottom: 10px;
  background: var(--surface);
  border: 1px solid var(--border-soft);
  border-radius: 8px;
  color: var(--text);
}

.auth-card input:focus {
  border-color: var(--accent);
  outline: none;
}

.btn-primary {
  width: 100%;
  padding: 12px;
  background: var(--accent);
  color: #000;
  border: none;
  font-weight: 700;
  margin-top: 10px;
  border-radius: 8px;
  cursor: pointer;
}

.btn-primary:hover {
  background: #d5ff33;
}

.btn-danger {
  width: 100%;
  padding: 12px;
  background: #ff4d1c;
  color: #fff;
  border: none;
  margin-top: 10px;
  border-radius: 8px;
  cursor: pointer;
}

.auth-link {
  margin-top: 1rem;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.auth-link span {
  color: var(--accent);
  cursor: pointer;
}

.profile-box {
  background: var(--surface);
  padding: 1rem;
  border-radius: 10px;
  margin-bottom: 1rem;
}