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

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  height: 100vh;
  overflow: hidden;
}

#app {
  display: flex;
  height: 100vh;
}

/* --- Sidebar --- */

#sidebar {
  width: 380px;
  min-width: 380px;
  background: #1a1a2e;
  color: #e0e0e0;
  padding: 20px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

h1 {
  font-size: 1.5rem;
  color: #4ecca3;
  letter-spacing: -0.5px;
}

.tagline {
  font-size: 0.85rem;
  color: #888;
  margin-top: -8px;
}

/* Mode toggle */

.mode-toggle {
  display: flex;
  gap: 4px;
  background: #16213e;
  border-radius: 8px;
  padding: 4px;
}

.mode-btn {
  flex: 1;
  padding: 8px;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: #888;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.mode-btn.active {
  background: #4ecca3;
  color: #1a1a2e;
}

/* Fields */

.field {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.field label {
  font-size: 0.75rem;
  color: #888;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.field input, .field select {
  padding: 10px 12px;
  border: 1px solid #2a2a4a;
  border-radius: 6px;
  background: #16213e;
  color: #e0e0e0;
  font-size: 0.9rem;
  outline: none;
  transition: border-color 0.2s;
}

.field input:focus, .field select:focus {
  border-color: #4ecca3;
}

.search-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.filters {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* Network checkboxes */

.network-checkboxes {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 5px 10px;
  background: #16213e;
  border: 1px solid #2a2a4a;
  border-radius: 6px;
  font-size: 0.8rem;
  color: #ccc;
  cursor: pointer;
  transition: all 0.2s;
  text-transform: none;
  letter-spacing: 0;
}

.checkbox-label:hover {
  border-color: #4ecca3;
}

.checkbox-label input[type="checkbox"] {
  accent-color: #4ecca3;
  width: 14px;
  height: 14px;
  padding: 0;
  border: none;
  background: none;
}

.checkbox-label:has(input:checked) {
  background: #2a3f5f;
  border-color: #4ecca3;
  color: #fff;
}

.network-hint {
  font-size: 0.7rem;
  color: #555;
  margin-top: 2px;
}

/* Autocomplete */

.ac-wrapper {
  position: relative;
}

.ac-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: #16213e;
  border: 1px solid #4ecca3;
  border-top: none;
  border-radius: 0 0 6px 6px;
  z-index: 100;
  max-height: 200px;
  overflow-y: auto;
}

.ac-item {
  padding: 8px 12px;
  font-size: 0.82rem;
  color: #ccc;
  cursor: pointer;
  border-bottom: 1px solid #2a2a4a;
}

.ac-item:last-child { border-bottom: none; }

.ac-item:hover, .ac-item.ac-active {
  background: #2a3f5f;
  color: #fff;
}

.ac-loader {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  padding: 8px 12px;
  background: #16213e;
  border: 1px solid #2a2a4a;
  border-top: none;
  border-radius: 0 0 6px 6px;
  font-size: 0.8rem;
  color: #4ecca3;
  z-index: 100;
}

.hidden { display: none !important; }

/* Search button */

#search-btn {
  padding: 12px;
  border: none;
  border-radius: 8px;
  background: #4ecca3;
  color: #1a1a2e;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.2s;
}

#search-btn:hover { background: #3db88f; }
#search-btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* Status */

#status {
  padding: 12px;
  border-radius: 8px;
  font-size: 0.85rem;
  text-align: center;
}

#status.loading {
  background: #16213e;
  color: #4ecca3;
}

#status.error {
  background: #3e1a1a;
  color: #f56565;
}

/* Results */

#results-summary {
  padding: 10px 12px;
  background: #16213e;
  border-radius: 8px;
  font-size: 0.85rem;
  color: #4ecca3;
}

#results-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding-bottom: 20px;
}

.result-card {
  background: #16213e;
  border-radius: 10px;
  padding: 14px;
  cursor: pointer;
  transition: background 0.2s;
  border: 1px solid transparent;
}

.result-card:hover, .result-card.active {
  background: #1e2d50;
  border-color: #4ecca3;
}

.charger-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
  margin-bottom: 2px;
}

.charger-name {
  font-weight: 700;
  font-size: 0.95rem;
  color: #4ecca3;
}

.speed-badge {
  flex-shrink: 0;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 0.72rem;
  font-weight: 700;
  white-space: nowrap;
}

.speed-ultra {
  background: #4ecca3;
  color: #1a1a2e;
}

.speed-fast {
  background: #2a7a5a;
  color: #e0e0e0;
}

.speed-std {
  background: #2a2a4a;
  color: #bbb;
}

.charger-meta {
  font-size: 0.78rem;
  color: #777;
  margin-bottom: 8px;
}

.charger-plugs {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-bottom: 10px;
}

.plug-badge {
  background: #2a2a4a;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 0.72rem;
  color: #bbb;
}

.restaurants-header {
  font-size: 0.72rem;
  text-transform: uppercase;
  color: #666;
  letter-spacing: 0.5px;
  margin-bottom: 6px;
}

.restaurant-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 0;
  border-bottom: 1px solid #2a2a4a;
}

.restaurant-item:last-child { border-bottom: none; }

.restaurant-name {
  font-size: 0.85rem;
  color: #e0e0e0;
}

.restaurant-cuisine {
  font-size: 0.72rem;
  color: #777;
}

.restaurant-rating {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 0.85rem;
  font-weight: 600;
}

.star { color: #f6c23e; }

.review-count {
  font-size: 0.7rem;
  color: #777;
}

/* Route info */

.route-info {
  padding: 10px 12px;
  background: #16213e;
  border-radius: 8px;
  font-size: 0.85rem;
  color: #bbb;
  display: flex;
  gap: 16px;
}

.route-info strong { color: #4ecca3; }

.usage-info {
  text-align: center;
  font-size: 0.75rem;
  color: #666;
  padding: 6px 0;
}

.usage-low {
  color: #e74c3c;
  font-weight: 600;
}

/* --- Map --- */

#map {
  flex: 1;
  z-index: 0;
}

/* Custom marker icons */

.charger-icon {
  background: #4ecca3;
  border: 2px solid #1a1a2e;
  border-radius: 50%;
  width: 14px;
  height: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
}

.restaurant-icon {
  background: #f6c23e;
  border: 2px solid #1a1a2e;
  border-radius: 50%;
  width: 10px;
  height: 10px;
}

/* Leaflet popup tweaks */

.leaflet-popup-content-wrapper {
  border-radius: 10px;
}

.popup-title {
  font-weight: 700;
  margin-bottom: 4px;
}

.popup-meta {
  font-size: 0.8rem;
  color: #666;
}

/* Responsive */

@media (max-width: 768px) {
  #app { flex-direction: column; }
  #sidebar { width: 100%; min-width: 0; max-height: 45vh; }
  #map { height: 55vh; }
}
