/* ==========================================================================
   BDIS Bengkayang — Modul Inspeksi Pohon ROW JTM 20 kV
   Glassmorphism Stylesheet for Tree Inspections, GIS, ML Analytics, and Recommendations
   ========================================================================== */

/* Priority Badges */
.badge-prio-kritis {
  background: rgba(239, 68, 68, 0.2);
  color: #ef4444;
  border: 1px solid rgba(239, 68, 68, 0.4);
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 0.75rem;
}

.badge-prio-tinggi {
  background: rgba(249, 115, 22, 0.2);
  color: #f97316;
  border: 1px solid rgba(249, 115, 22, 0.4);
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 0.75rem;
}

.badge-prio-sedang {
  background: rgba(234, 179, 8, 0.2);
  color: #eab308;
  border: 1px solid rgba(234, 179, 8, 0.4);
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 0.75rem;
}

.badge-prio-pemantauan {
  background: rgba(34, 197, 94, 0.2);
  color: #22c55e;
  border: 1px solid rgba(34, 197, 94, 0.4);
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 0.75rem;
}

.badge-prio-unclassified {
  background: rgba(148, 163, 184, 0.15);
  color: #94a3b8;
  border: 1px solid rgba(148, 163, 184, 0.3);
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 0.75rem;
}

/* GIS Tree Markers - Lightweight Optimized Dots (Stage 2A Standard) */
.marker-pohon-wrapper {
  background: transparent;
  border: none;
}

.marker-pohon-dot {
  border-radius: 50%;
  display: block;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.45);
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  box-sizing: border-box;
}

.marker-pohon-dot:hover {
  transform: scale(1.5);
  box-shadow: 0 0 8px rgba(255, 255, 255, 0.8), 0 2px 6px rgba(0, 0, 0, 0.6);
  z-index: 1000 !important;
}

/* Specific Sizes & Colors per Section C2 */
.marker-pohon-kritis {
  width: 13px;
  height: 13px;
  background: #ef4444;
  border: 1.5px solid #ffffff;
}

.marker-pohon-tinggi {
  width: 11px;
  height: 11px;
  background: #f97316;
  border: 1px solid #ffffff;
}

.marker-pohon-sedang {
  width: 9px;
  height: 9px;
  background: #eab308;
  border: 1px solid rgba(255, 255, 255, 0.95);
}

.marker-pohon-pemantauan {
  width: 8px;
  height: 8px;
  background: #22c55e;
  border: 1px solid rgba(255, 255, 255, 0.9);
}

.marker-pohon-unclassified {
  width: 8px;
  height: 8px;
  background: #94a3b8;
  border: 1px solid rgba(255, 255, 255, 0.85);
}

/* Pulse animation ONLY for highlighted / selected critical assets, NOT permanent on all */
.marker-pohon-dot.highlighted,
.marker-pohon-dot.selected {
  animation: pulse-selected-pohon 1.4s infinite;
}

@keyframes pulse-selected-pohon {
  0% {
    box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.9);
  }
  70% {
    box-shadow: 0 0 0 8px rgba(239, 68, 68, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(239, 68, 68, 0);
  }
}

/* Tooltip for fast hover without popup click */
.pohon-gis-tooltip {
  background: rgba(15, 23, 42, 0.92);
  border: 1px solid rgba(148, 163, 184, 0.3);
  color: #f8fafc;
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 0.72rem;
  padding: 3px 7px;
  border-radius: 4px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.5);
  pointer-events: none;
}

/* Pohon ROW GIS Popup - Structured 7-Section Architecture */
.pohon-gis-popup {
  font-family: inherit;
  color: #f8fafc;
  min-width: 310px;
  max-width: 370px;
  padding: 4px;
}

.pohon-gis-popup .popup-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid rgba(255, 255, 255, 0.15);
  padding-bottom: 8px;
  margin-bottom: 8px;
}

.pohon-gis-popup .popup-title {
  font-size: 0.95rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 6px;
}

.pohon-gis-popup .popup-section {
  background: rgba(15, 23, 42, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 6px;
  padding: 6px 8px;
  margin-bottom: 6px;
}

.pohon-gis-popup .popup-section-title {
  font-weight: 700;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  margin-bottom: 4px;
  display: flex;
  align-items: center;
  gap: 5px;
}

.pohon-gis-popup .popup-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 3px;
  font-size: 0.77rem;
  gap: 8px;
}

.pohon-gis-popup .popup-row span {
  color: #94a3b8;
  font-size: 0.73rem;
  white-space: nowrap;
}

.pohon-gis-popup .popup-row strong {
  color: #f1f5f9;
  text-align: right;
  word-break: break-word;
}

.pohon-gis-popup .popup-badge-pill {
  display: inline-block;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.68rem;
  font-weight: 600;
}

.pohon-gis-popup .popup-note-box {
  margin-top: 6px;
  padding: 6px 8px;
  background: rgba(56, 189, 248, 0.08);
  border-left: 3px solid #38bdf8;
  font-size: 0.7rem;
  color: #cbd5e1;
  line-height: 1.35;
  border-radius: 0 4px 4px 0;
}

/* Modals */
.pohon-modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(6px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}

.pohon-modal {
  background: var(--panel-bg, #0f172a);
  border: 1px solid rgba(56, 189, 248, 0.3);
  border-radius: 12px;
  width: 90%;
  max-width: 900px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.8);
  color: #f8fafc;
}

.pohon-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.pohon-modal-body {
  padding: 20px;
  overflow-y: auto;
  flex: 1;
}

.pohon-modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  padding: 16px 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

/* Step Wizard in Upload Modal */
.upload-steps-nav {
  display: flex;
  justify-content: space-between;
  margin-bottom: 24px;
  position: relative;
}

.upload-steps-nav::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 30px;
  right: 30px;
  height: 2px;
  background: rgba(255, 255, 255, 0.1);
  z-index: 1;
}

.step-indicator {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  background: var(--panel-bg, #0f172a);
  padding: 0 10px;
}

.step-number {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  color: #94a3b8;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.85rem;
  transition: all 0.2s ease;
}

.step-indicator.active .step-number {
  background: #38bdf8;
  color: #0f172a;
  box-shadow: 0 0 12px rgba(56, 189, 248, 0.6);
}

.step-indicator.done .step-number {
  background: #22c55e;
  color: #fff;
}

.step-title {
  font-size: 0.75rem;
  color: #94a3b8;
  font-weight: 600;
}

.step-indicator.active .step-title {
  color: #38bdf8;
}

/* Summary KPI Cards for Pohon View */
.pohon-kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.pohon-kpi-card {
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  backdrop-filter: blur(8px);
}

.pohon-kpi-label {
  font-size: 0.75rem;
  color: #94a3b8;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.pohon-kpi-value {
  font-size: 1.8rem;
  font-weight: 800;
  color: #fff;
  line-height: 1;
}

/* Analytics & Rules UI */
.analytics-card {
  background: rgba(15, 23, 42, 0.75);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  padding: 20px;
  margin-bottom: 20px;
}

.analytics-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.feature-bar-container {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 8px;
  font-size: 0.8rem;
}

.feature-bar-label {
  width: 140px;
  color: #cbd5e1;
  font-family: monospace;
}

.feature-bar-track {
  flex: 1;
  height: 10px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 5px;
  overflow: hidden;
}

.feature-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #38bdf8, #818cf8);
  border-radius: 5px;
}

.feature-bar-val {
  width: 50px;
  text-align: right;
  color: #94a3b8;
  font-family: monospace;
  font-size: 0.75rem;
}

/* Decision tree code display */
.tree-rules-code {
  background: #090d16;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 6px;
  padding: 12px;
  font-family: "Fira Code", monospace;
  font-size: 0.78rem;
  color: #38bdf8;
  max-height: 240px;
  overflow-y: auto;
  white-space: pre-wrap;
}


/* ==========================================================================
   Addendum Prompt 3: Tree Analytics Page, Tabs & 9-Section Drawer Styles
   ========================================================================== */

.pohon-tabs-nav {
  display: flex;
  gap: 8px;
  margin-bottom: 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  padding-bottom: 10px;
  overflow-x: auto;
}

.pohon-tab-btn {
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #94a3b8;
  padding: 8px 16px;
  border-radius: 6px;
  font-weight: 600;
  font-size: 0.82rem;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.pohon-tab-btn:hover {
  background: rgba(30, 41, 59, 0.8);
  color: #e2e8f0;
  border-color: rgba(56, 189, 248, 0.3);
}

.pohon-tab-btn.active {
  background: rgba(56, 189, 248, 0.18);
  color: #38bdf8;
  border-color: rgba(56, 189, 248, 0.5);
  font-weight: 700;
  box-shadow: 0 0 12px rgba(56, 189, 248, 0.2);
}

/* 9-Section Tree Detail Drawer */
#drawerTreeDetail.inspeksi-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(6px);
  z-index: 2500;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding-top: 40px;
  overflow-y: auto;
}

#drawerTreeDetail .inspeksi-modal-content {
  background: #0f172a;
  border: 1px solid rgba(56, 189, 248, 0.3);
  border-radius: 12px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.8), 0 0 20px rgba(56, 189, 248, 0.15);
  padding: 24px;
}

#modalVerifyPohonRec.inspeksi-modal,
#modalUploadPohon.inspeksi-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(6px);
  z-index: 2500;
  display: flex;
  justify-content: center;
  align-items: center;
}

#modalVerifyPohonRec .inspeksi-modal-content,
#modalUploadPohon .inspeksi-modal-content {
  background: #0f172a;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 12px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.8);
  padding: 24px;
}
