/* ── Canvas sharpness ── */
canvas.qr {
  image-rendering: pixelated;
  image-rendering: -moz-crisp-edges;
  image-rendering: crisp-edges;
}

/* ── Animations (Light Theme) ── */
@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
@keyframes slideIn {
  from {
    transform: translateY(100%);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}
@keyframes slideOut {
  from {
    transform: translateY(0);
    opacity: 1;
  }
  to {
    transform: translateY(100%);
    opacity: 0;
  }
}
@keyframes scan-line {
  0% {
    top: 8%;
  }
  50% {
    top: 88%;
  }
  100% {
    top: 8%;
  }
}

.anim-fade-up {
  animation: fadeUp 0.4s ease-out both;
}
.delay-100 {
  animation-delay: 0.1s;
}

/* ── Locker door 3D (Light Theme) ── */
.locker-perspective {
  perspective: 600px;
}
.locker-door {
  transform-origin: left center;
  transition: transform 0.9s cubic-bezier(0.34, 1.56, 0.64, 1);
  transform-style: preserve-3d;
  backface-visibility: hidden;
}
.locker-door.open {
  transform: rotateY(-105deg);
}

/* ── Toast Notification ── */
.toast-container {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 100;
  pointer-events: none;
}
.toast {
  padding: 12px 20px;
  border-radius: 14px;
  font-size: 13px;
  font-weight: 600;
  pointer-events: auto;
  animation: slideIn 0.35s ease-out;
  backdrop-filter: blur(12px);
  border: 1px solid rgba(0, 0, 0, 0.1);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}
.toast.leaving {
  animation: slideOut 0.3s ease-in forwards;
}
.toast.success {
  background: #10b981;
  color: white;
}
.toast.error {
  background: #ef4444;
  color: white;
}
.toast.info {
  background: #3b82f6;
  color: white;
}

/* ── Scanner Viewport ── */
.scanner-viewport {
  position: relative;
  overflow: hidden;
}
.scanner-viewport::after {
  content: "";
  position: absolute;
  left: 10%;
  right: 10%;
  height: 2px;
  background: linear-gradient(90deg, transparent, #3b82f6, transparent);
  border-radius: 1px;
  top: 8%;
  animation: scan-line 2.2s ease-in-out infinite;
}

/* ====================================================
   E-INK TERMINAL THEME
   Scoped to .theme-e-ink
==================================================== */

.theme-e-ink {
  /* Core Variables */
  --fg: #000000;
  --bg: #ffffff;
  --border-thick: 2px solid var(--fg);
  --font-mono: "Courier New", Courier, monospace;

  background-color: var(--bg);
  color: var(--fg);
  padding: 24px;
  min-height: 500px;
  font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
}

/* Override default Tailwind rounding & styling within E-ink */
.theme-e-ink * {
  border-radius: 0 !important;
  box-shadow: none !important;
  animation: none !important; /* Disable fade-ups */
  transition: none !important; /* E-ink is instant */
}

/* E-Ink Headings */
.theme-e-ink .e-title {
  font-family: var(--font-mono);
  font-size: 24px;
  font-weight: bold;
  text-transform: uppercase;
  text-align: center;
  border-bottom: var(--border-thick);
  padding-bottom: 10px;
  margin-bottom: 20px;
}

/* E-Ink Camera Feed */
.theme-e-ink .e-camera-box {
  border: var(--border-thick);
  position: relative;
  aspect-ratio: 4/3;
  margin: 0 auto 20px auto;
  max-width: 400px;
  overflow: hidden;
  background: #eee;
}
.theme-e-ink .e-camera-feed {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: grayscale(100%) contrast(1.5) brightness(1.1);
}
.theme-e-ink .e-camera-overlay {
  position: absolute;
  inset: 15%;
  border: 2px dashed var(--fg);
  pointer-events: none;
}

/* E-Ink Buttons */
.theme-e-ink .e-btn {
  background: var(--bg);
  color: var(--fg);
  border: var(--border-thick);
  padding: 14px 20px;
  font-family: var(--font-mono);
  font-weight: bold;
  font-size: 16px;
  text-transform: uppercase;
  width: 100%;
  max-width: 320px;
  margin: 10px auto;
  display: block;
  cursor: pointer;
}
.theme-e-ink .e-btn:hover {
  background: var(--fg);
  color: var(--bg);
}

/* E-Ink Data Card */
.theme-e-ink .e-data-card {
  border: var(--border-thick);
  padding: 16px;
  margin: 0 auto 20px auto;
  max-width: 320px;
  text-align: left;
  font-family: var(--font-mono);
  font-size: 14px;
}
.theme-e-ink .e-data-row {
  display: flex;
  justify-content: space-between;
  margin-bottom: 8px;
  border-bottom: 1px dotted #999;
  padding-bottom: 4px;
}
.theme-e-ink .e-data-row:last-child {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}

/* E-Ink Big Label */
.theme-e-ink .e-big-label {
  font-size: 32px;
  font-family: var(--font-mono);
  font-weight: bold;
  text-align: center;
  margin: 40px 0;
}
