/**
 * ═══════════════════════════════════════════════════════════
 * POUYAB CAL - PREMIUM UI EFFECTS STYLES
 * Industrial High-Tech Micro-interactions CSS
 * ═══════════════════════════════════════════════════════════
 */

/* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
   1. LASER SCANNER EFFECT
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */
.laser-scanner-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.95);
  backdrop-filter: blur(10px);
  animation: fadeIn 0.3s ease;
}

.scanner-box {
  position: relative;
  width: min(90%, 500px);
  height: 400px;
  border: 2px solid rgba(31, 138, 134, 0.3);
  border-radius: 1rem;
  background: 
    linear-gradient(180deg, rgba(31, 138, 134, 0.05), transparent),
    rgba(10, 20, 30, 0.8);
  overflow: hidden;
  box-shadow: 
    0 0 40px rgba(31, 138, 134, 0.3),
    inset 0 0 60px rgba(31, 138, 134, 0.1);
}

.scanner-grid {
  position: absolute;
  inset: 0;
  background-image: 
    linear-gradient(rgba(31, 138, 134, 0.1) 1px, transparent 1px),
    linear-gradient(90deg, rgba(31, 138, 134, 0.1) 1px, transparent 1px);
  background-size: 20px 20px;
  opacity: 0.3;
}

.laser-beam {
  position: absolute;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, 
    transparent,
    rgba(31, 138, 134, 0.3),
    rgba(31, 138, 134, 1),
    rgba(31, 138, 134, 0.3),
    transparent
  );
  box-shadow: 
    0 0 20px rgba(31, 138, 134, 0.8),
    0 0 40px rgba(31, 138, 134, 0.5);
  animation: laserScan 2s ease-in-out infinite;
}

@keyframes laserScan {
  0%, 100% { top: 10%; opacity: 1; }
  50% { top: 90%; opacity: 0.6; }
}

.scanner-stats {
  position: absolute;
  top: 2rem;
  left: 2rem;
  right: 2rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  font-family: 'Courier New', monospace;
}

.stat-line {
  display: flex;
  justify-content: space-between;
  padding: 0.75rem 1rem;
  background: rgba(31, 138, 134, 0.1);
  border: 1px solid rgba(31, 138, 134, 0.3);
  border-radius: 0.5rem;
  backdrop-filter: blur(10px);
}

.stat-label {
  color: rgba(27, 42, 38, 0.6);
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.stat-value {
  color: #1f8a86;
  font-size: 1rem;
  font-weight: 700;
  text-shadow: 0 0 10px rgba(31, 138, 134, 0.5);
}

.scanner-message {
  position: absolute;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%);
  color: #2fa37c;
  font-size: 0.9rem;
  font-weight: 600;
  text-align: center;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  transition: opacity 0.3s ease;
  text-shadow: 0 0 15px rgba(126, 240, 197, 0.6);
}

/* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
   2. ODOMETER EFFECT (handled in JS, but styling)
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */
.odometer-value {
  font-family: 'Courier New', monospace;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.05em;
}

/* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
   3. PROGRESS RING
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */
.progress-ring {
  position: relative;
  width: 120px;
  height: 120px;
}

.progress-ring svg {
  transform: rotate(-90deg);
  width: 100%;
  height: 100%;
}

.progress-ring-circle {
  fill: none;
  stroke: #2fa37c;
  stroke-width: 8;
  stroke-linecap: round;
  transition: stroke-dashoffset 0.6s cubic-bezier(0.4, 0, 0.2, 1);
  filter: drop-shadow(0 0 8px rgba(126, 240, 197, 0.6));
}

.progress-ring-bg {
  fill: none;
  stroke: rgba(255, 255, 255, 0.1);
  stroke-width: 8;
}

.progress-ring-text {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 1.5rem;
  font-weight: 700;
  color: #2fa37c;
  text-shadow: 0 0 15px rgba(126, 240, 197, 0.6);
}

/* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
   4. CRUNCHY BUTTONS (Industrial Feel)
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */
.btn-industrial {
  position: relative;
  padding: 1rem 2rem;
  border: none;
  border-radius: 0.75rem;
  background: linear-gradient(180deg, #1f8a86, #14624b);
  color: #ffffff;
  font-size: 1rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  cursor: pointer;
  transition: all 0.15s ease;
  box-shadow: 
    0 6px 0 #1e3a8a,
    0 10px 25px rgba(0, 0, 0, 0.4),
    inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.btn-industrial::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 0.75rem;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.2), transparent);
  pointer-events: none;
}

.btn-industrial:hover {
  transform: translateY(2px);
  box-shadow: 
    0 4px 0 #1e3a8a,
    0 8px 20px rgba(0, 0, 0, 0.4),
    inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.btn-industrial:active {
  transform: translateY(6px);
  box-shadow: 
    0 0px 0 #1e3a8a,
    0 2px 8px rgba(0, 0, 0, 0.4),
    inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.btn-industrial:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

/* Success variant */
.btn-industrial.success {
  background: linear-gradient(180deg, #1f8463, #14624b);
  box-shadow: 
    0 6px 0 #065f46,
    0 10px 25px rgba(0, 0, 0, 0.4),
    inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.btn-industrial.success:hover {
  box-shadow: 
    0 4px 0 #065f46,
    0 8px 20px rgba(0, 0, 0, 0.4);
}

.btn-industrial.success:active {
  box-shadow: 
    0 0px 0 #065f46,
    0 2px 8px rgba(0, 0, 0, 0.4);
}

/* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
   5. SUCCESS CHECKMARK ANIMATION
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */
.success-checkmark {
  width: 80px;
  height: 80px;
  margin: 0 auto;
}

.success-checkmark-circle {
  stroke: #1f8463;
  stroke-width: 3;
  stroke-dasharray: 166;
  stroke-dashoffset: 166;
  animation: none;
}

.success-checkmark-check {
  stroke: #1f8463;
  stroke-width: 3;
  stroke-linecap: round;
  stroke-dasharray: 48;
  stroke-dashoffset: 48;
  animation: none;
}

.success-checkmark.animate .success-checkmark-circle {
  animation: checkmarkCircle 0.6s cubic-bezier(0.65, 0, 0.45, 1) forwards;
}

.success-checkmark.animate .success-checkmark-check {
  animation: checkmarkCheck 0.3s 0.4s cubic-bezier(0.65, 0, 0.45, 1) forwards;
}

@keyframes checkmarkCircle {
  to {
    stroke-dashoffset: 0;
  }
}

@keyframes checkmarkCheck {
  to {
    stroke-dashoffset: 0;
  }
}

/* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
   6. PARTICLE BURST
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */
.particle {
  position: absolute;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: linear-gradient(135deg, #2fa37c, #1f8a86);
  pointer-events: none;
  animation: particleBurst 1s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
  box-shadow: 0 0 10px rgba(126, 240, 197, 0.8);
}

@keyframes particleBurst {
  0% {
    transform: translate(0, 0) scale(1);
    opacity: 1;
  }
  100% {
    transform: translate(var(--tx), var(--ty)) scale(0);
    opacity: 0;
  }
}

/* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
   7. RIPPLE EFFECT
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */
.ripple-effect {
  position: absolute;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.5);
  transform: scale(0);
  animation: ripple 0.6s ease-out;
  pointer-events: none;
}

@keyframes ripple {
  to {
    transform: scale(4);
    opacity: 0;
  }
}

/* Add to buttons that need ripple */
.btn-industrial,
.btn-primary,
[data-ripple] {
  position: relative;
  overflow: hidden;
}

/* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
   8. MAGNETIC HOVER
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */
[data-magnetic] {
  transition: transform 0.2s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  will-change: transform;
}

/* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
   9. BREATHING GLOW
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */
.breathing-glow {
  animation: breathingGlow 2s ease-in-out infinite;
}

@keyframes breathingGlow {
  0%, 100% {
    box-shadow: 
      0 0 20px rgba(126, 240, 197, 0.4),
      0 0 40px rgba(126, 240, 197, 0.2),
      inset 0 0 20px rgba(126, 240, 197, 0.1);
  }
  50% {
    box-shadow: 
      0 0 30px rgba(126, 240, 197, 0.6),
      0 0 60px rgba(126, 240, 197, 0.3),
      inset 0 0 30px rgba(126, 240, 197, 0.15);
  }
}

/* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
   10. GLITCH EFFECT
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */
.glitch-text {
  position: relative;
  font-family: 'Courier New', monospace;
  font-weight: 700;
}

.glitch-text::before,
.glitch-text::after {
  content: attr(data-text);
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

.glitch-text::before {
  left: 2px;
  text-shadow: -2px 0 #ff00de;
  clip: rect(24px, 550px, 90px, 0);
  animation: glitch-anim-1 2s infinite linear alternate-reverse;
}

.glitch-text::after {
  left: -2px;
  text-shadow: -2px 0 #00fff9;
  clip: rect(85px, 550px, 140px, 0);
  animation: glitch-anim-2 2s infinite linear alternate-reverse;
}

@keyframes glitch-anim-1 {
  0% { clip: rect(61px, 9999px, 85px, 0); }
  20% { clip: rect(45px, 9999px, 23px, 0); }
  40% { clip: rect(12px, 9999px, 98px, 0); }
  60% { clip: rect(77px, 9999px, 34px, 0); }
  80% { clip: rect(23px, 9999px, 67px, 0); }
  100% { clip: rect(89px, 9999px, 12px, 0); }
}

@keyframes glitch-anim-2 {
  0% { clip: rect(12px, 9999px, 78px, 0); }
  20% { clip: rect(89px, 9999px, 34px, 0); }
  40% { clip: rect(45px, 9999px, 91px, 0); }
  60% { clip: rect(23px, 9999px, 56px, 0); }
  80% { clip: rect(67px, 9999px, 12px, 0); }
  100% { clip: rect(34px, 9999px, 89px, 0); }
}

/* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
   UTILITY ANIMATIONS
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

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

@keyframes scaleIn {
  from {
    opacity: 0;
    transform: scale(0.8);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

/* Pulse animation for loading states */
@keyframes pulse {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.5;
  }
}

.pulse {
  animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

/* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
   RESPONSIVE ADJUSTMENTS
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */
@media (max-width: 768px) {
  .scanner-box {
    height: 300px;
  }
  
  .scanner-stats {
    top: 1rem;
    left: 1rem;
    right: 1rem;
    gap: 0.5rem;
  }
  
  .stat-line {
    padding: 0.5rem 0.75rem;
  }
  
  .btn-industrial {
    padding: 0.75rem 1.5rem;
    font-size: 0.9rem;
  }
  
  .progress-ring {
    width: 100px;
    height: 100px;
  }
  
  .success-checkmark {
    width: 60px;
    height: 60px;
  }
}

/* Reduce motion for accessibility */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
