/* QR Scanner Overlay Styles */

#qr-scanner-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.95);
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.2s ease-in-out;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.qr-scanner__container {
  width: 100%;
  max-width: 600px;
  height: 100%;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  background: #1a1a1a;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
}

.qr-scanner__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  background: #2a2a2a;
  border-bottom: 1px solid #3a3a3a;
}

.qr-scanner__title {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
  color: #fff;
}

.qr-scanner__close {
  background: none;
  border: none;
  color: #fff;
  font-size: 32px;
  line-height: 1;
  cursor: pointer;
  padding: 0;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  transition: background 0.2s;
}

.qr-scanner__close:hover {
  background: rgba(255, 255, 255, 0.1);
}

.qr-scanner__video-container {
  position: relative;
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #000;
  overflow: hidden;
}

#qr-scanner-video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.qr-scanner__viewfinder {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 280px;
  height: 280px;
  pointer-events: none;
}

.qr-scanner__corner {
  position: absolute;
  width: 40px;
  height: 40px;
  border: 3px solid #4CAF50;
}

.qr-scanner__corner--tl {
  top: 0;
  left: 0;
  border-right: none;
  border-bottom: none;
  border-top-left-radius: 8px;
}

.qr-scanner__corner--tr {
  top: 0;
  right: 0;
  border-left: none;
  border-bottom: none;
  border-top-right-radius: 8px;
}

.qr-scanner__corner--bl {
  bottom: 0;
  left: 0;
  border-right: none;
  border-top: none;
  border-bottom-left-radius: 8px;
}

.qr-scanner__corner--br {
  bottom: 0;
  right: 0;
  border-left: none;
  border-top: none;
  border-bottom-right-radius: 8px;
}

/* Animated scanning line */
.qr-scanner__viewfinder::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, #4CAF50, transparent);
  animation: scan 2s linear infinite;
}

@keyframes scan {
  0% {
    transform: translateY(0);
  }
  100% {
    transform: translateY(280px);
  }
}

.qr-scanner__status {
  padding: 16px 20px;
  background: #2a2a2a;
  border-top: 1px solid #3a3a3a;
  text-align: center;
  color: #ccc;
  font-size: 14px;
}

.qr-scanner__error {
  padding: 16px 20px;
  background: rgba(239, 68, 68, 0.15);
  border-top: 1px solid rgba(239, 68, 68, 0.35);
  text-align: center;
  color: #ff6b6b;
  font-size: 14px;
  font-weight: 600;
  animation: slideDown 0.3s ease-out;
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.qr-scanner__result {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.95);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: slideUp 0.3s ease-out;
}

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

.qr-scanner__result-content {
  background: #2a2a2a;
  border-radius: 12px;
  padding: 24px;
  max-width: 400px;
  width: 100%;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.qr-scanner__result-content h3 {
  margin: 0 0 20px 0;
  color: #4CAF50;
  font-size: 20px;
  text-align: center;
}

#qr-result-details {
  margin-bottom: 24px;
}

.qr-result-field {
  display: flex;
  justify-content: space-between;
  padding: 10px 0;
  border-bottom: 1px solid #3a3a3a;
  color: #fff;
}

.qr-result-field:last-child {
  border-bottom: none;
}

.qr-result-field__label {
  font-weight: 600;
  color: #aaa;
}

.qr-result-field__value {
  color: #fff;
  font-weight: 500;
}

.qr-scanner__actions {
  display: flex;
  gap: 12px;
}

.qr-scanner__btn {
  flex: 1;
  padding: 12px 20px;
  border: none;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.qr-scanner__btn--primary {
  background: #4CAF50;
  color: white;
}

.qr-scanner__btn--primary:hover {
  background: #45a049;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(76, 175, 80, 0.3);
}

.qr-scanner__btn--secondary {
  background: #555;
  color: white;
}

.qr-scanner__btn--secondary:hover {
  background: #666;
}

.qr-scanner__btn--success {
  background: #28a745;
  color: white;
}

.qr-scanner__btn--success:hover {
  background: #218838;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(40, 167, 69, 0.3);
}

/* Mobile responsive */
@media (max-width: 768px) {
  .qr-scanner__container {
    max-width: 100%;
    max-height: 100vh;
    border-radius: 0;
  }

  .qr-scanner__viewfinder {
    width: 240px;
    height: 240px;
  }

  .qr-scanner__corner {
    width: 30px;
    height: 30px;
  }

  @keyframes scan {
    0% {
      transform: translateY(0);
    }
    100% {
      transform: translateY(240px);
    }
  }
}

/* Floating Action Button (FAB) */
.qr-fab {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  border: none;
  background: linear-gradient(135deg, #4CAF50, #45a049);
  color: white;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 20px rgba(76, 175, 80, 0.4), 0 8px 40px rgba(0, 0, 0, 0.3);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 9999;
  animation: fabPulse 2s ease-in-out infinite;
}

.qr-fab:hover {
  transform: scale(1.1) translateY(-2px);
  box-shadow: 0 8px 30px rgba(76, 175, 80, 0.6), 0 12px 50px rgba(0, 0, 0, 0.4);
  animation: none;
}

.qr-fab:active {
  transform: scale(1.05);
}

.qr-fab svg {
  display: block;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
}

/* Pulse animation */
@keyframes fabPulse {
  0%, 100% {
    box-shadow: 0 4px 20px rgba(76, 175, 80, 0.4), 0 8px 40px rgba(0, 0, 0, 0.3);
  }
  50% {
    box-shadow: 0 4px 20px rgba(76, 175, 80, 0.6), 0 8px 40px rgba(0, 0, 0, 0.3), 0 0 0 8px rgba(76, 175, 80, 0.2);
  }
}

/* Mobile adjustments */
@media (max-width: 768px) {
  .qr-fab {
    width: 56px;
    height: 56px;
    bottom: 20px;
    right: 20px;
  }

  .qr-fab svg {
    width: 24px;
    height: 24px;
  }
}
