/* ═══════════════════════════════════════════════════════
   MEMBERS SCANNER — Styles (Executive Premium Mobile)
   ═══════════════════════════════════════════════════════ */

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(--success);
  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-members);
  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;
}

/* ─── Operator Setup Overlay ──────────────────────────── */
.scanner-name-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: var(--bg-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 200;
  padding: 24px;
}

.scanner-setup-box {
  width: 100%;
  max-width: 360px;
  padding: 32px;
  text-align: center;
}

.setup-title {
  font-size: 1.6rem;
  letter-spacing: 2px;
  margin-bottom: 4px;
}

.setup-subtitle {
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 24px;
  display: block;
}

.setup-input {
  text-align: center;
  font-size: 16px;
  padding: 12px;
  margin-bottom: 18px;
  font-family: 'Outfit', sans-serif;
  letter-spacing: 1px;
}

.setup-btn {
  padding: 12px 20px !important;
  font-size: 13.5px !important;
  border-radius: var(--radius-sm) !important;
}

/* ─── 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); /* Dim background */
  border-radius: var(--radius-md);
  overflow: hidden;
}

/* Frame Corner Highlights (Executive Members Green) */
.corner {
  position: absolute;
  width: 16px;
  height: 16px;
  border: 2.5px solid var(--success);
  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 (Green themed) */
.scan-line {
  position: absolute;
  width: 100%;
  height: 2px;
  background: linear-gradient(to right, transparent, var(--success), transparent);
  box-shadow: 0 0 10px var(--success), 0 0 20px rgba(34, 197, 94, 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: 55vh;
  overflow-y: auto;
}

/* Custom enter/mark buttons */
.action-buttons {
  margin-top: 14px;
}

.enter-btn {
  width: 100%;
  padding: 14px;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 1px;
  background: linear-gradient(135deg, var(--success), #16a34a);
  color: white;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 4px 14px rgba(34, 197, 94, 0.25);
  font-family: 'Outfit', sans-serif;
}

.enter-btn:hover {
  filter: brightness(1.1);
  box-shadow: 0 6px 20px rgba(34, 197, 94, 0.35);
  transform: translateY(-1px);
}

.enter-btn:active {
  transform: scale(0.98);
}

.enter-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none !important;
  box-shadow: none !important;
}

.dismiss-btn {
  padding: 10px 20px !important;
  font-size: 12.5px !important;
  border-radius: var(--radius-sm) !important;
  font-weight: 600 !important;
}

/* ─── Scan History Section ────────────────────────────── */
.scan-history {
  margin-top: 16px;
  padding: 14px 16px;
  background: rgba(0, 0, 0, 0.2);
  border-radius: var(--radius-md);
  border: 1px solid rgba(255, 255, 255, 0.03);
  text-align: left;
}

.scan-history h4 {
  color: var(--text-muted);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 10px;
}

.scan-history-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.02);
  font-size: 12px;
}

.scan-history-item:last-child {
  border-bottom: none;
}

/* 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; }
