/* ==========================================================================
   SISTEM MONITORING OVER DIMENSION - DISHUB KOTA BANJARBARU
   Stylesheet Khusus Halaman Dashboard Publik (/dashboard)
   ========================================================================== */

/* 1. Header & Dropdown Periode */
.period-select-dishub {
  border-radius: 0 !important;
  font-weight: 600;
  border-color: #CBD5E1;
  color: #0F172A;
  background-color: #FFFFFF;
  padding: 0.35rem 2rem 0.35rem 0.75rem;
  font-size: 0.875rem;
}

.period-select-dishub:focus {
  border-color: #EA580C;
  box-shadow: 0 0 0 0.2rem rgba(234, 88, 12, 0.15);
}

.period-badge-info {
  background-color: #F8FAFC;
  border: 1px solid #E2E8F0;
  color: #64748B;
  font-size: 0.78rem;
  padding: 0.3rem 0.75rem;
  border-radius: 4px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

/* 2. Navigasi Dua Tab (Statistik & Hasil Deteksi) */
.dashboard-nav-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  border-bottom: 2px solid #E2E8F0;
  padding-bottom: 8px;
  margin-bottom: 1.5rem;
  list-style: none;
  padding-left: 0;
}

.dashboard-tab-btn {
  background-color: #F8FAFC;
  border: 1px solid #E2E8F0;
  color: #475569;
  font-weight: 600;
  font-size: 0.92rem;
  padding: 0.55rem 1.35rem;
  border-radius: 6px;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  text-decoration: none;
}

.dashboard-tab-btn:hover {
  background-color: #F1F5F9;
  color: #0F172A;
  border-color: #CBD5E1;
}

.dashboard-tab-btn.active {
  background-color: #EA580C;
  color: #FFFFFF;
  border-color: #EA580C;
  box-shadow: 0 2px 8px rgba(234, 88, 12, 0.25);
}

.dashboard-tab-btn i {
  font-size: 1rem;
}

/* 3. Tiga Insight Card (Tab Statistik) */
.dashboard-insight-card {
  background-color: #FFFFFF;
  border: 1px solid #E2E8F0;
  border-radius: 12px;
  padding: 1.15rem 1.25rem;
  height: 100%;
  display: flex;
  align-items: flex-start;
  gap: 14px;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.dashboard-insight-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.06);
}

.dashboard-insight-icon {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  background-color: #FFF7ED;
  color: #EA580C;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  flex-shrink: 0;
}

.dashboard-insight-label {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #64748B;
  margin-bottom: 0.25rem;
}

.dashboard-insight-val {
  font-size: 1.05rem;
  font-weight: 700;
  color: #0F172A;
  margin-bottom: 0.15rem;
  line-height: 1.3;
}

.dashboard-insight-sub {
  font-size: 0.78rem;
  color: #EA580C;
  font-weight: 600;
}

/* 4. Filter Panel (Tab Hasil Deteksi) */
.dashboard-filter-card {
  background-color: #FFFFFF;
  border: 1px solid #E2E8F0;
  border-radius: 8px;
  padding: 1.25rem;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04);
}

.dashboard-filter-card .form-select,
.dashboard-filter-card .form-control {
  border-radius: 0 !important;
  border-color: #CBD5E1;
  font-size: 0.85rem;
}

.dashboard-filter-card .form-select:focus,
.dashboard-filter-card .form-control:focus {
  border-color: #EA580C;
  box-shadow: 0 0 0 0.2rem rgba(234, 88, 12, 0.15);
}

/* Tombol Oranye & Outline Khusus Dashboard */
.btn-dishub-primary {
  background-color: #EA580C;
  border: 1px solid #EA580C;
  color: #FFFFFF;
  font-weight: 600;
  padding: 0.45rem 1rem;
  border-radius: 6px;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  text-decoration: none;
}

.btn-dishub-primary:hover {
  background-color: #C2410C;
  border-color: #C2410C;
  color: #FFFFFF;
}

.btn-dishub-outline {
  background-color: transparent;
  border: 1px solid #CBD5E1;
  color: #334155;
  font-weight: 600;
  padding: 0.45rem 0.95rem;
  border-radius: 6px;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  text-decoration: none;
}

.btn-dishub-outline:hover {
  background-color: #F1F5F9;
  border-color: #94A3B8;
  color: #0F172A;
}

/* Badge Filter Aktif */
.badge-filter-active {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 2.5px 9px;
  border-radius: 999px;
  background-color: rgba(234, 179, 8, 0.15);
  color: #A16207;
  border: 1px solid rgba(234, 179, 8, 0.35);
  display: inline-flex;
  align-items: center;
  vertical-align: middle;
  line-height: 1.2;
}

/* 5. Tabel Hasil Deteksi */
.table-responsive-dashboard {
  background-color: #FFFFFF;
  border: 1px solid #E2E8F0;
  border-radius: 8px;
  overflow-x: auto;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04);
}

.table-detection {
  width: 100%;
  margin-bottom: 0;
  border-collapse: collapse;
}

.table-detection th {
  background-color: #F8FAFC;
  color: #0F172A;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 0.85rem 1rem;
  border-bottom: 1px solid #E2E8F0;
  white-space: nowrap;
}

.table-detection td {
  padding: 0.85rem 1rem;
  font-size: 0.85rem;
  color: #334155;
  border-bottom: 1px solid #F1F5F9;
  vertical-align: middle;
}

.table-detection tbody tr:hover {
  background-color: #F8FAFC;
}

.table-detection tbody tr:last-child td {
  border-bottom: none;
}

/* 6. Badge Hasil Deteksi (Text-Only Tanpa Ikon) */
.badge-deteksi {
  font-size: 0.75rem;
  font-weight: 700;
  padding: 3.5px 12px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  line-height: 1.25;
  white-space: nowrap;
}

.badge-deteksi.badge-normal {
  background-color: #DCFCE7;
  color: #15803D;
  border: 1px solid #BBF7D0;
}

.badge-deteksi.badge-kontainer {
  background-color: #DBEAFE;
  color: #2563EB;
  border: 1px solid #BFDBFE;
}

.badge-deteksi.badge-overdim {
  background-color: #FFF7ED;
  color: #EA580C;
  border: 1px solid #FED7AA;
}

/* 7. Paginasi Halaman Hasil Deteksi */
.dashboard-pagination {
  display: flex;
  align-items: center;
  gap: 4px;
}

.dashboard-page-link {
  min-width: 34px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 8px;
  border-radius: 4px;
  border: 1px solid #E2E8F0;
  background-color: #FFFFFF;
  color: #334155;
  font-size: 0.82rem;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.15s ease;
}

.dashboard-page-link:hover {
  background-color: #F1F5F9;
  border-color: #CBD5E1;
  color: #0F172A;
}

.dashboard-page-link.active {
  background-color: #EA580C;
  border-color: #EA580C;
  color: #FFFFFF;
}

.dashboard-page-link.disabled {
  opacity: 0.45;
  pointer-events: none;
  background-color: #F8FAFC;
  cursor: not-allowed;
}

/* 8. Galeri Cuplikan Truk Terdeteksi */
.detection-thumb-card {
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.detection-thumb-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08) !important;
}
.hover-zoom {
  transition: transform 0.2s ease;
}
.hover-zoom:hover {
  transform: scale(1.04);
}
.cursor-pointer {
  cursor: pointer;
}

/* 9. Penanda Status AI Live Pulsing */
.ai-status-pulse {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0.35rem 0.85rem;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.3px;
  transition: all 0.3s ease;
}

.ai-status-pulse.status-online {
  background-color: #ECFDF5;
  color: #065F46;
  border: 1px solid #A7F3D0;
}

.ai-status-pulse.status-online .pulse-dot {
  width: 9px;
  height: 9px;
  background-color: #10B981;
  border-radius: 50%;
  box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
  animation: pulse-green 1.8s infinite;
}

@keyframes pulse-green {
  0% {
    transform: scale(0.95);
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
  }
  70% {
    transform: scale(1);
    box-shadow: 0 0 0 7px rgba(16, 185, 129, 0);
  }
  100% {
    transform: scale(0.95);
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0);
  }
}

.ai-status-pulse.status-offline {
  background-color: #FEF2F2;
  color: #991B1B;
  border: 1px solid #FECACA;
}

.ai-status-pulse.status-offline .pulse-dot {
  width: 9px;
  height: 9px;
  background-color: #EF4444;
  border-radius: 50%;
}

.ai-status-pulse.status-connecting {
  background-color: #FFFBEB;
  color: #92400E;
  border: 1px solid #FDE68A;
}

.ai-status-pulse.status-connecting .pulse-dot {
  width: 9px;
  height: 9px;
  background-color: #F59E0B;
  border-radius: 50%;
  animation: pulse-amber 1.8s infinite;
}

@keyframes pulse-amber {
  0% {
    transform: scale(0.95);
    box-shadow: 0 0 0 0 rgba(245, 158, 11, 0.7);
  }
  70% {
    transform: scale(1);
    box-shadow: 0 0 0 7px rgba(245, 158, 11, 0);
  }
  100% {
    transform: scale(0.95);
    box-shadow: 0 0 0 0 rgba(245, 158, 11, 0);
  }
}


/* 10. Area Plot Grafik (gaya rapi ala Matplotlib, tinggi responsif) */
.chart-plot-area {
  position: relative;
  width: 100%;
  height: 340px;
  padding: 0.25rem 0.25rem 0;
}

@media (max-width: 575.98px) {
  .chart-plot-area {
    height: 280px;
    padding: 0;
  }
}
