/* ==========================================================================
   StormView — global styles
   Tailwind handles the bulk of styling; this file holds a few primitives that
   are awkward to express as utility classes (scrollbars, video object-fit,
   skeleton shimmer, Mapbox GL theming).
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

:root {
  color-scheme: light dark;
}

html {
  scroll-behavior: smooth;
}

/* --- Skeleton shimmer for loading states ------------------------------- */
.skeleton {
  position: relative;
  overflow: hidden;
  background: rgba(148, 163, 184, 0.18);
}
.skeleton::after {
  content: '';
  position: absolute;
  inset: 0;
  transform: translateX(-100%);
  background: linear-gradient(
    90deg,
    transparent,
    rgba(148, 163, 184, 0.25),
    transparent
  );
  animation: shimmer 1.4s infinite;
}
@keyframes shimmer {
  100% {
    transform: translateX(100%);
  }
}

/* --- Video fills its card -------------------------------------------------- */
.camera-video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: #0b1120;
}

/* --- Status dot pulse ------------------------------------------------------ */
.status-pulse {
  position: relative;
}
.status-pulse::before {
  content: '';
  position: absolute;
  inset: -3px;
  border-radius: 9999px;
  background: currentColor;
  opacity: 0.45;
  animation: ping 1.8s cubic-bezier(0, 0, 0.2, 1) infinite;
}
@keyframes ping {
  75%,
  100% {
    transform: scale(2);
    opacity: 0;
  }
}

/* --- Custom scrollbar ----------------------------------------------------- */
* {
  scrollbar-width: thin;
  scrollbar-color: rgba(148, 163, 184, 0.5) transparent;
}
*::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}
*::-webkit-scrollbar-thumb {
  background: rgba(148, 163, 184, 0.45);
  border-radius: 9999px;
  border: 2px solid transparent;
  background-clip: content-box;
}
*::-webkit-scrollbar-thumb:hover {
  background: rgba(148, 163, 184, 0.7);
  background-clip: content-box;
}

/* --- Navbar logo ---------------------------------------------------------- */
.nav-logo {
  display: block;
  flex-shrink: 0;
}
.stormview-map,
.mapbox-map {
  font-family: inherit;
  background: #0b1120;
}
.mapbox-map .mapboxgl-canvas {
  outline: none;
}
.mapbox-map .mapboxgl-ctrl-group button {
  border-radius: 8px;
}
.dark .mapbox-map .mapboxgl-ctrl-group button {
  background: rgba(15, 23, 42, 0.9);
  color: #e2e8f0;
}

/* Camera marker pins */
.cam-marker {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 9999px;
  border: 2px solid #fff;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.4);
  font-size: 14px;
  color: #fff;
  cursor: pointer;
  transition: transform 0.15s ease;
}
.cam-marker:hover {
  transform: scale(1.12);
}

/* Mapbox popup styling */
.mapboxgl-popup-content {
  padding: 12px 14px;
  border-radius: 12px;
  font-family: inherit;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
}
.dark .mapboxgl-popup-content {
  background: #1e293b;
  color: #e2e8f0;
}
.cam-popup-title {
  font-weight: 700;
  font-size: 14px;
  margin-bottom: 2px;
}
.cam-popup-location {
  font-size: 12px;
  opacity: 0.75;
  margin-bottom: 6px;
}
.cam-popup-category {
  font-size: 11px;
  margin-bottom: 10px;
}
.cam-popup-actions {
  display: flex;
  gap: 6px;
}
.cam-popup-btn {
  cursor: pointer;
  border-radius: 8px;
  padding: 6px 10px;
  font-size: 12px;
  font-weight: 600;
  border: none;
}
.cam-popup-btn-primary {
  flex: 1;
  background: #2563eb;
  color: #fff;
}
.cam-popup-btn-secondary {
  background: transparent;
  border: 1px solid #cbd5e1;
  color: inherit;
}
.dark .cam-popup-btn-secondary {
  border-color: #475569;
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    transition-duration: 0.001ms !important;
  }
}
