/**
 * ============================================================================
 * LPR (AUTOMATIC LICENSE PLATE RECOGNITION) — ESTILOS TÁTICOS
 * SISTEMA C2 2ª CIA - 14º BPM
 * Design System: Paleta Tática Noturna (--bg, --panel, --accent, --teal, --line)
 * ============================================================================
 */

/* ─── HUD Pill / Status Superior do LPR ───────────────────────────────────── */
.lpr-status-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: var(--radius-sm, 3px);
  background: var(--panel-alt, #1b2228);
  border: 1px solid var(--line, #2e3942);
  color: var(--text-muted, #b0bcc4);
  font-size: 11px;
  font-family: var(--mono, monospace);
  font-weight: 600;
  box-shadow: var(--shadow-sm);
  transition: all var(--transition-fast, 0.15s ease);
}

.lpr-status-pill.active {
  background: rgba(49, 201, 176, 0.12);
  border-color: var(--teal, #31c9b0);
  color: var(--teal, #31c9b0);
  box-shadow: 0 0 10px var(--teal-glow, rgba(49, 201, 176, 0.25));
}

.lpr-status-pill.paused {
  background: rgba(242, 201, 76, 0.12);
  border-color: var(--yellow, #f2c94c);
  color: var(--yellow, #f2c94c);
  box-shadow: 0 0 10px rgba(242, 201, 76, 0.25);
}

.lpr-status-pill .lpr-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--text-dim, #778691);
}

.lpr-status-pill.active .lpr-dot {
  background: var(--teal, #31c9b0);
  box-shadow: 0 0 8px var(--teal, #31c9b0);
  animation: lpr-dot-pulse 1.4s infinite;
}

.lpr-status-pill.paused .lpr-dot {
  background: var(--yellow, #f2c94c);
  box-shadow: 0 0 8px var(--yellow, #f2c94c);
  animation: none;
}

@keyframes lpr-dot-pulse {
  0% { transform: scale(0.9); opacity: 0.8; }
  50% { transform: scale(1.2); opacity: 1; }
  100% { transform: scale(0.9); opacity: 0.8; }
}

/* ─── Botão Flutuante de Placas para Telespectador / Operador ────────────── */
.lpr-floating-trigger {
  position: fixed !important;
  bottom: 24px !important;
  right: 24px !important;
  z-index: 99999 !important;
  display: flex !important;
  align-items: center !important;
  gap: 8px !important;
  background: var(--panel, #141a1f) !important;
  border: 1.5px solid var(--accent, #ff8c46) !important;
  border-radius: var(--radius-md, 6px) !important;
  padding: 8px 14px !important;
  color: var(--text, #e9ece6) !important;
  font-size: 12px !important;
  font-weight: 700 !important;
  font-family: var(--mono, monospace) !important;
  box-shadow: var(--shadow-lg), 0 0 16px var(--accent-glow, rgba(255, 140, 70, 0.25)) !important;
  cursor: pointer !important;
  transition: all var(--transition-fast, 0.15s ease) !important;
  pointer-events: auto !important;
}

.lpr-floating-trigger:hover {
  background: var(--panel-elevated, #212a31) !important;
  border-color: var(--accent-hover, #ffa366) !important;
  transform: translateY(-2px) !important;
  box-shadow: var(--shadow-lg), 0 0 24px rgba(255, 140, 70, 0.45) !important;
}

.lpr-floating-trigger .lpr-badge-count {
  background: var(--accent, #ff8c46);
  color: #141a1f;
  border-radius: 10px;
  padding: 1px 7px;
  font-size: 10.5px;
  font-weight: 800;
  font-family: var(--mono, monospace);
  line-height: 1.3;
}

/* ─── Alerta Toast Tático de Nova Placa Detectada ────────────────────────── */
.lpr-toast-alert {
  position: fixed;
  top: 70px;
  right: 20px;
  z-index: 2000;
  display: flex;
  align-items: center;
  gap: 12px;
  background: rgba(20, 26, 31, 0.96);
  border: 1px solid var(--accent, #ff8c46);
  border-left: 4px solid var(--accent, #ff8c46);
  backdrop-filter: blur(10px);
  padding: 10px 16px;
  border-radius: var(--radius-md, 6px);
  box-shadow: var(--shadow-lg), 0 0 20px var(--accent-glow, rgba(255, 140, 70, 0.25));
  color: var(--text, #e9ece6);
  font-family: var(--mono, monospace);
  animation: lpr-toast-in 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  max-width: 400px;
}

@keyframes lpr-toast-in {
  from { transform: translateX(50px); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

.lpr-toast-icon {
  font-size: 22px;
}

.lpr-toast-content {
  flex: 1;
}

.lpr-toast-title {
  font-size: 10px;
  text-transform: uppercase;
  color: var(--accent, #ff8c46);
  font-weight: 700;
  letter-spacing: 0.08em;
}

.lpr-toast-plate {
  font-size: 16px;
  font-weight: 800;
  color: #ffffff;
  margin: 2px 0;
  letter-spacing: 0.05em;
}

.lpr-toast-meta {
  font-size: 10px;
  color: var(--text-dim, #778691);
}

/* ─── Painel Lateral / Drawer de Placas ──────────────────────────────────── */
.lpr-drawer {
  position: fixed !important;
  top: 0 !important;
  right: -450px !important;
  width: 420px !important;
  max-width: 92vw !important;
  height: 100vh !important;
  background: var(--panel, #141a1f) !important;
  border-left: 1px solid var(--line-highlight, #455663) !important;
  backdrop-filter: blur(16px) !important;
  -webkit-backdrop-filter: blur(16px) !important;
  z-index: 100000 !important;
  display: flex !important;
  flex-direction: column !important;
  transition: right 0.3s cubic-bezier(0.16, 1, 0.3, 1) !important;
  box-shadow: var(--shadow-lg), -10px 0 40px rgba(0, 0, 0, 0.85) !important;
}

.lpr-drawer.open {
  right: 0 !important;
}

.lpr-drawer-header {
  padding: 14px 18px;
  border-bottom: 1px solid var(--line, #2e3942);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--panel-alt, #1b2228);
}

.lpr-drawer-title-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
}

.lpr-drawer-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--text, #e9ece6);
  font-family: var(--display, sans-serif);
  letter-spacing: 0.04em;
}

.lpr-drawer-subtitle {
  font-size: 10px;
  color: var(--teal, #31c9b0);
  font-family: var(--mono, monospace);
  margin-top: 2px;
}

.lpr-close-btn {
  background: transparent;
  border: none;
  color: var(--text-dim, #778691);
  font-size: 18px;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: var(--radius-sm, 3px);
  transition: color var(--transition-fast, 0.15s ease);
}

.lpr-close-btn:hover {
  color: var(--danger, #e5484d);
  background: var(--danger-bg, rgba(229, 72, 77, 0.12));
}

.lpr-drawer-search {
  padding: 10px 14px;
  border-bottom: 1px solid var(--line-soft, #232c33);
  background: var(--bg-deep, #080a0c);
  display: flex;
  gap: 8px;
}

.lpr-drawer-search input {
  flex: 1;
  background: var(--panel, #141a1f);
  border: 1px solid var(--line, #2e3942);
  color: var(--text, #e9ece6);
  font-family: var(--mono, monospace);
  border-radius: var(--radius-sm, 3px);
  padding: 6px 10px;
  font-size: 11.5px;
  transition: border-color var(--transition-fast, 0.15s ease);
}

.lpr-drawer-search input:focus {
  outline: none;
  border-color: var(--accent, #ff8c46);
  box-shadow: 0 0 8px var(--accent-glow, rgba(255, 140, 70, 0.25));
}

.lpr-drawer-body {
  flex: 1;
  overflow-y: auto;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.lpr-drawer-footer {
  padding: 12px 16px;
  border-top: 1px solid var(--line, #2e3942);
  display: flex;
  gap: 8px;
  background: var(--panel-alt, #1b2228);
}

/* ─── Cartão de Placa Estilizado (Mercosul e Legado) ─────────────────────── */
.lpr-plate-card {
  background: var(--bg-deep, #080a0c);
  border: 1px solid var(--line, #2e3942);
  border-radius: var(--radius-md, 6px);
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: all var(--transition-fast, 0.15s ease);
  position: relative;
  cursor: pointer;
}

.lpr-plate-card:hover {
  border-color: var(--teal, #31c9b0);
  background: var(--panel-alt, #1b2228);
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm), 0 0 12px var(--teal-glow, rgba(49, 201, 176, 0.25));
}

.lpr-plate-card.newest-highlight {
  border-color: var(--accent, #ff8c46);
  box-shadow: var(--shadow-sm), 0 0 16px var(--accent-glow, rgba(255, 140, 70, 0.25));
}

.lpr-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.lpr-plate-graphic-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* Graphic Mercosul Plate */
.mercosul-plate-box {
  width: 140px;
  height: 44px;
  background: #ffffff;
  border: 2px solid #111827;
  border-radius: 4px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.5);
  user-select: none;
}

.mercosul-header {
  height: 12px;
  background: #003399;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 5px;
}

.mercosul-country {
  font-family: Arial, sans-serif;
  font-size: 7.5px;
  font-weight: 900;
  color: #ffffff;
  letter-spacing: 0.1em;
}

.mercosul-flag-icon {
  width: 8px;
  height: 6px;
  background: #009c3b;
  position: relative;
  border-radius: 1px;
}

.mercosul-flag-icon::after {
  content: '';
  position: absolute;
  width: 4px;
  height: 3px;
  background: #ffdf00;
  top: 1.5px;
  left: 2px;
  clip-path: polygon(50% 0%, 100% 50%, 50% 100%, 0% 50%);
}

.mercosul-text {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--display, 'Space Grotesk'), var(--mono, monospace), sans-serif;
  font-size: 19px;
  font-weight: 900;
  color: #000000;
  letter-spacing: 0.08em;
  padding-bottom: 2px;
}

/* Graphic Legacy Plate */
.legacy-plate-box {
  width: 140px;
  height: 44px;
  background: #c0c0c0;
  border: 2px solid #333333;
  border-radius: 4px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.5);
  user-select: none;
}

.legacy-header {
  height: 11px;
  background: #a0a0a0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: Arial, sans-serif;
  font-size: 6.5px;
  font-weight: 800;
  color: #222222;
  letter-spacing: 0.05em;
  border-bottom: 1px solid #777;
}

.legacy-text {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--display, 'Space Grotesk'), var(--mono, monospace), sans-serif;
  font-size: 19px;
  font-weight: 900;
  color: #111111;
  letter-spacing: 0.08em;
  padding-bottom: 2px;
}

.lpr-crop-thumb {
  width: 68px;
  height: 44px;
  object-fit: cover;
  border-radius: var(--radius-sm, 3px);
  border: 1px solid var(--line-highlight, #455663);
  background: #000;
}

.lpr-card-meta {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px 10px;
  font-size: 10px;
  color: var(--text-dim, #778691);
  font-family: var(--mono, monospace);
  background: rgba(0, 0, 0, 0.3);
  padding: 6px 8px;
  border-radius: var(--radius-sm, 3px);
  border: 1px solid var(--line-soft, #232c33);
}

.lpr-card-meta b {
  color: var(--text, #e9ece6);
}

.lpr-card-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 2px;
}

.lpr-order-badge {
  font-size: 9.5px;
  font-family: var(--mono, monospace);
  color: var(--accent, #ff8c46);
  background: var(--accent-glow, rgba(255, 140, 70, 0.25));
  padding: 2px 6px;
  border-radius: var(--radius-sm, 3px);
  border: 1px solid rgba(255, 140, 70, 0.4);
  font-weight: 700;
}

.lpr-conf-badge {
  font-size: 9.5px;
  font-family: var(--mono, monospace);
  color: var(--teal, #31c9b0);
  font-weight: 600;
}

.lpr-click-hint {
  font-size: 9px;
  color: var(--text-dim, #778691);
  font-family: var(--mono, monospace);
  display: flex;
  align-items: center;
  gap: 3px;
  transition: color var(--transition-fast, 0.15s ease);
}

.lpr-plate-card:hover .lpr-click-hint {
  color: var(--teal, #31c9b0);
}

/* ─── Modal Tático de Visualização Forense da Foto do Veículo ───────────── */
.lpr-vehicle-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(8, 10, 12, 0.88);
  backdrop-filter: blur(8px);
  z-index: 100000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition-fast, 0.15s ease);
}

.lpr-vehicle-modal-overlay.open {
  opacity: 1;
  pointer-events: auto;
}

.lpr-vehicle-modal-card {
  background: var(--panel, #141a1f);
  border: 1.5px solid var(--accent, #ff8c46);
  border-radius: var(--radius-md, 6px);
  width: 100%;
  max-width: 780px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: var(--shadow-lg), 0 0 25px var(--accent-glow, rgba(255, 140, 70, 0.25));
}

.lpr-modal-header {
  padding: 14px 18px;
  background: var(--panel-alt, #1b2228);
  border-bottom: 1px solid var(--line, #2e3942);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.lpr-modal-title {
  font-family: var(--display, sans-serif);
  font-size: 13.5px;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--text, #e9ece6);
  display: flex;
  align-items: center;
  gap: 8px;
}

.lpr-modal-body {
  padding: 16px 18px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
  background: var(--panel, #141a1f);
}

.lpr-vehicle-photo-wrap {
  width: 100%;
  background: #000;
  border-radius: var(--radius-sm, 3px);
  border: 1px solid var(--line-highlight, #455663);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  min-height: 260px;
  max-height: 480px;
}

.lpr-vehicle-photo-wrap img {
  width: 100%;
  height: 100%;
  max-height: 460px;
  object-fit: contain;
  display: block;
}

.lpr-modal-footer {
  padding: 12px 18px;
  background: var(--panel-alt, #1b2228);
  border-top: 1px solid var(--line, #2e3942);
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}
