/* ═══════════════════════════════════════════════════════════════════
   KMAP PENDAKIAN GUNUNG INDONESIA (MODUL TAKTIS V76)
   Tema-Aware, 0% Warna Biru, Non-Blocking Overlay, Responsif Mobile
   ═══════════════════════════════════════════════════════════════════ */

/* MODAL KATALOG GUNUNG (TAHAP 2) */
.pdk-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.78);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  z-index: 9999;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  transition: opacity 0.25s ease;
}

@media (min-width: 640px) {
  .pdk-modal-backdrop {
    align-items: center;
    padding: 20px;
  }
}

.pdk-catalog-card {
  width: 100%;
  max-width: 580px;
  max-height: 88vh;
  background: var(--bg-card-solid, #1e293b);
  border: 1px solid var(--border-ui, rgba(255,255,255,0.12));
  border-radius: 20px 20px 0 0;
  box-shadow: var(--shadow-float, 0 16px 36px rgba(0,0,0,0.5));
  display: flex;
  flex-direction: column;
  overflow: hidden;
  color: var(--text-main, #f8fafc);
  animation: pdkSlideUp 0.28s cubic-bezier(0.16, 1, 0.3, 1);
}

@media (min-width: 640px) {
  .pdk-catalog-card {
    border-radius: 20px;
    max-height: 82vh;
  }
}

@keyframes pdkSlideUp {
  from { transform: translateY(40px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

/* HEADER KATALOG */
.pdk-catalog-head {
  padding: 14px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border-ui, rgba(255,255,255,0.08));
}

.pdk-head-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 15px;
  font-weight: 800;
  letter-spacing: 0.3px;
  color: var(--text-main, #f8fafc);
}

.pdk-head-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.pdk-btn-icon {
  background: rgba(255,255,255,0.08);
  border: 1px solid var(--border-ui, rgba(255,255,255,0.12));
  color: var(--text-main, #f8fafc);
  width: 34px;
  height: 34px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.pdk-btn-icon:active {
  transform: scale(0.92);
  background: rgba(255,255,255,0.15);
}

/* SEARCH & FILTER CHIPS */
.pdk-filter-box {
  padding: 12px 16px 8px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  border-bottom: 1px solid var(--border-ui, rgba(255,255,255,0.06));
}

.pdk-search-input {
  width: 100%;
  padding: 10px 14px;
  background: rgba(0, 0, 0, 0.22);
  border: 1.5px solid var(--border-ui, rgba(255,255,255,0.14));
  border-radius: 12px;
  font-size: 13px;
  color: var(--text-main, #f8fafc);
  outline: none;
  box-sizing: border-box;
}

.pdk-search-input:focus {
  border-color: var(--accent-primary, #10b981);
}

.pdk-chips-row {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  scrollbar-width: none;
  padding-bottom: 4px;
}

.pdk-chips-row::-webkit-scrollbar {
  display: none;
}

.pdk-chip {
  flex-shrink: 0;
  padding: 5px 12px;
  background: rgba(255,255,255,0.06);
  border: 1px solid var(--border-ui, rgba(255,255,255,0.1));
  border-radius: 20px;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--text-sub, #94a3b8);
  cursor: pointer;
  transition: all 0.15s ease;
}

.pdk-chip.active {
  background: var(--accent-primary, #10b981);
  color: #ffffff;
  border-color: var(--accent-primary, #10b981);
}

/* LIST ITEM GUNUNG */
.pdk-catalog-list {
  flex: 1;
  overflow-y: auto;
  padding: 12px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.pdk-item-card {
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--border-ui, rgba(255,255,255,0.08));
  border-radius: 14px;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  cursor: pointer;
  transition: transform 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}

.pdk-item-card:active {
  transform: scale(0.985);
  background: rgba(255,255,255,0.06);
}

.pdk-item-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}

.pdk-item-name {
  font-size: 14.5px;
  font-weight: 800;
  color: var(--text-main, #f8fafc);
  line-height: 1.3;
}

.pdk-item-island {
  font-size: 11px;
  color: var(--accent-amber, #f59e0b);
  font-weight: 700;
  letter-spacing: 0.2px;
}

.pdk-item-metrics {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 14px;
  font-size: 11.5px;
  color: var(--text-sub, #94a3b8);
}

.pdk-metric-val {
  font-weight: 700;
  color: var(--text-main, #f8fafc);
}

.pdk-item-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 4px;
  padding-top: 6px;
  border-top: 1px dashed rgba(255,255,255,0.07);
}

.pdk-item-status {
  font-size: 11px;
  display: flex;
  align-items: center;
  gap: 5px;
}

.pdk-item-status.offline {
  color: var(--accent-primary, #10b981);
}

.pdk-item-status.online {
  color: var(--text-sub, #94a3b8);
}

.pdk-item-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.pdk-mini-btn {
  padding: 4px 9px;
  background: rgba(255,255,255,0.08);
  border: 1px solid var(--border-ui, rgba(255,255,255,0.1));
  border-radius: 8px;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-main, #f8fafc);
  cursor: pointer;
}

.pdk-mini-btn:active {
  background: rgba(255,255,255,0.18);
}

/* ═══════════════════════════════════════════════════════════════════
   HUD TAKTIS DI ATAS PETA (TAHAP 3, 4, 5)
   ═══════════════════════════════════════════════════════════════════ */
.pdk-hud-top {
  position: fixed;
  top: 12px;
  left: 12px;
  right: 12px;
  max-width: 520px;
  margin: 0 auto;
  z-index: 1000;
  background: var(--bg-card-solid, #1e293b);
  border: 1.5px solid var(--border-ui, rgba(255,255,255,0.14));
  border-radius: 16px;
  padding: 10px 14px;
  box-shadow: var(--shadow-float, 0 10px 25px rgba(0,0,0,0.5));
  color: var(--text-main, #f8fafc);
  display: flex;
  flex-direction: column;
  gap: 6px;
  animation: pdkFadeIn 0.2s ease;
}

@keyframes pdkFadeIn {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}

.pdk-hud-top-row1 {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.pdk-hud-name-badge {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px 8px;
  flex: 1;
  min-width: 0;
  font-size: 13.5px;
  font-weight: 800;
  color: var(--text-main, #f8fafc);
  line-height: 1.25;
}

.pdk-hud-name-badge > span:first-child {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pdk-mode-badge {
  font-size: 10px;
  font-weight: 800;
  padding: 2px 7px;
  border-radius: 6px;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  flex-shrink: 0;
}

.pdk-mode-badge.plan {
  background: rgba(245, 158, 11, 0.2);
  color: var(--accent-amber, #f59e0b);
  border: 1px solid rgba(245, 158, 11, 0.4);
}

.pdk-mode-badge.climb {
  background: rgba(16, 185, 129, 0.2);
  color: var(--accent-primary, #10b981);
  border: 1px solid rgba(16, 185, 129, 0.4);
}

.pdk-mode-badge.descend {
  background: rgba(236, 72, 153, 0.2);
  color: #ec4899;
  border: 1px solid rgba(236, 72, 153, 0.4);
}

.pdk-hud-top-tools {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.pdk-hud-telemetry {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 12px;
  font-size: 11.5px;
  color: var(--text-sub, #94a3b8);
  border-top: 1px solid var(--border-ui, rgba(148,163,184,0.22));
  padding-top: 6px;
}

.pdk-telemetry-item {
  display: flex;
  align-items: center;
  gap: 4px;
}

.pdk-telemetry-val {
  font-weight: 700;
  color: var(--text-main, #f8fafc);
}

/* ═══════════════════════════════════════════════════════════════════
   BANNER DARURAT MELENCENG (TAHAP 4B)
   ═══════════════════════════════════════════════════════════════════ */
.pdk-offroute-banner {
  position: fixed;
  top: 126px;
  left: 12px;
  right: 12px;
  max-width: 520px;
  margin: 0 auto;
  z-index: 1001;
  background: #7f1d1d;
  border: 1.5px solid #ef4444;
  border-radius: 12px;
  padding: 8px 12px;
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: 0 8px 24px rgba(239, 68, 68, 0.4);
  animation: pdkPulseRed 1.8s infinite;
}

@keyframes pdkPulseRed {
  0%, 100% { box-shadow: 0 4px 14px rgba(239, 68, 68, 0.3); }
  50% { box-shadow: 0 6px 22px rgba(239, 68, 68, 0.65); }
}

.pdk-offroute-text {
  font-size: 12px;
  font-weight: 800;
  display: flex;
  align-items: center;
  gap: 6px;
}

.pdk-offroute-btn {
  background: #ef4444;
  color: #ffffff;
  border: none;
  border-radius: 8px;
  padding: 6px 11px;
  font-size: 11.5px;
  font-weight: 800;
  cursor: pointer;
  white-space: nowrap;
}

.pdk-offroute-btn:active {
  transform: scale(0.94);
  background: #dc2626;
}

/* ═══════════════════════════════════════════════════════════════════
   HUD BAWAH & GRAFIK ELEVASI LIPAT (COLLAPSIBLE)
   ═══════════════════════════════════════════════════════════════════ */
.pdk-hud-bottom {
  position: fixed;
  bottom: 16px;
  left: 12px;
  right: 12px;
  max-width: 520px;
  margin: 0 auto;
  z-index: 1000;
  background: var(--bg-card-solid, #1e293b);
  border: 1.5px solid var(--border-ui, rgba(255,255,255,0.14));
  border-radius: 18px;
  box-shadow: var(--shadow-float, 0 14px 30px rgba(0,0,0,0.55));
  overflow: hidden;
  color: var(--text-main, #f8fafc);
  display: flex;
  flex-direction: column;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

/* BAR ELEVASI TIPIS SAAT DILIPAT */
.pdk-chart-toggle-bar {
  padding: 8px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  background: rgba(0, 0, 0, 0.16);
  border-bottom: 1px solid var(--border-ui, rgba(255,255,255,0.06));
  font-size: 11.5px;
  font-weight: 700;
  color: var(--text-sub, #94a3b8);
  user-select: none;
}

.pdk-chart-toggle-bar:active {
  background: rgba(0, 0, 0, 0.28);
}

.pdk-chart-toggle-info {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-main, #f8fafc);
}

.pdk-chart-box {
  padding: 6px 12px;
  height: 115px;
  position: relative;
  transition: height 0.2s ease, opacity 0.2s ease;
}

.pdk-chart-box.collapsed {
  height: 0;
  padding: 0 12px;
  opacity: 0;
  pointer-events: none;
}

.pdk-elev-canvas {
  width: 100%;
  height: 100%;
  display: block;
}

/* BAR AKSI TOMBOL FOOTER */
.pdk-actions-bar {
  padding: 10px 14px;
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(0,0,0,0.06);
}

.pdk-btn-primary {
  flex: 1;
  padding: 10px 14px;
  background: var(--accent-primary, #10b981);
  color: #ffffff;
  border: none;
  border-radius: 12px;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: all 0.15s ease;
}

.pdk-btn-primary:active {
  transform: scale(0.97);
  filter: brightness(0.9);
}

.pdk-btn-amber {
  flex: 1;
  padding: 10px 14px;
  background: var(--accent-amber, #f59e0b);
  color: #ffffff;
  border: none;
  border-radius: 12px;
  font-size: 12.5px;
  font-weight: 800;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: all 0.15s ease;
}

.pdk-btn-amber:active {
  transform: scale(0.97);
  filter: brightness(0.9);
}

.pdk-btn-secondary {
  padding: 10px 12px;
  background: rgba(255,255,255,0.08);
  border: 1px solid var(--border-ui, rgba(255,255,255,0.12));
  color: var(--text-main, #f8fafc);
  border-radius: 12px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 5px;
}

.pdk-btn-secondary:active {
  background: rgba(255,255,255,0.16);
  transform: scale(0.96);
}

.pdk-btn-danger {
  padding: 10px 12px;
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.35);
  color: #ef4444;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
}

.pdk-btn-danger:active {
  background: #ef4444;
  color: #ffffff;
  transform: scale(0.96);
}

/* FLOATING RETURN PILL SAAT NAVIGASI JALAN AKTIF */
.pdk-return-pill {
  position: fixed;
  top: 152px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1005;
  background: var(--bg-card-solid, #1e293b);
  border: 1.5px solid var(--accent-primary, #10b981);
  color: var(--text-main, #f8fafc);
  padding: 8px 16px;
  border-radius: 30px;
  font-size: 12.5px;
  font-weight: 800;
  box-shadow: var(--shadow-float, 0 10px 25px rgba(0,0,0,0.5));
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  animation: pdkFadeIn 0.2s ease;
}

.pdk-return-pill:active {
  transform: translateX(-50%) scale(0.95);
}
