/**
 * BDIS - Inspeksi Tiang TM Stylesheet
 * Premium Dark Mode UI with Glassmorphism and Status Badging
 */

.inspeksi-page-container {
  padding: 0 4px 40px 4px;
}

.inspeksi-header-card {
  background: linear-gradient(135deg, rgba(30, 41, 59, 0.8), rgba(15, 23, 42, 0.9));
  border: 1px solid rgba(56, 189, 248, 0.2);
  border-radius: 12px;
  padding: 20px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 20px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
  backdrop-filter: blur(8px);
}

.inspeksi-title-group h2 {
  font-family: var(--font-heading);
  font-size: 1.35rem;
  font-weight: 700;
  color: #fff;
  margin: 0 0 6px 0;
  display: flex;
  align-items: center;
  gap: 10px;
}

.inspeksi-title-group p {
  font-size: 0.82rem;
  color: var(--text-dim);
  margin: 0;
  max-width: 680px;
  line-height: 1.45;
}

.btn-inspeksi-upload {
  background: linear-gradient(135deg, #0284c7, #2563eb);
  color: #fff;
  border: none;
  border-radius: 6px;
  padding: 9px 18px;
  font-weight: 600;
  font-size: 0.85rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: all 0.2s ease;
  box-shadow: 0 2px 10px rgba(37, 99, 235, 0.35);
}

.btn-inspeksi-upload:hover {
  background: linear-gradient(135deg, #0369a1, #1d4ed8);
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.5);
  transform: translateY(-1px);
}

.inspeksi-kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 12px;
  margin-bottom: 20px;
}

.inspeksi-kpi-card {
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  padding: 14px 16px;
  backdrop-filter: blur(6px);
  position: relative;
  overflow: hidden;
}

.inspeksi-kpi-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
}

.inspeksi-kpi-card.kpi-total::before { background: #38bdf8; }
.inspeksi-kpi-card.kpi-baik::before { background: #22c55e; }
.inspeksi-kpi-card.kpi-buruk::before { background: #ef4444; }
.inspeksi-kpi-card.kpi-unlinked::before { background: #f59e0b; }
.inspeksi-kpi-card.kpi-batch::before { background: #c084fc; }

.inspeksi-kpi-label {
  font-size: 0.72rem;
  color: var(--text-muted);
  text-transform: uppercase;
  font-weight: 600;
  letter-spacing: 0.04em;
  margin-bottom: 4px;
}

.inspeksi-kpi-val {
  font-family: var(--font-mono);
  font-size: 1.5rem;
  font-weight: 700;
  color: #fff;
}

.inspeksi-kpi-sub {
  font-size: 0.72rem;
  color: var(--text-dim);
  margin-top: 4px;
}

/* Status Badges */
.badge-status-baik {
  background: rgba(34, 197, 94, 0.15);
  border: 1px solid #22c55e;
  color: #22c55e;
  padding: 2px 8px;
  border-radius: 4px;
  font-weight: 700;
  font-size: 0.75rem;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.badge-status-buruk {
  background: rgba(239, 68, 68, 0.18);
  border: 1px solid #ef4444;
  color: #ef4444;
  padding: 2px 8px;
  border-radius: 4px;
  font-weight: 700;
  font-size: 0.75rem;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  animation: pulseBuruk 2s infinite ease-in-out;
}

@keyframes pulseBuruk {
  0%, 100% { box-shadow: 0 0 0 rgba(239, 68, 68, 0); }
  50% { box-shadow: 0 0 8px rgba(239, 68, 68, 0.5); }
}

.badge-status-lainnya {
  background: rgba(148, 163, 184, 0.15);
  border: 1px solid #94a3b8;
  color: #cbd5e1;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 0.75rem;
}

.badge-link-ok {
  background: rgba(56, 189, 248, 0.12);
  border: 1px solid rgba(56, 189, 248, 0.4);
  color: #38bdf8;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.72rem;
}

.badge-link-unlinked {
  background: rgba(245, 158, 11, 0.12);
  border: 1px solid rgba(245, 158, 11, 0.4);
  color: #f59e0b;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.72rem;
}

/* Modal styling */
.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: 9999;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.inspeksi-modal.show {
  display: flex;
}

.inspeksi-modal-content {
  background: #0f172a;
  border: 1px solid rgba(56, 189, 248, 0.3);
  border-radius: 12px;
  width: 100%;
  max-width: 900px;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6);
}

.inspeksi-modal-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(30, 41, 59, 0.5);
}

.inspeksi-modal-body {
  padding: 20px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.inspeksi-modal-footer {
  padding: 14px 20px;
  border-top: 1px solid var(--border-subtle);
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  background: rgba(15, 23, 42, 0.9);
}

/* Mapping Grid */
.mapping-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 12px;
}

.mapping-field-card {
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid var(--border-subtle);
  border-radius: 6px;
  padding: 10px 12px;
}

.mapping-field-card label {
  font-size: 0.78rem;
  color: var(--text-dim);
  display: block;
  margin-bottom: 4px;
}

.mapping-field-card label strong {
  color: #fff;
}

.mapping-select {
  width: 100%;
  padding: 6px 10px;
  background: #1e293b;
  border: 1px solid var(--border-subtle);
  color: #fff;
  border-radius: 4px;
  font-size: 0.8rem;
}

/* GIS Inspection Marker Styling & Animations */
.marker-buruk-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.marker-buruk-pin {
  width: 24px;
  height: 24px;
  background: #ef4444;
  border: 2px solid #ffffff;
  border-radius: 50%;
  box-shadow: 0 0 12px rgba(239, 68, 68, 0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  color: #fff;
  font-weight: bold;
  animation: pulse-buruk 1.6s infinite ease-in-out;
}

@keyframes pulse-buruk {
  0% {
    transform: scale(0.92);
    box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.7);
  }
  70% {
    transform: scale(1.12);
    box-shadow: 0 0 0 10px rgba(239, 68, 68, 0);
  }
  100% {
    transform: scale(0.92);
    box-shadow: 0 0 0 0 rgba(239, 68, 68, 0);
  }
}

.marker-unlinked-pin {
  width: 20px;
  height: 20px;
  background: #f59e0b;
  border: 2px dashed #ffffff;
  border-radius: 4px;
  box-shadow: 0 0 8px rgba(245, 158, 11, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  color: #fff;
  font-weight: bold;
}

/* Inspection Popup styles */
.inspeksi-gis-popup {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 12px;
  color: #fff;
  min-width: 240px;
  padding: 4px;
}

.inspeksi-gis-popup .popup-title {
  font-size: 13px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
  padding-bottom: 4px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.inspeksi-gis-popup .popup-row {
  display: flex;
  justify-content: space-between;
  margin-bottom: 3px;
  color: #cbd5e1;
}

.inspeksi-gis-popup .popup-row strong {
  color: #fff;
}

/* ==========================================================================
   Tahap 4: Edit & Hapus Data Inspeksi Tiang Styles
   ========================================================================== */

.inspeksi-table tr.selected {
  background: rgba(56, 189, 248, 0.12) !important;
  border-left: 3px solid #38bdf8;
}

.btn-action-edit {
  background: rgba(245, 158, 11, 0.15);
  color: #f59e0b;
  border: 1px solid rgba(245, 158, 11, 0.35);
  font-weight: 600;
  padding: 4px 8px;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.15s ease;
  font-size: 0.72rem;
  display: inline-flex;
  align-items: center;
  gap: 3px;
}

.btn-action-edit:hover {
  background: rgba(245, 158, 11, 0.3);
  color: #fbbf24;
  border-color: #f59e0b;
}

.btn-action-delete {
  background: rgba(239, 68, 68, 0.15);
  color: #ef4444;
  border: 1px solid rgba(239, 68, 68, 0.35);
  font-weight: 600;
  padding: 4px 8px;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.15s ease;
  font-size: 0.72rem;
  display: inline-flex;
  align-items: center;
  gap: 3px;
}

.btn-action-delete:hover {
  background: rgba(239, 68, 68, 0.3);
  color: #f87171;
  border-color: #ef4444;
}

.inspeksi-alert-danger {
  background: rgba(239, 68, 68, 0.12);
  border: 1px solid rgba(239, 68, 68, 0.35);
  border-left: 4px solid #ef4444;
  padding: 12px 14px;
  border-radius: 6px;
  color: #fca5a5;
  font-size: 0.8rem;
  line-height: 1.5;
  margin-bottom: 16px;
}

.inspeksi-alert-info {
  background: rgba(56, 189, 248, 0.1);
  border: 1px solid rgba(56, 189, 248, 0.3);
  border-left: 4px solid #38bdf8;
  padding: 12px 14px;
  border-radius: 6px;
  color: #bae6fd;
  font-size: 0.8rem;
  line-height: 1.5;
  margin-bottom: 16px;
}

.inspeksi-form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.inspeksi-form-full {
  grid-column: span 2;
}

.inspeksi-field-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.inspeksi-field-group label {
  font-size: 0.75rem;
  color: #cbd5e1;
  font-weight: 600;
}

.inspeksi-input-text, .inspeksi-input-select, .inspeksi-textarea {
  background: #090d16;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 6px;
  padding: 8px 10px;
  color: #fff;
  font-size: 0.82rem;
  font-family: inherit;
  transition: border-color 0.15s ease;
}

.inspeksi-input-text:focus, .inspeksi-input-select:focus, .inspeksi-textarea:focus {
  outline: none;
  border-color: #38bdf8;
  box-shadow: 0 0 8px rgba(56, 189, 248, 0.25);
}

.inspeksi-field-readonly {
  background: rgba(15, 23, 42, 0.5);
  border-color: rgba(255, 255, 255, 0.08);
  color: #94a3b8;
  cursor: not-allowed;
}
