/* VIAGENS RUSSAS — style.css v1 */

:root,
[data-theme="corporate"] {
  --color-primary: oklch(22% 0.18 263);
  --color-primary-content: oklch(99% 0 0);
  --color-primary-focus: oklch(18% 0.18 263);
}

[x-cloak] { display: none !important; }

body { font-family: 'Inter', system-ui, sans-serif; }

/* Sidebar */
.sidebar-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.5rem 0.875rem;
  border-radius: 0.5rem;
  color: rgb(148 163 184);
  font-size: 0.8125rem;
  font-weight: 500;
  text-decoration: none;
  transition: background 0.15s, color 0.15s;
  white-space: nowrap;
}
.sidebar-link:hover  { background: rgba(255,255,255,0.1); color: #fff; }
.sidebar-link.active { background: rgba(255,255,255,0.15); color: #fff; }
.sidebar-link .icon  { width: 1.125rem; text-align: center; font-size: 0.875rem; flex-shrink: 0; }

/* Cards */
.stat-card { border-radius: 1rem; padding: 1.25rem; color: white; }

/* HTMX loading bar */
#htmx-bar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 9998;
  height: 2px; background: #FFDA00;
  transform-origin: left; transform: scaleX(0);
  opacity: 0; pointer-events: none; transition: opacity 0.15s;
}
#htmx-bar.running { opacity: 1; animation: htmx-bar-run 1.6s ease-in-out infinite; }
#htmx-bar.done    { transform: scaleX(1) !important; animation: none; opacity: 0; transition: opacity 0.35s; }
@keyframes htmx-bar-run {
  0%   { transform: scaleX(0);    }
  60%  { transform: scaleX(0.72); }
  100% { transform: scaleX(0.9);  }
}

/* Map container */
#map {
  width: 100%;
  height: calc(100vh - 3.25rem);
  z-index: 1;
}
@media (min-width: 1024px) {
  #map { height: calc(100vh - 3rem); }
}

/* Vehicle popup Leaflet */
.veiculo-popup .leaflet-popup-content-wrapper {
  border-radius: 12px;
  padding: 0;
  overflow: hidden;
  box-shadow: 0 8px 32px rgba(0,0,0,0.18);
  min-width: 240px;
}
.veiculo-popup .leaflet-popup-content { margin: 0; }

/* Pulsing marker for moving vehicles */
@keyframes marker-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(34,197,94,0.5); }
  50%       { box-shadow: 0 0 0 8px rgba(34,197,94,0); }
}
.marker-moving { animation: marker-pulse 1.5s ease-in-out infinite; }

/* Card animation */
main .card { animation: card-appear 0.22s ease-out both; }
@keyframes card-appear {
  from { opacity: 0; transform: translateY(5px); }
  to   { opacity: 1; transform: translateY(0);   }
}

/* Scrollbar */
::-webkit-scrollbar       { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(148,163,184,0.5); border-radius: 4px; }

/* Buttons */
.btn-primary, .btn-primary *, .btn-primary:hover { color: #ffffff !important; }
.alert-error, .alert-error * { color: #ffffff !important; }

/* Toast */
.toast .alert { max-width: min(480px, 92vw) !important; }

/* View transitions */
::view-transition-old(root), ::view-transition-new(root) { animation: none; mix-blend-mode: normal; }
::view-transition-new(root) { z-index: 2; }
::view-transition-old(root) { z-index: 1; }

/* Curtain login */
@keyframes hpulse {
  0%  { transform: scale(1);    }
  14% { transform: scale(1.15); }
  28% { transform: scale(1.06); }
  42% { transform: scale(1.12); }
  70% { transform: scale(1);    }
  100%{ transform: scale(1);    }
}
.curtain-heart-bg {
  position: absolute; inset: 0;
  background: url('/assets/FundoAnimado.png') no-repeat center center;
  background-size: cover; opacity: .7;
  pointer-events: none; transform-origin: center center;
  animation: hpulse 2s ease-out infinite;
}
.curtain-label {
  position: relative; z-index: 1;
  color: #FFDA00; font-family: 'Inter', sans-serif;
  font-size: 1.15rem; font-weight: 700;
  letter-spacing: 0.1em; text-shadow: 0 2px 12px rgba(0,0,0,0.4);
}

/* Status ignição inline */
.dot-on  { display:inline-block;width:8px;height:8px;border-radius:50%;background:#22c55e;margin-right:4px; }
.dot-off { display:inline-block;width:8px;height:8px;border-radius:50%;background:#94a3b8;margin-right:4px; }

/* Print */
@media print {
  .drawer-side, nav, .no-print, .topbar { display: none !important; }
  main { padding: 0 !important; }
}
