/* RESET */
html,
body {
  margin: 0;
  padding: 0;
  height: 100%;
  font-family: Arial, sans-serif;
}

/* MAP */
#map {
  width: 100%;
  height: 100%;
}

/* INFO BOX */
.info-box {
  position: absolute;
  top: 10px;
  left: 10px;
  z-index: 1000;
  background: rgba(0, 0, 0, 0.75);
  color: #fff;
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 13px;
  max-width: 85vw;
}

/* BMKG HEADER */
.bmkg-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 6px;
}

.bmkg-logo {
  width: 42px;
  height: auto;
}

.bmkg-text {
  line-height: 1.25;
}

.bmkg-title {
  font-size: 16px;
  font-weight: bold;
}

.bmkg-subtitle {
  font-size: 16px;
}

/* DATETIME */
.datetime {
  font-size: 13px;
  font-weight: bold;
  margin-top: 4px;
}

/* MOBILE FRIENDLY */
@media (max-width: 600px) {
  .bmkg-logo {
    width: 36px;
  }

  .bmkg-title {
    font-size: 10px;
  }

  .bmkg-subtitle {
    font-size: 10px;
  }

  .datetime {
    font-size: 12px;
  }
}

/* LEGEND */
.legend-box {
  position: absolute;
  bottom: 10px;
  right: 10px;
  z-index: 1000;
}

.legend-box img {
  width: 280px;
  max-width: 35vw;
  height: auto;
}

/* Leaflet popup & control touch friendly */
.leaflet-control-zoom a {
  width: 36px;
  height: 36px;
  line-height: 36px;
}

.leaflet-container .leaflet-bottom.leaflet-right {
  right: auto !important;
  left: 10px !important;
}

/* TOMBOL PERINGATAN DINI */
.early-warning-btn {
  position: absolute;
  top: 98px; /* tepat di bawah info-box */
  left: 10px;
  z-index: 1000;
}

.early-warning-btn a {
  width: 36px;
  height: 36px;
  line-height: 36px;
  text-align: center;
  font-size: 18px;
  background: #fff;
  color: #d32f2f;
  text-decoration: none;
}

.early-warning-btn a:hover {
  background: #f5f5f5;
}

/* MODAL OVERLAY */
.warning-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.45);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 2000;
}

.warning-content {
  background: #fff;
  width: 90%;
  max-width: 420px;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
}

.warning-header {
  background: #fbc02d;
  color: #000;
  padding: 10px 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-weight: bold;
}

.warning-header button {
  background: none;
  border: none;
  font-size: 18px;
  cursor: pointer;
}

.warning-body {
  padding: 14px;
  font-size: 13px;
  white-space: pre-wrap;
  line-height: 1.5;
  max-height: 60vh;
  overflow-y: auto;
}

/* =========================
   RADAR TIMELINE
========================= */
.radar-timeline {
  position: absolute;
  bottom: 16px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1200;

  display: flex;
  align-items: center;
  gap: 12px;

  background: rgba(0, 0, 0, 0.75);
  padding: 8px 12px;
  border-radius: 10px;
  color: #fff;
  font-size: 13px;
}

.radar-timeline #timeStart,
.radar-timeline #timeEnd {
  min-width: 110px;
  text-align: center;
  font-weight: bold;
}

.timeline-control {
  display: flex;
  align-items: center;
  gap: 8px;
}

#radarPlay {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  border: none;
  background: #2c7be5;
  color: #fff;
  font-size: 16px;
  cursor: pointer;
}

#radarPlay:hover {
  background: #1a5fc1;
}

#radarSlider {
  width: 240px;
}

/* =========================
   MOBILE: TIMELINE MENYESUAIKAN LEGENDA
========================= */
@media (max-width: 600px) {
  .radar-timeline {
    width: 94vw; /* hampir full layar seperti legend */
    max-width: 94vw;
    bottom: 10px;
    padding: 10px 10px;
    gap: 10px;
    font-size: 13px;
    border-radius: 14px;
  }

  .radar-timeline #timeStart,
  .radar-timeline #timeEnd {
    min-width: auto; /* hilangkan fix width */
    font-size: 12px;
  }

  .timeline-control {
    flex: 1;
  }

  #radarPlay {
    width: 36px; /* lebih nyaman disentuh */
    height: 36px;
    font-size: 16px;
    flex-shrink: 0;
  }

  #radarSlider {
    flex: 1;
    width: 100%;
  }

  /* Legend tetap di atas timeline */
  .legend-box {
    bottom: 90px;
  }
}

/* =========================
   MOBILE: LEGENDA NAIK DI ATAS SLIDER
========================= */
@media (max-width: 600px) {
  .legend-box {
    bottom: 70px; /* naik sedikit dari posisi default */
    right: 10px;
  }

  .legend-box img {
    width: 220px;
    max-width: 55vw;
  }
}

.leaflet-control-attribution {
  display: none !important;
}
