/* ═══════════════════════════════════════════════════════
   GIS-Điện Bàn Bắc — Digital Twin CSS
   ═══════════════════════════════════════════════════════ */

/* ─── Digital Twin Page Layout ─── */
.dt-page {
  display: flex;
  height: 100%;
  overflow: hidden;
  background: var(--md-sys-color-surface);
  position: relative;
}

.dt-map-area {
  flex: 1;
  min-width: 0;
  position: relative;
  height: 100%;
}

#dt-map {
  width: 100%;
  height: 100%;
  background: #1a2332;
  z-index: 1;
}

/* ─── Control Panel ─── */
.dt-panel {
  width: 380px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  background: var(--md-sys-color-surface-container-low);
  border-left: 1px solid var(--md-sys-color-outline-variant);
  overflow: hidden;
  z-index: 10;
}

.dt-panel-tabs {
  display: flex;
  background: var(--md-sys-color-surface-container);
  border-bottom: 1px solid var(--md-sys-color-outline-variant);
  flex-shrink: 0;
}

.dt-panel-tab {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 10px 4px 8px;
  cursor: pointer;
  border: none;
  background: none;
  color: var(--md-sys-color-on-surface-variant);
  font-family: var(--font-family, 'Inter', sans-serif);
  font-size: 10px;
  font-weight: 500;
  transition: all 0.2s;
  position: relative;
}

.dt-panel-tab .material-symbols-outlined { font-size: 20px; }

.dt-panel-tab.active {
  color: var(--md-sys-color-primary);
}

.dt-panel-tab.active::after {
  content: '';
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 2px;
  background: var(--md-sys-color-primary);
  border-radius: 2px 2px 0 0;
}

.dt-panel-tab:hover:not(.active) {
  background: var(--md-sys-color-surface-container-high);
  color: var(--md-sys-color-on-surface);
}

.dt-panel-body {
  flex: 1;
  overflow-y: auto;
  padding: 0;
}

.dt-panel-section {
  display: none;
  padding: 16px;
  flex-direction: column;
  gap: 14px;
}

.dt-panel-section.active {
  display: flex;
}

/* ─── Live Indicator ─── */
.dt-live-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  background: linear-gradient(135deg, #003d2e 0%, #00241c 100%);
  border-bottom: 1px solid rgba(0,255,180,0.15);
  flex-shrink: 0;
}

.dt-live-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: #00e5aa;
  box-shadow: 0 0 0 0 rgba(0,229,170,0.6);
  animation: dt-pulse 1.8s infinite;
  flex-shrink: 0;
}

@keyframes dt-pulse {
  0%   { box-shadow: 0 0 0 0 rgba(0,229,170,0.7); }
  70%  { box-shadow: 0 0 0 8px rgba(0,229,170,0); }
  100% { box-shadow: 0 0 0 0 rgba(0,229,170,0); }
}

.dt-live-label {
  font-size: 11px;
  font-weight: 700;
  color: #00e5aa;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.dt-live-time {
  font-size: 11px;
  color: rgba(255,255,255,0.5);
  margin-left: auto;
}

/* ─── KPI Grid ─── */
.dt-kpi-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.dt-kpi-card {
  background: var(--md-sys-color-surface-container);
  border-radius: 12px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  border: 1px solid var(--md-sys-color-outline-variant);
  position: relative;
  overflow: hidden;
  transition: background 0.3s;
}

.dt-kpi-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: var(--dt-accent, var(--md-sys-color-primary));
}

.dt-kpi-icon {
  width: 32px; height: 32px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: color-mix(in srgb, var(--dt-accent, var(--md-sys-color-primary)) 15%, transparent);
}

.dt-kpi-icon .material-symbols-outlined {
  font-size: 18px;
  color: var(--dt-accent, var(--md-sys-color-primary));
}

.dt-kpi-value {
  font-size: 22px;
  font-weight: 700;
  color: var(--md-sys-color-on-surface);
  line-height: 1;
  transition: all 0.4s;
}

.dt-kpi-value.updating {
  opacity: 0.4;
  transform: scale(0.95);
}

.dt-kpi-label {
  font-size: 11px;
  color: var(--md-sys-color-on-surface-variant);
  font-weight: 500;
}

/* ─── Sensor List ─── */
.dt-sensor-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.dt-sensor-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  background: var(--md-sys-color-surface-container);
  border-radius: 10px;
  border: 1px solid var(--md-sys-color-outline-variant);
  cursor: pointer;
  transition: all 0.2s;
}

.dt-sensor-item:hover {
  background: var(--md-sys-color-surface-container-high);
  border-color: var(--md-sys-color-primary);
}

.dt-sensor-status {
  width: 8px; height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.dt-sensor-status.online  { background: #43A047; box-shadow: 0 0 0 3px rgba(67,160,71,0.2); }
.dt-sensor-status.offline { background: #E53935; }
.dt-sensor-status.warning { background: #FB8C00; box-shadow: 0 0 0 3px rgba(251,140,0,0.2); }

.dt-sensor-name {
  flex: 1;
  font-size: 12px;
  font-weight: 500;
  color: var(--md-sys-color-on-surface);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dt-sensor-badge {
  font-size: 10px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 20px;
  white-space: nowrap;
}

.dt-sensor-badge.clear { background: #e8f5e9; color: #2e7d32; }
.dt-sensor-badge.normal { background: #fffde7; color: #f57f17; }
.dt-sensor-badge.heavy { background: #fff3e0; color: #e65100; }
.dt-sensor-badge.jam { background: #ffebee; color: #c62828; }

/* ─── Infrastructure Health ─── */
.dt-infra-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.dt-infra-item {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.dt-infra-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.dt-infra-label {
  font-size: 12px;
  font-weight: 500;
  color: var(--md-sys-color-on-surface);
  display: flex;
  align-items: center;
  gap: 6px;
}

.dt-infra-label .material-symbols-outlined { font-size: 16px; }

.dt-infra-pct {
  font-size: 12px;
  font-weight: 700;
  color: var(--md-sys-color-on-surface);
}

.dt-infra-bar {
  height: 6px;
  border-radius: 3px;
  background: var(--md-sys-color-surface-container-high);
  overflow: hidden;
}

.dt-infra-fill {
  height: 100%;
  border-radius: 3px;
  transition: width 0.8s ease;
}

/* ─── Construction Sites ─── */
.dt-construction-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.dt-construction-item {
  background: var(--md-sys-color-surface-container);
  border-radius: 10px;
  padding: 10px 12px;
  border: 1px solid var(--md-sys-color-outline-variant);
  cursor: pointer;
  transition: all 0.2s;
}

.dt-construction-item:hover {
  border-color: var(--md-sys-color-primary);
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.dt-construction-header {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin-bottom: 6px;
}

.dt-construction-type {
  width: 28px; height: 28px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.dt-construction-type .material-symbols-outlined { font-size: 16px; }

.dt-construction-type.residential { background: #e3f2fd; color: #1565c0; }
.dt-construction-type.commercial  { background: #fff3e0; color: #e65100; }
.dt-construction-type.infrastructure { background: #fce4ec; color: #c62828; }
.dt-construction-type.public      { background: #e8f5e9; color: #2e7d32; }
.dt-construction-type.industrial  { background: #eceff1; color: #455a64; }

.dt-construction-name {
  font-size: 12px;
  font-weight: 600;
  color: var(--md-sys-color-on-surface);
  line-height: 1.3;
  flex: 1;
}

.dt-construction-meta {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}

.dt-meta-chip {
  font-size: 10px;
  color: var(--md-sys-color-on-surface-variant);
  background: var(--md-sys-color-surface-container-high);
  padding: 2px 6px;
  border-radius: 10px;
}

.dt-construction-progress-bar {
  height: 5px;
  border-radius: 3px;
  background: var(--md-sys-color-surface-container-high);
  overflow: hidden;
  margin-bottom: 4px;
}

.dt-construction-progress-fill {
  height: 100%;
  border-radius: 3px;
  background: linear-gradient(90deg, #006D5B, #00bfa5);
  transition: width 0.8s ease;
}

.dt-construction-pct {
  font-size: 11px;
  font-weight: 600;
  color: var(--md-sys-color-primary);
}

/* ─── Scenario Simulator ─── */
.dt-scenario-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.dt-scenario-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 12px 8px;
  background: var(--md-sys-color-surface-container);
  border: 1px solid var(--md-sys-color-outline-variant);
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.2s;
  font-family: inherit;
  color: var(--md-sys-color-on-surface);
}

.dt-scenario-btn:hover {
  background: var(--md-sys-color-primary-container);
  border-color: var(--md-sys-color-primary);
  color: var(--md-sys-color-on-primary-container);
}

.dt-scenario-btn.active {
  background: var(--md-sys-color-primary);
  border-color: var(--md-sys-color-primary);
  color: var(--md-sys-color-on-primary);
}

.dt-scenario-btn .material-symbols-outlined { font-size: 24px; }
.dt-scenario-btn span:not(.material-symbols-outlined) { font-size: 11px; font-weight: 600; text-align: center; }

.dt-scenario-input-area {
  display: none;
  flex-direction: column;
  gap: 10px;
  padding: 12px;
  background: var(--md-sys-color-surface-container);
  border-radius: 12px;
  border: 1px solid var(--md-sys-color-outline-variant);
}

.dt-scenario-input-area.show { display: flex; }

.dt-scenario-results {
  display: none;
  flex-direction: column;
  gap: 8px;
  padding: 12px;
  background: var(--md-sys-color-primary-container);
  border-radius: 12px;
}

.dt-scenario-results.show { display: flex; }

.dt-result-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--md-sys-color-on-primary-container);
  display: flex;
  align-items: center;
  gap: 6px;
}

.dt-result-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 5px 0;
  border-bottom: 1px solid rgba(0,0,0,0.06);
}

.dt-result-row:last-child { border-bottom: none; }

.dt-result-label { font-size: 11px; color: var(--md-sys-color-on-primary-container); opacity: 0.8; }
.dt-result-value { font-size: 12px; font-weight: 700; color: var(--md-sys-color-on-primary-container); }

/* ─── Time Machine ─── */
.dt-time-machine {
  position: absolute;
  bottom: 16px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1000;
  background: var(--md-sys-color-surface);
  border-radius: 16px;
  padding: 12px 20px;
  box-shadow: 0 4px 24px rgba(0,0,0,0.2);
  border: 1px solid var(--md-sys-color-outline-variant);
  min-width: 500px;
  max-width: 700px;
}

.dt-time-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.dt-time-title {
  font-size: 12px;
  font-weight: 700;
  color: var(--md-sys-color-on-surface);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  display: flex;
  align-items: center;
  gap: 6px;
}

.dt-time-title .material-symbols-outlined { font-size: 16px; color: var(--md-sys-color-primary); }

.dt-year-display {
  margin-left: auto;
  font-size: 18px;
  font-weight: 800;
  color: var(--md-sys-color-primary);
}

.dt-timeline-track {
  position: relative;
  padding: 4px 0;
}

.dt-timeline-labels {
  display: flex;
  justify-content: space-between;
  margin-bottom: 4px;
}

.dt-timeline-label {
  font-size: 10px;
  color: var(--md-sys-color-on-surface-variant);
  font-weight: 500;
}

.dt-timeline-label.future {
  color: var(--md-sys-color-primary);
  font-style: italic;
}

input[type="range"].dt-timeline-slider {
  width: 100%;
  height: 4px;
  -webkit-appearance: none;
  appearance: none;
  border-radius: 2px;
  outline: none;
  background: linear-gradient(to right,
    var(--md-sys-color-primary) 0%,
    var(--md-sys-color-primary) var(--progress, 33%),
    var(--md-sys-color-surface-container-high) var(--progress, 33%),
    var(--md-sys-color-surface-container-high) 100%);
  cursor: pointer;
}

input[type="range"].dt-timeline-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 20px; height: 20px;
  border-radius: 50%;
  background: var(--md-sys-color-primary);
  border: 3px solid var(--md-sys-color-surface);
  box-shadow: 0 2px 6px rgba(0,0,0,0.2);
  cursor: pointer;
  transition: transform 0.15s;
}

input[type="range"].dt-timeline-slider::-webkit-slider-thumb:hover {
  transform: scale(1.2);
}

.dt-timeline-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
}

.dt-play-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  background: var(--md-sys-color-primary);
  color: var(--md-sys-color-on-primary);
  border: none;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.2s;
}

.dt-play-btn:hover { opacity: 0.85; transform: scale(1.02); }
.dt-play-btn .material-symbols-outlined { font-size: 16px; }

.dt-epoch-info {
  flex: 1;
  font-size: 11px;
  color: var(--md-sys-color-on-surface-variant);
}

/* ─── Map Overlays ─── */
.dt-map-controls {
  position: absolute;
  top: 16px;
  left: 16px;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.dt-overlay-dropdown-wrap {
  position: absolute;
  top: 16px;
  right: 16px;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
}

.dt-overlay-trigger {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0 14px;
  height: 38px;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(8px);
  color: #00e5aa;
  border: 1.5px solid rgba(0, 229, 170, 0.5);
  border-radius: 20px;
  font-size: 12px;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.25s;
  letter-spacing: 0.04em;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.3);
}

.dt-overlay-trigger:hover {
  background: rgba(0, 229, 170, 0.15);
  border-color: #00e5aa;
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(0, 229, 170, 0.25);
}

.dt-overlay-trigger .material-symbols-outlined { font-size: 18px; }

.dt-overlay-panel {
  display: none;
  background: var(--md-sys-color-surface);
  border-radius: 12px;
  padding: 12px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.15);
  border: 1px solid var(--md-sys-color-outline-variant);
  width: 200px;
}

.dt-overlay-panel.show {
  display: block;
  animation: dt-dropdown-in 0.2s ease-out;
}

@keyframes dt-dropdown-in {
  from { opacity: 0; transform: translateY(-10px); }
  to { opacity: 1; transform: translateY(0); }
}

.dt-overlay-title {
  font-size: 11px;
  font-weight: 700;
  color: var(--md-sys-color-on-surface-variant);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 8px;
}

.dt-overlay-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 0;
  cursor: pointer;
  border-bottom: 1px solid var(--md-sys-color-outline-variant);
}

.dt-overlay-toggle:last-child { border-bottom: none; }

.dt-overlay-toggle input[type="checkbox"] {
  accent-color: var(--md-sys-color-primary);
  width: 14px; height: 14px;
}

.dt-overlay-toggle-label {
  font-size: 12px;
  color: var(--md-sys-color-on-surface);
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 1;
  cursor: pointer;
}

.dt-overlay-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

/* ─── Traffic Flow Marker ─── */
.dt-traffic-marker {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.dt-traffic-ring {
  width: 28px; height: 28px;
  border-radius: 50%;
  border: 3px solid currentColor;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 700;
  background: white;
  animation: dt-traffic-pulse 2.5s infinite;
}

@keyframes dt-traffic-pulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.15); opacity: 0.85; }
}

/* ─── Construction Marker ─── */
.dt-construction-marker {
  width: 32px; height: 32px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  border: 2px solid white;
  box-shadow: 0 2px 6px rgba(0,0,0,0.25);
  animation: dt-build-pulse 3s infinite;
}

@keyframes dt-build-pulse {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-3px); }
}

/* ─── Environment Marker ─── */
.dt-env-marker {
  width: 26px; height: 26px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  border: 2px solid white;
  box-shadow: 0 2px 6px rgba(0,0,0,0.2);
}

/* ─── Section Headers ─── */
.dt-section-title {
  font-size: 12px;
  font-weight: 700;
  color: var(--md-sys-color-on-surface-variant);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  display: flex;
  align-items: center;
  gap: 6px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--md-sys-color-outline-variant);
}

.dt-section-title .material-symbols-outlined { font-size: 16px; }

/* ─── Text field compact ─── */
.dt-input {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid var(--md-sys-color-outline);
  border-radius: 8px;
  background: var(--md-sys-color-surface);
  color: var(--md-sys-color-on-surface);
  font-family: inherit;
  font-size: 13px;
  outline: none;
  transition: border-color 0.2s;
  box-sizing: border-box;
}

.dt-input:focus { border-color: var(--md-sys-color-primary); }

.dt-input-label {
  font-size: 11px;
  color: var(--md-sys-color-on-surface-variant);
  font-weight: 500;
  margin-bottom: 4px;
}

/* ─── Responsive ─── */
@media (max-width: 1100px) {
  .dt-panel { width: 320px; }
  .dt-time-machine { min-width: 360px; }
}

@media (max-width: 800px) {
  .dt-page { flex-direction: column; }
  .dt-panel { width: 100%; height: 50%; border-left: none; border-top: 1px solid var(--md-sys-color-outline-variant); }
  .dt-map-area { height: 50%; }
  .dt-time-machine { min-width: 280px; max-width: calc(100% - 32px); left: 16px; transform: none; }
}

/* ─── Map overlay on /ban-do page (DT Toggle Button) ─── */
.dt-map-toggle-btn {
  background: linear-gradient(135deg, #006D5B, #00897b);
  color: white;
  border: none;
  border-radius: 8px;
  padding: 0 10px;
  height: 40px;
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
  font-family: inherit;
  box-shadow: 0 2px 8px rgba(0,109,91,0.35);
  transition: all 0.2s;
  white-space: nowrap;
}

.dt-map-toggle-btn:hover { opacity: 0.88; transform: scale(1.02); }
.dt-map-toggle-btn .material-symbols-outlined { font-size: 18px; }

.dt-map-toggle-btn.active {
  background: linear-gradient(135deg, #00e5aa, #00bfa5);
  color: #003d2e;
  box-shadow: 0 2px 12px rgba(0,229,170,0.4);
}

/* ─── DT Floating Status on map ─── */
.dt-floating-status {
  position: absolute;
  top: 16px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 900;
  background: rgba(0,30,22,0.88);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(0,229,170,0.3);
  border-radius: 10px;
  padding: 8px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  pointer-events: none;
  transition: opacity 0.3s;
}

.dt-floating-status.hidden { opacity: 0; }

.dt-fs-item {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  color: rgba(255,255,255,0.8);
}

.dt-fs-item strong { color: #00e5aa; font-weight: 700; }

.dt-fs-sep { color: rgba(255,255,255,0.2); font-size: 16px; }

/* ─── Mini Popup on map marker ─── */
.dt-popup {
  font-family: 'Inter', sans-serif;
  min-width: 180px;
}

.dt-popup-title {
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 6px;
  color: #1a1a2e;
}

.dt-popup-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 11px;
  color: #444;
  padding: 3px 0;
  border-bottom: 1px solid #f0f0f0;
}

.dt-popup-row:last-child { border-bottom: none; }
.dt-popup-val { font-weight: 700; }

/* ═══════════════════════════════════════════════════════
   3D Mode Styles — MapLibre GL
   ═══════════════════════════════════════════════════════ */

/* ─── 3D Toggle button — floating on top-left of map ─── */
.dt3d-toggle-wrap {
  position: absolute;
  top: 16px;
  left: 16px;
  z-index: 1010;
  display: flex;
  gap: 6px;
  align-items: center;
}

.dt3d-toggle-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0 14px;
  height: 38px;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(8px);
  color: #00e5aa;
  border: 1.5px solid rgba(0, 229, 170, 0.5);
  border-radius: 20px;
  font-size: 12px;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.25s;
  letter-spacing: 0.04em;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.3);
}

.dt3d-toggle-btn .material-symbols-outlined { font-size: 18px; }

.dt3d-toggle-btn:hover {
  background: rgba(0, 229, 170, 0.15);
  border-color: #00e5aa;
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(0, 229, 170, 0.25);
}

.dt3d-toggle-btn.active {
  background: linear-gradient(135deg, #00695C, #00897b);
  color: #fff;
  border-color: #00e5aa;
  box-shadow: 0 2px 16px rgba(0, 229, 170, 0.4);
  animation: dt3d-glow 2s ease-in-out infinite;
}

@keyframes dt3d-glow {
  0%, 100% { box-shadow: 0 2px 16px rgba(0,229,170,0.4); }
  50%       { box-shadow: 0 4px 24px rgba(0,229,170,0.7); }
}

.dt3d-reset-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(8px);
  color: rgba(255,255,255,0.8);
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: 50%;
  cursor: pointer;
  transition: all 0.2s;
  font-family: inherit;
}

.dt3d-reset-btn:hover {
  background: rgba(255,255,255,0.15);
  color: white;
  transform: rotate(30deg);
}

.dt3d-reset-btn .material-symbols-outlined { font-size: 18px; }

/* ─── 3D Active badge trên live bar ─── */
.dt-3d-badge {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 10px;
  font-weight: 800;
  color: #fff;
  background: linear-gradient(135deg, #6200EA, #AA00FF);
  padding: 2px 8px;
  border-radius: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  animation: dt-badge-pulse 2s infinite;
  margin-left: 4px;
}

@keyframes dt-badge-pulse {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.7; }
}

/* ─── MapLibre GL — override popup style ─── */
.maplibregl-popup-content {
  border-radius: 12px !important;
  padding: 12px 14px !important;
  box-shadow: 0 4px 20px rgba(0,0,0,0.2) !important;
  font-family: 'Inter', sans-serif !important;
  min-width: 180px;
}

.maplibregl-popup-close-button {
  font-size: 16px !important;
  color: #888 !important;
  padding: 4px 8px !important;
  right: 2px !important;
  top: 2px !important;
}

/* ─── MapLibre control overrides (dark theme) ─── */
.maplibregl-ctrl-top-left {
  top: 60px !important;
}

.maplibregl-ctrl-group {
  background: rgba(0,0,0,0.75) !important;
  backdrop-filter: blur(8px) !important;
  border: 1px solid rgba(255,255,255,0.1) !important;
  border-radius: 10px !important;
  overflow: hidden;
}

.maplibregl-ctrl-group button {
  background: transparent !important;
  color: rgba(255,255,255,0.8) !important;
  border-bottom: 1px solid rgba(255,255,255,0.08) !important;
}

.maplibregl-ctrl-group button .maplibregl-ctrl-icon {
  filter: invert(1) brightness(1.2);
}

.maplibregl-ctrl-group button:last-child { border-bottom: none !important; }

.maplibregl-ctrl-group button:hover {
  background: rgba(0,229,170,0.1) !important;
  color: #00e5aa !important;
}

.maplibregl-ctrl-group button:hover .maplibregl-ctrl-icon {
  filter: invert(1) brightness(1.5) sepia(1) hue-rotate(100deg) saturate(3);
}

/* MapLibre compass pitch indicator */
.maplibregl-ctrl-compass .maplibregl-ctrl-compass-arrow {
  filter: invert(1);
}

/* ─── 3D hint tooltip (hiện khi mới bật 3D) ─── */
.dt3d-hint {
  position: absolute;
  bottom: 120px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1000;
  background: rgba(0,0,0,0.8);
  color: #00e5aa;
  padding: 8px 16px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  pointer-events: none;
  backdrop-filter: blur(6px);
  border: 1px solid rgba(0,229,170,0.3);
  animation: dt3d-hint-fade 4s ease forwards;
  white-space: nowrap;
}

@keyframes dt3d-hint-fade {
  0%   { opacity: 0; transform: translateX(-50%) translateY(10px); }
  15%  { opacity: 1; transform: translateX(-50%) translateY(0); }
  75%  { opacity: 1; }
  100% { opacity: 0; }
}

/* ─── Overlay panel opacity in 3D mode ─── */
.dt-overlay-panel .dt-overlay-toggle[title] {
  transition: opacity 0.3s;
}

