/* ==========================================
   VARIABEL WARNA (TEMA TERANG)
   ========================================== */
:root {
  --bg-body: #f0f2f5;
  --bg-container: #ffffff;
  --bg-controls: #f8f9fa;
  --text-main: #333333;
  --border-color: #dddddd;
  --info-color: #007bff;
}

/* ==========================================
   VARIABEL WARNA (TEMA GELAP)
   ========================================== */
[data-theme="dark"] {
  --bg-body: #18191a;
  --bg-container: #242526;
  --bg-controls: #3a3b3c;
  --text-main: #e4e6eb;
  --border-color: #3e4042;
  --info-color: #66b2ff;
}

/* ==========================================
   GAYA DASAR (BASE)
   ========================================== */
body {
  font-family: "Poppins", sans-serif;
  margin: 0;
  padding: 20px;
  background-color: var(--bg-body);
  color: var(--text-main);
  transition: all 0.3s ease;
}

.container {
  max-width: 1100px;
  margin: 0 auto;
  background: var(--bg-container);
  padding: 25px;
  border-radius: 12px;
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
  transition: all 0.3s ease;
}

.header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

h1 {
  font-size: 24px;
  margin: 0;
}

/* --- Penataan Tombol Header --- */
.header-buttons {
  display: flex;
  gap: 10px;
}

#btnDarkMode,
#btnLang {
  padding: 8px 16px;
  border-radius: 20px;
  border: 1px solid var(--border-color);
  background: transparent;
  color: var(--text-main);
  cursor: pointer;
  font-family: "Poppins", sans-serif;
  transition: all 0.3s;
}

#btnLang:hover,
#btnDarkMode:hover {
  background: #007bff;
  color: white;
  border-color: #007bff;
}

/* ==========================================
   AREA KONTROL (DROPDOWN & INFO)
   ========================================== */
.controls {
  display: flex;
  flex-wrap: wrap;
  gap: 15px;
  align-items: center;
  background: var(--bg-controls);
  padding: 15px;
  border-radius: 8px;
  margin-bottom: 20px;
  transition: all 0.3s ease;
}

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

select {
  padding: 10px;
  font-size: 15px;
  border-radius: 8px;
  border: 1px solid var(--border-color);
  background: var(--bg-container);
  color: var(--text-main);
  font-family: "Poppins", sans-serif;
  max-width: 100%;
}

.info-text {
  font-size: 14px;
  color: var(--info-color);
}

/* ==========================================
   KOTAK WAKTU IJTIMA'
   ========================================== */
.ijtima-container {
  background: #e9f5ff;
  border-left: 4px solid #007bff;
  padding: 12px 15px;
  margin-bottom: 20px;
  border-radius: 4px;
  font-size: 15px;
  color: #333333;
  transition: all 0.3s ease;
}

[data-theme="dark"] .ijtima-container {
  background: #1e293b;
  border-left: 4px solid #3b82f6;
  color: var(--text-main);
}

/* ==========================================
   PETA LEAFLET & POPUP
   ========================================== */
#map {
  height: 65vh;
  width: 100%;
  border-radius: 8px;
  border: 2px solid var(--border-color);
  z-index: 1;
}

.leaflet-popup-content-wrapper,
.leaflet-popup-content {
  font-family: "Poppins", sans-serif !important;
}

.leaflet-popup-content {
  margin: 15px 18px !important;
}

.btn-detail {
  display: block;
  width: 100%;
  padding: 8px;
  margin-top: 15px;
  background: #007bff;
  color: #fff;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-family: "Poppins", sans-serif;
  font-size: 13px;
  font-weight: 500;
  text-align: center;
  transition: background 0.2s;
}

.btn-detail:hover {
  background: #0056b3;
}

/* Styling Tombol GPS di Peta */
.gps-btn {
  background-color: #ffffff;
  border: 2px solid rgba(0, 0, 0, 0.2);
  background-clip: padding-box;
  width: 34px;
  height: 34px;
  cursor: pointer;
  border-radius: 4px;
  font-size: 18px;
  line-height: 30px;
  text-align: center;
  padding: 0;
  transition: background-color 0.2s;
}

.gps-btn:hover {
  background-color: #f4f4f4;
}

/* Penyesuaian Tombol GPS saat Dark Mode */
[data-theme="dark"] .gps-btn {
  background-color: #242526;
  border-color: #3e4042;
  color: #fff;
}
[data-theme="dark"] .gps-btn:hover {
  background-color: #3a3b3c;
}

/* Styling Tombol Heatmap Zona Visibilitas */
.heatmap-btn {
  background-color: #ffffff;
  border: 2px solid rgba(0, 0, 0, 0.2);
  background-clip: padding-box;
  width: 34px;
  height: 34px;
  cursor: pointer;
  border-radius: 4px;
  font-size: 18px;
  line-height: 30px;
  text-align: center;
  padding: 0;
  transition: background-color 0.2s;
  margin-top: 5px; /* Jarak dengan tombol GPS di atasnya */
  display: block;
}

.heatmap-btn:hover {
  background-color: #f4f4f4;
}

/* Warna khusus saat Heatmap menyala (Aktif) */
.heatmap-btn.active-mode {
  background-color: #d1e7dd !important;
  border-color: #0f5132;
}

/* Penyesuaian Tombol Heatmap saat Dark Mode */
[data-theme="dark"] .heatmap-btn {
  background-color: #242526;
  border-color: #3e4042;
  color: #fff;
}
[data-theme="dark"] .heatmap-btn:hover {
  background-color: #3a3b3c;
}
[data-theme="dark"] .heatmap-btn.active-mode {
  background-color: #198754 !important;
  border-color: #0f5132;
}

/* ==========================================
   MODAL LAPORAN ASTRONOMI (TERMINAL VIEW)
   ========================================== */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(4px);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 9999;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.modal-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

/* Kotak Terminal Selalu Gelap */
.modal-content {
  background: #0d1117; /* Warna gelap ala GitHub Dark Mode */
  color: #58a6ff;
  width: 90%;
  max-width: 500px;
  border-radius: 8px;
  border: 1px solid #30363d;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.8);
  font-family: Consolas, "Liberation Mono", Menlo, Courier, monospace;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.modal-header {
  background: #1f1f1f;
  padding: 15px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid #30363d;
}

.modal-header h3 {
  margin: 0;
  font-size: 15px;
  color: #ffffff;
  font-family: "Poppins", sans-serif;
  letter-spacing: 1px;
}

.close-btn {
  background: transparent;
  border: none;
  color: #ff5555;
  font-size: 26px;
  cursor: pointer;
  line-height: 1;
  transition: transform 0.2s;
}

.close-btn:hover {
  transform: scale(1.2);
}

.modal-body {
  padding: 20px;
  max-height: 70vh;
  overflow-y: auto;
  font-size: 14px;
  line-height: 1.6;
}

.modal-body table {
  width: 100%;
  border-collapse: collapse;
}

.modal-body th,
.modal-body td {
  padding: 10px 0;
  border-bottom: 1px dashed #30363d;
}

.modal-body th {
  text-align: left;
  color: #c9d1d9;
  font-weight: normal;
  width: 55%;
  letter-spacing: 0.5px;
}

.modal-body td {
  text-align: right;
  font-weight: bold;
  color: #3fb950;
  letter-spacing: 0.5px;
}

/* Container untuk tombol-tombol di Terminal */
.terminal-actions {
  display: flex;
  gap: 10px;
  margin-top: 15px;
}

/* Penyesuaian Tombol Download (Lebar dibagi rata) */
.btn-download {
  flex: 1;
  padding: 12px;
  background: #238636;
  color: #fff;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-family: "Poppins", sans-serif;
  font-size: 13px;
  font-weight: 600;
  text-align: center;
  transition: background 0.2s;
}
.btn-download:hover {
  background: #2ea043;
}

/* Gaya khusus Tombol WhatsApp */
.btn-share {
  flex: 1;
  padding: 12px;
  background: #25d366; /* Warna Hijau Khas WhatsApp */
  color: #fff;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-family: "Poppins", sans-serif;
  font-size: 13px;
  font-weight: 600;
  text-align: center;
  transition: background 0.2s;
}
.btn-share:hover {
  background: #128c7e;
}
/* Kotak Peringatan & Timer Heatmap */
#heatmap-loading {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: rgba(0, 0, 0, 0.85);
  color: white;
  padding: 20px 30px;
  border-radius: 8px;
  z-index: 9999;
  display: none; /* Sembunyikan default */
  text-align: center;
  font-family: "Poppins", sans-serif;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

/* Legenda Peta (Kiri Bawah) */
.info.legend {
  background: white;
  padding: 10px 15px;
  border-radius: 6px;
  box-shadow: 0 0 15px rgba(0, 0, 0, 0.2);
  font-size: 13px;
  color: #333;
  font-family: "Poppins", sans-serif;
  line-height: 1.5;
}

[data-theme="dark"] .info.legend {
  background: #242526;
  color: #e4e6eb;
  box-shadow: 0 0 15px rgba(0, 0, 0, 0.6);
}

.legend-box {
  width: 16px;
  height: 16px;
  display: inline-block;
  background: #25d366;
  opacity: 0.4;
  margin-right: 8px;
  vertical-align: middle;
  border: 1px solid #128c7e;
}
