/* QR Page Specific Styles */

.phone-device {
  position: absolute;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  width: 240px;
  height: 420px;
  background: linear-gradient(135deg, #0ea5e9, #22c55e);
  border-radius: 36px;
  box-shadow: 0 20px 40px rgba(15, 23, 42, 0.9);
  transform-origin: center;
  z-index: 5;
  padding: 20px;
  overflow: hidden;
  transition: all 0.5s ease;
}

.phone-device::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 40%;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.2), rgba(255, 255, 255, 0.05));
  border-radius: 28px 28px 0 0;
}

/* Phone states for animation sequence */
.phone-device.state-scanning {
  animation: phone-scanning 2s ease-in-out;
}

.phone-device.state-hacked {
  animation: phone-hacked-final 4s ease-in-out;
  filter: hue-rotate(0deg) brightness(0.7);
}

/* Phone notch */
.phone-notch {
  position: absolute;
  top: 10px;
  left: 50%;
  transform: translateX(-50%);
  width: 100px;
  height: 6px;
  background: rgba(15, 23, 42, 0.4);
  border-radius: 4px;
}

/* Phone screen content */
.phone-screen {
  position: absolute;
  top: 24px;
  left: 10px;
  right: 10px;
  bottom: 10px;
  background: rgba(15, 23, 42, 0.1);
  border-radius: 24px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  overflow: hidden;
}

/* Camera view */
.camera-view {
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, #1e293b, #0f172a);
  border-radius: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.camera-overlay {
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.scan-frame {
  width: 200px;
  height: 200px;
  border: 3px solid rgba(34, 197, 94, 0.8);
  border-radius: 12px;
  box-shadow: 
    0 0 20px rgba(34, 197, 94, 0.6),
    inset 0 0 20px rgba(34, 197, 94, 0.2);
  position: relative;
  animation: scan-frame-pulse 2s ease-in-out infinite;
}

.scan-frame::before,
.scan-frame::after {
  content: "";
  position: absolute;
  width: 20px;
  height: 20px;
  border: 3px solid rgba(34, 197, 94, 1);
}

.scan-frame::before {
  top: -3px;
  left: -3px;
  border-right: none;
  border-bottom: none;
  border-top-left-radius: 8px;
}

.scan-frame::after {
  bottom: -3px;
  right: -3px;
  border-left: none;
  border-top: none;
  border-bottom-right-radius: 8px;
}

.scan-line {
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(
    to right,
    transparent,
    rgba(34, 197, 94, 0.8),
    rgba(34, 197, 94, 1),
    rgba(34, 197, 94, 0.8),
    transparent
  );
  box-shadow: 0 0 10px rgba(34, 197, 94, 0.8);
  transform: translateY(-50%);
  opacity: 0;
}

/* QR Code display */
.qr-code-display {
  position: absolute;
  inset: 0;
  background: #ffffff;
  border-radius: 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 20px;
  animation: qr-appear 0.5s ease-in;
}

.qr-code-grid {
  display: grid;
  grid-template-columns: repeat(15, 1fr);
  gap: 2px;
  width: 200px;
  height: 200px;
  background: #ffffff;
  border: 2px solid #000000;
  padding: 10px;
  border-radius: 8px;
}

.qr-cell {
  aspect-ratio: 1;
  background: #ffffff;
  border-radius: 1px;
  transition: background 0.1s ease;
}

.qr-cell-filled {
  background: #000000;
}

.qr-code-text {
  font-size: 0.75rem;
  color: #323130;
  font-weight: 600;
  text-align: center;
  animation: qr-text-pulse 1.5s ease-in-out infinite;
}

/* Hacked state visuals */
.phone-device.hacked .phone-screen,
.phone-screen.hacked {
  background: rgba(239, 68, 68, 0.2);
  border: 2px solid rgba(239, 68, 68, 0.6);
}

.phone-screen.hacked::before {
  content: "⚠";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 4rem;
  color: rgba(239, 68, 68, 0.8);
  animation: hack-warning 1s ease-in-out infinite;
  z-index: 10;
}

.phone-screen.hacked::after {
  content: "HACKED";
  position: absolute;
  top: 60%;
  left: 50%;
  transform: translateX(-50%);
  font-size: 1.2rem;
  font-weight: 700;
  color: #ef4444;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  z-index: 10;
  animation: hack-text 1s ease-in-out infinite;
}

.hack-particles {
  position: absolute;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 9;
}

.hack-particle {
  position: absolute;
  width: 4px;
  height: 4px;
  background: #ef4444;
  border-radius: 50%;
  animation: particle-float 2s ease-out infinite;
}

/* Animations */
@keyframes phone-scanning {
  0% {
    transform: translateX(-50%) scale(1);
  }
  50% {
    transform: translateX(-50%) scale(1.05);
  }
  100% {
    transform: translateX(-50%) scale(1);
  }
}

@keyframes phone-hacked-final {
  0% {
    filter: brightness(1) hue-rotate(0deg);
  }
  50% {
    filter: brightness(0.7) hue-rotate(15deg);
  }
  100% {
    filter: brightness(0.6) hue-rotate(30deg);
  }
}

@keyframes scan-frame-pulse {
  0%, 100% {
    box-shadow: 
      0 0 20px rgba(34, 197, 94, 0.6),
      inset 0 0 20px rgba(34, 197, 94, 0.2);
  }
  50% {
    box-shadow: 
      0 0 30px rgba(34, 197, 94, 0.9),
      inset 0 0 30px rgba(34, 197, 94, 0.4);
  }
}

@keyframes scan-line-move {
  0% {
    top: 20%;
    opacity: 0;
  }
  10% {
    opacity: 1;
  }
  90% {
    opacity: 1;
  }
  100% {
    top: 80%;
    opacity: 0;
  }
}

@keyframes qr-appear {
  0% {
    opacity: 0;
    transform: scale(0.9);
  }
  100% {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes qr-text-pulse {
  0%, 100% {
    opacity: 0.7;
  }
  50% {
    opacity: 1;
  }
}

@keyframes hack-warning {
  0%, 100% {
    transform: translate(-50%, -50%) scale(1) rotate(0deg);
    opacity: 0.8;
  }
  50% {
    transform: translate(-50%, -50%) scale(1.2) rotate(10deg);
    opacity: 1;
  }
}

@keyframes hack-text {
  0%, 100% {
    opacity: 0.8;
    transform: translateX(-50%) scale(1);
  }
  50% {
    opacity: 1;
    transform: translateX(-50%) scale(1.05);
  }
}

@keyframes particle-float {
  0% {
    opacity: 1;
    transform: translateY(0) translateX(0);
  }
  100% {
    opacity: 0;
    transform: translateY(-100px) translateX(var(--particle-x, 0));
  }
}

/* Desktop improvements */
@media (min-width: 1200px) {
  .phone-device {
    width: 260px;
    height: 440px;
  }
  
  .scan-frame {
    width: 220px;
    height: 220px;
  }
  
  .qr-code-grid {
    width: 220px;
    height: 220px;
  }
}

/* Mobile Responsive */
@media (max-width: 900px) {
  .art-inner.qr-art {
    min-height: 400px;
    height: 400px;
    max-width: 280px;
  }
  
  .phone-device {
    width: 220px;
    height: 380px;
  }
  
  .scan-frame {
    width: 180px;
    height: 180px;
  }
  
  .qr-code-grid {
    width: 180px;
    height: 180px;
  }
}

@media (max-width: 700px) {
  .art-inner.qr-art {
    min-height: 380px;
    height: 380px;
    max-width: 260px;
  }
  
  .phone-device {
    width: 200px;
    height: 340px;
  }
  
  .scan-frame {
    width: 160px;
    height: 160px;
  }
  
  .qr-code-grid {
    width: 160px;
    height: 160px;
  }
}
