/* ============================================================================
   EMC Multi-Event Ticket Management System (V4.0.0)
   File: style.css (Gate Scanner PWA)
   Description: Mobile-first responsive styles, scanner laser animation,
                modal backdrops, fullscreen alert overlays, and animations.
   ============================================================================ */

/* Disable pull-to-refresh and rubber-band bounce on mobile iOS/Android */
html, body {
  overscroll-behavior-y: contain;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
  -webkit-user-select: none;
}

/* Custom scrollbars */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: rgba(15, 23, 42, 0.6);
}
::-webkit-scrollbar-thumb {
  background: rgba(100, 116, 139, 0.5);
  border-radius: 9999px;
}
::-webkit-scrollbar-thumb:hover {
  background: rgba(148, 163, 184, 0.8);
}

/* HTML5-QRCode Viewfinder customization */
#qrReaderViewfinder {
  width: 100% !important;
  height: 100% !important;
  border: none !important;
  background: #000;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

#qrReaderViewfinder video {
  width: 100% !important;
  height: 100% !important;
  object-fit: cover !important;
  border-radius: 1rem;
}

/* Scanner Laser Sweep Animation */
.scanner-laser {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, rgba(99, 102, 241, 0) 0%, rgba(129, 140, 248, 1) 50%, rgba(99, 102, 241, 0) 100%);
  box-shadow: 0 0 14px 3px rgba(99, 102, 241, 0.85);
  border-radius: 9999px;
  animation: laserSweep 2.2s ease-in-out infinite alternate;
}

@keyframes laserSweep {
  0% {
    top: 5%;
    opacity: 0.8;
  }
  50% {
    opacity: 1;
  }
  100% {
    top: 92%;
    opacity: 0.8;
  }
}

/* Modal Backdrops & Cards */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background-color: rgba(15, 23, 42, 0.85);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 60;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.modal-backdrop.hidden {
  display: none;
}

.modal-card {
  animation: modalPop 0.25s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.7);
}

@keyframes modalPop {
  0% {
    opacity: 0;
    transform: scale(0.92) translateY(12px);
  }
  100% {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

/* Animations for Overlays & Cards */
.animate-slide-up {
  animation: slideUp 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes slideUp {
  0% {
    opacity: 0;
    transform: translateY(24px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

.animate-fade-in {
  animation: fadeIn 0.2s ease-out forwards;
}

@keyframes fadeIn {
  0% {
    opacity: 0;
    transform: scale(0.96);
  }
  100% {
    opacity: 1;
    transform: scale(1);
  }
}

.animate-shake {
  animation: shake 0.45s cubic-bezier(0.36, 0.07, 0.19, 0.97) both;
}

@keyframes shake {
  10%, 90% {
    transform: translate3d(-3px, 0, 0);
  }
  20%, 80% {
    transform: translate3d(5px, 0, 0);
  }
  30%, 50%, 70% {
    transform: translate3d(-6px, 0, 0);
  }
  40%, 60% {
    transform: translate3d(6px, 0, 0);
  }
}

/* Active touch feedback */
button:active {
  transform: scale(0.97);
}

/* Badge styling */
.badge-status {
  display: inline-flex;
  align-items: center;
  padding: 0.15rem 0.5rem;
  border-radius: 9999px;
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.badge-issued {
  background-color: rgba(59, 130, 246, 0.15);
  color: #93c5fd;
  border: 1px solid rgba(59, 130, 246, 0.3);
}

.badge-checked-in {
  background-color: rgba(16, 185, 129, 0.15);
  color: #6ee7b7;
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.badge-revoked {
  background-color: rgba(239, 68, 68, 0.15);
  color: #fca5a5;
  border: 1px solid rgba(239, 68, 68, 0.3);
}
