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

body {
  font-family: "Inter", -apple-system, Arial, sans-serif;
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
}

.app {
  display: flex;
  height: 100vh;
  height: 100dvh;
  position: relative;
}

/* ===== SIDEBAR ===== */
.sidebar {
  width: 360px;
  background: #1a1a2e;
  color: #eee;
  padding: 16px;
  overflow-y: auto;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 10;
  transition: transform 0.3s ease;
}

.sidebar-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.sidebar-header h1 {
  font-size: 1.2rem;
  color: #e94560;
}

.icon-btn {
  background: none;
  border: none;
  color: #aaa;
  font-size: 1.2rem;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 4px;
}

.icon-btn:hover {
  color: #fff;
  background: rgba(255,255,255,0.1);
}

.controls {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.control-row {
  display: flex;
  gap: 8px;
}

.btn {
  padding: 8px 14px;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 600;
  transition: background 0.2s;
  flex: 1;
  text-align: center;
}

.btn-primary {
  background: #e94560;
  color: white;
}

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

.btn-primary:disabled {
  background: #555;
  cursor: not-allowed;
}

.btn-toggle {
  background: #2a2a4a;
  color: #aaa;
  border: 1px solid #444;
}

.btn-toggle:hover {
  background: #3a3a5a;
}

.btn-toggle.active {
  background: #0f3460;
  color: #4fc3f7;
  border-color: #4fc3f7;
}

.btn-icon {
  margin-right: 4px;
}

.fuel-select {
  display: flex;
  align-items: center;
  gap: 8px;
}

.fuel-select label {
  font-size: 0.85rem;
  color: #aaa;
  white-space: nowrap;
}

.fuel-select select {
  flex: 1;
  padding: 6px 10px;
  background: #16213e;
  color: #eee;
  border: 1px solid #444;
  border-radius: 6px;
  font-size: 0.85rem;
  cursor: pointer;
}

.fuel-select select:focus {
  outline: none;
  border-color: #e94560;
}

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

.radius-control label {
  font-size: 0.85rem;
  color: #aaa;
}

.radius-control input[type="range"] {
  width: 100%;
  accent-color: #e94560;
}

.legend {
  display: flex;
  gap: 10px;
  font-size: 0.78rem;
  flex-wrap: wrap;
  padding: 4px 0;
  border-top: 1px solid #2a2a4a;
  border-bottom: 1px solid #2a2a4a;
}

.legend-item.green { color: #4caf50; }
.legend-item.yellow { color: #ffc107; }
.legend-item.red { color: #f44336; }
.legend-item.gray { color: #999; }

.loading-text {
  color: #e94560;
  font-size: 0.85rem;
  text-align: center;
  padding: 8px;
}

.station-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.station-item {
  background: #16213e;
  border-radius: 8px;
  padding: 10px 12px;
  cursor: pointer;
  transition: background 0.2s;
  border-left: 4px solid transparent;
}

.station-item:hover {
  background: #1a1a40;
}

.station-item.green { border-left-color: #4caf50; }
.station-item.yellow { border-left-color: #ffc107; }
.station-item.red { border-left-color: #f44336; }
.station-item.gray { border-left-color: #999; }

.station-item .name {
  font-weight: 600;
  font-size: 0.85rem;
}

.station-item .address {
  font-size: 0.72rem;
  color: #888;
  margin-top: 2px;
}

.station-item .price {
  font-size: 0.85rem;
  color: #4caf50;
  margin-top: 4px;
  font-weight: 600;
}

.station-item .no-price {
  font-size: 0.78rem;
  color: #666;
  margin-top: 4px;
}

.route-btn {
  margin-top: 6px;
  padding: 4px 12px;
  background: #e94560;
  color: white;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.78rem;
}

.route-btn:hover {
  background: #c73850;
}

/* ===== PRICE LABELS ON MAP ===== */
.price-label {
  position: absolute;
  font-family: "Inter", -apple-system, Arial, sans-serif;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
  white-space: nowrap;
  pointer-events: none;
  z-index: 50;
  box-shadow: 0 1px 4px rgba(0,0,0,0.3);
}

.price-label.green {
  background: #2e7d32;
  color: #fff;
}

.price-label.yellow {
  background: #f57f17;
  color: #fff;
}

.price-label.red {
  background: #c62828;
  color: #fff;
}

.price-label.gray {
  background: #555;
  color: #ddd;
}

/* ===== MAP ===== */
.map-wrapper {
  flex: 1;
  position: relative;
}

.map-container {
  width: 100%;
  height: 100%;
}

.fab {
  position: absolute;
  top: 12px;
  left: 12px;
  z-index: 5;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: #1a1a2e;
  color: #eee;
  border: none;
  font-size: 1.3rem;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0,0,0,0.4);
  display: none;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
}

.fab:hover {
  background: #2a2a4a;
}

/* ===== INFO WINDOW ===== */
.info-content {
  font-family: "Inter", -apple-system, Arial, sans-serif;
  min-width: 160px;
  max-width: 240px;
}

.info-content h3 {
  margin-bottom: 4px;
  font-size: 0.9rem;
}

.info-content .price {
  color: #2e7d32;
  font-weight: 600;
  font-size: 0.85rem;
}

.info-content .no-price {
  color: #999;
  font-size: 0.8rem;
}

.info-content .route-btn {
  margin-top: 6px;
  padding: 5px 14px;
  background: #e94560;
  color: white;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.8rem;
}

.info-content .route-btn:hover {
  background: #c73850;
}

/* ===== ROUTE INFO ===== */
.route-info {
  background: #16213e;
  border-radius: 8px;
  padding: 10px 12px;
  margin-top: 8px;
}

.route-info h3 {
  font-size: 0.9rem;
  margin-bottom: 4px;
}

.route-info p {
  font-size: 0.8rem;
  color: #aaa;
}

.route-info .clear-btn {
  margin-top: 6px;
  padding: 4px 12px;
  background: #333;
  color: #eee;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.78rem;
}

/* ===== MOBILE ===== */
@media (max-width: 768px) {
  .sidebar {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    width: 85vw;
    max-width: 360px;
    transform: translateX(-100%);
    box-shadow: 4px 0 20px rgba(0,0,0,0.5);
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .fab {
    display: flex;
  }

  .control-row {
    flex-direction: column;
    gap: 6px;
  }

  .station-item {
    padding: 8px 10px;
  }
}

@media (max-width: 400px) {
  .sidebar {
    width: 92vw;
  }

  .legend {
    font-size: 0.7rem;
  }
}

/* overlay for mobile */
.sidebar-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0,0,0,0.4);
  z-index: 9;
}

.sidebar-overlay.open {
  display: block;
}
