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

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: #f8fafc;
  color: #1e293b;
  min-height: 100vh;
}

a { color: #0ea5e9; text-decoration: none; }
a:hover { text-decoration: underline; }

.container { max-width: 800px; margin: 0 auto; padding: 0 1rem; }

/* Nav */
nav {
  background: #0f172a;
  color: white;
  padding: 0.75rem 1rem;
}
nav .nav-inner {
  max-width: 800px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
nav .brand {
  font-size: 1.1rem;
  font-weight: 700;
  color: white;
  text-decoration: none;
}
nav .nav-links a {
  color: #94a3b8;
  margin-left: 1.5rem;
  font-size: 0.9rem;
}
nav .nav-links a:hover { color: white; text-decoration: none; }

/* Hero */
.hero {
  background: linear-gradient(135deg, #0f172a 0%, #1e3a5f 100%);
  color: white;
  padding: 3rem 1rem;
  text-align: center;
}
.hero h1 { font-size: clamp(1.5rem, 4vw, 2.5rem); margin-bottom: 1rem; }
.hero p { font-size: 1.1rem; color: #cbd5e1; max-width: 560px; margin: 0 auto 2rem; }

/* Map thumbnail */
.map-thumb { border-radius: 0.75rem; overflow: hidden; margin: 1.5rem auto; max-width: 560px; border: 2px solid #334155; }
.map-thumb iframe { display: block; width: 100%; height: 250px; border: none; }

/* Search panel */
.search-panel {
  background: white;
  border-radius: 1rem;
  padding: 1.5rem;
  max-width: 560px;
  margin: 0 auto;
  box-shadow: 0 4px 24px rgba(0,0,0,0.12);
}
.search-info { font-size: 0.875rem; color: #64748b; margin-bottom: 0.4rem; }
.search-info span { font-weight: 600; color: #1e293b; }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  border-radius: 0.5rem;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: background 0.2s;
  text-decoration: none;
}
.btn-primary { background: #0ea5e9; color: white; width: 100%; justify-content: center; margin-top: 1rem; }
.btn-primary:hover { background: #0284c7; color: white; text-decoration: none; }
.btn-secondary { background: #e2e8f0; color: #1e293b; }
.btn-secondary:hover { background: #cbd5e1; text-decoration: none; }
.btn-outline { background: transparent; color: #0ea5e9; border: 2px solid #0ea5e9; }
.btn-outline:hover { background: #e0f2fe; text-decoration: none; }

/* Trust banner */
.trust-banner {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  border-radius: 0.75rem;
  padding: 1rem;
  margin: 1.5rem auto;
  max-width: 560px;
  font-size: 0.875rem;
  color: #166534;
}
.trust-banner .icon { font-size: 1.5rem; flex-shrink: 0; }

/* Results */
.results-header {
  padding: 1.5rem 1rem;
  background: white;
  border-bottom: 1px solid #e2e8f0;
}
.results-meta {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}
.stat-value { font-size: 1.5rem; font-weight: 700; color: #0f172a; }
.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.75rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 600;
}
.badge-blue { background: #dbeafe; color: #1d4ed8; }
.badge-green { background: #dcfce7; color: #166534; }
.badge-walk { background: #f0f9ff; color: #0369a1; }

/* Clinic card */
.clinic-list { padding: 1rem; }
.clinic-card {
  background: white;
  border-radius: 0.75rem;
  padding: 1.25rem;
  margin-bottom: 1rem;
  border: 1px solid #e2e8f0;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  box-shadow: 0 1px 4px rgba(0,0,0,0.06);
  transition: box-shadow 0.2s;
}
.clinic-card:hover { box-shadow: 0 4px 16px rgba(0,0,0,0.1); }
.clinic-card-header { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; }
.clinic-name { font-size: 1.1rem; font-weight: 700; color: #0f172a; }
.clinic-address { font-size: 0.875rem; color: #64748b; }
.clinic-card-footer { display: flex; justify-content: space-between; align-items: center; }

/* Map section */
.map-section { margin: 1rem; border-radius: 0.75rem; overflow: hidden; border: 1px solid #e2e8f0; }
.map-section iframe { display: block; width: 100%; height: 260px; border: none; }

/* Empty / error states */
.state-box {
  text-align: center;
  padding: 3rem 1rem;
  color: #64748b;
}
.state-box .state-icon { font-size: 3rem; margin-bottom: 1rem; }
.state-box h2 { font-size: 1.1rem; color: #0f172a; margin-bottom: 0.5rem; }
.state-box p { font-size: 0.95rem; margin-bottom: 1.5rem; }

/* Clinic detail */
.detail-header {
  background: white;
  padding: 1.5rem 1rem;
  border-bottom: 1px solid #e2e8f0;
}
.detail-header h1 { font-size: 1.5rem; font-weight: 700; margin-bottom: 0.75rem; }
.detail-badges { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.detail-info {
  background: white;
  margin: 1rem;
  border-radius: 0.75rem;
  padding: 1.25rem;
  border: 1px solid #e2e8f0;
}
.detail-info-row {
  display: flex;
  gap: 0.75rem;
  align-items: flex-start;
  padding: 0.6rem 0;
  border-bottom: 1px solid #f1f5f9;
  font-size: 0.95rem;
}
.detail-info-row:last-child { border-bottom: none; }
.detail-info-label { font-weight: 600; color: #475569; min-width: 120px; flex-shrink: 0; }
.detail-actions { padding: 0 1rem 1rem; display: flex; flex-direction: column; gap: 0.75rem; }

/* About */
.about-section {
  background: white;
  margin: 1rem;
  border-radius: 0.75rem;
  padding: 1.5rem;
  border: 1px solid #e2e8f0;
}
.about-section h2 { font-size: 1.1rem; font-weight: 700; margin-bottom: 0.75rem; color: #0f172a; }
.about-section p { font-size: 0.95rem; color: #475569; margin-bottom: 0.75rem; line-height: 1.6; }

/* Footer */
footer {
  text-align: center;
  padding: 2rem 1rem;
  font-size: 0.8rem;
  color: #94a3b8;
}
footer a { color: #94a3b8; }

/* Loading indicator */
.htmx-indicator { display: none; }
.htmx-request .htmx-indicator { display: inline; }
.htmx-request.htmx-indicator { display: inline; }

/* Spinner */
.spinner {
  display: inline-block;
  width: 1.25rem;
  height: 1.25rem;
  border: 3px solid rgba(255,255,255,0.3);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

@media (max-width: 600px) {
  .clinic-card-footer { flex-direction: column; align-items: flex-start; gap: 0.5rem; }
  .detail-info-label { min-width: 90px; }
}
