/* ═══════════════════════════════════════════════════════
   GATE SCANNER — Styles (Linear Mobile Premium)
   ═══════════════════════════════════════════════════════ */

body {
  overflow: hidden;
  height: 100vh;
  height: 100dvh;
  display: flex;
  flex-direction: column;
}

/* ─── Scanner Header ──────────────────────────────────── */
.scanner-header {
  position: fixed;
  top: 16px;
  left: 16px;
  right: 16px;
  z-index: 100;
  border-radius: var(--radius-md) !important;
}

.header-logo {
  font-size: 18px !important;
  letter-spacing: 3px !important;
}

.scanner-label {
  font-size: 9px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-weight: 600;
  display: block;
}

.scan-counter {
  padding: 0 !important;
  background: rgba(255, 255, 255, 0.02) !important;
  border-color: rgba(255, 255, 255, 0.04) !important;
}

.scan-counter .card-content {
  padding: 6px 14px;
}

#scanCount {
  font-size: 20px;
  font-weight: 800;
  color: var(--scan-count-color);
  line-height: 1;
  font-family: 'Outfit', sans-serif;
}

.scans-count-lbl {
  font-size: 8px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-top: 1px;
}

/* ─── Camera Viewport ─────────────────────────────────── */
.scanner-container {
  flex: 1;
  position: relative;
  margin-top: 84px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}

.camera-card {
  width: 100%;
  max-width: 480px;
  height: 100%;
  max-height: 520px;
  overflow: hidden;
  padding: 0 !important;
}

.camera-view {
  width: 100%;
  height: 100%;
  position: relative;
  background: var(--camera-bg, #000);
}

.camera-view video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Frosted Scan Overlay Frame */
.scan-overlay {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  background: var(--scanner-overlay-bg, rgba(0, 0, 0, 0.25));
  backdrop-filter: saturate(1.2) blur(1px);
}

.scan-frame {
  width: 230px;
  height: 230px;
  position: relative;
  border: 1px solid var(--scanner-frame-border);
  box-shadow: 0 0 0 9999px var(--scanner-mask); /* Custom dimming surrounding scanport */
  border-radius: var(--radius-md);
  overflow: hidden;
}

/* Frame Corner Highlights */
.corner {
  position: absolute;
  width: 16px;
  height: 16px;
  border: 2.5px solid var(--accent-light);
  pointer-events: none;
}

.corner-tl { top: -1px; left: -1px; border-right: none; border-bottom: none; border-top-left-radius: 6px; }
.corner-tr { top: -1px; right: -1px; border-left: none; border-bottom: none; border-top-right-radius: 6px; }
.corner-bl { bottom: -1px; left: -1px; border-right: none; border-top: none; border-bottom-left-radius: 6px; }
.corner-br { bottom: -1px; right: -1px; border-left: none; border-top: none; border-bottom-right-radius: 6px; }

/* Dynamic Scan Line Ticker */
.scan-line {
  position: absolute;
  width: 100%;
  height: 2px;
  background: linear-gradient(to right, transparent, var(--accent-light), transparent);
  box-shadow: 0 0 10px var(--accent), 0 0 20px rgba(94, 106, 210, 0.5);
  top: 0;
  animation: scan 2.8s infinite linear;
}

@keyframes scan {
  0% { top: 0%; }
  50% { top: 100%; }
  100% { top: 0%; }
}

.scan-hint {
  color: var(--scan-hint-color);
  font-size: 12.5px;
  font-weight: 500;
  margin-top: 24px;
  letter-spacing: 0.02em;
  text-shadow: var(--scan-hint-shadow);
  z-index: 5;
}

/* ─── Result Drawer Overlay ───────────────────────────── */
.result-container {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: var(--drawer-overlay-bg);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  z-index: 1000;
  display: flex;
  align-items: flex-end; /* Slides from bottom */
  justify-content: center;
  padding: 16px;
}

.result-wrapper {
  width: 100%;
  max-width: 460px;
  animation: slideDrawerUp 0.35s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes slideDrawerUp {
  from {
    transform: translateY(100px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.result-wrapper .scan-result {
  max-height: 70vh;
  overflow-y: auto;
}

.dismiss-btn {
  padding: 14px 20px !important;
  font-size: 14px !important;
  font-family: 'Outfit', sans-serif !important;
  font-weight: 600 !important;
  border-radius: var(--radius-md) !important;
}

/* Flash Feedbacks */
@keyframes flashGreen {
  0% { background-color: rgba(34, 197, 94, 0.25); }
  100% { background-color: transparent; }
}

@keyframes flashRed {
  0% { background-color: rgba(239, 68, 68, 0.25); }
  100% { background-color: transparent; }
}

.flash-green { animation: flashGreen 0.5s ease-out; }
.flash-red { animation: flashRed 0.5s ease-out; }
