/* ============================================================
   UNFOLD V5 — Motore delle 10 Transizioni Esclusive (0.8s)
   ============================================================ */

.transition-tester-panel {
  margin: 28px auto 0;
  max-width: 580px;
  background: rgba(14, 28, 21, 0.88);
  border: 1px solid var(--color-border);
  border-radius: 12px;
  padding: 16px 20px;
  backdrop-filter: blur(12px);
  text-align: center;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
}

.tester-label {
  display: block;
  font-size: 0.72rem;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--color-gold);
  margin-bottom: 12px;
  font-weight: 500;
}

.tester-buttons-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
}

.test-pill-btn {
  background: rgba(20, 40, 30, 0.9);
  border: 1px solid rgba(197, 160, 89, 0.3);
  color: var(--color-cream);
  font-family: 'DM Sans', sans-serif;
  font-size: 0.72rem;
  letter-spacing: 0.8px;
  padding: 6px 12px;
  border-radius: 20px;
  cursor: pointer;
  transition: all 0.25s ease;
}

.test-pill-btn:hover {
  border-color: var(--color-gold);
  background: rgba(30, 60, 45, 0.9);
}

.test-pill-btn.active {
  background: var(--color-gold);
  color: #0E1C15;
  font-weight: 600;
  box-shadow: 0 0 12px rgba(197, 160, 89, 0.45);
}

.tester-hint {
  margin-top: 10px;
  font-size: 0.72rem;
  color: var(--color-muted);
  font-style: italic;
}

.transition-stage-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 5;
  opacity: 0;
  overflow: hidden;
  transition: opacity 0.35s ease;
}

.transition-stage-overlay.active {
  opacity: 1;
}

.trans-element-layer {
  position: absolute;
  width: 100%;
  height: 100%;
  top: 0;
  left: 0;
}

/* 1. DISSOLVENZA CON SFOCATURA (Blur Fade) */
.trans-mode-blur-fade.active .portal-video {
  filter: blur(28px) brightness(1.25);
  opacity: 0.1;
  transition: filter 0.8s ease, opacity 0.8s ease;
}
.trans-mode-blur-fade.active .trans-element-layer {
  background: radial-gradient(circle, rgba(242, 227, 198, 0.4) 0%, rgba(14, 28, 21, 0.95) 80%);
  animation: blurAtmosphere 0.8s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}
@keyframes blurAtmosphere {
  0% { opacity: 0; transform: scale(0.9); }
  50% { opacity: 1; transform: scale(1.05); }
  100% { opacity: 0.95; transform: scale(1); }
}

/* 2. DISSOLVENZA INCROCIATA (Luxury Crossfade) */
.trans-mode-crossfade.active .portal-video {
  opacity: 0;
  transition: opacity 0.8s cubic-bezier(0.25, 1, 0.5, 1);
}
.trans-mode-crossfade.active .trans-element-layer {
  background: #0E1C15;
  animation: crossfadeDark 0.8s ease forwards;
}
@keyframes crossfadeDark {
  0% { opacity: 0; }
  100% { opacity: 1; }
}

/* 3. STRIATURE LIQUIDE (Liquid Streaks) */
.trans-mode-liquid-streaks.active .portal-video {
  filter: blur(10px);
  opacity: 0.2;
}
.trans-mode-liquid-streaks.active .trans-element-layer {
  background: linear-gradient(180deg, transparent 0%, rgba(242, 227, 198, 0.6) 50%, transparent 100%);
  animation: liquidSlide 0.8s cubic-bezier(0.25, 1, 0.5, 1) forwards;
}
@keyframes liquidSlide {
  0% { transform: translateY(-100%) scaleY(1.5); opacity: 0; }
  50% { opacity: 0.95; }
  100% { transform: translateY(100%) scaleY(1.8); opacity: 0; }
}

/* 4. GOCCE LIQUIDE & RIPPLE (Droplet Splash) */
.trans-mode-droplet-splash.active .trans-element-layer {
  border-radius: 50%;
  box-shadow: inset 0 0 40px rgba(197, 160, 89, 0.7);
  background: radial-gradient(circle, rgba(255, 248, 231, 0.85) 0%, rgba(14, 28, 21, 0.9) 70%);
  animation: dropletRipple 0.8s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}
@keyframes dropletRipple {
  0% { transform: scale(0.1); opacity: 0; }
  40% { opacity: 1; }
  100% { transform: scale(2.8); opacity: 0.95; }
}

/* 5. VIDEO REVEAL CIRCOLARE (Iris Reveal) */
.trans-mode-iris-reveal.active .portal-video {
  clip-path: circle(0% at 50% 50%);
  transition: clip-path 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}
.trans-mode-iris-reveal.active .trans-element-layer {
  border: 3px solid var(--color-gold-light);
  border-radius: 50%;
  animation: irisRing 0.8s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}
@keyframes irisRing {
  0% { transform: scale(0.1); opacity: 0; }
  50% { opacity: 1; border-color: #FFF8E7; }
  100% { transform: scale(3); opacity: 0; }
}

/* 6. FASCIO DI LUCE VOLUMETRICO (Light Beam 0.8s) */
.trans-mode-light-beam.active .trans-element-layer {
  background: linear-gradient(115deg, transparent 20%, rgba(242, 227, 198, 0.85) 50%, transparent 80%);
  filter: blur(14px);
  animation: beamFlash 0.8s cubic-bezier(0.2, 0.9, 0.3, 1) forwards;
}
@keyframes beamFlash {
  0% { transform: translateX(-120%) rotate(25deg); opacity: 0; }
  50% { opacity: 1; }
  100% { transform: translateX(120%) rotate(25deg); opacity: 0.8; }
}

/* 7. ONDA CIMATICA DORATA (Cymatic Harmonic) */
.trans-mode-cymatic.active .trans-element-layer {
  background: radial-gradient(circle, transparent 35%, rgba(197, 160, 89, 0.7) 40%, transparent 45%, rgba(242, 227, 198, 0.5) 60%, transparent 65%);
  animation: cymaticPulse 0.8s cubic-bezier(0.25, 1, 0.5, 1) forwards;
}
@keyframes cymaticPulse {
  0% { transform: scale(0.2) rotate(0deg); opacity: 0; }
  50% { opacity: 1; }
  100% { transform: scale(2.6) rotate(60deg); opacity: 0.9; }
}

/* 8. RESPIRO SOMATICO (Inhale / Exhale Expansion) */
.trans-mode-somatic-breath.active .portal-video {
  animation: breathPump 0.8s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}
@keyframes breathPump {
  0% { transform: scale(1); filter: brightness(1); }
  35% { transform: scale(0.93); filter: brightness(0.8); }
  100% { transform: scale(1.18); filter: brightness(1.7) blur(18px); opacity: 0.2; }
}

/* 9. VELO PRISMATICO OLOGRAFICO (Prismatic Veil) */
.trans-mode-prismatic-veil.active .trans-element-layer {
  background: linear-gradient(135deg, rgba(197, 160, 89, 0.4) 0%, rgba(242, 227, 198, 0.85) 50%, rgba(46, 92, 70, 0.4) 100%);
  filter: blur(16px);
  animation: prismSweep 0.8s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}
@keyframes prismSweep {
  0% { transform: scale(0.4) rotate(-30deg); opacity: 0; }
  50% { opacity: 1; }
  100% { transform: scale(2.2) rotate(15deg); opacity: 0.9; }
}

/* 10. DIAFRAMMA MORBIDO (Soft Vignette) */
.trans-mode-soft-vignette.active .portal-video {
  animation: vignetteIris 0.8s cubic-bezier(0.25, 1, 0.5, 1) forwards;
}
@keyframes vignetteIris {
  0% { filter: contrast(100%); }
  45% { filter: brightness(0.4) contrast(150%); }
  100% { filter: brightness(2) blur(16px); opacity: 0.15; }
}