/* ==========================================================================
   SOMATIC MIRROR — ANIMATIONS & MICRO-INTERACTIONS
   ========================================================================== */

/* Fade & Slide Transitions */
.view-panel {
  display: none;
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0.35s ease, transform 0.35s ease;
}

.view-panel.active {
  display: block;
  opacity: 1;
  transform: translateY(0);
}

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

@keyframes pulseGlow {
  0% {
    transform: scale(0.98);
    opacity: 0.8;
  }
  50% {
    transform: scale(1.03);
    opacity: 1;
  }
  100% {
    transform: scale(0.98);
    opacity: 0.8;
  }
}

@keyframes radarScan {
  0% {
    top: 0%;
    opacity: 0;
  }
  15% {
    opacity: 1;
  }
  85% {
    opacity: 1;
  }
  100% {
    top: 100%;
    opacity: 0;
  }
}

.scan-bar {
  position: absolute;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--accent-cyan), var(--accent-blue), transparent);
  box-shadow: 0 0 16px var(--accent-cyan);
  animation: radarScan 2.6s cubic-bezier(0.4, 0, 0.2, 1) infinite;
  z-index: 3;
  pointer-events: none;
}

/* Reticle targeting animation */
.camera-reticle {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 220px;
  height: 280px;
  border-radius: 50% 50% 45% 45%;
  border: 2px dashed rgba(255, 255, 255, 0.2);
  pointer-events: none;
  z-index: 2;
  transition: border-color 0.4s ease;
}

.camera-reticle.locked {
  border-color: rgba(16, 185, 129, 0.6);
  box-shadow: 0 0 25px rgba(16, 185, 129, 0.2);
}

/* Pulsing Status Dot */
.pulse-indicator {
  position: relative;
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.pulse-indicator::after {
  content: '';
  position: absolute;
  inset: -3px;
  border-radius: 50%;
  background: inherit;
  opacity: 0.6;
  animation: pulseDot 2s infinite ease-out;
}

@keyframes pulseDot {
  0% {
    transform: scale(1);
    opacity: 0.8;
  }
  100% {
    transform: scale(2.4);
    opacity: 0;
  }
}

/* Dynamic Breathing Sphere Transitions */
.breath-sphere.inhale {
  transform: scale(1.5);
  box-shadow: 0 0 50px rgba(56, 189, 248, 0.7);
}

.breath-sphere.hold {
  transform: scale(1.5);
  box-shadow: 0 0 45px rgba(99, 102, 241, 0.7);
}

.breath-sphere.exhale {
  transform: scale(0.9);
  box-shadow: 0 0 20px rgba(59, 130, 246, 0.3);
}

.breath-sphere.rest {
  transform: scale(0.9);
  box-shadow: 0 0 15px rgba(148, 163, 184, 0.2);
}

/* Accessibility: Reduced Motion Support */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
  
  .scan-bar {
    display: none;
  }
}
