:root {
  --neo: #a9fe07;
  /* lime green */
  --magenta: #ff00ff;
  /* neon magenta */
  --bg: #14181e;
  --bg-acc: #1b2129;
  --text: #e5e7eb;
  --muted: #94a3b8;
}

html,
body {
  height: 100%;
  background: var(--bg);
  color: var(--text);
}

.bg-dark-acc {
  background: var(--bg-acc) !important;
}

.border-neo {
  border-color: rgba(57, 255, 20, .25) !important;
}

.text-neo {
  color: var(--neo) !important;
}

.text-bg-neo {
  color: #0b0f14;
  background: var(--neo);
}

.navbar-brand .brand-title {
  font-weight: 800;
  letter-spacing: .5px
}

.navbar-brand .brand-subtitle {
  font-weight: 600;
  font-size: 0.85rem;
  background: linear-gradient(135deg, #a9fe07 0%, #d8ff7b 50%, #a9fe07 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: 0.3px;
  text-shadow: 0 0 12px rgba(169, 254, 7, .35);
  font-style: italic;
}

/* Subtle animated neon glow for brand */
.navbar-brand .brand-title {
  text-shadow: 0 0 8px rgba(169, 254, 7, .6), 0 0 18px rgba(169, 254, 7, .35);
  animation: neonGlow 2.8s ease-in-out infinite;
}

@keyframes neonGlow {

  0%,
  100% {
    text-shadow: 0 0 6px rgba(169, 254, 7, .45), 0 0 14px rgba(169, 254, 7, .25);
  }

  50% {
    text-shadow: 0 0 16px rgba(169, 254, 7, .75), 0 0 28px rgba(169, 254, 7, .45);
  }
}

.btn-neo {
  background: var(--neo);
  color: #0b0f14;
  border: 1px solid #a9fe07;
  box-shadow: 0 0 12px rgba(169, 254, 7, .35);
}

.btn-neo:hover {
  filter: brightness(.95)
}

.btn-neo-subtle {
  background: transparent;
  border: 1px solid rgba(169, 254, 7, .35);
  color: var(--text);
}

.btn-outline-neo {
  color: var(--neo);
  border-color: rgba(169, 254, 7, .4)
}

.btn-outline-neo:hover {
  background: rgba(169, 254, 7, .12);
  color: var(--neo)
}

/* Solid neon for navbar radius chips on hover/checked */
.navbar .btn-check:checked+.btn-outline-neo,
.navbar .btn-outline-neo:hover,
.navbar .btn-outline-neo:focus,
.navbar .btn-outline-neo:active,
.navbar .btn-outline-neo.active {
  background: var(--neo) !important;
  color: #0b0f14 !important;
border-color: #a9fe07 !important;
box-shadow: 0 0 12px rgba(169, 254, 7, .35) !important;
}

.navbar .btn-outline-neo {
  transition: background-color .12s ease, color .12s ease, box-shadow .12s ease
}

/* Solid neon for Monitor modal options on hover/checked */
#monitorModal .btn-check:checked+.btn-outline-neo,
#monitorModal .btn-outline-neo:active,
#monitorModal .btn-outline-neo.active,
#monitorModal .btn-outline-neo:focus,
#monitorModal .btn-outline-neo:hover {
  background: var(--neo) !important;
  color: #0b0f14 !important;
  border-color: #a9fe07 !important;
  box-shadow: 0 0 12px rgba(169, 254, 7, .35) !important;
}

/* Ensure text stays visible even during hover transitions */
#monitorModal .btn-outline-neo {
  transition: background-color .12s ease, color .12s ease, box-shadow .12s ease
}

/* New Card-Style Navbar Buttons - Clear and Beautiful */
.nav-desktop-toolbar {
  padding: 0.45rem 0.6rem;
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(20, 24, 30, .88) 0%, rgba(27, 33, 41, .82) 100%);
  border: 1px solid rgba(169, 254, 7, .12);
  box-shadow: 0 8px 24px rgba(0, 0, 0, .18), inset 0 1px 0 rgba(255, 255, 255, .03);
  max-width: 100%;
  flex-wrap: nowrap !important;
  overflow-x: auto;
  scrollbar-width: none;
}

.nav-desktop-shell {
  max-width: 100%;
  position: relative;
}

.nav-desktop-side {
  min-width: 220px;
}

.nav-desktop-toolbar::-webkit-scrollbar {
  display: none;
}

.nav-mobile-toolbar {
  width: 100%;
}

.nav-weather-strip {
  margin-right: 0;
}

.nav-search-toggle {
  min-width: 0;
  padding: 0.45rem 0.55rem !important;
}

.nav-search-toggle-icon {
  width: 1rem;
  height: 1rem;
  display: block;
}

.nav-search-popover {
  position: absolute;
  top: calc(100% + 0.65rem);
  right: 0;
  z-index: 1065;
  padding: 0.6rem;
  border-radius: 14px;
  border: 1px solid rgba(169, 254, 7, .22);
  background: rgba(11, 17, 23, .98);
  box-shadow: 0 18px 40px rgba(0, 0, 0, .35);
  backdrop-filter: blur(10px);
}

.nav-mobile-menu {
  min-width: 260px;
  padding: 0.4rem;
}

.nav-mobile-menu .dropdown-item {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  border-radius: 8px;
  padding: 0.6rem 0.8rem;
  color: var(--text);
}

.nav-mobile-menu .dropdown-item:hover,
.nav-mobile-menu .dropdown-item:focus {
  background: rgba(169, 254, 7, 0.12);
  color: #fff;
}

.nav-menu-trigger {
  min-width: 86px;
}

.nav-search-wrap-mobile {
  width: 100%;
}

.btn-nav-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.25rem;
  padding: 0.45rem 0.6rem;
  border-radius: 10px;
  border: 1px solid rgba(169, 254, 7, .25);
  background: linear-gradient(135deg, rgba(20, 24, 30, .8) 0%, rgba(27, 33, 41, .8) 100%);
  color: var(--text);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.3px;
  transition: all 0.2s ease;
  backdrop-filter: blur(8px);
  min-width: auto;
  text-align: center;
  white-space: nowrap;
}

.btn-nav-card i {
  font-size: 1.3rem;
  color: var(--neo);
  transition: all 0.2s ease;
}

.btn-nav-card span {
  line-height: 1;
  white-space: nowrap;
}

.btn-nav-card:hover {
  background: linear-gradient(135deg, rgba(169, 254, 7, .2) 0%, rgba(169, 254, 7, .12) 100%);
  border-color: rgba(169, 254, 7, .6);
  color: #fff;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(169, 254, 7, .25);
}

.btn-nav-card:active,
.btn-nav-card.active {
  background: var(--neo);
  border-color: var(--neo);
  color: #0b0f14;
  transform: translateY(0);
  box-shadow: 0 0 20px rgba(169, 254, 7, .5), inset 0 2px 4px rgba(0, 0, 0, .2);
}

.btn-nav-card:active i,
.btn-nav-card.active i {
  color: #0b0f14;
}

/* Alert button (Traffic News) - more prominent */
.btn-nav-alert {
  background: linear-gradient(135deg, rgba(169, 254, 7, .3) 0%, rgba(169, 254, 7, .18) 100%);
  border-color: rgba(169, 254, 7, .5);
  box-shadow: 0 0 12px rgba(169, 254, 7, .2);
}

.btn-nav-alert:hover {
  box-shadow: 0 4px 16px rgba(169, 254, 7, .35);
}

@media (max-width: 991.98px) {
  .nav-mobile-toolbar .btn-nav-card {
    min-width: auto;
    padding: 0.5rem 0.75rem;
    font-size: 0.75rem;
    flex-direction: row;
    gap: 0.4rem;
  }

  .nav-mobile-toolbar .btn-nav-card i {
    font-size: 1.1rem;
  }

  .nav-mobile-toolbar .btn-nav-card span {
    display: inline;
  }
}

/* Nav dividers */
.nav-divider {
  width: 1px;
  height: 24px;
  background: rgba(57, 255, 20, .2);
  margin: 0 0.25rem;
}

@media (max-width: 991.98px) {
  .nav-divider {
    display: none;
  }
}

/* Weather Widget - Card Style */
.nav-weather-widget {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.45rem 0.65rem;
  border-radius: 10px;
  border: 1px solid rgba(57, 255, 20, .25);
  background: linear-gradient(135deg, rgba(20, 24, 30, .8) 0%, rgba(27, 33, 41, .8) 100%);
  backdrop-filter: blur(8px);
  cursor: pointer;
  transition: all 0.2s ease;
}

.nav-weather-widget:hover {
  background: linear-gradient(135deg, rgba(57, 255, 20, .15) 0%, rgba(57, 255, 20, .08) 100%);
  border-color: rgba(57, 255, 20, .4);
  box-shadow: 0 4px 12px rgba(57, 255, 20, .2);
  transform: translateY(-1px);
}

.weather-icon-compact {
  font-size: 1.65rem;
  line-height: 1;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, .3));
}

.weather-info {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  line-height: 1.2;
}

.weather-temp-compact {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--neo);
  text-shadow: 0 0 8px rgba(57, 255, 20, .4);
}

.weather-location {
  font-size: 0.7rem;
  color: #94a3b8;
  font-weight: 500;
}

@media (max-width: 991.98px) {
  .nav-weather-widget {
    padding: 0.5rem 0.75rem;
    gap: 0.5rem;
  }

  .weather-icon-compact {
    font-size: 1.6rem;
  }

  .weather-info {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 0.4rem;
  }

  .weather-temp-compact {
    font-size: 0.9rem;
  }

  .weather-location {
    font-size: 0.75rem;
    display: inline;
  }

  /* Make search full width on mobile */
  .nav-search-wrap {
    width: 100%;
    margin-top: 0.25rem;
  }

  .nav-search-input {
    width: 100%;
  }

  .nav-desktop-toolbar .btn-nav-card i {
    display: none;
  }

  .nav-desktop-toolbar .btn-nav-card {
    flex-direction: row;
    gap: 0;
    padding-inline: 0.5rem;
  }

  .nav-desktop-toolbar .btn-nav-card span {
    white-space: nowrap;
  }

  .nav-search-input:focus {
    width: 100%;
  }
}

/* New search design */
.nav-search-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.nav-search-input {
  background: rgba(20, 24, 30, .6);
  border: 1px solid rgba(57, 255, 20, .2);
  border-radius: 8px;
  padding: 0.45rem 0.65rem 0.45rem 1.8rem;
  color: var(--text);
  font-size: 0.85rem;
  width: 160px;
  transition: all 0.2s ease;
  backdrop-filter: blur(4px);
}

.nav-search-input::placeholder {
  color: #7b8a9b;
}

.nav-search-input:focus {
  outline: none;
  border-color: rgba(57, 255, 20, .5);
  background: rgba(20, 24, 30, .8);
  box-shadow: 0 0 12px rgba(57, 255, 20, .2);
  width: 190px;
}

.search-icon {
  position: absolute;
  left: 0.6rem;
  color: var(--neo);
  font-size: 0.9rem;
  pointer-events: none;
}

/* Radius chips bar (below navbar) */
.radius-chips-bar {
  padding: 0.75rem 0;
  background: rgba(20, 24, 30, .4);
  border-bottom: 1px solid rgba(57, 255, 20, .15);
  backdrop-filter: blur(8px);
}

.radius-chips-bar .btn-group {
  gap: 0.25rem;
}

/* Old navbar button styles - keep for backward compatibility */
.navbar .btn-neo-subtle:hover,
.navbar .btn-neo-subtle:focus,
.navbar .btn-neo-subtle:active,
.navbar .btn-neo-subtle.active,
.navbar .btn-neo-subtle[aria-pressed="true"] {
  background: var(--neo) !important;
  color: #0b0f14 !important;
  border-color: #a9fe07 !important;
  box-shadow: 0 0 12px rgba(169, 254, 7, .35) !important;
}

.navbar .btn-neo-subtle {
  border-radius: 999px;
  background: linear-gradient(180deg, #10151b 0%, #151b23 100%);
  border: 1px solid rgba(169, 254, 7, .35);
  color: var(--text);
  padding: .5rem .9rem;
  font-weight: 600;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .25), 0 0 6px rgba(57, 255, 20, .12);
}

.navbar .btn-neo-subtle .bi {
  color: var(--neo);
}

/* Help chip beside Auto Tour */
#btnHelp.btn-link.btn-sm {
  width: 22px;
  height: 22px;
  padding: 0;
  line-height: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(57, 255, 20, .35);
  border-radius: 999px;
  color: var(--neo) !important;
  background: transparent;
}

#btnHelp.btn-link.btn-sm:hover {
  box-shadow: 0 0 8px rgba(57, 255, 20, .35);
  color: #aaffb5 !important;
}

/* Search pill to match buttons */
.search-wrap .input-group-text {
  border-radius: 999px 0 0 999px;
}

.search-wrap .form-control {
  border: 1px solid rgba(57, 255, 20, .35);
  border-left: 0;
  border-radius: 0 999px 999px 0;
  background: #0f141a;
  color: var(--text);
}

.search-wrap .form-control::placeholder {
  color: #8aa0b5;
}

.pulse-dot {
  width: .6rem;
  height: .6rem;
  border-radius: 50%;
  background: var(--neo);
  display: inline-block;
  box-shadow: 0 0 0 0 rgba(57, 255, 20, .7);
  animation: pulse 1.5s infinite
}

@keyframes pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(57, 255, 20, .7)
  }

  70% {
    box-shadow: 0 0 0 12px rgba(57, 255, 20, 0)
  }

  100% {
    box-shadow: 0 0 0 0 rgba(57, 255, 20, 0)
  }
}

.search-wrap .form-control {
  background: transparent;
  border-color: rgba(57, 255, 20, .35);
  color: var(--text)
}

.search-wrap .form-control::placeholder {
  color: #7b8a9b
}

/* Pill search */
.search-wrap .input-group-text {
  border-color: rgba(57, 255, 20, .35);
  border-top-left-radius: 10px;
  border-bottom-left-radius: 10px;
}

.search-wrap .form-control {
  border-top-right-radius: 10px;
  border-bottom-right-radius: 10px;
}
/* New search design */
.nav-search-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.nav-search-input {
  background: rgba(20, 24, 30, .6);
  border: 1px solid rgba(57, 255, 20, .2);
  border-radius: 8px;
  padding: 0.5rem 0.75rem 0.5rem 2rem;
  color: var(--text);
  font-size: 0.9rem;
  width: 180px;
  transition: all 0.2s ease;
  backdrop-filter: blur(4px);
}

.nav-search-input::placeholder {
  color: #7b8a9b;
}

.nav-search-input:focus {
  outline: none;
  border-color: rgba(57, 255, 20, .5);
  background: rgba(20, 24, 30, .8);
  box-shadow: 0 0 12px rgba(57, 255, 20, .2);
  width: 220px;
}

.search-icon {
  position: absolute;
  left: 0.6rem;
  color: var(--neo);
  font-size: 0.9rem;
  pointer-events: none;
}

/* Radius chips bar (below navbar) */
.radius-chips-bar {
  padding: 0.75rem 0;
  background: rgba(20, 24, 30, .4);
  border-bottom: 1px solid rgba(57, 255, 20, .15);
  backdrop-filter: blur(8px);
}

.radius-chips-bar .btn-group {
  gap: 0.25rem;
}

/* Animations for Incident */
@keyframes incidentBarScan {
  0% { transform: translateX(-100%); }
  50% { transform: translateX(100%); }
  100% { transform: translateX(-100%); }
}

@keyframes incidentRingPulse {
  0% { transform: scale(1); opacity: 0.8; }
  100% { transform: scale(1.6); opacity: 0; }
}

/* Old navbar button styles - keep for backward compatibility */
.navbar .btn-neo-subtle:hover,
.navbar .btn-neo-subtle:focus,
.navbar .btn-neo-subtle:active,
.navbar .btn-neo-subtle.active,
.navbar .btn-neo-subtle[aria-pressed="true"] {
  background: var(--neo) !important;
  color: #0b0f14 !important;
  border-color: #a9fe07 !important;
  box-shadow: 0 0 12px rgba(169, 254, 7, .35) !important;
}

.navbar .btn-neo-subtle {
  border-radius: 999px;
  background: linear-gradient(180deg, #10151b 0%, #151b23 100%);
  border: 1px solid rgba(169, 254, 7, .35);
  color: var(--text);
  padding: .5rem .9rem;
  font-weight: 600;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .25), 0 0 6px rgba(57, 255, 20, .12);
}

.navbar .btn-neo-subtle .bi {
  color: var(--neo);
}

/* Help chip beside Auto Tour */
#btnHelp.btn-link.btn-sm {
  width: 22px;
  height: 22px;
  padding: 0;
  line-height: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(57, 255, 20, .35);
  border-radius: 999px;
  color: var(--neo) !important;
  background: transparent;
}

#btnHelp.btn-link.btn-sm:hover {
  box-shadow: 0 0 8px rgba(57, 255, 20, .35);
  color: #aaffb5 !important;
}

/* Search pill to match buttons */
.search-wrap .input-group-text {
  border-radius: 999px 0 0 999px;
}

.search-wrap .form-control {
  border: 1px solid rgba(57, 255, 20, .35);
  border-left: 0;
  border-radius: 0 999px 999px 0;
  background: #0f141a;
  color: var(--text);
}

.search-wrap .form-control::placeholder {
  color: #8aa0b5;
}

.pulse-dot {
  width: .6rem;
  height: .6rem;
  border-radius: 50%;
  background: var(--neo);
  display: inline-block;
  box-shadow: 0 0 0 0 rgba(57, 255, 20, .7);
  animation: pulse 1.5s infinite
}

@keyframes pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(57, 255, 20, .7)
  }

  70% {
    box-shadow: 0 0 0 12px rgba(57, 255, 20, 0)
  }

  100% {
    box-shadow: 0 0 0 0 rgba(57, 255, 20, 0)
  }
}

.search-wrap .form-control {
  background: transparent;
  border-color: rgba(57, 255, 20, .35);
  color: var(--text)
}

.search-wrap .form-control::placeholder {
  color: #7b8a9b
}

/* Pill search */
.search-wrap .input-group-text {
  border-color: rgba(57, 255, 20, .35);
  border-top-left-radius: 10px;
  border-bottom-left-radius: 10px;
}

.search-wrap .form-control {
  border-top-right-radius: 10px;
  border-bottom-right-radius: 10px;
}

.bg-dim {
  background: linear-gradient(180deg, #0f141a 0%, #151b23 100%);
}

.cam-card {
  position: relative;
  border-radius: 12px;
  overflow: visible;
}

/* Allow Quick Look scale to overflow the grid row */
#grid {
  overflow: visible !important;
}


/* Keep top corners rounded for the image wrapper */
.cam-card .ratio {
  border-top-left-radius: inherit;
  border-top-right-radius: inherit;
  overflow: hidden;
}

.cam-region-overlay {
  position: absolute !important;
  top: auto !important;
  right: auto !important;
  bottom: .45rem !important;
  left: .45rem !important;
  z-index: 3;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: auto;
  height: auto;
  max-width: calc(100% - .9rem);
  padding: .18rem .5rem;
  font-size: .72rem;
  line-height: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  background: rgba(169, 254, 7, 0.92);
  color: #0b0f14;
  border: 1px solid rgba(169, 254, 7, 0.95);
  border-radius: 999px;
  font-weight: 800;
  backdrop-filter: blur(4px);
  box-shadow: 0 0 10px rgba(0, 0, 0, .22);
}

/* Keep bottom corners rounded for the body */
.cam-card .card-body-compact {
  border-bottom-left-radius: inherit;
  border-bottom-right-radius: inherit;
}

/* Compact card body - saves space */
.card-body-compact {
  padding: 0.4rem 0.5rem
}

.card-title-compact {
  font-weight: 700;
  font-size: 0.85rem;
  margin-bottom: 0.35rem;
  line-height: 1.2
}

.text-truncate-2 {
  display: -webkit-box;
  display: box;
  line-clamp: 2;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden
}

/* Favorite button overlay on image */
.btn-fav-overlay {
  position: absolute;
  top: 0.4rem;
  left: 0.4rem;
  z-index: 2;
  width: 32px;
  height: 32px;
  padding: 0;
  border-radius: 6px;
  background: rgba(11, 17, 23, .85);
  border: 1px solid rgba(57, 255, 20, .3);
  color: var(--text);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.btn-fav-overlay:hover {
  background: rgba(57, 255, 20, .2);
  border-color: rgba(57, 255, 20, .6);
  transform: scale(1.05);
}

.btn-fav-overlay.active {
  background: var(--neo);
  border-color: var(--neo);
  color: #0b0f14;
}

.btn-fav-overlay i {
  font-size: 1rem;
  color: var(--neo);
}

.btn-fav-overlay.active i {
  color: #0b0f14;
}

/* Legacy card styles */
.cam-card .card-body {
  padding: 0.5rem
}

.cam-card .card-title {
  font-weight: 700;
  font-size: 0.9rem
}

.cam-img {
  object-fit: cover;
  border-bottom: 1px solid rgba(57, 255, 20, .15)
}

.cam-img.loading {
  filter: grayscale(100%) blur(2px);
  opacity: .7
}

/* Fade transitions */
.fade {
  opacity: 1;
  transition: opacity .6s ease
}

.fade.hide {
  opacity: 0
}

#regionChips .chip {
  border: 1px solid rgba(57, 255, 20, .35);
  border-radius: 999px;
  padding: .35rem .75rem
}

/* Scrollbar subtle styling */
* {
  scrollbar-width: thin;
  scrollbar-color: #26313e #0f141a
}

*::-webkit-scrollbar {
  height: 10px;
  width: 10px
}

*::-webkit-scrollbar-thumb {
  background: #26313e;
  border-radius: 8px
}

.small,
.text-secondary {
  color: var(--muted) !important
}

/* Leaflet popup dark theme to match neon UI */
.neo-leaflet-popup .leaflet-popup-content-wrapper {
  background: #0b1117;
  color: #e2e8f0;
  border: 1px solid rgba(169, 254, 7, 0.3);
  box-shadow: 0 0 12px rgba(0, 0, 0, 0.6), 0 0 8px rgba(169, 254, 7, 0.25);
}

.neo-leaflet-popup .leaflet-popup-tip {
  background: #0b1117;
  box-shadow: 0 0 6px rgba(0, 0, 0, 0.5);
}

.neo-leaflet-popup .leaflet-popup-content a {
  color: #a9fe07;
}

/* Remove any image transition animations to avoid mobile jump */
img.cam-img,
img.rg-img,
#modalImg {
  transition: none !important;
}

/* Remove default modal body padding for image modal */
#imageModal .modal-body {
  padding: 0;
}

/* Default modal image sizing (non-fullscreen): use safe viewport height on mobile */
#imageModal #modalImg {
  width: 100%;
  height: auto;
  max-height: calc(80dvh - 48px);
  object-fit: contain;
  background: #000;
}

/* Modal fullscreen for overlay image */
#imageModal .modal-dialog.modal-fullscreen {
  margin: 0;
  max-width: 100%;
  width: 100%;
  height: 100%;
}

#imageModal .modal-dialog.modal-fullscreen .modal-content {
  height: 100%;
  background: #0b1117;
  border: 1px solid rgba(57, 255, 20, 0.25);
}

#imageModal .modal-dialog.modal-fullscreen .modal-body {
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

#imageModal .modal-dialog.modal-fullscreen #modalImg {
  max-width: 100%;
  max-height: 100%;
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #000;
}

/* True Fullscreen (Fullscreen API) */
.modal-content:fullscreen,
.modal-content:-webkit-full-screen {
  width: 100%;
  height: 100%;
}

.modal-content:fullscreen .modal-body,
.modal-content:-webkit-full-screen .modal-body {
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-content:fullscreen #modalImg,
.modal-content:-webkit-full-screen #modalImg {
  width: 100%;
  height: 100%;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  background: #000;
}

/* Loading overlay */
.loading-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(2px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1055;
  /* above navbar and modal backdrop */
}

.loading-overlay.d-none {
  display: none !important;
}

.loading-box {
  background: #0b1117;
  color: #cbd5e1;
  border: 1px solid rgba(57, 255, 20, 0.35);
  border-radius: 12px;
  padding: 20px 24px;
  min-width: 260px;
  box-shadow: 0 0 24px rgba(57, 255, 20, 0.15);
}

.neo-spinner {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 3px solid rgba(57, 255, 20, 0.25);
  border-top-color: rgb(57, 255, 20);
  animation: spin 0.9s linear infinite;
  margin-inline: auto;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* Ensure card/rolling images can host crossfade overlay */
.card-img-top,
.rg-cell {
  position: relative;
}

.badge.text-bg-neo {
  border: 1px solid #a9fe07
}

.ratio {
  background: #0f141a
}

/* Wider aspect ratio for bigger images */
.ratio-16x9 {
  --bs-aspect-ratio: 56.25%
}

.modal-content {
  border: 1px solid rgba(57, 255, 20, .25)
}

/* Card footer buttons */
.card-footer .btn {
  --bs-btn-padding-y: .2rem;
  --bs-btn-padding-x: .6rem
}

/* Modal overlay controls positioning */
/* Replaced by modal topbar */
.modal-topbar {
  padding: .5rem .75rem;
  border-bottom: 1px solid rgba(57, 255, 20, .15);
  background: rgba(10, 14, 19, .85);
  backdrop-filter: blur(6px)
}

.modal-topbar .title {
  font-weight: 700;
  font-size: 1rem;
  line-height: 1.1
}

.modal-topbar .sub {
  font-size: .8rem;
  color: #9aa5b1
}



kbd {
  padding: .25rem .5rem;
  border-radius: 4px;
  font-size: .85rem;
  font-weight: 600;
  border: 1px solid rgba(57, 255, 20, .3);
  box-shadow: 0 2px 4px rgba(0, 0, 0, .3)
}

.rolling-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  grid-template-rows: repeat(2, 0.9fr);
  gap: .5rem
}

.rolling-grid .cell {
  background: #0b1117;
  border: 1px solid rgba(57, 255, 20, .15);
  border-radius: 10px;
  overflow: hidden;
  position: relative
}

.rolling-grid img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block
}

@media (max-width: 576px) {
  .rolling-grid {
    grid-template-rows: repeat(2, 31vh)
  }
}

/* Neon green checkboxes for region filter */
#regionList input[type="checkbox"] {
  appearance: auto;
  width: 1.1rem;
  height: 1.1rem;
  border: 1px solid #a9fe07;
  background: transparent;
  cursor: pointer
}

#regionList input[type="checkbox"]:checked {
  background-color: #a9fe07;
  border-color: #a9fe07
}

#regionList label {
  color: #cfd8e3
}

/* Immersive viewer overlay */
#immersive[hidden] {
  display: none !important;
}

#immersive {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100dvh;
  background: #000;
  z-index: 1060;
  /* above modal */
  display: flex;
  flex-direction: column;
}

#immersive .iv-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: .5rem .75rem;
  border-bottom: 1px solid rgba(57, 255, 20, .2);
  background: rgba(10, 14, 19, .85);
  backdrop-filter: blur(6px);
}

#immersive .iv-title {
  font-weight: 700;
  font-size: 1rem;
  line-height: 1.1
}

#immersive .iv-sub {
  font-size: .8rem;
  color: #9aa5b1
}

#immersive .right .btn {
  --bs-btn-padding-y: .2rem;
  --bs-btn-padding-x: .6rem
}

#immersive #ivImg {
  flex: 1 1 auto;
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #000;
}

/* Immersive grid for Auto Tour multi-view (manual layouts) */
#immersive .iv-grid {
  flex: 1 1 auto;
  display: grid;
  width: 100%;
  height: 100%;
  gap: .5rem;
  padding: .5rem;
  background: #000;
}

#immersive .iv-grid .cell {
  position: relative;
  background: #000;
  border: 1px solid rgba(57, 255, 20, .25);
  border-radius: 8px;
  overflow: hidden;
}

#immersive .iv-grid .cell img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #000;
}

#immersive .iv-grid .cell .meta {
  position: absolute;
  left: 8px;
  bottom: 8px;
  background: rgba(10, 14, 19, .65);
  border: 1px solid rgba(57, 255, 20, .25);
  color: #cbd5e1;
  padding: .15rem .4rem;
  border-radius: 6px;
  font-size: .75rem;
}

/* Layout presets controlled by JS via class */
#immersive .iv-grid.ly-4 {
  grid-template-columns: repeat(2, 1fr);
  grid-template-rows: repeat(2, 1fr);
}

#immersive .iv-grid.ly-9 {
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: repeat(3, 1fr);
}

/* Small screens: tighter spacing */
@media (max-width: 575.98px) {
  #immersive .iv-grid {
    gap: .35rem;
    padding: .35rem;
  }
}

/* Neon-styled small select (used for Refresh dropdown) */
.neo-select {
  border: 1px solid rgba(57, 255, 20, .6) !important;
  background: linear-gradient(180deg, #10151b 0%, #151b23 100%);
  color: var(--text);
  border-radius: 10px;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .25), 0 0 8px rgba(57, 255, 20, .2);
}

.neo-select:focus {
  border-color: #a9fe07 !important;
  box-shadow: 0 0 12px rgba(169, 254, 7, .35), 0 0 0 .2rem rgba(169, 254, 7, .15) !important;
  outline: none !important;
}

.neo-select option {
  background: #0f141a;
  color: var(--text);
}

/* Idle modal styling */
.idle-modal {
  border: 1px solid var(--neo, #a9fe07);
  box-shadow: 0 0 0 1px rgba(169, 254, 7, 0.15), 0 8px 24px rgba(0, 0, 0, 0.6), 0 0 24px rgba(169, 254, 7, 0.08);
}

.idle-modal .modal-header .modal-title {
  font-family: 'Orbitron', ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial;
  letter-spacing: 0.5px;
}

.idle-modal .modal-footer .btn-neo {
  min-width: 160px;
}

.idle-modal .neo-spinner {
  width: 28px;
  height: 28px;
}

/* Tools dropdown styling */
.dropdown-menu.bg-dark-acc {
  background: #0b1117 !important;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5), 0 0 12px rgba(57, 255, 20, 0.15);
}

.dropdown-menu .dropdown-header {
  font-weight: 700;
  letter-spacing: 0.5px;
  font-size: 0.7rem;
  text-transform: uppercase;
}

.dropdown-menu .dropdown-item {
  color: var(--text);
  padding: 0.5rem 1rem;
  transition: background 0.15s ease, color 0.15s ease;
}

.dropdown-menu .dropdown-item:hover,
.dropdown-menu .dropdown-item:focus {
  background: rgba(57, 255, 20, 0.15);
  color: var(--neo);
}

.dropdown-menu .dropdown-item:active {
  background: var(--neo);
  color: #0b0f14;
}

.dropdown-menu .dropdown-item i {
  width: 1.25rem;
}

.dropdown-divider.border-neo {
  border-color: rgba(57, 255, 20, 0.2) !important;
}

/* Route Stories player */
.story-player {
  position: relative;
  background: #000;
  border-radius: 12px;
  overflow: hidden;
}

.story-player img {
  width: 100%;
  height: auto;
  min-height: 400px;
  max-height: 70vh;
  object-fit: contain;
  background: #000;
  display: block;
}

.story-player .story-progress {
  position: absolute;
  top: 0;
  left: 0;
  height: 3px;
  background: var(--neo);
  transition: width 0.3s linear;
}

.story-player .story-meta {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 1rem;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.85));
}

/* AI Traffic Analysis badges */
.traffic-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.25rem 0.6rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
}

.traffic-badge.traffic-clear {
  background: rgba(34, 197, 94, 0.2);
  color: #22c55e;
  border: 1px solid rgba(34, 197, 94, 0.4);
}

.traffic-badge.traffic-moderate {
  background: rgba(250, 204, 21, 0.2);
  color: #facc15;
  border: 1px solid rgba(250, 204, 21, 0.4);
}

.traffic-badge.traffic-heavy {
  background: rgba(239, 68, 68, 0.2);
  color: #ef4444;
  border: 1px solid rgba(239, 68, 68, 0.4);
}

/* Route builder map selection */
.route-builder-map {
  height: 400px;
  border-radius: 12px;
  border: 1px solid rgba(57, 255, 20, 0.25);
}

.route-point-marker {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.85rem;
}

.route-point-marker.start {
  background: var(--neo);
  color: #0b0f14;
}

.route-point-marker.end {
  background: #ef4444;
  color: #fff;
}

/* Insight Cards */
.insight-card {
  background: #0a0e12;
  border: 2px solid rgba(57, 255, 20, 0.4);
  border-radius: 12px;
  padding: 1.25rem;
  display: flex;
  gap: 1rem;
  align-items: flex-start;
  height: 100%;
}

.insight-icon {
  width: 52px;
  height: 52px;
  background: rgba(57, 255, 20, 0.2);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--neo);
  font-size: 1.75rem;
  flex-shrink: 0;
}

.insight-content {
  flex: 1;
}

.insight-content h6 {
  font-weight: 700;
  color: var(--neo);
  font-size: 0.95rem;
  margin-bottom: 0.5rem;
}

.insight-content .h4 {
  color: #ffffff;
  font-weight: 700;
}

.insight-content .small {
  color: #e6edf3;
  line-height: 1.8;
  font-size: 0.9rem;
}

.insight-content .small .badge {
  font-size: 0.85rem;
  padding: 0.35rem 0.6rem;
}

/* Stat Cards */
.stat-card {
  background: #0b1117;
  border: 1px solid rgba(57, 255, 20, 0.25);
  border-radius: 12px;
  padding: 1.5rem;
  text-align: center;
}

.stat-value {
  font-size: 2.5rem;
  font-weight: 700;
  line-height: 1;
  margin-bottom: 0.5rem;
}

.stat-label {
  color: #8b949e;
  font-size: 0.875rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* Weather Badge */
.weather-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.25rem 0.5rem;
  background: rgba(57, 255, 20, 0.1);
  border: 1px solid rgba(57, 255, 20, 0.25);
  border-radius: 6px;
  font-size: 0.75rem;
  color: var(--neo);
}

.weather-icon {
  font-size: 1.2rem;
}

/* Navbar weather widget */
.navbar-weather {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.35rem 0.75rem;
  background: rgba(57, 255, 20, 0.1);
  border: 1px solid rgba(57, 255, 20, 0.25);
  border-radius: 8px;
  font-size: 0.9rem;
  color: #c9d1d9;
  cursor: pointer;
  transition: all 0.2s;
}

.navbar-weather:hover {
  background: rgba(57, 255, 20, 0.15);
  border-color: rgba(57, 255, 20, 0.4);
}

.navbar-weather .weather-icon {
  font-size: 1.5rem;
}

.navbar-weather .weather-temp {
  font-weight: 600;
  color: var(--neo);
}

.navbar-weather .weather-desc {
  font-size: 0.8rem;
  color: #8b949e;
}

@media (max-width: 767.98px) {
  .navbar-weather .weather-desc {
    display: none;
  }
}

/* Footer neon glow for NI EMERGENCY RESPONSE VIDS */
.footer-nierv {
  color: var(--neo);
  text-shadow: 0 0 8px rgba(57, 255, 20, .7), 0 0 16px rgba(57, 255, 20, .4);
  font-weight: 700;
}

/* On-Site Traffic Notification Popups */
.traffic-notification {
  position: fixed;
  top: 80px;
  right: 20px;
  z-index: 10000;
  max-width: 400px;
  width: calc(100vw - 40px);
  opacity: 0;
  transform: translateX(120%);
  transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
  cursor: pointer;
}

.traffic-notification.show {
  opacity: 1;
  transform: translateX(0);
}

.traffic-notification-content {
  background: linear-gradient(135deg, #0b1117 0%, #151b23 100%);
  border: 2px solid rgba(57, 255, 20, .5);
  border-radius: 12px;
  padding: 1rem;
  box-shadow: 0 8px 32px rgba(0, 0, 0, .6), 0 0 24px rgba(57, 255, 20, .3);
  backdrop-filter: blur(10px);
}

.traffic-notification:hover .traffic-notification-content {
  border-color: rgba(57, 255, 20, .8);
  box-shadow: 0 8px 32px rgba(0, 0, 0, .7), 0 0 32px rgba(57, 255, 20, .5);
}

.notification-text {
  color: #e5e7eb;
  font-size: 0.9rem;
  line-height: 1.4;
}

.btn-close-notification {
  background: transparent;
  border: none;
  color: #94a3b8;
  padding: 0;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  transition: all 0.2s;
  flex-shrink: 0;
}

.btn-close-notification:hover {
  background: rgba(57, 255, 20, .2);
  color: var(--neo);
}

/* Stack multiple notifications */
.traffic-notification:nth-child(n+2) {
  top: calc(80px + 120px * (var(--index, 1)));
}

/* Mobile adjustments */
@media (max-width: 575.98px) {
  .traffic-notification {
    top: 70px;
    right: 10px;
    left: 10px;
    width: auto;
    max-width: none;
  }

  .traffic-notification-content {
    padding: 0.85rem;
  }

  .notification-text {
    font-size: 0.85rem;
  }
}

/* Update Available Banner */
.update-banner {
  position: fixed;
  top: 60px;
  left: 50%;
  transform: translateX(-50%) translateY(-120%);
  z-index: 10001;
  max-width: 600px;
  width: calc(100vw - 40px);
  opacity: 0;
  transition: all 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.update-banner.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.update-banner-content {
  background: linear-gradient(135deg, #0b1117 0%, #1a2129 100%);
  border: 2px solid var(--neo);
  border-radius: 12px;
  padding: 1rem 1.25rem;
  box-shadow: 0 8px 32px rgba(0, 0, 0, .7), 0 0 32px rgba(57, 255, 20, .4);
  backdrop-filter: blur(10px);
}

.btn-close-banner {
  background: transparent;
  border: none;
  color: #94a3b8;
  padding: 0;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  transition: all 0.2s;
  flex-shrink: 0;
}

.btn-close-banner:hover {
  background: rgba(255, 255, 255, .1);
  color: var(--text);
}

.btn-neo {
  background: var(--neo);
  color: #0b0f14;
  border: none;
  font-weight: 600;
  padding: 0.4rem 1rem;
  border-radius: 6px;
  transition: all 0.2s;
}

.btn-neo:hover {
  background: #a9fe07;
  box-shadow: 0 0 16px rgba(169, 254, 7, .5);
  transform: scale(1.02);
}

@media (max-width: 575.98px) {
  .update-banner {
    top: 10px;
    width: calc(100vw - 20px);
  }

  .update-banner-content {
    padding: 0.85rem 1rem;
  }

  .update-banner-content .small {
    font-size: 0.75rem;
  }

  .btn-neo {
    padding: 0.35rem 0.75rem;
    font-size: 0.85rem;
  }
}

/* Compact View Mode */
.compact-view .cam-card {
  font-size: 0.85rem;
}

.compact-view .card-body-compact {
  padding: 0.3rem 0.4rem;
}

.compact-view .card-title-compact {
  font-size: 0.8rem;
  margin-bottom: 0.25rem;
}

.compact-view .badge {
  font-size: 0.65rem;
  padding: 0.2rem 0.4rem;
}

.compact-view .btn-sm {
  font-size: 0.7rem;
  padding: 0.2rem 0.4rem;
}

.compact-view .col-lg-3 {
  width: 20%;
  flex: 0 0 20%;
}

@media (max-width: 1199.98px) {
  .compact-view .col-md-4 {
    width: 25%;
    flex: 0 0 25%;
  }
}

@media (max-width: 767.98px) {
  .compact-view .col-sm-6 {
    width: 33.333%;
    flex: 0 0 33.333%;
  }
}

/* Keyboard Shortcuts Help Toast */
.keyboard-help-toast {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.9);
  z-index: 10002;
  background: linear-gradient(135deg, #0b1117 0%, #1a2129 100%);
  border: 2px solid var(--neo);
  border-radius: 12px;
  padding: 1.5rem;
  box-shadow: 0 8px 32px rgba(0, 0, 0, .8), 0 0 40px rgba(57, 255, 20, .5);
  opacity: 0;
  transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
  cursor: pointer;
  max-width: 400px;
}

.keyboard-help-toast.show {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}

.shortcuts-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.shortcut-item {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.shortcut-item kbd {
  background: rgba(57, 255, 20, .2);
  border: 1px solid var(--neo);
  border-radius: 4px;
  padding: 0.25rem 0.5rem;
  font-family: monospace;
  font-size: 0.9rem;
  color: var(--neo);
  min-width: 50px;
  text-align: center;
  box-shadow: 0 2px 4px rgba(0, 0, 0, .3);
}

.shortcut-item span {
  color: var(--text);
  font-size: 0.9rem;
}

/* Screenshot button styling */
.btn-screenshot {
  --bs-btn-padding-y: 0.2rem;
  --bs-btn-padding-x: 0.5rem;
}

.btn-screenshot i {
  font-size: 0.9rem;
}

/* Screenshot Toast Notifications */
.screenshot-toast {
  position: fixed;
  bottom: 20px;
  right: 20px;
  background: linear-gradient(135deg, #0b1117 0%, #1a2129 100%);
  border: 2px solid var(--neo);
  border-radius: 8px;
  padding: 0.75rem 1.25rem;
  color: var(--text);
  font-size: 0.9rem;
  font-weight: 500;
  box-shadow: 0 4px 16px rgba(0, 0, 0, .6), 0 0 20px rgba(57, 255, 20, .3);
  z-index: 10003;
  opacity: 0;
  transform: translateY(20px);
  transition: all 0.3s ease;
}

.screenshot-toast.show {
  opacity: 1;
  transform: translateY(0);
}

.screenshot-toast-success {
  border-color: var(--neo);
}

.screenshot-toast-error {
  border-color: #ff4444;
  box-shadow: 0 4px 16px rgba(0, 0, 0, .6), 0 0 20px rgba(255, 68, 68, .3);
}

@media (max-width: 575.98px) {
  .screenshot-toast {
    bottom: 10px;
    right: 10px;
    left: 10px;
    font-size: 0.85rem;
    padding: 0.6rem 1rem;
  }
}

/* Share Toast Notifications */
.share-toast {
  position: fixed;
  bottom: 20px;
  right: 20px;
  background: linear-gradient(135deg, #0b1117 0%, #1a2129 100%);
  border: 2px solid var(--neo);
  border-radius: 8px;
  padding: 0.75rem 1.25rem;
  color: var(--text);
  font-size: 0.9rem;
  font-weight: 500;
  box-shadow: 0 4px 16px rgba(0, 0, 0, .6), 0 0 20px rgba(57, 255, 20, .3);
  z-index: 10003;
  opacity: 0;
  transform: translateY(20px);
  transition: all 0.3s ease;
}

.share-toast.show {
  opacity: 1;
  transform: translateY(0);
}

.share-toast-success {
  border-color: var(--neo);
}

@media (max-width: 575.98px) {
  .share-toast {
    bottom: 10px;
    right: 10px;
    left: 10px;
    font-size: 0.85rem;
    padding: 0.6rem 1rem;
  }
}

/* --- Timelapse Enhancements --- */
#tlCanvasContainer {
  transition: all 0.3s ease;
  cursor: crosshair;
}
#tlCanvasContainer.zoomed canvas {
  transform: scale(2.5);
  transform-origin: center;
  cursor: zoom-out !important;
}
#tlCanvasContainer canvas {
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}
.tl-controls {
  opacity: 0;
  transition: opacity 0.3s ease, transform 0.3s ease;
  transform: translateY(10px);
  z-index: 10;
}
#tlCanvasContainer:hover .tl-controls,
#tlCanvasContainer:active .tl-controls {
  opacity: 1;
  transform: translateY(0);
}
.tl-scrubber {
  accent-color: var(--neo);
}
.tl-scrubber::-webkit-slider-runnable-track {
  background: rgba(255, 255, 255, 0.1);
  height: 6px;
  border-radius: 3px;
  border: 1px solid rgba(169, 254, 7, 0.1);
}
.tl-scrubber::-webkit-slider-thumb {
  background: var(--neo);
  box-shadow: 0 0 12px var(--neo);
  width: 16px;
  height: 16px;
  margin-top: -6px;
  border: none;
}
.tl-speed-opt.active {
  background-color: var(--neo) !important;
  color: #0b1117 !important;
  font-weight: 700;
}
#tlFrameInfo {
  font-weight: 600;
  text-shadow: 0 0 8px rgba(169, 254, 7, 0.3);
}

/* Premium Pure CSS Incident Dashboard */
.alert-card-premium {
  background: rgba(30, 4, 10, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 0, 51, 0.2);
  border-left: 5px solid #ff0033;
  border-radius: 12px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4), 0 0 15px rgba(255, 0, 51, 0.1);
  transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  cursor: pointer;
  position: relative;
  overflow: hidden;
}

.alert-card-premium:hover {
  transform: translateY(-3px) scale(1.01);
  background: rgba(45, 6, 15, 0.9);
  border-color: rgba(255, 0, 51, 0.5);
  box-shadow: 0 8px 30px rgba(255, 0, 51, 0.2);
}

.alert-bar-pulse {
  width: 4px;
  height: 24px;
  background: #ff0033;
  border-radius: 2px;
  box-shadow: 0 0 10px #ff0033;
  animation: barPulse 1.5s infinite;
}

@keyframes barPulse { 0% { opacity: 0.6; } 50% { opacity: 1; } 100% { opacity: 0.6; } }

.alert-cam-title { color: #fff; font-weight: 800; font-size: 0.95rem; letter-spacing: 0.5px; }
.alert-type-label { color: #ff4d6d; font-size: 0.75rem; font-weight: 600; text-transform: uppercase; }

.btn-alert-view, .btn-alert-clear, .btn-alert-compare {
  padding: 5px 12px;
  font-size: 0.7rem;
  font-weight: 900;
  border-radius: 6px;
  transition: all 0.2s ease;
  border: 1px solid;
}

.btn-alert-view { background: rgba(255, 0, 51, 0.1); color: #ff0033; border-color: rgba(255, 0, 51, 0.3); }
.btn-alert-view:hover { background: #ff0033; color: #fff; }

.btn-alert-clear { background: rgba(255, 255, 255, 0.05); color: #aaa; border-color: rgba(255, 255, 255, 0.2); }
.btn-alert-clear:hover { background: #ff0033; color: #fff; border-color: #ff0033; }

.btn-alert-compare {
  background: rgba(169, 254, 7, 0.12);
  color: #a9fe07;
  border-color: rgba(169, 254, 7, 0.45);
  box-shadow: 0 0 0 rgba(169, 254, 7, 0);
}
.btn-alert-compare:hover {
  background: #a9fe07;
  color: #051109;
  border-color: #a9fe07;
  box-shadow: 0 0 14px rgba(169, 254, 7, 0.45);
}

/* ─────────────────────────────────────────────────
   INCIDENT TRUE GLOW CHASE — Conic Gradient
   Works because overflow:hidden was removed from .cam-card
   ───────────────────────────────────────────────── */

/* Outer col wrapper */
.has-incident {
  z-index: 1;
}

/* The card itself */
.has-incident-inner {
  border-color: rgba(255, 0, 51, 0.2) !important;
  isolation: isolate; /* Create new stacking context so z-index -1 stays above page bg */
}

/* The true conic-gradient chase beam */
.has-incident-inner::before {
  content: '';
  position: absolute;
  inset: -3px; /* Extends past border */
  border-radius: 14px; /* match card + padding */
  padding: 3px;
  background: conic-gradient(
    from 0deg,
    transparent 0deg,
    #ff0033 60deg,
    #ff6680 90deg,
    transparent 150deg,
    transparent 360deg
  );
  -webkit-mask:
    linear-gradient(#fff 0 0) content-box,
    linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask:
    linear-gradient(#fff 0 0) content-box,
    linear-gradient(#fff 0 0);
  mask-composite: exclude;
  animation: incidentGlowChase 2s linear infinite;
  z-index: -1;
  pointer-events: none;
}

/* Ambient pulsing aura */
.has-incident-inner::after {
  content: '';
  position: absolute;
  inset: -1px;
  border-radius: 13px;
  box-shadow: 0 0 20px 6px rgba(255, 0, 51, 0.4);
  animation: incidentGlowPulse 2.5s ease-in-out infinite;
  z-index: -2;
  pointer-events: none;
}

/* Incident type badge inside card body (legacy fallback if needed) */
.incident-grid-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  background: rgba(255, 0, 51, 0.18);
  border: 1px solid rgba(255, 0, 51, 0.4);
  color: #ff4d6d;
  font-size: 0.65rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  padding: 2px 8px;
  border-radius: 4px;
  margin-bottom: 0.3rem;
}

/* Incident type chip positioned OVER the camera image */
.incident-image-chip {
  position: absolute;
  top: 8px;
  left: 8px;
  width: max-content !important;
  height: max-content !important;
  z-index: 10;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  background: rgba(20, 0, 5, 0.85);
  border: 1px solid rgba(255, 0, 51, 0.6);
  color: #ff3355;
  font-size: 0.68rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  padding: 4px 10px;
  border-radius: 6px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.6), 0 0 10px rgba(255, 0, 51, 0.3);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  animation: chipPulse 2s infinite;
}

@keyframes chipPulse {
  0%, 100% { border-color: rgba(255, 0, 51, 0.5); box-shadow: 0 4px 12px rgba(0, 0, 0, 0.6), 0 0 8px rgba(255, 0, 51, 0.2); }
  50% { border-color: rgba(255, 0, 51, 1); box-shadow: 0 4px 12px rgba(0, 0, 0, 0.6), 0 0 16px rgba(255, 0, 51, 0.5); }
}

/* ---- Incident dashboard header animations ---- */
@keyframes incidentBarScan {
  0%    { opacity: 0.4; }
  50%   { opacity: 1;   }
  100%  { opacity: 0.4; }
}

@keyframes incidentRingPulse {
  0%   { transform: scale(1);   opacity: 0.8; }
  70%  { transform: scale(1.8); opacity: 0;   }
  100% { transform: scale(1.8); opacity: 0;   }
}

/* RECOVERY: Absolute Force Navbar Buttons */
.navbar-nav, .navbar-collapse {
  display: flex !important;
  visibility: visible !important;
  opacity: 1 !important;
}

@media (min-width: 992px) {
  .nav-desktop-toolbar .btn-nav-card {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 0.35rem !important;
    background: rgba(255, 255, 255, 0.03) !important;
    border: 1px solid rgba(169, 254, 7, 0.3) !important;
    color: #fff !important;
    padding: 0.45rem 0.65rem !important;
    border-radius: 10px !important;
    min-width: 0 !important;
    margin: 0 2px !important;
    transition: all 0.2s ease !important;
  }

  .nav-desktop-toolbar .btn-nav-card i {
    display: none !important;
  }

  .nav-desktop-toolbar .btn-nav-card span {
    font-size: 0.72rem !important;
    font-weight: 600 !important;
    text-transform: uppercase !important;
    color: #fff !important;
  }

  .nav-weather-widget {
    padding: 0.4rem 0.55rem;
  }

  .nav-search-toggle {
    padding: 0.45rem 0.55rem !important;
  }
}

@media (max-width: 991.98px) {
  .navbar .container-fluid {
    position: relative;
    flex-wrap: wrap;
    align-items: flex-start;
  }

  .navbar-brand {
    flex: 1 1 auto;
    padding-right: 5.25rem;
  }

  .nav-mobile-toolbar {
    position: fixed;
    top: 0.85rem;
    right: 0.75rem;
    width: auto;
    display: flex;
    justify-content: flex-end;
    z-index: 1075;
  }

  .nav-search-wrap-mobile {
    width: 100%;
    order: 3;
  }

  .navbar-collapse {
    order: 4;
    width: 100%;
  }
}

.btn-nav-card:hover {
  background: rgba(169, 254, 7, 0.1) !important;
  border-color: #a9fe07 !important;
  box-shadow: 0 0 15px rgba(169, 254, 7, 0.3) !important;
  transform: translateY(-2px) !important;
}

.btn-nav-alert { border-color: #ff0033 !important; animation: navAlertPulse 2s infinite !important; }
.btn-nav-alert i { color: #ff0033 !important; }

@keyframes navAlertPulse { 0% { box-shadow: 0 0 5px #ff0033; } 50% { box-shadow: 0 0 15px #ff0033; } 100% { box-shadow: 0 0 5px #ff0033; } }

/* ============================================================
   RECENTLY VIEWED TRAY
   ============================================================ */

.rv-tray {
  background: linear-gradient(135deg, rgba(20, 24, 30, 0.95) 0%, rgba(27, 33, 41, 0.95) 100%);
  border: 1px solid rgba(57, 255, 20, 0.2);
  border-radius: 14px;
  padding: 0.75rem 1rem;
  backdrop-filter: blur(8px);
}

.rv-tray-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.65rem;
}

.rv-tray-title {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--neo);
  text-transform: uppercase;
  letter-spacing: 0.8px;
}

.rv-tray-clear {
  background: transparent;
  border: 1px solid rgba(57, 255, 20, 0.2);
  color: var(--muted);
  border-radius: 6px;
  padding: 0.15rem 0.5rem;
  font-size: 0.72rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.rv-tray-clear:hover {
  border-color: rgba(255, 80, 80, 0.5);
  color: #ff6b6b;
  background: rgba(255, 0, 0, 0.08);
}

.rv-strip {
  display: flex;
  gap: 0.6rem;
  overflow-x: auto;
  padding-bottom: 4px;
  scrollbar-width: thin;
  scrollbar-color: rgba(57, 255, 20, 0.2) transparent;
}

.rv-strip::-webkit-scrollbar { height: 4px; }
.rv-strip::-webkit-scrollbar-thumb { background: rgba(57, 255, 20, 0.2); border-radius: 4px; }

.rv-card {
  flex: 0 0 auto;
  width: 120px;
  border-radius: 8px;
  overflow: hidden;
  cursor: pointer;
  border: 1px solid rgba(57, 255, 20, 0.2);
  transition: all 0.22s ease;
  position: relative;
}

.rv-card:hover {
  border-color: rgba(57, 255, 20, 0.7);
  transform: translateY(-3px);
  box-shadow: 0 6px 20px rgba(57, 255, 20, 0.2);
}

.rv-img-wrap {
  position: relative;
  width: 100%;
  padding-top: 56.25%; /* 16:9 */
  background: #0f141a;
}

.rv-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.rv-img-placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(57, 255, 20, 0.3);
  font-size: 1.6rem;
}

.rv-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(0deg, rgba(0,0,0,0.88) 0%, transparent 100%);
  padding: 0.4rem 0.4rem 0.3rem;
}

.rv-name {
  font-size: 0.62rem;
  font-weight: 700;
  color: #e5e7eb;
  line-clamp: 1;
  -webkit-line-clamp: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.rv-region {
  font-size: 0.55rem;
  color: var(--neo);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  opacity: 0.85;
}

/* ============================================================
   QUICK LOOK HOVER EXPAND
   ============================================================ */

/* Only applies on hover-capable devices (desktop) */
@media (hover: hover) {
  .cam-card {
    transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1),
                box-shadow 0.25s ease,
                z-index 0s;
  }

  .cam-card.ql-active {
    transform: scale(1.08);
    z-index: 20;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.7), 0 0 0 2px rgba(57, 255, 20, 0.6), 0 0 30px rgba(57, 255, 20, 0.25) !important;
    position: relative;
  }

  /* Parent col needs overflow visible for the scale to work */
  .col-12.col-sm-6.col-md-4.col-lg-3:has(.ql-active) {
    z-index: 20;
    position: relative;
  }
}



/* ============================================================
   COMPARE TWO CAMERAS MODAL
   ============================================================ */

.compare-slot {
  background: rgba(15, 20, 26, 0.8);
  border: 1px solid rgba(57, 255, 20, 0.2);
  border-radius: 12px;
  overflow: hidden;
  transition: border-color 0.2s ease;
}

.compare-slot:has(.compare-img:not(.d-none)) {
  border-color: rgba(57, 255, 20, 0.45);
}

.compare-slot-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.75rem;
  background: rgba(57, 255, 20, 0.05);
  border-bottom: 1px solid rgba(57, 255, 20, 0.15);
  flex-wrap: wrap;
}

.compare-slot-label {
  font-size: 0.68rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--neo);
  background: rgba(57, 255, 20, 0.12);
  border: 1px solid rgba(57, 255, 20, 0.3);
  padding: 2px 8px;
  border-radius: 4px;
  flex-shrink: 0;
}

.compare-slot-name {
  font-size: 0.82rem;
  font-weight: 600;
  color: #e5e7eb;
}

.compare-slot-region {
  font-size: 0.72rem;
}

.compare-img-wrap {
  position: relative;
  width: 100%;
  padding-top: 56.25%; /* 16:9 */
  background: #0a0e14;
}

.compare-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.compare-placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  color: rgba(57, 255, 20, 0.25);
  text-align: center;
  padding: 1rem;
}

.compare-placeholder i {
  font-size: 2.5rem;
}

.compare-placeholder p {
  font-size: 0.82rem;
  color: var(--muted);
  margin: 0;
  max-width: 200px;
}

/* Compare button on camera cards */
.btn-compare {
  opacity: 0.8;
  transition: opacity 0.2s ease, background 0.2s ease;
}

.btn-compare:hover {
  opacity: 1;
}

/* Extra-small button size */
.btn-xs {
  font-size: 0.7rem;
  padding: 0.2rem 0.5rem;
  line-height: 1.4;
  border-radius: 5px;
}

/* ---- Compare inline picker ---- */
.compare-slot-name {
  font-size: 0.82rem;
  font-weight: 600;
  color: #e5e7eb;
  max-width: 180px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.compare-picker {
  background: rgba(10, 14, 20, 0.95);
  border-top: 1px solid rgba(57, 255, 20, 0.12);
}

.compare-picker-search-wrap {
  position: relative;
  padding: 0.5rem 0.6rem;
  border-bottom: 1px solid rgba(57, 255, 20, 0.1);
}

.compare-picker-icon {
  position: absolute;
  left: 1rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--neo);
  font-size: 0.8rem;
  pointer-events: none;
}

.compare-picker-input {
  width: 100%;
  background: rgba(20, 24, 30, 0.8);
  border: 1px solid rgba(57, 255, 20, 0.25);
  border-radius: 7px;
  padding: 0.4rem 0.6rem 0.4rem 2rem;
  color: var(--text);
  font-size: 0.82rem;
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.compare-picker-input:focus {
  border-color: rgba(57, 255, 20, 0.5);
  box-shadow: 0 0 10px rgba(57, 255, 20, 0.15);
}

.compare-picker-input::placeholder { color: #7b8a9b; }

.compare-picker-list {
  max-height: 220px;
  overflow-y: auto;
  padding: 0.3rem 0;
  scrollbar-width: thin;
  scrollbar-color: rgba(57, 255, 20, 0.2) transparent;
}

.compare-picker-list::-webkit-scrollbar { width: 4px; }
.compare-picker-list::-webkit-scrollbar-thumb { background: rgba(57, 255, 20, 0.2); border-radius: 4px; }

.compare-picker-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 0.35rem 0.75rem;
  background: transparent;
  border: none;
  color: var(--text);
  text-align: left;
  cursor: pointer;
  transition: background 0.12s ease;
  gap: 0.5rem;
}

.compare-picker-item:hover {
  background: rgba(57, 255, 20, 0.08);
}

.compare-picker-item.active {
  background: rgba(57, 255, 20, 0.14);
  color: var(--neo);
}

.compare-picker-item-name {
  font-size: 0.8rem;
  font-weight: 600;
  flex: 1;
  text-align: left;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.compare-picker-item-region {
  font-size: 0.67rem;
  color: var(--neo);
  flex-shrink: 0;
  opacity: 0.75;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.compare-picker-empty {
  text-align: center;
  color: var(--muted);
  font-size: 0.8rem;
  padding: 1rem;
}

/* Fix compare img-wrap when displayed */
.compare-img-wrap {
  padding-top: 56.25%;
}
