/* =============================================================================
   Matrícula V3 · Web — Flashcard de alertas en vivo (estilo del addon V2)
   Tarjeta a pantalla, color por tipo de alerta, swipes, pestañas por carril.
   ============================================================================= */

.flash-wrap { display: flex; flex-direction: column; height: 100%; min-height: 0; }
.flash-head { padding: 20px 28px 0; flex: 0 0 auto; }
.flash-head h2 { font-size: 24px; margin: 0 0 4px; }
.flash-head p { margin: 0 0 14px; color: var(--ink-soft); font-size: 14px; }

/* Barra de estado de conexión (reutiliza estilos .conn de app.css) */
.flash-head .conn { margin-bottom: 14px; }

/* Escenario donde flota la flashcard */
.flash-stage {
  flex: 1; position: relative;
  display: flex; align-items: center; justify-content: center;
  padding: 8px 28px 28px; overflow: hidden; min-height: 0;
}

/* Hints laterales */
.swipe-hint {
  position: absolute; top: 50%; transform: translateY(-50%);
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  font-size: 14px; font-weight: 700; opacity: 0; pointer-events: none;
  transition: opacity .12s; z-index: 1;
}
.swipe-hint.left  { left: 36px; color: var(--steel); }
.swipe-hint.right { right: 36px; color: var(--green); }
.swipe-hint .big { font-size: 30px; }

/* La flashcard */
.flash {
  position: relative; width: 100%; max-width: 1100px; height: 100%;
  background: var(--card-bg, #555); border-radius: 16px; overflow: hidden;
  box-shadow: 0 14px 40px rgba(0,0,0,.25);
  color: #fff; cursor: grab; user-select: none; touch-action: none;
  display: flex; flex-direction: row;
  transition: transform .18s ease, opacity .18s ease;
}
.flash:active { cursor: grabbing; }
.flash.dragging { transition: none; }
.flash.fly-right { transform: translateX(140%) rotate(15deg); opacity: 0; }
.flash.fly-left  { transform: translateX(-140%) rotate(-15deg); opacity: 0; }

/* Columna de pestañas por carril */
.flash-tabs {
  width: 78px; flex: 0 0 auto; display: flex; flex-direction: column; gap: 6px;
  padding: 14px 8px; background: rgba(0,0,0,.22); border-right: 1px solid rgba(255,255,255,.08);
}
.flash-tab {
  flex: 1; min-height: 56px; background: rgba(255,255,255,.10); color: #fff;
  border: 2px solid transparent; border-radius: 10px; padding: 8px 6px; cursor: pointer;
  font-family: inherit; display: flex; flex-direction: column; align-items: center;
  justify-content: center; gap: 4px; opacity: .72; position: relative;
  transition: background .15s, border-color .15s, opacity .15s;
}
.flash-tab:hover { background: rgba(255,255,255,.18); opacity: 1; }
.flash-tab.active { background: var(--tab-color, rgba(255,255,255,.25)); border-color: rgba(255,255,255,.45); opacity: 1; }
.flash-tab.has-new { animation: tabFlash 1s ease-in-out infinite; opacity: 1; }
@keyframes tabFlash {
  0%,100% { box-shadow: 0 0 0 0 rgba(255,255,255,0); }
  50% { box-shadow: 0 0 0 3px rgba(255,255,255,.5); border-color: rgba(255,255,255,.55); }
}
.flash-tab-short { font-size: 20px; font-weight: 900; line-height: 1; }
.flash-tab-label { font-size: 9px; font-weight: 700; text-transform: uppercase; letter-spacing: .5px; opacity: .8; text-align: center; }
.flash-tab-count {
  position: absolute; top: 4px; right: 4px; min-width: 18px; height: 18px; padding: 0 5px;
  background: rgba(0,0,0,.5); color: #fff; font-size: 11px; font-weight: 800;
  border-radius: 9px; display: flex; align-items: center; justify-content: center;
}

.flash-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }

/* Header: tipo + tiempo */
.flash-header {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 16px 24px; background: rgba(0,0,0,.18); flex-shrink: 0;
}
.flash-type { display: flex; align-items: center; gap: 10px; }
.flash-dot { width: 12px; height: 12px; border-radius: 50%; background: #fff; animation: flashPulse 1.2s infinite; }
@keyframes flashPulse { 0%,100% { transform: scale(1); opacity: 1; } 50% { transform: scale(1.3); opacity: .55; } }
.flash-type-label { font-size: 14px; font-weight: 700; text-transform: uppercase; letter-spacing: .6px; }
.flash-pri { font-size: 11px; font-weight: 800; background: rgba(0,0,0,.3); padding: 3px 9px; border-radius: 4px; letter-spacing: .5px; }
.flash-time { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; font-size: 12px; color: rgba(255,255,255,.78); font-variant-numeric: tabular-nums; }
.flash-time strong { font-size: 14px; color: #fff; }
.flash-nav {
  background: rgba(0,0,0,.3); color: #fff; border: 1px solid rgba(255,255,255,.25);
  font-family: inherit; font-variant-numeric: tabular-nums; font-size: 11px; font-weight: 700;
  padding: 2px 9px; border-radius: 11px; cursor: pointer; margin-bottom: 2px; transition: background .15s, transform .12s;
}
.flash-nav:hover { background: rgba(0,0,0,.5); transform: scale(1.05); }

/* Cuerpo */
.flash-body { flex: 1; display: grid; grid-template-columns: 1fr 0.9fr; gap: 18px; padding: 22px; min-height: 0; }
.flash-body.no-photos { grid-template-columns: 1fr; }
.flash-info { display: flex; flex-direction: column; gap: 10px; min-width: 0; justify-content: center; }
.flash-plate { font-family: var(--mono); font-size: clamp(44px, 7vw, 110px); font-weight: 900; letter-spacing: 3px; line-height: 1; text-shadow: 0 4px 12px rgba(0,0,0,.25); word-break: break-all; }
.flash-lane { font-size: 18px; text-transform: uppercase; letter-spacing: 1px; color: rgba(255,255,255,.85); font-weight: 600; }
.flash-entry { font-size: 15px; color: rgba(255,255,255,.9); margin-top: 8px; }
.flash-entry strong { font-weight: 800; }
.flash-stay { font-size: 18px; font-weight: 700; margin-top: 6px; }
.flash-fee { display: inline-block; background: rgba(0,0,0,.35); padding: 8px 18px; border-radius: 8px; font-size: 22px; font-weight: 900; margin-top: 4px; width: fit-content; }

/* Footer */
.flash-footer {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 12px 24px; background: rgba(0,0,0,.22); font-size: 12px; color: rgba(255,255,255,.85); flex-shrink: 0;
}
.flash-footer-side { display: flex; align-items: center; gap: 8px; }

/* Dots de cola — clicables: cada punto es una alerta de la cola */
.flash-queue { position: absolute; bottom: 10px; left: 50%; transform: translateX(-50%); display: flex; gap: 8px; z-index: 6; pointer-events: none; }
.flash-queue-dot {
  width: 12px; height: 12px; border-radius: 50%; background: rgba(255,255,255,.45);
  pointer-events: auto; cursor: pointer; transition: background .12s, width .12s;
}
.flash-queue-dot:hover { background: rgba(255,255,255,.85); }
.flash-queue-dot.active { background: #fff; width: 28px; border-radius: 6px; }

/* Vacío */
.flash-empty {
  text-align: center; color: var(--ink-soft); max-width: 460px;
  background: var(--panel); border: 1px dashed var(--line); border-radius: var(--r-lg); padding: 40px 28px;
}
.flash-empty .big { font-size: 17px; font-weight: 700; color: var(--ink); margin-bottom: 6px; }

/* Vehículo (marca/modelo) bajo la matrícula */
.flash-vehicle { font-size: 16px; color: rgba(255,255,255,.92); font-weight: 500; }

/* Columna de fotos */
.flash-photos { display: flex; flex-direction: column; gap: 10px; min-width: 0; min-height: 0; }
.flash-photo {
  width: 100%; border-radius: 10px; object-fit: cover; background: #000;
  border: 1px solid rgba(255,255,255,.18); display: block; cursor: zoom-in; transition: transform .12s ease;
}
.flash-photo:hover { transform: scale(1.015); }
.flash-photo-vehicle { flex: 2; min-height: 0; }
.flash-photo-plate { flex: 1; min-height: 0; max-height: 150px; }

/* Lightbox */
.flash-lightbox {
  position: fixed; inset: 0; background: rgba(0,0,0,.93); z-index: 10001;
  display: flex; align-items: center; justify-content: center; padding: 32px; cursor: zoom-out;
}
.flash-lightbox img { max-width: 100%; max-height: 100%; object-fit: contain; border-radius: 6px; box-shadow: 0 12px 48px rgba(0,0,0,.65); cursor: default; }
.flash-lightbox-close {
  position: absolute; top: 18px; right: 18px; width: 38px; height: 38px;
  background: rgba(255,255,255,.14); border: 1px solid rgba(255,255,255,.22); border-radius: 50%;
  color: #fff; font-size: 20px; cursor: pointer; display: flex; align-items: center; justify-content: center; font-family: inherit;
}
.flash-lightbox-close:hover { background: rgba(255,255,255,.24); }

/* Matrícula no leída: algo más pequeña que una matrícula real, sin cursiva. */
.flash-plate.unread { font-size: clamp(34px, 5vw, 68px); letter-spacing: 2px; }

/* Coche que YA SE FUE (cruzó la barrera): tarjeta en gris + sello */
.flash.gone { filter: grayscale(0.85) brightness(0.85); }
.flash.gone .flash-dot { animation: none; opacity: .5; }
.flash-gone-stamp {
  position: absolute; top: 50%; left: 50%;
  transform: translate(-50%, -50%) rotate(-12deg);
  font-size: clamp(40px, 7vw, 92px); font-weight: 900; letter-spacing: .3vw;
  color: rgba(255,255,255,.18); border: 6px solid rgba(255,255,255,.18);
  padding: 8px 24px; border-radius: 10px; pointer-events: none; user-select: none;
  white-space: nowrap; z-index: 4;
}

/* Placeholder mientras el addon trae la foto de la alerta */
.flash-photo-loading {
  flex: 1; display: flex; align-items: center; justify-content: center;
  background: rgba(0,0,0,.22); border: 1px dashed rgba(255,255,255,.25); border-radius: 10px;
  color: rgba(255,255,255,.8); font-size: 13px;
}

/* Bloque de abonado dentro de la flashcard (SUBSCRIBER_DETECTED, cian) */
.flash-ab { margin-top: 10px; background: rgba(0,0,0,.18); border-radius: 10px; padding: 12px 14px; max-width: 520px; }
.flash-ab-name { font-size: 22px; font-weight: 800; line-height: 1.1; }
.flash-ab-store { font-size: 15px; color: rgba(255,255,255,.85); margin-top: 2px; }
.flash-ab-row { display: flex; align-items: center; gap: 10px; margin-top: 8px; flex-wrap: wrap; }
.flash-ab-status { font-size: 12px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; padding: 4px 10px; border-radius: 6px; }
.flash-ab-status.act  { background: #dcfce7; color: #166534; }
.flash-ab-status.venc { background: #fef9c3; color: #92400e; }
.flash-ab-status.exp  { background: #fee2e2; color: #991b1b; }
.flash-ab-vence { font-size: 13px; color: rgba(255,255,255,.85); font-variant-numeric: tabular-nums; }

/* Bloque de "posible buscada" (candidato parcial) dentro de la flashcard */
.flash-cand { margin-top: 10px; background: rgba(0,0,0,.2); border-radius: 10px; padding: 12px 14px; max-width: 520px; }
.flash-cand-tag { font-size: 13px; font-weight: 800; letter-spacing: .02em; }
.flash-cand-pat { font-size: 16px; margin-top: 6px; }
.flash-cand-pat strong { font-family: var(--mono); background: rgba(0,0,0,.3); padding: 2px 8px; border-radius: 5px; letter-spacing: 1px; }
.flash-cand-reason { font-size: 14px; margin-top: 6px; color: rgba(255,255,255,.9); }

/* Nota bajo el importe a cobrar: el precio es orientativo (haz caso a SKIDATA) */
.flash-fee-note { font-size: 12.5px; line-height: 1.35; color: rgba(255,255,255,.92); background: rgba(0,0,0,.22); border-radius: 7px; padding: 7px 11px; margin-top: 7px; width: fit-content; max-width: 420px; }
.flash-fee-note strong { font-weight: 800; letter-spacing: .02em; }
