
/* ============================================================
   PIXELLAB MEJORAS - Las 8 actualizaciones
   ============================================================ */

/* ===================== 8. LOADER ANIMADO ===================== */

#pixellab-loader {
  position: fixed;
  inset: 0;
  background: #0a0f1e;
  z-index: 999999;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  transition: opacity 0.6s ease, visibility 0.6s ease;
}

#pixellab-loader.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.loader-logo {
  font-size: 2.5rem;
  font-weight: 900;
  background: linear-gradient(90deg, #38bdf8, #22c55e, #a78bfa, #38bdf8);
  background-size: 300% 100%;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: loaderGradient 2s linear infinite;
  letter-spacing: 4px;
  margin-bottom: 30px;
}

@keyframes loaderGradient {
  0%   { background-position: 0% 50%; }
  100% { background-position: 300% 50%; }
}

.loader-pixels {
  display: flex;
  gap: 8px;
  margin-bottom: 20px;
}

.loader-pixel {
  width: 12px;
  height: 12px;
  border-radius: 2px;
  animation: pixelBounce 0.8s ease-in-out infinite;
}

.loader-pixel:nth-child(1) { background: #38bdf8; animation-delay: 0s; }
.loader-pixel:nth-child(2) { background: #22c55e; animation-delay: 0.1s; }
.loader-pixel:nth-child(3) { background: #a78bfa; animation-delay: 0.2s; }
.loader-pixel:nth-child(4) { background: #f59e0b; animation-delay: 0.3s; }
.loader-pixel:nth-child(5) { background: #f43f5e; animation-delay: 0.4s; }

@keyframes pixelBounce {
  0%, 100% { transform: scaleY(1); opacity: 0.5; }
  50% { transform: scaleY(2.5); opacity: 1; }
}

.loader-text {
  color: rgba(255,255,255,0.4);
  font-size: 0.75rem;
  letter-spacing: 3px;
  text-transform: uppercase;
}

/* ===================== 7. CURSOR PERSONALIZADO ===================== */

* { cursor: none !important; }

#cursor-dot {
  position: fixed;
  width: 8px;
  height: 8px;
  background: #38bdf8;
  border-radius: 2px;
  pointer-events: none;
  z-index: 999998;
  transform: translate(-50%, -50%) rotate(45deg);
  transition: transform 0.1s ease, background 0.3s ease, width 0.3s ease, height 0.3s ease;
}

#cursor-ring {
  position: fixed;
  width: 36px;
  height: 36px;
  border: 2px solid rgba(56, 189, 248, 0.5);
  border-radius: 4px;
  pointer-events: none;
  z-index: 999997;
  transform: translate(-50%, -50%) rotate(45deg);
  transition: transform 0.15s ease, width 0.3s ease, height 0.3s ease, border-color 0.3s ease;
}

#cursor-trail {
  position: fixed;
  width: 60px;
  height: 60px;
  border: 1px solid rgba(167, 139, 250, 0.2);
  border-radius: 6px;
  pointer-events: none;
  z-index: 999996;
  transform: translate(-50%, -50%) rotate(45deg);
  transition: transform 0.4s ease;
}

body:hover #cursor-dot { opacity: 1; }

a:hover ~ #cursor-dot,
button:hover ~ #cursor-dot { transform: translate(-50%, -50%) rotate(45deg) scale(2); }

/* ===================== 3. PARTÍCULAS EN EL HERO ===================== */

#particles-canvas {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  z-index: 5;
  pointer-events: none;
}

/* ===================== 1. ESTADÍSTICAS ANIMADAS ===================== */

#stats-section {
  background: linear-gradient(135deg, #0f172a 0%, #1e293b 50%, #0f172a 100%);
  padding: 80px 20px;
  position: relative;
  overflow: hidden;
}

#stats-section::before {
  content: "";
  position: absolute;
  inset: 0;
  background: 
    radial-gradient(ellipse at 20% 50%, rgba(56, 189, 248, 0.08) 0%, transparent 60%),
    radial-gradient(ellipse at 80% 50%, rgba(167, 139, 250, 0.08) 0%, transparent 60%);
}

.stats-grid {
  max-width: 1000px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 40px;
  position: relative;
  z-index: 2;
}

.stat-item {
  text-align: center;
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.stat-item.visible {
  opacity: 1;
  transform: translateY(0);
}

.stat-item:nth-child(1) { transition-delay: 0s; }
.stat-item:nth-child(2) { transition-delay: 0.15s; }
.stat-item:nth-child(3) { transition-delay: 0.3s; }
.stat-item:nth-child(4) { transition-delay: 0.45s; }

.stat-icon {
  font-size: 2.5rem;
  margin-bottom: 15px;
  display: block;
}

.stat-number {
  font-size: 3.5rem;
  font-weight: 900;
  line-height: 1;
  margin-bottom: 8px;
  background: linear-gradient(135deg, #38bdf8, #22c55e);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  display: block;
}

.stat-label {
  color: rgba(255,255,255,0.6);
  font-size: 0.9rem;
  letter-spacing: 1px;
  text-transform: uppercase;
  display: block;
}

.stat-divider {
  width: 40px;
  height: 3px;
  background: linear-gradient(90deg, #38bdf8, #a78bfa);
  margin: 12px auto 0;
  border-radius: 2px;
}

@media (max-width: 768px) {
  .stats-grid { grid-template-columns: repeat(2, 1fr); gap: 30px; }
  .stat-number { font-size: 2.5rem; }
}

@media (max-width: 480px) {
  .stat-number { font-size: 2rem; }
}

/* ===================== 2. TARJETAS DE CURSOS MEJORADAS ===================== */

.courses-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin-top: 20px;
}

.course-card {
  position: relative;
  border-radius: 16px;
  text-align: center;
  cursor: pointer;
  overflow: hidden;
  perspective: 1000px;
  min-height: 240px;
  font-size: 14px;
  border: none;
  padding: 0;
  background: transparent;
  transition: none;
  box-shadow: none;
}

.course-card:hover { transform: none; box-shadow: none; }

.course-card-inner {
  position: relative;
  width: 100%;
  height: 100%;
  min-height: 240px;
  transition: transform 0.7s cubic-bezier(0.4, 0, 0.2, 1);
  transform-style: preserve-3d;
}

.course-card:hover .course-card-inner {
  transform: rotateY(180deg);
}

.course-card-front,
.course-card-back {
  position: absolute;
  inset: 0;
  border-radius: 16px;
  padding: 30px 24px;
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

/* Card 1: Scratch - azul/cian */
.course-card:nth-child(1) .course-card-front {
  background: linear-gradient(135deg, #1e3a5f 0%, #0f2d5c 60%, #162447 100%);
  border: 1px solid rgba(56, 189, 248, 0.3);
  box-shadow: 0 20px 60px rgba(56, 189, 248, 0.15), inset 0 1px 0 rgba(56,189,248,0.2);
}

.course-card:nth-child(1) .course-card-back {
  background: linear-gradient(135deg, #38bdf8, #0ea5e9);
  transform: rotateY(180deg);
  box-shadow: 0 20px 60px rgba(56, 189, 248, 0.4);
}

/* Card 2: Roblox - verde/esmeralda */
.course-card:nth-child(2) .course-card-front {
  background: linear-gradient(135deg, #1a3d2e 0%, #0f2d1e 60%, #142d22 100%);
  border: 1px solid rgba(34, 197, 94, 0.3);
  box-shadow: 0 20px 60px rgba(34, 197, 94, 0.15), inset 0 1px 0 rgba(34,197,94,0.2);
}

.course-card:nth-child(2) .course-card-back {
  background: linear-gradient(135deg, #22c55e, #16a34a);
  transform: rotateY(180deg);
  box-shadow: 0 20px 60px rgba(34, 197, 94, 0.4);
}

/* Card 3: Web - morado/violeta */
.course-card:nth-child(3) .course-card-front {
  background: linear-gradient(135deg, #2d1a4d 0%, #1e1135 60%, #261545 100%);
  border: 1px solid rgba(167, 139, 250, 0.3);
  box-shadow: 0 20px 60px rgba(167, 139, 250, 0.15), inset 0 1px 0 rgba(167,139,250,0.2);
}

.course-card:nth-child(3) .course-card-back {
  background: linear-gradient(135deg, #a78bfa, #7c3aed);
  transform: rotateY(180deg);
  box-shadow: 0 20px 60px rgba(167, 139, 250, 0.4);
}

.course-card-icon {
  font-size: 3.5rem;
  margin-bottom: 16px;
  display: block;
  filter: drop-shadow(0 0 20px currentColor);
}

.course-card:nth-child(1) .course-card-icon { color: #38bdf8; }
.course-card:nth-child(2) .course-card-icon { color: #22c55e; }
.course-card:nth-child(3) .course-card-icon { color: #a78bfa; }

.course-card-front h3 {
  font-size: 1.4rem;
  color: white;
  margin-bottom: 8px;
  font-weight: 800;
}

.course-card-front .age {
  font-weight: 600;
  font-size: 12px;
  letter-spacing: 1px;
  text-transform: uppercase;
  margin: 0;
  opacity: 0.7;
  color: rgba(255,255,255,0.7);
}

.course-card-front .hover-hint {
  position: absolute;
  bottom: 14px;
  left: 0; right: 0;
  text-align: center;
  font-size: 10px;
  color: rgba(255,255,255,0.3);
  letter-spacing: 1.5px;
  text-transform: uppercase;
  animation: hintPulse 2s ease-in-out infinite;
}

@keyframes hintPulse {
  0%, 100% { opacity: 0.3; }
  50% { opacity: 0.8; }
}

.course-card-back h3 {
  font-size: 1.2rem;
  color: white;
  font-weight: 800;
  margin-bottom: 12px;
}

.course-card-back p {
  color: rgba(255,255,255,0.9);
  font-size: 12px;
  line-height: 1.6;
  margin-bottom: 16px;
}

.course-btn {
  background: rgba(255,255,255,0.25);
  color: white;
  border: 2px solid rgba(255,255,255,0.6);
  padding: 8px 20px;
  border-radius: 20px;
  font-weight: 700;
  font-size: 12px;
  cursor: pointer;
  letter-spacing: 1px;
  text-transform: uppercase;
  transition: 0.3s;
  backdrop-filter: blur(10px);
}

.course-btn:hover {
  background: rgba(255,255,255,0.4);
  border-color: white;
  transform: none;
}

@media (max-width: 980px) { .courses-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 600px) { .courses-grid { grid-template-columns: 1fr; } }

/* ===================== 4. MENÚ HAMBURGUESA MÓVIL ===================== */

#hamburger-btn {
  display: none;
  position: absolute;
  right: 1rem;
  top: 50%;
  transform: translateY(-50%);
  width: 44px;
  height: 44px;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  z-index: 10001;
  background: rgba(255,255,255,0.1);
  border-radius: 8px;
  border: 1px solid rgba(255,255,255,0.2);
  transition: 0.3s;
}

#hamburger-btn:hover { background: rgba(255,255,255,0.2); }

#hamburger-btn span {
  display: block;
  width: 22px;
  height: 2px;
  background: white;
  border-radius: 2px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  transform-origin: center;
}

#hamburger-btn.open span:nth-child(1) {
  transform: translateY(8px) rotate(45deg);
}
#hamburger-btn.open span:nth-child(2) {
  opacity: 0;
  transform: scaleX(0);
}
#hamburger-btn.open span:nth-child(3) {
  transform: translateY(-8px) rotate(-45deg);
}

#mobile-menu {
  display: none;
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: rgba(10, 15, 30, 0.97);
  z-index: 10000;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0;
  backdrop-filter: blur(20px);
  opacity: 0;
  transition: opacity 0.3s ease;
}

#mobile-menu.open {
  display: flex;
  opacity: 1;
}

#mobile-menu a {
  color: white;
  text-decoration: none;
  font-size: 2rem;
  font-weight: 800;
  padding: 20px 40px;
  letter-spacing: 2px;
  text-transform: uppercase;
  position: relative;
  overflow: hidden;
  transition: 0.3s;
  opacity: 0;
  transform: translateY(20px);
}

#mobile-menu.open a {
  opacity: 1;
  transform: translateY(0);
}

#mobile-menu.open a:nth-child(1) { transition: opacity 0.3s 0.05s, transform 0.3s 0.05s; }
#mobile-menu.open a:nth-child(2) { transition: opacity 0.3s 0.1s, transform 0.3s 0.1s; }
#mobile-menu.open a:nth-child(3) { transition: opacity 0.3s 0.15s, transform 0.3s 0.15s; }
#mobile-menu.open a:nth-child(4) { transition: opacity 0.3s 0.2s, transform 0.3s 0.2s; }
#mobile-menu.open a:nth-child(5) { transition: opacity 0.3s 0.25s, transform 0.3s 0.25s; }

#mobile-menu a::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 10px;
  width: 0;
  height: 3px;
  background: linear-gradient(90deg, #38bdf8, #22c55e);
  transform: translateX(-50%);
  transition: width 0.3s ease;
  border-radius: 2px;
}

#mobile-menu a:hover::after { width: 80%; }
#mobile-menu a:hover { color: #38bdf8; }

.mobile-menu-close {
  position: absolute;
  top: 20px;
  right: 20px;
  color: rgba(255,255,255,0.6);
  font-size: 2rem;
  cursor: pointer;
  transition: 0.3s;
  line-height: 1;
}
.mobile-menu-close:hover { color: white; }

@media screen and (max-width: 736px) {
  #hamburger-btn { display: flex; }
}

/* ===================== 5. TESTIMONIOS ===================== */

#testimonios {
  background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
  padding: 100px 20px;
  text-align: center;
  position: relative;
  overflow: hidden;
}

#testimonios::before {
  content: '"';
  position: absolute;
  top: -40px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 20rem;
  color: rgba(56, 189, 248, 0.06);
  font-family: Georgia, serif;
  line-height: 1;
  pointer-events: none;
}

#testimonios h2 {
  font-size: 2.5rem;
  color: #0f172a;
  margin-bottom: 15px;
  font-weight: 900;
}

#testimonios .section-subtitle {
  color: #64748b;
  font-size: 1rem;
  margin-bottom: 60px;
  display: block;
}

.testimonios-grid {
  max-width: 1100px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 30px;
}

.testimonio-card {
  background: white;
  border-radius: 20px;
  padding: 36px 30px;
  text-align: left;
  box-shadow: 0 4px 30px rgba(0,0,0,0.06);
  border: 1px solid rgba(56, 189, 248, 0.1);
  position: relative;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  opacity: 0;
  transform: translateY(30px);
}

.testimonio-card.visible {
  opacity: 1;
  transform: translateY(0);
  transition: opacity 0.6s ease, transform 0.6s ease, box-shadow 0.3s ease;
}

.testimonio-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 20px 50px rgba(56, 189, 248, 0.15);
}

.testimonio-card:nth-child(1) { transition-delay: 0s; }
.testimonio-card:nth-child(2) { transition-delay: 0.15s; }
.testimonio-card:nth-child(3) { transition-delay: 0.3s; }

.testimonio-stars {
  color: #f59e0b;
  font-size: 1rem;
  margin-bottom: 16px;
  letter-spacing: 2px;
}

.testimonio-text {
  color: #334155;
  font-size: 0.95rem;
  line-height: 1.7;
  margin-bottom: 24px;
  font-style: italic;
}

.testimonio-author {
  display: flex;
  align-items: center;
  gap: 12px;
}

.testimonio-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  font-weight: 900;
  color: white;
  flex-shrink: 0;
}

.testimonio-card:nth-child(1) .testimonio-avatar { background: linear-gradient(135deg, #38bdf8, #0ea5e9); }
.testimonio-card:nth-child(2) .testimonio-avatar { background: linear-gradient(135deg, #22c55e, #16a34a); }
.testimonio-card:nth-child(3) .testimonio-avatar { background: linear-gradient(135deg, #a78bfa, #7c3aed); }

.testimonio-name {
  font-weight: 800;
  color: #0f172a;
  font-size: 0.9rem;
  display: block;
}

.testimonio-role {
  color: #94a3b8;
  font-size: 0.8rem;
  display: block;
}

.testimonio-tag {
  position: absolute;
  top: 20px;
  right: 20px;
  background: linear-gradient(135deg, #38bdf8, #22c55e);
  color: white;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  padding: 4px 10px;
  border-radius: 20px;
}

@media (max-width: 900px) { .testimonios-grid { grid-template-columns: 1fr; max-width: 500px; } }

/* ===================== 6. SECCIÓN DE PRECIOS ===================== */

#precios {
  background: linear-gradient(135deg, #0a0f1e 0%, #1e293b 100%);
  padding: 100px 20px;
  text-align: center;
  position: relative;
  overflow: hidden;
}

#precios::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 50% 0%, rgba(56,189,248,0.1) 0%, transparent 60%);
  pointer-events: none;
}

#precios h2 {
  font-size: 2.5rem;
  color: white;
  margin-bottom: 10px;
  font-weight: 900;
}

#precios .section-subtitle {
  color: rgba(255,255,255,0.5);
  font-size: 0.95rem;
  margin-bottom: 60px;
  display: block;
}

.precios-grid {
  max-width: 1000px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  align-items: start;
}

.precio-card {
  border-radius: 20px;
  padding: 40px 28px;
  position: relative;
  transition: transform 0.3s ease;
  opacity: 0;
  transform: translateY(30px);
}

.precio-card.visible {
  opacity: 1;
  transform: translateY(0);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.precio-card:nth-child(1).visible { transition-delay: 0s; }
.precio-card:nth-child(2).visible { transition-delay: 0.15s; }
.precio-card:nth-child(3).visible { transition-delay: 0.3s; }

.precio-card:hover { transform: translateY(-8px); }

.precio-card.featured { transform: translateY(-12px) scale(1.03); }
.precio-card.featured:hover { transform: translateY(-18px) scale(1.03); }
.precio-card.featured.visible { transform: translateY(-12px) scale(1.03); }
.precio-card.featured:hover { transform: translateY(-20px) scale(1.03); }

.precio-card:nth-child(1) {
  background: #1e293b;
  border: 1px solid rgba(56, 189, 248, 0.2);
}

.precio-card:nth-child(2) {
  background: linear-gradient(135deg, #1e3a5f, #1a3d2e);
  border: 2px solid #38bdf8;
  box-shadow: 0 0 60px rgba(56, 189, 248, 0.2);
}

.precio-card:nth-child(3) {
  background: #1e293b;
  border: 1px solid rgba(167, 139, 250, 0.2);
}

.precio-badge {
  position: absolute;
  top: -14px;
  left: 50%;
  transform: translateX(-50%);
  background: linear-gradient(90deg, #38bdf8, #22c55e);
  color: white;
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 2px;
  text-transform: uppercase;
  padding: 6px 20px;
  border-radius: 20px;
  white-space: nowrap;
}

.precio-icon { font-size: 2.8rem; display: block; margin-bottom: 16px; }

.precio-name {
  color: white;
  font-size: 1.3rem;
  font-weight: 900;
  display: block;
  margin-bottom: 6px;
}

.precio-edad {
  color: rgba(255,255,255,0.4);
  font-size: 0.75rem;
  letter-spacing: 1px;
  text-transform: uppercase;
  display: block;
  margin-bottom: 24px;
}

.precio-amount {
  margin-bottom: 24px;
}

.precio-currency {
  color: rgba(255,255,255,0.5);
  font-size: 1rem;
  vertical-align: top;
  margin-top: 8px;
  display: inline-block;
}

.precio-number {
  font-size: 3.5rem;
  font-weight: 900;
  line-height: 1;
}

.precio-card:nth-child(1) .precio-number { color: #38bdf8; }
.precio-card:nth-child(2) .precio-number { color: #22c55e; }
.precio-card:nth-child(3) .precio-number { color: #a78bfa; }

.precio-period {
  color: rgba(255,255,255,0.4);
  font-size: 0.8rem;
  display: block;
  margin-top: 4px;
}

.precio-features {
  list-style: none;
  padding: 0;
  margin: 0 0 28px 0;
  text-align: left;
}

.precio-features li {
  color: rgba(255,255,255,0.7);
  font-size: 0.85rem;
  padding: 8px 0;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  display: flex;
  align-items: center;
  gap: 10px;
}

.precio-features li::before {
  content: "✓";
  font-weight: 900;
  font-size: 0.8rem;
  flex-shrink: 0;
}

.precio-card:nth-child(1) .precio-features li::before { color: #38bdf8; }
.precio-card:nth-child(2) .precio-features li::before { color: #22c55e; }
.precio-card:nth-child(3) .precio-features li::before { color: #a78bfa; }

.precio-btn {
  display: block;
  width: 100%;
  padding: 14px;
  border-radius: 12px;
  font-weight: 800;
  font-size: 0.85rem;
  letter-spacing: 1px;
  text-transform: uppercase;
  text-decoration: none;
  transition: 0.3s;
  border: none;
  cursor: pointer;
}

.precio-card:nth-child(1) .precio-btn {
  background: rgba(56, 189, 248, 0.15);
  color: #38bdf8;
  border: 1px solid rgba(56, 189, 248, 0.3);
}
.precio-card:nth-child(1) .precio-btn:hover {
  background: #38bdf8;
  color: #0a0f1e;
}

.precio-card:nth-child(2) .precio-btn {
  background: linear-gradient(135deg, #38bdf8, #22c55e);
  color: white;
}
.precio-card:nth-child(2) .precio-btn:hover {
  opacity: 0.9;
  transform: scale(1.02);
}

.precio-card:nth-child(3) .precio-btn {
  background: rgba(167, 139, 250, 0.15);
  color: #a78bfa;
  border: 1px solid rgba(167, 139, 250, 0.3);
}
.precio-card:nth-child(3) .precio-btn:hover {
  background: #a78bfa;
  color: #0a0f1e;
}

.precios-nota {
  margin-top: 40px;
  color: rgba(255,255,255,0.35);
  font-size: 0.8rem;
}

@media (max-width: 768px) {
  .precios-grid { grid-template-columns: 1fr; max-width: 380px; }
  .precio-card.featured { transform: none; }
  .precio-card.featured.visible { transform: translateY(0); }
}

/* ===================== AJUSTE MÓVIL GENERAL ===================== */

@media (max-width: 736px) {
  * { cursor: auto !important; }
  #cursor-dot, #cursor-ring, #cursor-trail { display: none !important; }
}

