﻿/* =========================================
   ANIMATIONS — REVEAL, TILT, PARALLAX, PARTICLES
   ========================================= */

/* ── PAGE TRANSITION ────────────────────────── */
.page-enter {
  animation: pageIn 0.45s cubic-bezier(0.23, 1, 0.32, 1) both;
}

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

/* ── REVEAL ON SCROLL ───────────────────────── */
.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.65s cubic-bezier(0.23, 1, 0.32, 1),
              transform 0.65s cubic-bezier(0.23, 1, 0.32, 1);
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

.reveal-left {
  opacity: 0;
  transform: translateX(-30px);
  transition: opacity 0.65s cubic-bezier(0.23, 1, 0.32, 1),
              transform 0.65s cubic-bezier(0.23, 1, 0.32, 1);
}

.reveal-left.visible {
  opacity: 1;
  transform: translateX(0);
}

.reveal-right {
  opacity: 0;
  transform: translateX(30px);
  transition: opacity 0.65s cubic-bezier(0.23, 1, 0.32, 1),
              transform 0.65s cubic-bezier(0.23, 1, 0.32, 1);
}

.reveal-right.visible {
  opacity: 1;
  transform: translateX(0);
}

.reveal-scale {
  opacity: 0;
  transform: scale(0.9);
  transition: opacity 0.6s ease, transform 0.6s cubic-bezier(0.23, 1, 0.32, 1);
}

.reveal-scale.visible {
  opacity: 1;
  transform: scale(1);
}

/* Delays para stagger */
.delay-100 { transition-delay: 0.1s; }
.delay-200 { transition-delay: 0.2s; }
.delay-300 { transition-delay: 0.3s; }
.delay-400 { transition-delay: 0.4s; }
.delay-500 { transition-delay: 0.5s; }
.delay-600 { transition-delay: 0.6s; }

/* ── HERO ANIMATIONS ────────────────────────── */
@keyframes heroFadeUp {
  from { opacity: 0; transform: translateY(40px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes heroFadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.hero-title-anim {
  animation: heroFadeUp 0.9s cubic-bezier(0.23, 1, 0.32, 1) 0.2s both;
}

.hero-subtitle-anim {
  animation: heroFadeUp 0.9s cubic-bezier(0.23, 1, 0.32, 1) 0.4s both;
}

.hero-cta-anim {
  animation: heroFadeUp 0.9s cubic-bezier(0.23, 1, 0.32, 1) 0.6s both;
}

/* ── FLOATING ───────────────────────────────── */
@keyframes float {
  0%, 100% { transform: translateY(0px); }
  50%       { transform: translateY(-12px); }
}

.float-anim { animation: float 4s ease-in-out infinite; }
.float-anim-slow { animation: float 6s ease-in-out infinite; }

/* ── PULSE MYSTIC ───────────────────────────── */
@keyframes pulseMystic {
  0%, 100% { box-shadow: 0 0 0 0 rgba(155,126,222,0); }
  50%       { box-shadow: 0 0 0 12px rgba(155,126,222,0.15); }
}

.pulse-mystic { animation: pulseMystic 3s ease-in-out infinite; }

/* ── GLOW ───────────────────────────────────── */
@keyframes glowViolet {
  0%, 100% { filter: drop-shadow(0 0 8px rgba(155,126,222,0.4)); }
  50%       { filter: drop-shadow(0 0 20px rgba(155,126,222,0.8)); }
}

@keyframes glowGold {
  0%, 100% { filter: drop-shadow(0 0 8px rgba(212,175,122,0.4)); }
  50%       { filter: drop-shadow(0 0 20px rgba(212,175,122,0.8)); }
}

.glow-violet { animation: glowViolet 2.5s ease-in-out infinite; }
.glow-gold   { animation: glowGold 2.5s ease-in-out infinite; }

/* ── ROTATE SLOW ────────────────────────────── */
@keyframes rotateSlow {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}

.rotate-slow { animation: rotateSlow 20s linear infinite; }
.rotate-slow-reverse { animation: rotateSlow 20s linear infinite reverse; }

/* ── SHIMMER ON HOVER ───────────────────────── */
.shimmer-hover {
  position: relative;
  overflow: hidden;
}

.shimmer-hover::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 60%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.08), transparent);
  transition: none;
}

.shimmer-hover:hover::before {
  animation: shimmerSlide 0.6s ease forwards;
}

@keyframes shimmerSlide {
  to { left: 150%; }
}

/* ── PARTICLES CANVAS ───────────────────────── */
#particles-canvas {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 1;
}

/* ── MYSTIC ORBS ────────────────────────────── */
.mystic-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(60px);
  pointer-events: none;
  z-index: 0;
  opacity: 0.4;
}

.mystic-orb-violet {
  background: radial-gradient(circle, rgba(155,126,222,0.5) 0%, transparent 70%);
  width: 400px; height: 400px;
}

.mystic-orb-gold {
  background: radial-gradient(circle, rgba(212,175,122,0.4) 0%, transparent 70%);
  width: 300px; height: 300px;
}

/* ── RIPPLE BUTTON ──────────────────────────── */
.ripple-effect {
  position: absolute;
  border-radius: 50%;
  background: rgba(255,255,255,0.25);
  transform: scale(0);
  animation: ripple 0.6s linear;
  pointer-events: none;
}

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

/* ── CONFETTI ───────────────────────────────── */
.confetti-particle {
  position: fixed;
  pointer-events: none;
  z-index: 9998;
  border-radius: 2px;
  animation: confettiFall linear forwards;
}

@keyframes confettiFall {
  0%   { transform: translateY(-20px) rotate(0deg); opacity: 1; }
  100% { transform: translateY(100vh) rotate(720deg); opacity: 0; }
}

/* ── TILT CARD ──────────────────────────────── */
.tilt-card {
  transform-style: preserve-3d;
  will-change: transform;
  transition: transform 0.1s ease;
}

.tilt-card .tilt-content {
  transform: translateZ(20px);
}

/* ── SECTION ORNAMENT ───────────────────────── */
.section-ornament {
  width: 120px;
  height: 2px;
  background: var(--gradient-gold);
  margin: var(--sp-6) auto;
  position: relative;
}

.section-ornament::before,
.section-ornament::after {
  content: '';
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 6px; height: 6px;
  background: var(--accent-gold);
  border-radius: 50%;
}

.section-ornament::before { left: -3px; }
.section-ornament::after  { right: -3px; }

/* ── STAR FIELD ─────────────────────────────── */
@keyframes twinkle {
  0%, 100% { opacity: 0.2; transform: scale(0.8); }
  50%       { opacity: 1; transform: scale(1.2); }
}

.star {
  position: absolute;
  border-radius: 50%;
  background: white;
  animation: twinkle ease-in-out infinite;
}

/* ── SCROLL INDICATOR ───────────────────────── */
.scroll-indicator {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--sp-2);
  position: absolute;
  bottom: var(--sp-8);
  left: 50%;
  transform: translateX(-50%);
  z-index: 2;
  opacity: 0.6;
}

.scroll-indicator-line {
  width: 1px;
  height: 40px;
  background: linear-gradient(to bottom, var(--accent-violet), transparent);
  animation: scrollLine 1.5s ease-in-out infinite;
}

@keyframes scrollLine {
  0%   { transform: scaleY(0); transform-origin: top; }
  50%  { transform: scaleY(1); transform-origin: top; }
  51%  { transform: scaleY(1); transform-origin: bottom; }
  100% { transform: scaleY(0); transform-origin: bottom; }
}

/* ── MODULE ACCORDION ───────────────────────── */
.module-item {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  margin-bottom: 14px;
  overflow: hidden;
  transition: border-color 0.4s ease, box-shadow 0.4s ease, transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.module-item:hover {
  border-color: var(--border-color-hover);
  box-shadow: 0 8px 40px rgba(155, 126, 222, 0.1);
  transform: translateY(-2px);
}

.module-item.activo {
  border-color: rgba(212, 175, 122, 0.45);
  background: linear-gradient(135deg, var(--bg-card) 0%, rgba(212, 175, 122, 0.04) 100%);
  box-shadow: 0 8px 48px rgba(212, 175, 122, 0.1);
}

.module-header {
  display: flex;
  align-items: center;
  gap: var(--sp-5);
  padding: 22px 28px;
  cursor: pointer;
  user-select: none;
  transition: background var(--tr-fast);
}

.module-header:hover { background: rgba(255,255,255,0.02); }

.module-icono-wrap {
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  background: rgba(212, 175, 122, 0.1);
  border: 1px solid rgba(212, 175, 122, 0.2);
  flex-shrink: 0;
  color: var(--accent-gold);
  transition: background 0.3s ease, border-color 0.3s ease, transform 0.3s ease;
}

.module-item.activo .module-icono-wrap,
.module-header:hover .module-icono-wrap {
  background: rgba(212, 175, 122, 0.18);
  border-color: rgba(212, 175, 122, 0.5);
  transform: rotate(8deg) scale(1.06);
}

.module-info { flex: 1; min-width: 0; }

.module-numero {
  font-family: var(--font-sans);
  font-size: 0.7rem;
  letter-spacing: 0.22em;
  color: var(--accent-gold);
  text-transform: uppercase;
  font-weight: 600;
  margin-bottom: 4px;
}

.module-titulo {
  font-family: var(--font-serif);
  font-size: 1.45rem;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.2;
}

.module-desc {
  font-size: var(--font-sm);
  color: var(--text-muted);
  margin-top: 4px;
  line-height: 1.5;
}

.module-lessons-count {
  font-size: var(--font-xs);
  color: var(--text-muted);
  margin-top: 4px;
}

.module-chevron {
  color: var(--text-muted);
  flex-shrink: 0;
  transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1), color 0.25s ease;
}

.module-item.activo .module-chevron {
  transform: rotate(180deg);
  color: var(--accent-gold);
}

.module-content {
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  border-top: 0px solid var(--border-color);
  transition: max-height 0.45s cubic-bezier(0.4, 0, 0.2, 1),
              opacity 0.35s ease,
              border-top-width 0.1s ease;
}

.module-content.open {
  max-height: 1200px;
  opacity: 1;
  border-top-width: 1px;
}

/* ── LESSON ROW ─────────────────────────────── */
.lesson-row {
  display: flex;
  align-items: center;
  gap: var(--sp-4);
  padding: var(--sp-4) 28px;
  border-bottom: 1px solid var(--border-color);
  transition: background var(--tr-fast);
}

.lesson-row:last-child { border-bottom: none; }
.lesson-row:hover { background: rgba(155, 126, 222, 0.05); }

.lesson-row-title {
  flex: 1;
  font-size: var(--font-sm);
  color: var(--text-secondary);
  line-height: 1.4;
}

.lesson-row-type {
  font-size: var(--font-xs);
  color: var(--text-muted);
  white-space: nowrap;
}

.lesson-row-drag {
  color: var(--text-muted);
  cursor: grab;
  font-size: 1rem;
}

/* ── LO QUE VAS A APRENDER ──────────────────── */
.aprenderas-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--sp-3) var(--sp-8);
}

.aprende-item {
  display: flex;
  align-items: flex-start;
  gap: var(--sp-3);
  font-size: var(--font-sm);
  color: var(--text-secondary);
  line-height: 1.5;
}

.aprende-check {
  color: var(--accent-gold);
  flex-shrink: 0;
  margin-top: 1px;
  font-size: 0.8rem;
}

/* ── FEATURED COURSE CARD ───────────────────── */
.card-course-destacado {
  display: grid;
  grid-template-columns: 1fr 1fr;
  border: 1px solid rgba(212, 175, 122, 0.3);
  border-radius: var(--border-radius-xl);
  overflow: hidden;
  background: var(--bg-card);
  text-decoration: none;
  color: inherit;
  max-width: 860px;
  margin: 0 auto;
  box-shadow: 0 8px 60px rgba(212, 175, 122, 0.08);
  transition: border-color var(--tr-base), box-shadow var(--tr-base), transform var(--tr-base);
}

.card-course-destacado:hover {
  border-color: rgba(212, 175, 122, 0.6);
  box-shadow: 0 16px 80px rgba(212, 175, 122, 0.18);
  transform: translateY(-3px);
  color: inherit;
}

.card-course-destacado:hover img { transform: scale(1.04); }

@media (max-width: 768px) {
  .card-course-destacado { grid-template-columns: 1fr; max-width: 100%; }
  .card-course-destacado img { min-height: 220px !important; }
  .aprenderas-grid { grid-template-columns: 1fr; }

  .module-header { padding: 18px 20px; gap: var(--sp-4); }
  .module-titulo { font-size: 1.2rem; }
  .lesson-row { padding: var(--sp-4) 20px; }
}
