/* SaveDigit EV Locator — ev.saveDigit.com
   Android-style dark theme: EV green + dark surfaces */

/* ——— 🎨 Design System (aligned with Android app) ——— */
:root {
  /* Brand greens (from Android theme) */
  --primary: #39B54A;
  --primary-hover: #2f9a3f;
  --primary-light: rgba(57, 181, 74, 0.18);
  --primary-dark: #2a7b36;

  --accent: #0071BC;
  --accent-hover: #005a96;
  --accent-light: #13324a;

  --warning: #f59e0b;
  --success: #39B54A;

  /* Dark theme surfaces */
  --bg: #121212;
  --bg-subtle: #121212;
  --card: #1E1E1E;
  --card-elevated: #232323;

  /* Text */
  --text: #f5f5f5;
  --text-secondary: #C1FFD3;
  --text-muted: #9aa6b2;

  /* Borders / outlines */
  --border: #272727;
  --border-strong: #39B54A;
  --radius: 16px;
  --radius-sm: 10px;
  --radius-lg: 24px;
  --shadow: 0 4px 14px rgba(13, 148, 136, 0.08);
  --shadow-hover: 0 12px 28px rgba(13, 148, 136, 0.15);
  --shadow-card: 0 2px 12px rgba(0, 0, 0, 0.06);
  --nav-height: 56px;
  --filter-height: 100px;
  --mobile-nav-height: 48px;
  --transition: 0.2s ease;
  --ease-out: cubic-bezier(0.33, 1, 0.68, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
  --duration-fast: 0.2s;
  --duration-normal: 0.3s;
  --duration-slow: 0.45s;
  --glow-primary: 0 0 20px rgba(13, 148, 136, 0.35);
}

* {
  box-sizing: border-box;
}

/* ——— Animations ——— */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes fadeInDown {
  from { opacity: 0; transform: translateY(-12px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes slideInRight {
  from { opacity: 0; transform: translateX(24px); }
  to { opacity: 1; transform: translateX(0); }
}
@keyframes slideInUp {
  from { opacity: 0; transform: translateY(40px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes scaleIn {
  from { opacity: 0; transform: scale(0.96); }
  to { opacity: 1; transform: scale(1); }
}
@keyframes pulse-soft {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.85; }
}
@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}
@keyframes gradient-shift {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}
@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}
@keyframes ripple {
  to { transform: scale(2.5); opacity: 0; }
}
@keyframes glow-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(13, 148, 136, 0.25); }
  50% { box-shadow: 0 0 0 8px rgba(13, 148, 136, 0); }
}
@keyframes underline-in {
  from { transform: scaleX(0); }
  to { transform: scaleX(1); }
}
@keyframes tab-slide {
  from { transform: translateX(var(--tab-from)); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

body {
  margin: 0;
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 15px;
  color: var(--text);
  background: var(--bg);
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}

/* Allow scrolling on simple layout pages (About / Privacy / Contact / Saved station etc.) */
.layout-page {
  overflow-y: auto;
}

.theme-ev .form-control,
.theme-ev .form-select {
  border-radius: var(--radius-sm);
  border-color: var(--border);
  background-color: var(--card);
  color: var(--text);
  transition: border-color var(--duration-normal) var(--ease-out), box-shadow var(--duration-normal) var(--ease-out), transform var(--duration-fast) var(--ease-out);
}
.theme-ev .form-control::placeholder {
  color: var(--text-muted);
}
.theme-ev .form-control:focus,
.theme-ev .form-select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(57, 181, 74, 0.25);
  outline: none;
  background-color: var(--card-elevated);
  color: var(--text);
}
.theme-ev .form-control:hover:not(:focus) {
  border-color: var(--border-strong);
}
.theme-ev .form-select {
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23C1FFD3' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  padding-right: 2rem;
}
.theme-ev .form-select option {
  background: var(--card-elevated);
  color: var(--text);
}

/* ——— View router (multi-screen) ——— */
.app-root { height: 100vh; display: flex; flex-direction: column; }
.view {
  display: none;
  flex-direction: column;
  height: 100%;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.35s var(--ease-out), transform 0.35s var(--ease-out);
}
.view.view-active {
  display: flex;
  opacity: 1;
  transform: translateY(0);
}
.view.view-enter .landing-hero { animation: fadeInUp 0.6s var(--ease-out) forwards; }
.view.view-enter .subline { animation: fadeInUp 0.6s var(--ease-out) 0.1s forwards; opacity: 0; }
.view.view-enter .landing-search { animation: fadeInUp 0.6s var(--ease-out) 0.2s forwards; opacity: 0; }
.view.view-enter .btn-detect { animation: fadeInUp 0.6s var(--ease-out) 0.3s forwards; opacity: 0; }
.view.view-enter .landing-quick-options { animation: fadeInUp 0.6s var(--ease-out) 0.35s forwards; opacity: 0; }
.view.view-enter .landing-features { animation: fadeInUp 0.6s var(--ease-out) 0.5s forwards; opacity: 0; }
.view.view-enter .feature-card:nth-child(1) { animation: fadeInUp 0.5s var(--ease-spring) 0.65s forwards; opacity: 0; }
.view.view-enter .feature-card:nth-child(2) { animation: fadeInUp 0.5s var(--ease-spring) 0.75s forwards; opacity: 0; }
.view.view-enter .feature-card:nth-child(3) { animation: fadeInUp 0.5s var(--ease-spring) 0.85s forwards; opacity: 0; }
.view#view-dashboard.view-active .dashboard-nav { animation: fadeInDown 0.4s var(--ease-out) forwards; }
.view#view-dashboard.view-active .filter-panel { animation: slideInRight 0.4s var(--ease-out) 0.1s forwards; opacity: 0; }
.view#view-dashboard.view-active .map-wrap { animation: fadeIn 0.5s var(--ease-out) 0.15s forwards; opacity: 0; }
.view#view-dashboard.view-active .bottom-drawer { animation: slideInUp 0.45s var(--ease-spring) 0.2s forwards; opacity: 0; }
.station-card.anim-in {
  animation: scaleIn 0.4s var(--ease-spring) forwards;
  opacity: 0;
}
.drawer-list .station-card { transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition); }
.drawer-list .station-card:hover { transform: translateY(-4px) scale(1.02); }
.bottom-drawer.drawer-open { transition: transform 0.35s var(--ease-spring); }
.sheet-backdrop.sheet-open { transition: opacity 0.25s ease; }
.empty-state-box { animation: scaleIn 0.35s var(--ease-spring); }
.theme-ev .modal .modal-content { animation: scaleIn 0.35s var(--ease-spring) forwards; }
.theme-ev .modal.show .modal-dialog { animation: fadeInUp 0.35s var(--ease-out) forwards; }
.theme-ev .modal-backdrop { transition: opacity var(--duration-normal) var(--ease-out); }
.theme-ev .modal-backdrop.show { opacity: 0.5; }
/* Loading state when searching */
.searching .drawer-hint { animation: pulse-soft 1.2s ease-in-out infinite; }
@keyframes loading-bar {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(400%); }
}
.searching .drawer-header {
  position: relative;
  overflow: hidden;
}
.searching .drawer-header::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: 0;
  height: 3px;
  width: 30%;
  background: var(--primary);
  border-radius: 2px;
  animation: loading-bar 1.2s ease-in-out infinite;
}
.logo:hover .logo-img { transform: scale(1.05); transition: transform 0.3s var(--ease-spring); }
.logo .logo-img { transition: transform 0.3s var(--ease-spring); }

/* ——— SCREEN 1: Landing ——— */
#view-landing.view-active {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  overflow-x: hidden;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
  /* Match Android home hero: dark green to deep black */
  background: radial-gradient(circle at top center, #1B3D2A 0%, #0D1F17 40%, #000000 100%);
  background-size: 100% 100%;
}
/* Landing: one smooth scroll, custom scrollbar */
#view-landing.view-active::-webkit-scrollbar {
  width: 10px;
}
#view-landing.view-active::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.5);
  border-radius: 10px;
}
#view-landing.view-active::-webkit-scrollbar-thumb {
  background: var(--border-strong);
  border-radius: 10px;
  border: 2px solid transparent;
  background-clip: padding-box;
}
#view-landing.view-active::-webkit-scrollbar-thumb:hover {
  background: var(--primary);
  background-clip: padding-box;
}
#view-landing.view-active {
  scrollbar-width: thin;
  scrollbar-color: var(--border-strong) rgba(255, 255, 255, 0.5);
}
/* Navbar (user spec) */
.navbar {
  height: 88px;
  min-height: 88px;
  display: flex;
  align-items: center;
  padding: 0 40px;
  background: #121212;
}
.logo-container {
  display: flex;
  align-items: center;
}
.navbar .logo-container img.logo,
.navbar .logo-container .logo-img {
  height: 66px;
  width: auto;
  max-width: none;
  margin-right: 14px;
  object-fit: contain;
  object-position: left center;
}
.navbar .title {
  font-size: 26px;
  font-weight: 600;
  color: #1f5c55;
}

.landing-header {
  animation: fadeInDown 0.5s var(--ease-out);
  position: sticky;
  top: 0;
  z-index: 100;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  background: #121212;
  border-bottom: 1px solid #272727;
  box-shadow: 0 1px 0 0 rgba(0, 0, 0, 0.8) inset, 0 4px 24px rgba(0, 0, 0, 0.6);
}
.landing-header.navbar {
  padding: 0 40px;
  min-height: 88px;
  height: 88px;
}
.landing-header .logo-container {
  min-width: 0;
  flex-shrink: 1;
  text-decoration: none;
  color: inherit;
}
.landing-nav {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-shrink: 0;
}
.landing-nav .link {
  color: var(--primary);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.95rem;
  padding: 0.5rem 1rem;
  border-radius: var(--radius-sm);
  transition: background 0.25s var(--ease-out), color 0.25s var(--ease-out), transform 0.2s var(--ease-out), box-shadow 0.25s var(--ease-out);
}
.landing-nav .link:hover {
  background: var(--primary-light);
  color: var(--primary-dark);
  transform: translateY(-1px);
}
.landing-nav .link:active { transform: translateY(0); }
/* Register as primary CTA */
.landing-nav .link:last-child {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  color: #fff;
  padding: 0.55rem 1.25rem;
  box-shadow: 0 2px 8px rgba(13, 148, 136, 0.25);
}
.landing-nav .link:last-child:hover {
  background: linear-gradient(135deg, var(--primary-hover) 0%, var(--primary-dark) 100%);
  color: #fff;
  box-shadow: 0 4px 14px rgba(13, 148, 136, 0.3);
}
@media (max-width: 575.98px) {
  .navbar { padding: 0 16px; height: 72px; min-height: 72px; }
  .landing-header.navbar { padding: 0 16px; height: 72px; min-height: 72px; }
  .dashboard-nav.navbar { padding: 0 16px; height: 72px; min-height: 72px; }
  .navbar .logo-container img.logo,
  .navbar .logo-container .logo-img { height: 56px; max-width: none; margin-right: 10px; }
  .navbar .title { font-size: 22px; }
  .dashboard-nav .title { font-size: 20px; }
  .landing-nav { gap: 0.5rem; }
  .landing-nav .link { font-size: 0.8rem; padding: 0.35rem 0.6rem; }
  .landing-nav .link:last-child { padding: 0.4rem 0.75rem; }
}
.landing-main {
  flex: 1;
  padding: 3rem 1.5rem 4rem;
  max-width: 680px;
  width: 100%;
  margin: 0 auto;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.landing-hero {
  font-family: 'Outfit', sans-serif;
  font-weight: 700;
  font-size: 2.25rem;
  line-height: 1.2;
  margin: 0 0 0.5rem 0;
  color: #ffffff;
  letter-spacing: -0.02em;
}
.landing-main > p.subline {
  color: var(--text-muted);
  font-size: 1.05rem;
  margin: 0 0 2rem 0;
}
.landing-search {
  display: flex;
  gap: 0.75rem;
  margin-bottom: 1.25rem;
  max-width: 520px;
  width: 100%;
}
.landing-search .form-control {
  flex: 1;
  border-radius: var(--radius);
  padding: 0.85rem 1.25rem;
  font-size: 1rem;
  border: 2px solid var(--border);
  transition: border-color var(--duration-normal) var(--ease-out), box-shadow var(--duration-normal) var(--ease-out);
}
.landing-search .form-control::placeholder {
  transition: opacity var(--duration-normal);
}
.landing-search .form-control:focus::placeholder {
  opacity: 0.6;
}
.landing-search .btn-primary {
  padding: 0.85rem 1.5rem;
  border-radius: var(--radius);
  font-weight: 600;
  box-shadow: var(--shadow);
  transition: transform var(--duration-normal) var(--ease-spring), box-shadow var(--duration-normal) var(--ease-out), filter var(--duration-fast);
}
.landing-search .btn-primary:hover {
  box-shadow: var(--glow-primary);
}
.landing-search .btn-primary:active {
  transform: scale(0.97);
}
.landing-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  justify-content: center;
  margin-bottom: 2rem;
}
.landing-actions .btn-detect,
.landing-actions .btn-route {
  margin-bottom: 0;
}
.btn-detect {
  padding: 0.65rem 1.5rem;
  border-radius: var(--radius);
  font-weight: 500;
  border: 2px solid var(--primary);
  color: var(--primary);
  transition: background var(--duration-normal) var(--ease-out), transform var(--duration-fast) var(--ease-spring), box-shadow var(--duration-normal);
}
.btn-detect:hover { background: var(--primary-light); border-color: var(--primary); color: var(--primary-dark); box-shadow: 0 4px 12px rgba(13, 148, 136, 0.2); transform: translateY(-2px); }
.btn-detect:active { transform: translateY(0) scale(0.98); }
.landing-actions .btn-route {
  padding: 0.65rem 1.5rem;
  border-radius: var(--radius);
  font-weight: 500;
  border: 2px solid var(--primary);
  color: var(--primary);
  text-decoration: none;
  transition: background var(--duration-normal) var(--ease-out), transform var(--duration-fast) var(--ease-spring), box-shadow var(--duration-normal);
}
.landing-actions .btn-route:hover { background: var(--primary-light); border-color: var(--primary); color: var(--primary-dark); box-shadow: 0 4px 12px rgba(13, 148, 136, 0.2); transform: translateY(-2px); }
.landing-actions .btn-route:active { transform: translateY(0) scale(0.98); }
.landing-quick-options {
  margin-bottom: 2.5rem;
  text-align: center;
}
.landing-quick-options .label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.landing-quick-options .option {
  display: inline-flex;
  align-items: center;
  margin: 0 0.35rem 0.5rem 0;
  font-size: 0.9rem;
  padding: 0.4rem 0.9rem;
  background: var(--card);
  border-radius: 999px;
  border: 1px solid var(--border);
  cursor: pointer;
  transition: border-color var(--duration-normal) var(--ease-out), background var(--duration-normal) var(--ease-out), box-shadow var(--duration-normal) var(--ease-out), transform var(--duration-fast) var(--ease-spring);
}
.landing-quick-options .option:hover {
  border-color: var(--primary);
  background: var(--primary-light);
  box-shadow: var(--shadow-card);
  transform: translateY(-2px) scale(1.02);
}
.landing-quick-options .option:has(input:checked) {
  border-color: var(--primary);
  background: var(--primary-light);
  box-shadow: 0 0 0 2px rgba(13, 148, 136, 0.2);
}
.landing-quick-options .option:active {
  transform: translateY(0) scale(0.98);
}
.landing-quick-options input {
  margin-right: 0.4rem;
  accent-color: var(--primary);
  transition: transform var(--duration-fast);
}
.landing-quick-options input:checked {
  transform: scale(1.1);
}
.landing-features {
  text-align: center;
  margin-top: 3rem;
  width: 100%;
}
.features-title {
  font-family: 'Outfit', sans-serif;
  font-weight: 700;
  font-size: 1.25rem;
  margin-bottom: 1.5rem;
  color: var(--text);
}
.feature-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1.25rem;
  max-width: 640px;
  width: 100%;
  margin: 0 auto;
}
.feature-card {
  background: var(--card);
  padding: 1.5rem;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  border: 1px solid var(--border);
  transition: transform 0.35s var(--ease-spring), box-shadow var(--duration-normal) var(--ease-out), border-color var(--duration-normal), background var(--duration-normal);
}
.feature-card:hover {
  transform: translateY(-8px) scale(1.02);
  box-shadow: var(--shadow-hover), 0 0 0 1px rgba(13, 148, 136, 0.1);
  border-color: var(--border-strong);
}
.feature-card:active {
  transform: translateY(-3px) scale(1);
}
.feature-card .fc-icon {
  font-size: 2rem;
  display: block;
  margin-bottom: 0.5rem;
  transition: transform 0.35s var(--ease-spring);
}
.feature-card:hover .fc-icon {
  transform: scale(1.15);
}
.feature-card h3 { font-size: 1.05rem; font-weight: 700; margin: 0.5rem 0 0.35rem; color: var(--text); }
.feature-card p { font-size: 0.875rem; color: var(--text-muted); margin: 0; line-height: 1.4; }

.app-footer {
  flex-shrink: 0;
  margin-top: auto;
  padding: 1.25rem 2rem;
  background: #121212;
  border-top: 1px solid #272727;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 1rem 1.5rem;
  font-size: 0.9rem;
  color: var(--text-muted);
}
.footer-nav {
  display: flex;
  align-items: center;
  gap: 1.25rem;
}
.footer-link {
  color: var(--primary);
  text-decoration: none;
  font-weight: 500;
  position: relative;
  transition: color var(--duration-normal) var(--ease-out), transform var(--duration-fast);
}
.footer-link::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: -2px;
  width: 100%;
  height: 2px;
  background: var(--primary);
  transform: scaleX(0);
  transform-origin: right;
  transition: transform var(--duration-normal) var(--ease-out);
}
.footer-link:hover { color: var(--primary-dark); transform: translateY(-1px); }
.footer-link:hover::after { transform: scaleX(1); transform-origin: left; }
.footer-copy {
  margin: 0;
  color: var(--text-muted);
}

/* ——— SCREEN 2: Dashboard layout ——— */
#view-dashboard { height: 100vh; overflow: hidden; background: var(--bg); }
.dashboard-nav.navbar {
  padding: 0 40px;
  height: 88px;
  min-height: 88px;
}
.dashboard-nav {
  background: #121212;
  border-bottom: 1px solid #272727;
  box-shadow: 0 1px 0 0 rgba(0, 0, 0, 0.9) inset, 0 4px 20px rgba(0, 0, 0, 0.6);
}
.dashboard-nav .logo-container {
  text-decoration: none;
  color: inherit;
}
.dashboard-nav .title {
  font-size: 22px;
  font-weight: 600;
  color: #1f5c55;
}
.dashboard-nav .logo-container img.logo,
.dashboard-nav .logo-container .logo-img {
  height: 66px;
  max-width: none;
  margin-right: 12px;
  object-fit: contain;
  object-position: left center;
}
.dashboard-nav .title {
  font-size: 24px;
}
.dashboard-nav .nav-search {
  flex: 1;
  max-width: 320px;
  margin: 0 0.5rem;
}
.dashboard-nav .nav-search .form-control {
  border-radius: 999px;
  padding: 0.5rem 1rem 0.5rem 1.25rem;
  border: 1px solid var(--border);
  background-color: var(--card);
  color: var(--text);
  font-size: 0.9rem;
  transition: border-color var(--duration-normal), box-shadow var(--duration-normal);
}
.dashboard-nav .nav-search .form-control::placeholder {
  color: var(--text-muted);
}
.dashboard-nav .nav-search .form-control:focus {
  background-color: var(--card-elevated);
  box-shadow: 0 0 0 2px rgba(57, 181, 74, 0.25);
  color: var(--text);
}
.dashboard-nav .nav-filters {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}
.dashboard-nav .nav-filters .form-select {
  width: auto;
  min-width: 110px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  font-size: 0.875rem;
  padding: 0.45rem 0.75rem;
  background-color: var(--card);
  color: var(--text);
  transition: border-color var(--duration-normal), box-shadow var(--duration-normal);
}
.dashboard-nav .nav-filters .form-select option {
  background: #232323;
  color: #f5f5f5;
}
.dashboard-nav .nav-filters .form-select:hover {
  border-color: var(--border-strong);
}
.dashboard-nav .nav-filters .form-select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(13, 148, 136, 0.15);
}
.dashboard-body { flex: 1; display: flex; min-height: 0; }
.filter-panel {
  width: 260px;
  min-width: 220px;
  padding: 1.25rem;
  background: var(--card);
  border-right: 1px solid var(--border);
  overflow-y: auto;
  flex-shrink: 0;
  box-shadow: var(--shadow-card);
}
.filter-panel .panel-title {
  font-family: 'Outfit', sans-serif;
  font-weight: 700;
  font-size: 1rem;
  margin-bottom: 1.25rem;
  color: var(--text);
}
.filter-panel .filter-section {
  margin-bottom: 1.25rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border);
}
.filter-panel .filter-section:last-of-type { border-bottom: none; }
.filter-panel .filter-section h4 {
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 0.6rem;
  color: var(--text-muted);
}
.filter-panel label {
  display: flex;
  align-items: center;
  font-size: 0.9rem;
  margin-bottom: 0.5rem;
  padding: 0.4rem 0.5rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  color: var(--text);
  transition: background var(--duration-fast) var(--ease-out), color var(--duration-fast);
}
.filter-panel label:hover {
  background: var(--primary-light);
  color: var(--primary-dark);
}
.filter-panel input[type=checkbox] {
  margin-right: 0.5rem;
  accent-color: var(--primary);
  width: 1.1em;
  height: 1.1em;
  cursor: pointer;
  transition: transform var(--duration-fast) var(--ease-spring);
}
.filter-panel input[type=checkbox]:checked {
  transform: scale(1.08);
}
.filter-panel #btn-reset-filters {
  margin-top: 0.5rem;
  border-radius: var(--radius-sm);
  transition: transform var(--duration-fast), background var(--duration-normal);
}
.filter-panel #btn-reset-filters:hover {
  transform: translateY(-1px);
}
.filter-panel #btn-reset-filters:active {
  transform: translateY(0) scale(0.98);
}
.map-wrap {
  flex: 1;
  position: relative;
  min-width: 0;
  /* Dark map surround to match Android */
  background: radial-gradient(circle at top, #1B3D2A 0%, #0D1F17 40%, #000000 100%);
}
.map-wrap #map { width: 100%; height: 100%; min-height: 300px; }
.bottom-drawer {
  flex-shrink: 0;
  max-height: 300px;
  min-height: 140px;
  border-top: 1px solid var(--border);
  background: var(--card);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 -4px 20px rgba(13, 148, 136, 0.08);
}
.drawer-handle {
  height: 5px;
  background: var(--border);
  margin: 8px auto 0;
  width: 56px;
  border-radius: 999px;
  cursor: ns-resize;
  opacity: 0.8;
  transition: background var(--duration-normal), opacity var(--duration-fast), transform var(--duration-fast);
}
.drawer-handle:hover {
  background: var(--primary);
  opacity: 1;
  transform: scaleX(1.1);
}
.drawer-header {
  padding: 0.75rem 1.25rem;
  border-bottom: 1px solid var(--border);
  background: var(--bg);
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem;
}
.drawer-title {
  font-family: 'Outfit', sans-serif;
  font-weight: 700;
  font-size: 1rem;
  margin: 0;
  color: var(--text);
}
.drawer-hint {
  font-size: 0.8rem;
  margin: 0;
  color: var(--text-muted);
}
.drawer-count {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text);
  margin: 0;
}
.drawer-list {
  flex: 1;
  overflow-y: auto;
  overflow-x: auto;
  padding: 1rem;
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  align-content: flex-start;
  align-items: stretch;
}
.drawer-list .station-card { flex: 0 0 auto; min-width: 280px; max-width: 340px; }
@media (max-width: 767.98px) {
  .bottom-drawer { position: fixed; left: 0; right: 0; bottom: 0; max-height: 50vh; min-height: 0; border-radius: 1rem 1rem 0 0; box-shadow: 0 -4px 20px rgba(0,0,0,0.15); z-index: 1000; transform: translateY(100%); transition: transform 0.3s ease; }
  .bottom-drawer.drawer-open { transform: translateY(0); max-height: 75vh; }
  .filter-panel { position: fixed; left: -280px; top: 0; bottom: 0; z-index: 1001; transition: left 0.3s; }
  .filter-panel.open { left: 0; }
}
.detail-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.65rem 1.25rem;
  background: #121212;
  border-bottom: 1px solid #272727;
  box-shadow: 0 1px 0 0 rgba(0, 0, 0, 0.9) inset, 0 4px 20px rgba(0, 0, 0, 0.6);
}
.btn-back {
  text-decoration: none;
  color: var(--primary);
  font-size: 1rem;
  font-weight: 600;
  padding: 0.35rem 0;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  transition: color var(--duration-normal), transform var(--duration-fast) var(--ease-spring);
}
.btn-back:hover { color: var(--primary-dark); transform: translateX(-4px); }
.btn-back:active { transform: translateX(-2px) scale(0.98); }
.detail-title {
  margin: 0;
  font-size: 1.2rem;
  font-family: 'Outfit', sans-serif;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.02em;
  line-height: 1.3;
}
.detail-main { flex: 1; overflow-y: auto; padding: 1.25rem 1.5rem; background: #121212; }
.detail-map-thumb { height: 180px; background: linear-gradient(135deg, #1B3D2A 0%, #0D1F17 100%); border-radius: var(--radius); margin-bottom: 1.25rem; border: 1px solid #272727; }
.detail-block {
  margin-bottom: 1.5rem;
  padding: 1rem;
  background: var(--card);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  transition: box-shadow var(--duration-normal), border-color var(--duration-normal);
}
.detail-block:hover {
  box-shadow: var(--shadow-card);
  border-color: var(--border-strong);
}
.detail-block h4 { font-size: 0.8rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; color: var(--text-muted); margin-bottom: 0.4rem; }
.detail-block p, .detail-block ul { margin: 0; font-size: 0.95rem; color: var(--text); }
.detail-actions { display: flex; gap: 0.75rem; margin: 1.5rem 0; flex-wrap: wrap; }
.detail-reviews { margin-top: 1.5rem; padding-top: 1.25rem; border-top: 1px solid var(--border); }
.navigate-map-wrap { flex: 1; position: relative; min-height: 300px; }
.navigate-panel { padding: 1.25rem 1.5rem; background: var(--card); border-top: 1px solid var(--border); box-shadow: 0 -4px 20px rgba(0,0,0,0.06); }
.navigate-panel p { margin: 0.35rem 0; font-size: 0.95rem; }
.profile-main { flex: 1; overflow-y: auto; padding: 1.25rem 1.5rem; background: var(--bg); }
.profile-tabs {
  display: flex;
  gap: 0.25rem;
  list-style: none;
  padding: 0;
  margin: 0 0 1.25rem;
  border-bottom: 2px solid var(--border);
  position: relative;
}
.tab-btn {
  background: none;
  border: none;
  padding: 0.6rem 1.25rem;
  cursor: pointer;
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--text-muted);
  border-radius: var(--radius-sm);
  transition: color var(--duration-normal) var(--ease-out), background var(--duration-normal), transform var(--duration-fast);
}
.tab-btn:hover { color: var(--text); background: var(--primary-light); transform: translateY(-1px); }
.tab-btn.active { color: var(--primary); font-weight: 700; background: var(--primary-light); }
.tab-btn:active { transform: translateY(0) scale(0.98); }
.tab-pane { display: block; }
.tab-pane[hidden] { display: none; }
.table-wrap { overflow-x: auto; margin-bottom: 1rem; background: var(--card); border-radius: var(--radius-sm); padding: 0.5rem; border: 1px solid var(--border); }
.empty-state-overlay { position: fixed; inset: 0; background: rgba(15, 118, 110, 0.2); backdrop-filter: blur(6px); z-index: 2000; display: flex; align-items: center; justify-content: center; padding: 1rem; }
.empty-state-box {
  background: var(--card);
  padding: 2.5rem;
  border-radius: var(--radius-lg);
  text-align: center;
  max-width: 380px;
  box-shadow: var(--shadow-hover);
  border: 1px solid var(--border);
}
.empty-state-box .empty-icon { font-size: 3rem; display: block; margin-bottom: 0.75rem; opacity: 0.9; }
.empty-state-box h3 { font-family: 'Outfit', sans-serif; font-weight: 700; margin-bottom: 0.5rem; color: var(--text); }
.star-rating { font-size: 1.75rem; color: var(--border); cursor: pointer; letter-spacing: 0.15em; }
.star-rating .filled { color: var(--warning); }

/* ——— Top Navigation ——— */
.top-nav {
  height: var(--nav-height);
  min-height: var(--nav-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.5rem;
  flex-shrink: 0;
  gap: 1rem;
}

.nav-left,
.nav-center,
.nav-right {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.nav-right {
  flex-shrink: 0;
}
.dashboard-nav .nav-search {
  min-width: 0;
}

.nav-center {
  flex: 1;
  justify-content: center;
}

.logo {
  display: flex;
  align-items: center;
  text-decoration: none;
  color: var(--text);
  gap: 0.5rem;
  font-weight: 700;
  font-size: 1.2rem;
  letter-spacing: -0.02em;
}
.logo-img {
  height: 52px;
  width: auto;
  max-width: 240px;
  min-height: 40px;
  object-fit: contain;
  object-position: left center;
  display: block;
}
.logo-img-nav {
  height: 48px;
  max-width: 200px;
  min-height: 36px;
  object-fit: contain;
  object-position: left center;
}
.logo-icon {
  font-size: 1.75rem;
}

.nav-title {
  font-family: 'Outfit', sans-serif;
  font-weight: 700;
  font-size: 1.2rem;
  margin: 0;
  color: var(--text);
}

.btn-icon {
  width: 42px;
  height: 42px;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 50%;
  background: var(--card);
  font-size: 1.1rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background var(--duration-normal), border-color var(--duration-normal), box-shadow var(--duration-normal), transform var(--duration-fast);
}
.btn-icon:hover {
  background: var(--primary-light);
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(13, 148, 136, 0.15);
  transform: scale(1.05);
}
.btn-icon:active {
  transform: scale(0.96);
}
#btn-profile:hover {
  box-shadow: 0 0 0 2px var(--primary-light);
}

.nav-link-dash {
  color: var(--primary);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.9rem;
  padding: 0.4rem 0.75rem;
  border-radius: var(--radius-sm);
  white-space: nowrap;
  transition: background var(--duration-normal), color var(--duration-normal);
}
.nav-link-dash:hover {
  color: var(--primary-dark);
  background: var(--primary-light);
}
.nav-link-dash-cta {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  color: #fff;
  padding: 0.45rem 1rem;
}
.nav-link-dash-cta:hover {
  background: linear-gradient(135deg, var(--primary-hover) 0%, var(--primary-dark) 100%);
  color: #fff;
}

.api-status {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-right: 0.5rem;
}
.api-status.api-ok {
  color: var(--primary);
  font-weight: 500;
}
.api-status.api-error {
  color: #dc3545;
  font-weight: 500;
}
.api-hint {
  font-size: 0.7rem;
  color: var(--text-muted);
  max-width: 220px;
  margin-right: 0.5rem;
}

/* ——— Search + Filter Bar (100px) ——— */
.filter-bar {
  height: var(--filter-height);
  min-height: var(--filter-height);
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0 1.5rem;
  background: var(--card);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.filter-group {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.filter-label {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin: 0;
  white-space: nowrap;
}
.location-search-wrap {
  flex: 1;
  min-width: 200px;
  max-width: 320px;
}
.location-search-wrap .filter-icon {
  font-size: 1rem;
  opacity: 0.7;
}
.location-search-wrap input {
  border-radius: 8px;
  border: 1px solid var(--border);
}
.filter-group .form-select {
  width: auto;
  min-width: 90px;
  border-radius: 8px;
}
.open-now-wrap .form-check-label {
  font-size: 0.9rem;
  font-weight: 500;
}

.btn-outline-primary {
  border: 2px solid var(--primary);
  color: var(--primary);
  font-weight: 600;
  border-radius: var(--radius-sm);
  transition: background var(--transition), color var(--transition), border-color var(--transition);
}
.btn-outline-primary:hover {
  background: var(--primary-light);
  color: var(--primary-dark);
  border-color: var(--primary);
}
.btn-primary {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  border: none;
  color: #fff;
  font-weight: 600;
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-card);
  transition: opacity var(--duration-normal), transform var(--duration-normal) var(--ease-spring), box-shadow var(--duration-normal) var(--ease-out);
}
.btn-primary:hover {
  opacity: 0.98;
  transform: translateY(-2px);
  box-shadow: var(--shadow-hover), var(--glow-primary);
}
.btn-primary:active {
  transform: translateY(0) scale(0.98);
}
.btn-outline-primary:active {
  transform: translateY(0) scale(0.98);
}
.theme-ev .btn {
  transition: transform var(--transition), box-shadow var(--transition), opacity var(--transition), border-color var(--transition), background var(--transition);
}

/* ——— Main: Sidebar 30% + Map 70% ——— */
.app-main {
  display: flex;
  flex: 1;
  min-height: 0;
  position: relative;
}

.sidebar {
  width: 30%;
  min-width: 280px;
  max-width: 420px;
  background: var(--bg);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.sheet-handle {
  flex-shrink: 0;
  height: 4px;
  width: 40px;
  margin: 8px auto 0;
  background: var(--border);
  border-radius: 2px;
}
.sidebar .sheet-handle {
  display: none;
}

.sidebar-header {
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.sidebar-title {
  font-family: 'Poppins', sans-serif;
  font-weight: 600;
  font-size: 1rem;
  margin: 0 0 0.25rem 0;
}
.sidebar-hint {
  font-size: 0.8rem;
}

.sidebar-list {
  flex: 1;
  overflow-y: auto;
  padding: 0.75rem;
}

.empty-state {
  padding: 2rem 1rem;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.9rem;
}

/* ——— Station Card (Desktop) ——— */
.station-card {
  background: var(--card);
  border-radius: var(--radius);
  padding: 1.15rem 1.35rem;
  margin-bottom: 0;
  cursor: pointer;
  box-shadow: var(--shadow-card);
  border: 1px solid var(--border);
  transition: box-shadow var(--duration-normal) var(--ease-out), transform var(--duration-normal) var(--ease-spring), border-color var(--duration-normal);
  display: flex;
  flex-direction: column;
}
.station-card .card-full,
.station-card .card-compact {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
}
.station-card:hover {
  box-shadow: var(--shadow-hover);
  border-color: var(--border-strong);
  transform: translateY(-4px) scale(1.01);
}
.station-card:active {
  transform: translateY(-2px) scale(1);
}
.station-card.active {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px var(--primary-light);
  transform: translateY(-2px);
}

.station-card .name {
  font-family: 'Outfit', sans-serif;
  font-weight: 700;
  font-size: 1.02rem;
  margin-bottom: 0.4rem;
  display: flex;
  align-items: center;
  gap: 0.35rem;
  color: var(--text);
}
.station-card .name .icon-ev {
  flex: 0 0 auto;
  font-size: 0.9rem;
}
.station-card .name-text {
  min-width: 0;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 1;
  overflow: hidden;
}
.station-card .address {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
  display: flex;
  align-items: flex-start;
  gap: 0.35rem;
}
.station-card .address-icon { flex: 0 0 auto; }
.station-card .address-text {
  min-width: 0;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
  line-height: 1.25;
  /* keeps consistent vertical rhythm across cards */
  min-height: 2.5em;
}
.station-card .meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem 0.75rem;
  font-size: 0.8rem;
  margin-bottom: 0.5rem;
}
.station-card .meta > span {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}
.station-card .rating {
  color: var(--warning);
  font-weight: 500;
  white-space: nowrap;
}
.station-card .charger-type {
  color: var(--primary);
  font-weight: 500;
  white-space: nowrap;
}
.station-card .distance {
  color: var(--text-muted);
  white-space: nowrap;
}
.station-card .status-line {
  display: flex;
  align-items: center;
  margin: 0.25rem 0 0.75rem 0;
  min-height: 1.35rem;
}
.station-card .open-status {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.28rem 0.65rem;
  border-radius: 999px;
  font-weight: 700;
  font-size: 0.72rem;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  background: rgba(255,255,255,0.06);
  color: var(--text-muted);
  border: 1px solid rgba(255,255,255,0.10);
}
.station-card .open-status::before {
  content: '';
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 50%;
  background: #9ca3af;
  box-shadow: 0 0 0 3px rgba(156, 163, 175, 0.15);
}
.station-card .open-status.open {
  background: rgba(209, 250, 229, 0.16);
  border-color: rgba(34, 197, 94, 0.35);
  color: #bff7d8;
}
.station-card .open-status.closed {
  background: rgba(254, 226, 226, 0.12);
  border-color: rgba(239, 68, 68, 0.35);
  color: #fecaca;
}
.station-card .open-status.unknown {
  background: rgba(255,255,255,0.06);
  border-color: rgba(255,255,255,0.12);
  color: var(--text-muted);
}
.station-card .open-status.open::before {
  background: #22c55e;
  box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.18);
}
.station-card .open-status.closed::before {
  background: #ef4444;
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.16);
}
.station-card .card-actions {
  display: flex;
  gap: 0.5rem;
  margin-top: auto;
  padding-top: 0.75rem;
}
.station-card .card-actions .btn {
  flex: 1;
  font-size: 0.85rem;
  font-weight: 500;
  border-radius: 8px;
}
.station-card .card-actions .btn-primary {
  background: var(--primary);
  border-color: var(--primary);
}
.station-card .card-actions .btn-outline-secondary {
  border-color: var(--border);
  color: var(--text);
}
.station-card .card-actions .btn-outline-secondary:hover {
  background: var(--bg);
  border-color: var(--border-strong);
}

/* Save button on station cards */
.station-card .card-actions .btn-save {
  border-color: var(--border);
  background: rgba(15, 23, 42, 0.9);
  color: var(--text-muted);
}
.station-card .card-actions .btn-save:hover {
  background: rgba(57, 181, 74, 0.12);
  border-color: var(--primary);
  color: var(--primary);
}

/* ——— Station Tile (Mobile, compact) ——— */
.station-tile {
  background: var(--card);
  border-radius: var(--radius);
  padding: 0.75rem 1rem;
  margin-bottom: 0.5rem;
  cursor: pointer;
  box-shadow: var(--shadow-card);
  border: 1px solid var(--border);
  transition: border-color var(--duration-normal), box-shadow var(--duration-normal), transform var(--duration-fast) var(--ease-spring);
}
.station-tile:hover {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px var(--primary-light);
  transform: scale(1.02);
}
.station-tile.active {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px var(--primary-light);
}
.station-tile:active {
  transform: scale(0.99);
}
.station-tile .tile-name {
  font-family: 'Outfit', sans-serif;
  font-weight: 700;
  font-size: 0.95rem;
  margin-bottom: 0.2rem;
}
.station-tile .tile-meta {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 0.25rem;
}
.station-tile .tile-address {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}
.station-tile .btn-directions {
  font-size: 0.8rem;
  font-weight: 500;
  padding: 0.35rem 0.75rem;
  border-radius: 8px;
}

/* ——— Map ——— */
.map-container {
  flex: 1;
  position: relative;
  min-width: 0;
  background: #e9ecef;
}

#map {
  width: 100%;
  height: 100%;
  min-height: 300px;
}

.map-overlay.map-legend {
  position: absolute;
  bottom: 1.25rem;
  left: 1.25rem;
  background: var(--card);
  padding: 0.6rem 1rem;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text);
  box-shadow: var(--shadow-hover);
  border: 1px solid var(--border);
}
.legend-dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  background: var(--primary);
  border-radius: 50%;
  margin-right: 0.5rem;
  vertical-align: middle;
  box-shadow: 0 0 0 2px rgba(255,255,255,0.8);
}

/* ——— FABs (Mobile) ——— */
.fab {
  position: absolute;
  z-index: 10;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.6rem 1rem;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 999px;
  box-shadow: var(--shadow-hover);
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text);
  cursor: pointer;
  transition: background var(--duration-normal), box-shadow var(--duration-normal) var(--ease-out), transform var(--duration-normal) var(--ease-spring), border-color var(--duration-normal);
}
.fab:hover {
  background: var(--primary-light);
  border-color: var(--primary);
  box-shadow: 0 8px 24px rgba(13, 148, 136, 0.25), var(--glow-primary);
  transform: scale(1.08);
}
.fab:active {
  transform: scale(0.95);
  box-shadow: var(--shadow-card);
}
.d-md-none .fab-locate {
  animation: float 3s ease-in-out infinite;
}
.d-md-none .fab-filter {
  animation: float 3s ease-in-out 0.5s infinite;
}
.d-md-none .fab-stations {
  animation: float 3s ease-in-out 1s infinite;
}
.fab-locate {
  top: 1rem;
  right: 1rem;
  width: 48px;
  height: 48px;
  padding: 0;
  font-size: 1.25rem;
}
.fab-filter {
  top: 1rem;
  right: 4.5rem;
  width: 48px;
  height: 48px;
  padding: 0;
  font-size: 1.1rem;
}
.fab-stations {
  bottom: 1.25rem;
  right: 1rem;
}
.fab-icon {
  font-size: 1.1rem;
}
.fab-label {
  white-space: nowrap;
}

/* ——— Bottom sheet (Mobile) ——— */
.sheet-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  z-index: 999;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}
.sheet-backdrop.sheet-open {
  opacity: 1;
  pointer-events: auto;
}

.filter-panel-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  z-index: 1000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}
.filter-panel-backdrop.sheet-open {
  opacity: 1;
  pointer-events: auto;
}

/* ——— Modal ——— */
.theme-ev .modal-content {
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-hover);
}
.theme-ev .modal-header {
  border-bottom-color: var(--border);
  padding: 1.25rem 1.5rem;
}
.theme-ev .modal-title { font-family: 'Outfit', sans-serif; font-weight: 700; color: var(--text); }
.theme-ev .modal-body { padding: 1.5rem; }

/* Station detail modals: ensure all text is visible (dark on light) */
#stationModal .modal-content,
#routeStationModal .modal-content {
  background: #fff;
  color: #1f2937;
}
#stationModal .modal-header,
#routeStationModal .modal-header {
  border-bottom-color: #e5e7eb;
}
#stationModal .modal-title,
#routeStationModal .modal-title {
  color: #111827;
}
#stationModal .modal-body,
#routeStationModal .modal-body {
  color: #1f2937;
}
#stationModal .modal-body img.station-photo,
#routeStationModal .modal-body img.station-photo {
  width: 100%;
  max-height: 220px;
  object-fit: cover;
  border-radius: var(--radius-sm);
  margin-bottom: 1.25rem;
  border: 1px solid #e5e7eb;
}
#stationModal .detail-row,
#routeStationModal .detail-row {
  margin-bottom: 0.85rem;
  font-size: 0.95rem;
  color: #1f2937;
}
#stationModal .detail-row br + *,
#routeStationModal .detail-row br + *,
#stationModal .detail-row .detail-value,
#routeStationModal .detail-row .detail-value {
  color: #374151;
}
#stationModal .detail-label,
#routeStationModal .detail-label {
  font-weight: 600;
  color: #6b7280;
  margin-bottom: 0.25rem;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
#stationModal .btn-primary,
#routeStationModal .btn-primary { color: #fff; }
#stationModal .btn-outline-secondary,
#routeStationModal .btn-outline-secondary {
  color: #374151;
  border-color: #d1d5db;
}
#stationModal .btn-outline-secondary:hover,
#routeStationModal .btn-outline-secondary:hover {
  color: #111827;
  border-color: #9ca3af;
}
#stationModal .btn-close,
#routeStationModal .btn-close {
  filter: none;
  opacity: 0.7;
}

/* Map popup (InfoWindow): speech-bubble style with thumbnail, Navigate + View detail */
.infowindow-content.infowindow-bubble {
  font-family: Inter, system-ui, sans-serif;
  min-width: 260px;
  max-width: 320px;
  padding: 0;
  background: #fff;
  color: #1f2937;
  border-radius: 12px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
  overflow: hidden;
}
.infowindow-bubble .infowindow-body {
  display: flex;
  align-items: stretch;
  gap: 0;
}
.infowindow-bubble .infowindow-thumb-wrap {
  flex: 0 0 80px;
  min-height: 80px;
  background: #f3f4f6;
}
.infowindow-bubble .infowindow-thumb,
.infowindow-bubble .infowindow-thumb-placeholder {
  width: 80px;
  height: 80px;
  object-fit: cover;
  display: block;
}
.infowindow-bubble .infowindow-thumb-placeholder {
  font-size: 2rem;
  line-height: 80px;
  text-align: center;
  color: var(--primary);
}
.infowindow-bubble .infowindow-text {
  flex: 1;
  padding: 10px 12px;
  min-width: 0;
}
.infowindow-bubble .infowindow-name {
  font-weight: 700;
  font-size: 0.95rem;
  line-height: 1.3;
  margin-bottom: 4px;
  color: #111;
}
.infowindow-bubble .infowindow-address {
  font-size: 0.8rem;
  color: #6b7280;
  line-height: 1.35;
  margin-bottom: 4px;
}
.infowindow-bubble .infowindow-distance {
  font-size: 0.8rem;
  color: #374151;
  margin-bottom: 8px;
}
.infowindow-bubble .infowindow-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 6px;
}
.infowindow-bubble .infowindow-nav,
.infowindow-bubble .btn-outline-primary {
  font-size: 0.8rem;
  padding: 6px 12px;
}
.infowindow-bubble .btn-outline-primary {
  border-color: #d1d5db;
  color: #374151;
}
.infowindow-bubble .btn-outline-primary:hover {
  border-color: var(--primary);
  color: var(--primary);
}

/* Login modal – ensure all text is visible on dark background */
#modal-login .modal-content {
  background: #1a1a1a;
  color: #f0f0f0;
}
#modal-login .modal-header .modal-title {
  color: #f0f0f0;
}
#modal-login .modal-body p,
#modal-login .login-modal-desc {
  color: #c8d0d9;
}
#modal-login .form-label {
  font-size: 0.85rem;
  font-weight: 600;
  color: #e2e8f0;
}
#modal-login .login-optional {
  color: #9aa6b2;
  font-weight: 400;
}
#modal-login .login-sent-to {
  color: #39b54a;
}
#modal-login .form-control {
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  background-color: #111827;
  color: #f0f0f0;
}
#modal-login .form-control::placeholder {
  color: #6b7280;
}
#modal-login .form-control:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(57, 181, 74, 0.25);
  background-color: #0f172a;
  color: #f0f0f0;
}
#modal-login .form-select {
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  background-color: #111827;
  color: #f0f0f0;
}
#modal-login .form-select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(57, 181, 74, 0.25);
}
#modal-login .btn-link {
  color: #39b54a;
}
#modal-login .btn-link:hover {
  color: #5dd96a;
}
#modal-login .btn-outline-secondary {
  border-radius: 999px;
  border-color: var(--border);
  color: #e2e8f0;
}
#modal-login .btn-outline-secondary:hover {
  border-color: var(--primary);
  color: var(--primary);
}
#modal-login .btn-primary {
  border-radius: 999px;
  background: var(--primary);
  border-color: var(--primary);
  font-weight: 600;
  color: #fff;
}
#modal-login .alert-danger {
  color: #fef2f2;
  background-color: #7f1d1d;
  border-color: #991b1b;
}
#modal-login .alert-success {
  color: #d1fae5;
  background-color: #064e3b;
  border-color: #047857;
}
#modal-login .btn-close {
  filter: invert(1);
}
#modal-login .nav-tabs-auth .nav-link {
  color: #9aa6b2;
  border-color: transparent;
}
#modal-login .nav-tabs-auth .nav-link:hover {
  color: #e2e8f0;
}
#modal-login .nav-tabs-auth .nav-link.active {
  color: #39b54a;
  background: transparent;
  border-color: transparent;
  border-bottom-color: #39b54a;
}

/* ——— Responsive: Mobile (Page 2) ——— */
@media (max-width: 767.98px) {
  :root {
    --nav-height: 56px;
  }

  .top-nav {
    height: var(--mobile-nav-height);
    min-height: var(--mobile-nav-height);
    padding: 0 1rem;
  }
  .nav-title {
    font-size: 1rem;
  }
  .nav-center {
    flex: 0 1 auto;
  }

  .app-main {
    flex-direction: row;
  }
  .map-container {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    height: 100%;
  }

  .sidebar {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    min-width: 0;
    max-width: none;
    max-height: 75vh;
    border-right: none;
    border-top: 1px solid var(--border);
    border-radius: 1rem 1rem 0 0;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.15);
    z-index: 1000;
    transform: translateY(100%);
    transition: transform 0.3s ease-out;
    background: var(--card);
  }
  .sidebar.sheet-open {
    transform: translateY(0);
  }
  .sidebar .sheet-handle {
    display: block;
  }
  .sidebar-header {
    display: block !important;
    padding: 0.5rem 1rem 0.75rem;
  }
  .sidebar-title {
    font-size: 0.95rem;
  }
  .sidebar-list {
    padding: 0 1rem 1rem;
  }
}

@media (min-width: 768px) {
  .sidebar .sheet-handle {
    display: none;
  }
}

.loading-spinner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  text-align: center;
  padding: 2rem;
  color: var(--text-muted);
}
.loading-spinner .spinner-border { flex-shrink: 0; }
.loading-spinner.inline {
  padding: 0.75rem 0.25rem;
}

.skeleton-card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.15rem 1.35rem;
  background: linear-gradient(90deg, rgba(255,255,255,0.04) 25%, rgba(255,255,255,0.08) 37%, rgba(255,255,255,0.04) 63%);
  background-size: 400% 100%;
  animation: shimmer 1.2s ease-in-out infinite;
}
.skeleton-line {
  height: 10px;
  border-radius: 999px;
  background: rgba(255,255,255,0.12);
  margin: 0.55rem 0;
}
.skeleton-line.title { height: 14px; width: 70%; margin-top: 0; }
.skeleton-line.addr1 { width: 95%; }
.skeleton-line.addr2 { width: 80%; }
.skeleton-line.meta { width: 65%; margin-bottom: 0; }
.page-loader-overlay {
  position: fixed;
  inset: 0;
  background: rgba(255,255,255,0.85);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  transition: opacity 0.2s ease;
}
.page-loader-overlay.hide { opacity: 0; pointer-events: none; }
.page-loader-overlay .loading-spinner { padding: 2rem; }
.error-message {
  padding: 1rem;
  background: #fee2e2;
  color: #991b1b;
  border-radius: var(--radius);
  font-size: 0.9rem;
  margin: 0.75rem;
}

/* ——— Search results page (Thymeleaf) ——— */
.search-result-count {
  margin-left: auto;
  font-size: 1rem;
  font-weight: 700;
  color: #ffffff !important;
}
.search-results-summary {
  margin: 0 0 1rem 0;
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-secondary);
}
.search-results-summary .search-results-count-num {
  font-weight: 700;
  color: var(--primary);
}

/* ——— Static content pages (About / Privacy) ——— */
.content-page {
  padding: 2.5rem 1.5rem 3rem;
}
.content-page h1 {
  font-family: 'Outfit', sans-serif;
  font-weight: 700;
  font-size: 1.6rem;
  margin-bottom: 1rem;
  color: var(--text);
}
.content-page h2 {
  font-family: 'Outfit', sans-serif;
  font-weight: 600;
  font-size: 1.1rem;
  margin-bottom: 0.75rem;
  color: var(--text);
}
.content-page .card {
  background: var(--card-elevated);
  border-radius: var(--radius);
  border-color: var(--border);
  box-shadow: var(--shadow-card);
}
.content-page .muted {
  color: var(--text-muted);
}

.search-results-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 1rem;
}
.search-results-filter {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  min-width: 140px;
}
.search-results-filter label {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
}
.search-results-filter .form-select {
  height: 36px;
  padding: 0.25rem 0.75rem;
  font-size: 0.85rem;
}

/* ——— Station detail: Save button ——— */
.save-station-form {
  margin: 0;
}
.btn-save-station {
  width: 100%;
  height: 48px;
  padding: 0 1rem;
  font-size: 1rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  color: #fff;
  box-shadow: var(--shadow-card);
  transition: background var(--duration-normal), transform var(--duration-fast) var(--ease-spring), box-shadow var(--duration-normal);
}
.btn-save-station:hover {
  background: linear-gradient(135deg, var(--primary-hover) 0%, var(--primary-dark) 100%);
  box-shadow: 0 4px 14px rgba(57, 181, 74, 0.3);
  transform: translateY(-1px);
}
.btn-save-station:active {
  transform: translateY(0) scale(0.98);
}

/* ——— Google Places Autocomplete: theme sync with site (dark + primary green) ——— */
.pac-container {
  background-color: var(--card) !important;
  border: 1px solid var(--border) !important;
  border-radius: var(--radius-sm) !important;
  box-shadow: var(--shadow-card), 0 8px 24px rgba(0, 0, 0, 0.4) !important;
  font-family: inherit !important;
  margin-top: 4px !important;
  overflow: hidden !important;
}
.pac-item {
  color: var(--text) !important;
  border-top: 1px solid var(--border) !important;
  padding: 10px 12px !important;
  cursor: pointer !important;
  font-size: 14px !important;
}
.pac-item:first-child {
  border-top: none !important;
}
.pac-item:hover,
.pac-item-selected {
  background-color: var(--primary-light) !important;
  color: var(--text) !important;
}
.pac-item-query {
  color: var(--text) !important;
  font-size: 14px !important;
}
.pac-icon {
  filter: invert(1) brightness(0.85) !important;
  margin-right: 8px !important;
}
.pac-item-query .pac-icon {
  opacity: 0.9 !important;
}
.hdpi.pac-icon {
  background-image: none !important;
}
.pac-container::after {
  background-image: none !important;
}

/* ——— Reduced motion ——— */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .d-md-none .fab-locate,
  .d-md-none .fab-filter,
  .d-md-none .fab-stations {
    animation: none;
  }
  #view-landing.view-active {
    animation: none;
  }
}
