/* ============================
   GLOBAL
============================ */
body {
  font-family: "Inter", sans-serif;
  background: #d2e3fc;
  color: #333;
  margin: 0;
  padding: 20px;
}

h1 {
  text-align: center;
  margin-bottom: 10px;
  color: #222;
}

.leaflet-marker-icon {
  filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.7));
}



/* ============================
   TOOLBAR
============================ */
.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;
  color: #555;
}

/* ============================
   SUMMARY ITEM + ICON FIX
============================ */
.summary-item {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1 1 45%;
}

.summary-item .icon {
  width: 30px;
  height: 30px;
  object-fit: contain;
  background: transparent !important;
  mix-blend-mode: normal !important;
  opacity: 1;
  user-select: none;
  pointer-events: none;
}

.summary-item h3 {
  margin: 14px 0;
  opacity: 0.8;
}

.summary-item p {
  margin: 0;
  font-size: 1.3em;
  font-weight: bold;
}

.summary-item {
    justify-content: center;
    text-align: center;
}

/* Warna parameter */
.summary-item:nth-child(1) p { color: #f1c40f; }
.summary-item:nth-child(2) p { color: #aadafa; }
.summary-item:nth-child(3) p { color: #b8fff1; }
.summary-item:nth-child(4) p { color: #d3b1e0; }
.summary-item:nth-child(5) p { color: #a3ced1; }

/* ============================
   GRID SYSTEM
============================ */
.grid-container {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
}

/* ============================
   CARD
============================ */
.station-card {
  background: #365a8f;
  color: white;
  border-radius: 16px;
  padding: 16px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.4);
  overflow: hidden;
  transition: 0.2s;
  transform: translateY(10px);
  animation: fadeInUp 0.6s ease forwards;
}

.station-card { min-height: 300px; }

.station-card small {
  color: #d0e6ff;
}

.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: #10284a;
}

/* MAP */



#miniMap {
  width: 100%;
  height: 300px;
  border-radius: 10px;
  background: #1e2a38;
}

.map-card {
  grid-column: 4;
  grid-row: 2;
}

/* ============================
   HEADER DI CARD
============================ */
.station-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.station-header h2 { margin: 0; }

.status {
  font-weight: bold;
  padding: 4px 10px;
  border-radius: 8px;
}

.status.online { background: #2ecc71; color: white; }
.status.offline { background: #e74c3c; color: white; }

/* ============================
   WARNING HUJAN
============================ */
.alert-hujan {
  border: 5px solid red;
  box-shadow: 0 0 15px red;
  animation: blink 1s infinite;
}

@keyframes blink {
  0% { opacity: 1; }
  50% { opacity: 0.3; }
  100% { opacity: 1; }
}

/* ============================
   OFFLINE MESSAGE
============================ */
.offline-msg {
  padding: 20px;
  background: rgba(255,255,255,0.08);
  border-radius: 12px;
  color: #ffbaba;
  text-align: center;
}

/* ============================
   FOOTER
============================ */
footer {
  text-align: center;
  opacity: 0.8;
  margin-top: 30px;
  padding: 14px 18px;
  background-color: #182840;
  color: white;
  border-radius: 12px;
}

.btn-back {
  display: block;
  margin: 10px auto;
  padding: 14px 18px;
  background-color: #233c61;
  color: white;
  font-weight: bold;
  text-decoration: none;
  text-align: center;
  border-radius: 12px;
  transition: background 0.3s, transform 0.2s;
  box-shadow: 0 3px 6px rgba(0,0,0,0.2);
}

.btn-back:hover {
  background-color: #51688a;
  transform: translateY(-2px);
}

/* ============================
   RESPONSIVE — TABLET
============================ */
@media (max-width: 768px) {

  .grid-container {
    grid-template-columns: 1fr;
  }

  .map-card {
    order: 999 !important;
    grid-column: 1 !important;
    width: 100% !important;
  }

  .station-summary {
    flex-direction: column;
  }

  .summary-item {
    flex: 1 1 100%;
  }

  #miniMap {
    height: 300px !important;
  }

  h1 { font-size: 1.4em; }
  body { padding: 10px; }
  .station-card { padding: 12px; }
}

/* ============================
   RESPONSIVE — HP KECIL
============================ */
@media (max-width: 480px) {

  .summary-item p {
    font-size: 1.1em;
  }

  .summary-item small {
    font-size: 0.75em;
  }

  #miniMap {
    height: 260px !important;
  }
}

