

/* Animaciones personalizadas */
@layer utilities {
  .fade-in {
    @apply opacity-0 translate-y-4 transition-all duration-700 ease-out;
  }

  .fade-in.show {
    @apply opacity-100 translate-y-0;
  }
}

/* Asegurar que las clases personalizadas tengan mayor especificidad */
@layer components {
  .fade-on-scroll {
    opacity: 0 !important;
    transform: translateY(20px) !important;
    transition: opacity 0.6s ease-out, transform 0.6s ease-out !important;
  }

  .fade-on-scroll.show {
    opacity: 1 !important;
    transform: translateY(0) !important;
  }
}

@keyframes floatDown {
  from {
    opacity: 0;
    transform: translateY(-20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
@layer components {
  .effect-fade-in-scroll {
    @apply fade-in opacity-0 translate-y-4 transition-all duration-700 ease-out fade-on-scroll;
  }
}
.float-down {
  animation: floatDown 1.2s ease-out forwards;
}

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


.animate-fade-in {
  animation: fadeIn 0.4s ease-out forwards;
}

/*Estilo de la imagen en seccion about us*/
.custom-bottom-round {
  clip-path: ellipse(100% 90% at 50% 0%);
}

h1,
h2,
h3,
h4 {
  font-family: "Playfair Display", serif;
}

/* Excepción: mantener Playfair Display para el logo */
header h1,
header .logo-text,
header a h1 {
  font-family: "Playfair Display", serif;
}

body,
p,
a,
span,
li {
  font-family: "Source Sans Pro", sans-serif;
}

/* anumacion del boton inicio en menu nav */
@keyframes spin-slow {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}
.spin-slow {
  animation: spin-slow 10s linear infinite;
}

/* Animacion de svg menu nav en movil version */
.eyes-bounce {
  animation: bounceUp 6s ease-in-out 2s infinite;
}

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

.wiggle-card {
  transform-origin: center;
  animation: wiggle 2s ease-in-out infinite;
}

@keyframes wiggle {
  0%,
  100% {
    transform: rotate(0deg);
  }
  25% {
    transform: rotate(10deg);
  }
  50% {
    transform: rotate(-10deg);
  }
  75% {
    transform: rotate(5deg);
  }
}

.flip {
  transform-origin: center;
  animation: flipY 10s ease-in-out infinite;
}

@keyframes flipY {
  0%,
  100% {
    transform: rotateY(0deg);
  }
  50% {
    transform: rotateY(180deg);
  }
}

.heart-group {
  transform-origin: center;
  animation: pulse 3s infinite ease-in-out;
}

.heart {
  fill: none;
  stroke: #f8f4e3;
  stroke-width: 2;
}

@keyframes pulse {
  0%,
  100% {
    transform: scale(0.8);
  }
  50% {
    transform: scale(1.2);
  }
}

/* ===== ESTILOS PARA LA ANIMACIÓN DEL RELOJ DE ARENA ===== */

/* Animación principal para los elementos que caen */
@keyframes fallDown {
  0% {
    transform: translateY(-50px);
    opacity: 0;
  }
  10% {
    opacity: 1;
  }
  90% {
    opacity: 1;
  }
  100% {
    transform: translateY(calc(100vh - 100px));
    opacity: 0;
  }
}

/* Estilos para los elementos de arena (gránulos) */
.sand-grain {
  position: absolute;
  background: rgba(120, 172, 207, 0.8);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 600;
  color: #2C3E50;
  text-align: center;
  padding: 0.5rem;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
  border: 2px solid rgba(120, 172, 207, 0.9);
  animation: fallDown linear infinite;
  z-index: 5;
  width: 100px;
  height: 100px;
  word-wrap: break-word;
  line-height: 1.2;
  aspect-ratio: 1;
}

/* Diferentes velocidades para cada elemento */
.sand-grain.speed-1 {
  animation-duration: 8s;
}

.sand-grain.speed-2 {
  animation-duration: 10s;
}

.sand-grain.speed-3 {
  animation-duration: 12s;
}

.sand-grain.speed-4 {
  animation-duration: 9s;
}

.sand-grain.speed-5 {
  animation-duration: 11s;
}

.sand-grain.speed-6 {
  animation-duration: 13s;
}

/* Efecto de brillo sutil */
.sand-grain::before {
  content: '';
  position: absolute;
  top: 10%;
  left: 20%;
  width: 30%;
  height: 30%;
  background: rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  pointer-events: none;
}

/* Contenedor de gránulos completamente transparente */
#hourglass-container {
  background: transparent !important;
}

/* Estilos para el progreso del reloj de arena */
.sand-level-1 { height: 0.25rem !important; } /* h-1 */
.sand-level-2 { height: 0.5rem !important; }  /* h-2 */
.sand-level-3 { height: 0.75rem !important; } /* h-3 */
.sand-level-4 { height: 1rem !important; }    /* h-4 */
.sand-level-5 { height: 1.25rem !important; } /* h-5 */
.sand-level-6 { height: 1.5rem !important; }  /* h-6 */
.sand-level-7 { height: 1.75rem !important; } /* h-7 */
.sand-level-8 { height: 2rem !important; }    /* h-8 */
.sand-level-9 { height: 2.25rem !important; } /* h-9 */
.sand-level-10 { height: 2.5rem !important; } /* h-10 */

/* Colores de progreso para el texto */
.text-progress-start { color: #336699 !important; } /* Azul inicial */
.text-progress-middle { color: #2D5016 !important; } /* Verde crecimiento */
.text-progress-max { color: #F8F4E3 !important; } /* Beige completado */

/* Timeline background - Desktop */
#timeline-bg-container {
  background-image: url('../images/svg/fidelandante.svg');
  background-position: center top;
  background-size: 100% 100%;
  background-repeat: no-repeat;
  background-attachment: fixed;
  min-height: 100vh;
}

/* Responsive: ajustar tamaños en móviles */
@media (max-width: 768px) {
  .sand-grain {
    font-size: 0.65rem;
    width: 80px;
    height: 80px;
    padding: 0.3rem;
  }

  /* Timeline background para móvil */
  #timeline-bg-container {
    background-image: url('../images/svg/fidelandante-mobile.svg') !important;
    background-attachment: scroll !important;
    background-size: 100% 100% !important;
    background-position: center top !important;
    background-repeat: no-repeat !important;
    height: auto !important;
    min-height: 100vh !important;
    display: block !important;
    position: relative !important;
  }
}