body {
  font-family: "Inter", sans-serif;
  background: linear-gradient(to bottom, #0f2027, #203a43, #2c5364);
  color: white;
  margin: 0;
  padding: 20px;
}

h1 {
  text-align: center;
  margin-bottom: 10px;
}

/* Toolbar atas */
.toolbar {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 16px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

#refreshBtn {
  background: #3498db;
  border: none;
  color: white;
  font-weight: bold;
  padding: 8px 16px;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.3s;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}

#refreshBtn:hover {
  background: #2980b9;
}

#lastUpdate {
  font-size: 0.9em;
  opacity: 0.8;
}

/* Grid container */
.grid-container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
  gap: 20px;
}

/* Loading */
.loading {
  text-align: center;
  padding: 40px;
  font-size: 1.1em;
  color: #ecf0f1;
  opacity: 0.8;
}

/* Kartu stasiun */
.station-card {
  background: rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  padding: 16px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
  transition: transform 0.2s ease, background 0.3s;
  overflow: hidden;
  opacity: 0;
  transform: translateY(10px);
  animation: fadeInUp 0.6s ease forwards;
  will-change: transform, opacity;
}

.station-card:nth-child(odd) { animation-delay: 0.1s; }
.station-card:nth-child(even) { animation-delay: 0.3s; }

@keyframes fadeInUp {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.station-card:hover {
  transform: translateY(-4px);
  background: rgba(255, 255, 255, 0.12);
}

/* Header Stasiun */
.station-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.station-header h2 {
  font-size: 1.2em;
  margin: 0;
}

.status {
  font-weight: bold;
  font-size: 0.9em;
  padding: 4px 10px;
  border-radius: 8px;
}

.status.online {
  background: #2ecc71;
  color: #fff;
  box-shadow: 0 0 6px #2ecc71aa;
}

.status.offline {
  background: #e74c3c;
  color: #fff;
  box-shadow: 0 0 6px #e74c3caa;
}

/* Ringkasan data */
.station-summary {
  display: flex;
  justify-content: space-around;
  text-align: center;
  flex-wrap: wrap;
  gap: 10px;
}

.summary-item {
  flex: 1 1 45%;
  min-width: 100px;
}

.summary-item h3 {
  margin: 4px 0;
  font-size: 0.9em;
  opacity: 0.8;
}

.summary-item p {
  margin: 0;
  font-size: 1.3em;
  font-weight: bold;
}

/* Warna parameter */
.summary-item:nth-child(1) p { color: #f1c40f; } /* Suhu */
.summary-item:nth-child(2) p { color: #3498db; } /* Kelembaban */
.summary-item:nth-child(3) p { color: #1abc9c; } /* Angin */
.summary-item:nth-child(4) p { color: #9b59b6; } /* Curah hujan */
.summary-item:nth-child(5) p { color: #95a5a6; } /* Total hujan */

.offline-msg {
  text-align: center;
  padding: 20px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  color: #ffbaba;
  font-weight: 500;
}

canvas {
  margin-top: 15px;
  width: 100%;
  height: 180px;
}

/* Responsif */
@media (max-width: 480px) {
  body {
    padding: 10px;
  }
  h1 {
    font-size: 1.4em;
  }
  .summary-item p {
    font-size: 1.1em;
  }
}

footer {
  text-align: center;
  margin-top: 30px;
  font-size: 0.9em;
  opacity: 0.8;
}

/* Peta Leaflet */
.map-container {
  height: 320px;
  border-radius: 16px;
  overflow: hidden;
  margin-bottom: 30px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

/* Atur tampilan kontrol zoom biar nyatu dengan tema gelap */
.leaflet-control-zoom a {
  background-color: rgba(30, 30, 30, 0.8) !important;
  color: white !important;
  border: none !important;
}
.leaflet-control-zoom a:hover {
  background-color: rgba(255, 255, 255, 0.2) !important;
}

/* Tooltip/popup di peta */
.leaflet-popup-content-wrapper {
  background: rgba(40, 40, 40, 0.9);
  color: #fff;
  border-radius: 8px;
  box-shadow: 0 4px 10px rgba(0,0,0,0.5);
}
.leaflet-popup-tip {
  background: rgba(40, 40, 40, 0.9);
}

/* Tambahkan garis halus di atas footer agar transisi lembut dari peta */
footer {
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding-top: 15px;
}

