/* Custom styles layered on top of Tailwind — LIGHT ops-console theme. */

/* ---- Page background: faint cool tint + grid so panels read as elevated ---- */
body {
  background-color: #F4F6FA;
  background-image:
    radial-gradient(1100px 480px at 82% -10%, rgba(37, 99, 235, 0.05), transparent 60%),
    linear-gradient(to bottom, rgba(15, 23, 42, 0.022) 1px, transparent 1px),
    linear-gradient(to right, rgba(15, 23, 42, 0.022) 1px, transparent 1px);
  background-size: auto, 44px 44px, 44px 44px;
  background-attachment: fixed;
}

/* ---- Light scrollbars ---- */
* { scrollbar-width: thin; scrollbar-color: #CBD5E1 transparent; }
::-webkit-scrollbar { width: 9px; height: 9px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #CBD5E1; border-radius: 8px; border: 2px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-thumb:hover { background: #94A3B8; background-clip: padding-box; }

/* ---- Camera thumbnails stay dark behind the (often dark) video letterbox ---- */
img.thumb { background: #0B1220; }

/* ---- Sidebar active item: left accent bar ---- */
.nav-item.active::before {
  content: "";
  position: absolute;
  left: -0.75rem;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 1.15rem;
  border-radius: 0 3px 3px 0;
  background: #2563EB;
}

/* ---- Camera cards: gentle lift on hover ---- */
#sources > div {
  transition: transform 0.16s ease, border-color 0.16s ease, box-shadow 0.16s ease;
}
#sources > div:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 24px -12px rgba(16, 24, 40, 0.25);
}

/* ---- Map markers: tidy, legible pins ---- */
.map-marker { transition: transform 0.15s ease; cursor: grab; }
.map-marker:hover { transform: translate(-50%, -50%) scale(1.12); z-index: 5; }
.map-marker.cursor-grabbing { cursor: grabbing; }
/* Heatmap sits under the coverage cones, both under the pins. */
#map-heat { z-index: 1; }
#map-cov { z-index: 2; }
#map-markers { z-index: 3; }

/* ---- Buttons: subtle press feedback ---- */
.btn-primary:active, .btn-ghost:active { transform: translateY(1px); }

/* ---- Tables: row hover ---- */
#log-rows tr, #audit-rows tr { transition: background-color 0.12s ease; }
#log-rows tr:hover, #audit-rows tr:hover { background-color: #F8FAFC; }

/* ---- Skeleton loaders (shimmer) ---- */
.skeleton { position: relative; overflow: hidden; background-color: #E9EEF4; }
.skeleton::after {
  content: "";
  position: absolute;
  inset: 0;
  transform: translateX(-100%);
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.7), transparent);
  animation: shimmer 1.5s infinite;
}
@keyframes shimmer { 100% { transform: translateX(100%); } }

/* ---- Ask TheEye chat: reserve space when docked on wide screens ---- */
@media (min-width: 1280px) {
  body.chat-docked .app-shell { padding-right: 380px; }
}

/* ---- Chat typing indicator (three bouncing dots) ---- */
.chat-typing { display: inline-flex; gap: 4px; align-items: center; padding: 2px 0; }
.chat-typing span {
  width: 6px; height: 6px; border-radius: 9999px; background: #94A3B8;
  animation: chatdot 1.2s infinite ease-in-out;
}
.chat-typing span:nth-child(2) { animation-delay: 0.18s; }
.chat-typing span:nth-child(3) { animation-delay: 0.36s; }
@keyframes chatdot { 0%, 80%, 100% { transform: translateY(0); opacity: 0.5; } 40% { transform: translateY(-4px); opacity: 1; } }

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