/* Reset y configuración base */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: #333;
  line-height: 1.6;
  overflow-x: hidden;
}

/* Preloader mejorado */
#preloader-css {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(45deg, #ff6b6b, #4ecdc4, #45b7d1, #96ceb4);
  background-size: 400% 400%;
  animation: gradientShift 3s ease infinite, fadeOut 1s ease-in-out 3s forwards;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}

.loader-css {
  width: 80px;
  height: 80px;
  border: 6px solid rgba(255, 255, 255, 0.3);
  border-top: 6px solid white;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  box-shadow: 0 0 20px rgba(255, 255, 255, 0.5);
}

@keyframes gradientShift {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

@keyframes fadeOut {
  to {
    opacity: 0;
    visibility: hidden;
  }
}


header {
  background: linear-gradient(135deg, #ff6b6b, #ff8e8e);
  padding: 2em 0;
  text-align: center;
  color: white;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
  position: relative;
  overflow: hidden;
}

header::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.1) 0%, transparent 70%);
  animation: float 6s ease-in-out infinite;
}

header h1 {
  font-size: 3rem;
  margin-bottom: 1rem;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
  animation: bounce 2s ease-in-out infinite alternate;
  position: relative;
  z-index: 2;
}

@keyframes float {
  0%, 100% { transform: translate(0, 0) rotate(0deg); }
  50% { transform: translate(-20px, -20px) rotate(180deg); }
}

@keyframes bounce {
  0% { transform: translateY(0); }
  100% { transform: translateY(-10px); }
}


nav {
  position: relative;
  z-index: 2;
}

nav ul {
  list-style: none;
  display: flex;
  justify-content: center;
  gap: 3em;
  margin-top: 1rem;
}

nav li {
  position: relative;
}

nav a {
  color: white;
  text-decoration: none;
  font-weight: bold;
  font-size: 1.1rem;
  padding: 0.8rem 1.5rem;
  border-radius: 25px;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

nav a::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
  transition: left 0.5s ease;
}

nav a:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: translateY(-3px);
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

nav a:hover::before {
  left: 100%;
}

/* Slider mejorado */
.slider {
  position: relative;
  width: 100%;
  height: 500px;
  overflow: hidden;
  margin-bottom: 2rem;
  border-radius: 0 0 50px 50px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.slider img,
.slider .slide {
  position: absolute;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 1s ease-in-out;
  animation: slideShow 15s infinite;
}

.slider img:nth-child(1),
.slider .slide:nth-child(1) {
  animation-delay: 0s;
}

.slider img:nth-child(2),
.slider .slide:nth-child(2) {
  animation-delay: 5s;
}

.slider img:nth-child(3),
.slider .slide:nth-child(3) {
  animation-delay: 10s;
}

@keyframes slideShow {
  0% { opacity: 0; transform: scale(1.1); }
  6.67% { opacity: 1; transform: scale(1); }
  33.33% { opacity: 1; transform: scale(1); }
  40% { opacity: 0; transform: scale(0.9); }
  100% { opacity: 0; transform: scale(0.9); }
}

/* Main content mejorado */
main {
  max-width: 1200px;
  margin: 2rem auto;
  padding: 0 2rem;
}

/* Artículos y secciones mejorados */
article,
section {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  border-radius: 20px;
  padding: 2.5rem;
  margin-bottom: 2rem;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.3);
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

article::before,
section::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(102, 126, 234, 0.1), transparent);
  transition: left 0.6s ease;
}

article:hover::before,
section:hover::before {
  left: 100%;
}

article:hover,
section:hover {
  transform: translateY(-5px);
  box-shadow: 0 15px 40px rgba(0, 0, 0, 0.2);
}

article h2,
section h2 {
  color: #4a5568;
  font-size: 2rem;
  margin-bottom: 1rem;
  border-left: 6px solid #667eea;
  padding-left: 1rem;
  position: relative;
}

article p,
section p {
  font-size: 1.1rem;
  margin-bottom: 1rem;
  text-align: justify;
}

/* Listas mejoradas */
ul {
  margin: 1rem 0;
  padding-left: 0;
}

li {
  list-style: none;
  margin-bottom: 0.8rem;
  padding: 0.8rem 1rem;
  background: linear-gradient(135deg, #f8f9ff, #e8edff);
  border-radius: 10px;
  border-left: 4px solid #667eea;
  transition: all 0.3s ease;
  position: relative;
}

li::before {
  content: '🎢';
  margin-right: 0.5rem;
  font-size: 1.2rem;
}

li:hover {
  transform: translateX(10px);
  background: linear-gradient(135deg, #e8edff, #d1d9ff);
  box-shadow: 0 3px 10px rgba(102, 126, 234, 0.2);
}

/* Galería de imágenes mejorada */
.imagenes {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 2rem;
  margin: 3rem 0;
  padding: 2rem;
}

.hover-img {
  width: 100%;
  height: 250px;
  object-fit: cover;
  border-radius: 20px;
  transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
  filter: brightness(0.9) saturate(1.1);
}

.hover-img:hover {
  transform: scale(1.05) rotate(2deg);
  box-shadow: 0 15px 40px rgba(0, 0, 0, 0.3);
  filter: brightness(1.1) saturate(1.3);
}

/* Video responsive mejorado */
.video-container {
  position: relative;
  width: 100%;
  max-width: 800px;
  margin: 3rem auto;
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

iframe {
  width: 100%;
  height: 450px;
  border: none;
}

/* Footer mejorado */
footer {
  background: linear-gradient(135deg, #667eea, #764ba2);
  color: white;
  text-align: center;
  padding: 3rem 2rem;
  margin-top: 4rem;
  position: relative;
  overflow: hidden;
}

footer::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.1) 0%, transparent 70%);
  animation: rotate 20s linear infinite;
}

footer p {
  font-size: 1.1rem;
  position: relative;
  z-index: 2;
}

@keyframes rotate {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* Responsive Design */
@media (max-width: 768px) {
  header h1 {
    font-size: 2rem;
  }
  
  nav ul {
    flex-direction: column;
    gap: 1rem;
  }
  
  .slider {
    height: 300px;
    border-radius: 0;
  }
  
  article, section {
    padding: 1.5rem;
    margin-bottom: 1.5rem;
  }
  
  .imagenes {
    grid-template-columns: 1fr;
    gap: 1rem;
    padding: 1rem;
  }
  
  iframe {
    height: 250px;
  }
}

@media (max-width: 480px) {
  main {
    padding: 0 1rem;
  }
  
  header h1 {
    font-size: 1.5rem;
  }
  
  article h2, section h2 {
    font-size: 1.5rem;
  }
  
  li::before {
    display: none;
  }
}

/* Animaciones adicionales */
@keyframes pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.05); }
}

.pulse-animation {
  animation: pulse 2s infinite;
}

/* Efectos de scroll suave */
html {
  scroll-behavior: smooth;
}

/* Mejoras de accesibilidad */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* Focus styles para accesibilidad */
a:focus, button:focus {
  outline: 3px solid #667eea;
  outline-offset: 2px;
}

/* ANIMACIÓN INTERACTIVA SÚPER COOL - MONTAÑA RUSA ANIMADA */
.roller-coaster-container {
  position: relative;
  width: 100%;
  height: 400px;
  margin: 3rem 0;
  background: linear-gradient(to bottom, #87CEEB 0%, #98FB98 100%);
  border-radius: 20px;
  overflow: hidden;
  cursor: pointer;
  transition: all 0.3s ease;
}



@keyframes rideCoaster {
  0% { 
    left: -60px; 
    bottom: 130px; 
    transform: rotate(0deg); 
  }
  10% { 
    left: 10%; 
    bottom: 200px; 
    transform: rotate(-15deg); 
  }
  20% { 
    left: 20%; 
    bottom: 280px; 
    transform: rotate(-25deg); 
  }
  30% { 
    left: 30%; 
    bottom: 300px; 
    transform: rotate(-10deg); 
  }
  40% { 
    left: 40%; 
    bottom: 250px; 
    transform: rotate(10deg); 
  }
  50% { 
    left: 50%; 
    bottom: 180px; 
    transform: rotate(15deg); 
  }
  60% { 
    left: 60%; 
    bottom: 300px; 
    transform: rotate(-20deg); 
  }
  70% { 
    left: 70%; 
    bottom: 250px; 
    transform: rotate(5deg); 
  }
  80% { 
    left: 80%; 
    bottom: 200px; 
    transform: rotate(10deg); 
  }
  90% { 
    left: 90%; 
    bottom: 230px; 
    transform: rotate(-5deg); 
  }
  100% { 
    left: calc(100% + 60px); 
    bottom: 200px; 
    transform: rotate(0deg); 
  }
}

@keyframes carBounce {
  0% { transform: translateX(-50%) translateY(0); }
  100% { transform: translateX(-50%) translateY(-5px); }
}

@keyframes floatClouds1 {
  0% { left: -100px; }
  100% { left: calc(100% + 100px); }
}

@keyframes floatClouds2 {
  0% { left: -80px; }
  100% { left: calc(100% + 80px); }
}

@keyframes floatClouds3 {
  0% { left: -120px; }
  100% { left: calc(100% + 120px); }
}

@keyframes sunRotate {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

@keyframes sunGlow {
  0% { opacity: 0.5; }
  100% { opacity: 1; }
}

@keyframes flyBird {
  0% { 
    left: -30px; 
    transform: translateY(0) scale(1); 
  }
  50% { 
    left: 50%; 
    transform: translateY(-20px) scale(1.1); 
  }
  100% { 
    left: calc(100% + 30px); 
    transform: translateY(0) scale(1); 
  }
}

@keyframes explode {
  0% {
    opacity: 1;
    transform: translate(0, 0) scale(0);
  }
  20% {
    opacity: 1;
    transform: translate(-20px, -30px) scale(1);
  }
  40% {
    opacity: 0.8;
    transform: translate(-40px, -60px) scale(1.2);
  }
  60% {
    opacity: 0.6;
    transform: translate(-60px, -90px) scale(1);
  }
  80% {
    opacity: 0.3;
    transform: translate(-80px, -120px) scale(0.8);
  }
  100% {
    opacity: 0;
    transform: translate(-100px, -150px) scale(0);
  }
}


.roller-coaster-container:hover .fireworks {
  animation: none;
}

.roller-coaster-container:hover .firework {
  animation-play-state: running;
}


.coaster-text {
  position: absolute;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  color: white;
  font-size: 1.2rem;
  font-weight: bold;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.7);
  animation: textPulse 3s ease-in-out infinite;
  z-index: 4;
}

@keyframes textPulse {
  0%, 100% { opacity: 0.8; transform: translateX(-50%) scale(1); }
  50% { opacity: 1; transform: translateX(-50%) scale(1.1); }
}


@media (max-width: 768px) {
  .roller-coaster-container {
    height: 300px;
  }
  
  .track {
    bottom: 30px;
    height: 150px;
  }
  
  .roller-car {
    bottom: 100px;
    width: 50px;
    height: 35px;
  }
  
  .sun {
    width: 50px;
    height: 50px;
  }
  
  .coaster-text {
    font-size: 1rem;
  }
}