/**
 * AFASASLAK?! (أَفَصَّصْلَك?!) - Motion & Spatial Transitions
 * Scrollytelling, 3D Card Tilts, Optical Scan-lines & SVG Sweeps
 */

/* ==========================================================================
   SCROLL-DRIVEN OPTICAL DISSECTION LENS (INDEX.HTML)
   ========================================================================== */
.lens-viewport {
  position: relative;
  width: 100%;
  height: 100vh;
  perspective: 1200px;
  perspective-origin: 50% 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.lens-stage {
  position: relative;
  width: 900px;
  max-width: 92vw;
  height: 560px;
  transform-style: preserve-3d;
  will-change: transform;
}

.lens-layer {
  position: absolute;
  inset: 0;
  border-radius: var(--radius-xl);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.2s ease-out;
  backface-visibility: hidden;
  pointer-events: none;
}

/* Layer 1: Student Handwritten Algebra */
.lens-layer-1 {
  background: var(--surface-card);
  border: 1px solid var(--surface-card-border);
  box-shadow: var(--shadow-lg);
  transform: translateZ(0px);
  z-index: 10;
  padding: 40px;
}

/* Layer 2: Glowing Emerald Marks & Method Badges */
.lens-layer-2 {
  transform: translateZ(120px);
  z-index: 20;
}

/* Layer 3: Floating Gold Examiner Directive Card */
.lens-layer-3 {
  transform: translateZ(240px);
  z-index: 30;
}

/* Magnetic Dropzone Optical Laser Scan (UPLOAD.HTML) */
.dropzone-container {
  position: relative;
  overflow: hidden;
  border: 2px dashed var(--surface-card-border);
  border-radius: var(--radius-xl);
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  background: var(--bg-primary);
}

.dropzone-container.drag-over {
  border-color: var(--emerald-mortarboard);
  background: var(--emerald-correct-bg);
  transform: scale(1.015);
  box-shadow: var(--shadow-glow);
}

.laser-scan-line {
  position: absolute;
  top: -10px;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, transparent, var(--emerald-mortarboard), var(--gold-accent), transparent);
  box-shadow: 0 0 15px var(--emerald-mortarboard), 0 0 30px var(--gold-accent);
  opacity: 0;
  pointer-events: none;
}

.dropzone-container.scanning .laser-scan-line {
  opacity: 1;
  animation: laserScan 2.2s cubic-bezier(0.4, 0, 0.2, 1) infinite;
}

@keyframes laserScan {
  0% {
    top: 0%;
    opacity: 0.2;
  }
  50% {
    opacity: 1;
  }
  100% {
    top: 98%;
    opacity: 0.2;
  }
}

/* Animated SVG Circular Score Ring (RESULTS.HTML) */
.score-ring-circle {
  transition: stroke-dashoffset 1.8s cubic-bezier(0.16, 1, 0.3, 1);
  stroke-linecap: round;
}

/* Keyframe Micro-Interactions */
@keyframes pulseGlow {
  0%, 100% {
    box-shadow: 0 0 15px var(--emerald-correct-border);
  }
  50% {
    box-shadow: 0 0 30px var(--emerald-mortarboard);
  }
}

@keyframes floatElement {
  0%, 100% {
    transform: translateY(0px);
  }
  50% {
    transform: translateY(-8px);
  }
}

.animate-float {
  animation: none !important;
  transform: none !important;
}

.animate-pulse-glow {
  animation: none !important;
  transform: none !important;
}

/* Shimmer Loading State */
@keyframes shimmer {
  0% {
    background-position: -200% 0;
  }
  100% {
    background-position: 200% 0;
  }
}

.skeleton-shimmer {
  background: linear-gradient(90deg, var(--bg-secondary) 25%, var(--surface-card) 50%, var(--bg-secondary) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.6s infinite;
}
