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

:root {
  --bg: #1a1a2e;
  --surface: #16213e;
  --surface-light: #1f3460;
  --primary: #6c63ff;
  --primary-hover: #5a52d5;
  --text: #e0e0e0;
  --text-muted: #888;
  --radius: 8px;
  --panel-width: 340px;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  height: 100vh;
  display: flex;
  overflow: hidden;
}

/* Panel */
#panel {
  width: var(--panel-width);
  min-width: var(--panel-width);
  height: 100vh;
  background: var(--bg);
  overflow-y: auto;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  border-right: 1px solid var(--surface-light);
  z-index: 1000;
}

.panel-header h1 {
  font-size: 1.3rem;
  color: #fff;
  margin: 8px 0 4px;
}

.back-link {
  color: var(--primary);
  text-decoration: none;
  font-size: 0.85rem;
}

.back-link:hover {
  text-decoration: underline;
}

.subtitle {
  color: var(--text-muted);
  font-size: 0.85rem;
}

/* Map */
#map {
  flex: 1;
  height: 100vh;
}

/* Sections */
section {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

h2 {
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  border-bottom: 1px solid var(--surface-light);
  padding-bottom: 6px;
}

/* Buttons */
.btn-primary {
  background: var(--primary);
  color: #fff;
  border: none;
  padding: 12px 20px;
  border-radius: var(--radius);
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  width: 100%;
  font-family: inherit;
}

.btn-primary:hover {
  background: var(--primary-hover);
}

.btn-primary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Progress */
.progress-bar {
  background: var(--surface);
  border-radius: 4px;
  height: 8px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: var(--primary);
  width: 0%;
  transition: width 0.3s;
  border-radius: 4px;
}

#progress-text {
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* Slider */
input[type="range"] {
  -webkit-appearance: none;
  width: 100%;
  height: 6px;
  background: var(--surface);
  border-radius: 3px;
  outline: none;
}

input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 18px;
  height: 18px;
  background: var(--primary);
  border-radius: 50%;
  cursor: pointer;
}

input[type="range"]::-moz-range-thumb {
  width: 18px;
  height: 18px;
  background: var(--primary);
  border: none;
  border-radius: 50%;
  cursor: pointer;
}

.slider-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.time-label {
  font-size: 1.2rem;
  font-weight: 700;
  color: #fff;
  font-variant-numeric: tabular-nums;
}

.toggle-label {
  font-size: 0.85rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 4px;
  cursor: pointer;
}

/* Settings row */
.setting-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.85rem;
}

.input-with-unit {
  display: flex;
  align-items: center;
  gap: 6px;
}

.input-with-unit input {
  width: 60px;
  padding: 6px 8px;
  background: var(--surface);
  border: 1px solid var(--surface-light);
  border-radius: 4px;
  color: var(--text);
  font-size: 0.85rem;
  font-family: inherit;
  text-align: center;
}

.input-with-unit input:focus {
  outline: none;
  border-color: var(--primary);
}

.input-with-unit span {
  color: var(--text-muted);
}

input[type="time"] {
  padding: 6px 8px;
  background: var(--surface);
  border: 1px solid var(--surface-light);
  border-radius: 4px;
  color: var(--text);
  font-size: 0.85rem;
  font-family: inherit;
  color-scheme: dark;
}

input[type="time"]:focus {
  outline: none;
  border-color: var(--primary);
}

/* Seasonal cards */
#seasonal-cards {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.season-card {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 10px 12px;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  border-left: 4px solid transparent;
}

.season-card.active {
  border-left-color: var(--season-color);
}

.season-check {
  margin-top: 2px;
  cursor: pointer;
  accent-color: var(--season-color);
}

.season-info {
  flex: 1;
  min-width: 0;
}

.season-name {
  font-weight: 600;
  font-size: 0.9rem;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 6px;
}

.season-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
  flex-shrink: 0;
}

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

.season-details {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 4px;
  line-height: 1.5;
}

.season-drive-time {
  color: #fff;
  font-weight: 600;
}

.muted {
  color: var(--text-muted);
  font-size: 0.8rem;
}

.hidden {
  display: none !important;
}

/* Leaflet popup override */
.leaflet-popup-content-wrapper {
  background: var(--surface);
  color: var(--text);
  border-radius: var(--radius);
}

.leaflet-popup-tip {
  background: var(--surface);
}

.leaflet-popup-content-wrapper .leaflet-popup-content a {
  color: var(--primary);
}

/* Mobile */
@media (max-width: 768px) {
  body {
    flex-direction: column;
  }

  #panel {
    width: 100%;
    min-width: 100%;
    height: auto;
    max-height: 45vh;
    border-right: none;
    border-bottom: 1px solid var(--surface-light);
  }

  #map {
    height: 55vh;
  }
}
