:root {
  --neukenia-blue: #0e3b4c;
  --neukenia-orange: #c9692d;
  --neukenia-cream: #f9f0dc;
}

*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: "Arial", sans-serif;
}

html,
body {
  height: 100%;
  width: 100%;
  overflow-x: hidden;
  position: relative;
}

body {
  min-height: 100vh;
  /* Usar viewport height para asegurar altura completa */
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* Fondo con animación */
.background {
  position: fixed; /* Cambiado de absolute a fixed */
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image: url("../img/bkg.png");
  background-size: cover;
  background-position: center;
  filter: brightness(0.7);
  animation: zoomEffect 30s infinite alternate;
  z-index: -2; /* Asegura que esté detrás de todo */
}

@keyframes zoomEffect {
  from {
    transform: scale(1);
  }
  to {
    transform: scale(1.1);
  }
}

/* Overlay para oscurecer el fondo */
.overlay {
  position: fixed; /* Cambiado de absolute a fixed */
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.4);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: -1; /* Detrás del contenido pero encima del fondo */
}

/* Contenedor principal que envuelve todo el contenido */
.main-container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
  z-index: 1;
}

/* Contenedor del logo */
.logo-container {
  width: 100%;
  display: flex;
  justify-content: center;
  margin-bottom: 30px;
  padding-top: 30px;
}

/* Logo responsive */
.logo {
  width: 100%;
  max-width: 153px;
  height: auto;
}

/* Contenedor del chat con mejor responsividad */
.chat-container {
  background-color: rgba(249, 240, 220, 0.95);
  border-radius: 16px;
  padding: clamp(15px, 5vw, 30px); /* Padding responsivo */
  width: 100%;
  max-width: 364.5px;
  margin: 20px auto;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
  z-index: 10;
}

/* Burbujas del chat con efecto de crecimiento */
.chat-bubble {
  padding: clamp(10px, 3vw, 15px) clamp(12px, 4vw, 20px);
  background-color: var(--neukenia-blue);
  color: white;
  border-radius: 18px;
  border-bottom-left-radius: 5px;
  margin-bottom: 20px;
  position: relative;
  opacity: 0;
  transform: scale(0.8);
  transition: opacity 0.3s ease, transform 0.3s ease;
  font-size: clamp(0.9rem, 2.5vw, 1rem); /* Tamaño de texto responsive */
}

.chat-bubble.show {
  opacity: 1;
  transform: scale(1);
}

/* Clases para retrasar la aparición de las burbujas */
.chat-bubble.delay-1 {
  animation: showBubble 0.5s ease-out forwards 0.5s;
  opacity: 0;
  transform: scale(0.8);
}

.chat-bubble.delay-2 {
  animation: showBubble 0.5s ease-out forwards 2s;
  opacity: 0;
  transform: scale(0.8);
}

.chat-bubble.delay-3 {
  animation: showBubble 0.5s ease-out forwards 3.5s;
  opacity: 0;
  transform: scale(0.8);
}

@keyframes showBubble {
  to {
    opacity: 1;
    transform: scale(1);
  }
}

/* Contacto y barra de progreso */
.contact-container {
  margin-top: 25px;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  opacity: 0;
  animation: fadeIn 1s ease-out forwards 5.5s;
}

@keyframes fadeIn {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.social-icons {
  display: flex;
  gap: clamp(10px, 3vw, 15px);
  margin-top: 15px;
  flex-wrap: wrap; /* Permite que los iconos se ajusten en pantallas pequeñas */
  justify-content: center;
}

.social-icon {
  width: clamp(32px, 8vw, 40px);
  height: clamp(32px, 8vw, 40px);
  border-radius: 50%;
  background-color: var(--neukenia-orange);
  display: flex;
  justify-content: center;
  align-items: center;
  color: white;
  font-size: clamp(16px, 5vw, 20px);
  text-decoration: none;
  transition: transform 0.3s, background-color 0.3s;
}

.social-icon:hover {
  transform: translateY(-3px);
  filter: brightness(1.1);
}

.social-icon svg {
  width: clamp(18px, 5vw, 22px);
  height: clamp(18px, 5vw, 22px);
  fill: white;
}

.contact-email {
  margin-top: 10px;
  color: var(--neukenia-blue);
  text-decoration: none;
  font-weight: bold;
  font-size: clamp(0.9rem, 2.5vw, 1rem);
}

.contact-email:hover {
  text-decoration: underline;
}

.action-button {
  margin-top: 20px;
  padding: clamp(10px, 3vw, 12px) clamp(20px, 5vw, 25px);
  background-color: var(--neukenia-orange);
  color: white;
  border: none;
  border-radius: 30px;
  font-size: clamp(0.9rem, 2.5vw, 1rem);
  font-weight: bold;
  cursor: pointer;
  transition: background-color 0.3s, transform 0.3s;
  text-decoration: none;
  display: inline-block;
  text-align: center;
}

.action-button:hover {
  filter: brightness(1.1);
  transform: translateY(-2px);
}

.progress-container {
  margin-top: 25px;
  width: 100%;
  opacity: 0;
  transition: opacity 0.5s ease;
}

.progress-label {
  display: flex;
  justify-content: space-between;
  margin-bottom: 8px;
  font-size: clamp(0.8rem, 2.5vw, 1rem);
  color: var(--neukenia-blue);
  font-weight: bold;
}

.progress-bar {
  height: clamp(6px, 2vw, 8px);
  width: 100%;
  background-color: #e0e0e0;
  border-radius: 4px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  width: 0%;
  background-color: var(--neukenia-orange);
  border-radius: 4px;
  animation: progressFill 2s ease-out forwards 5s;
}

@keyframes progressFill {
  to {
    width: 75%;
  }
}

/* Media queries mejoradas para mayor responsividad */

/* Pantallas grandes */
@media (min-width: 1200px) {
  .chat-container {
    transform: translateY(
      0
    ); /* Elimina el posicionamiento fijo para pantallas grandes */
  }
}

/* Pantallas medianas - Tablets y laptops pequeñas */
@media (max-width: 992px) {
  .main-container {
    padding: 15px;
  }

  .logo-container {
    padding-top: 20px;
    margin-bottom: 20px;
  }

  .chat-container {
    margin-top: 0;
  }
}

/* Tablets */
@media (max-width: 768px) {
  .logo-container {
    padding-top: 15px;
  }

  .logo {
    max-width: 130px;
  }

  .chat-container {
    max-width: 90%;
  }
}

/* Teléfonos grandes */
@media (max-width: 576px) {
  .logo {
    max-width: 120px;
  }

  .chat-container {
    max-width: 95%;
    padding: 15px;
  }

  .action-button {
    width: 100%; /* Botón de ancho completo en móviles */
  }
}

/* Teléfonos pequeños */
@media (max-width: 375px) {
  .logo {
    max-width: 100px;
  }

  .chat-container {
    padding: 12px;
  }

  .chat-bubble {
    padding: 8px 10px;
    margin-bottom: 15px;
  }

  .social-icons {
    gap: 8px;
  }
}

/* Añadir soporte para dispositivos con altura reducida (modo paisaje en móviles) */
@media (max-height: 600px) {
  .logo-container {
    padding-top: 10px;
    margin-bottom: 10px;
  }

  .logo {
    max-width: 100px;
  }

  .chat-container {
    padding: 12px;
    margin: 5px auto;
  }

  .chat-bubble {
    margin-bottom: 10px;
  }

  .contact-container {
    margin-top: 15px;
  }

  .action-button {
    margin-top: 10px;
  }

  .progress-container {
    margin-top: 15px;
  }
}

/* Soporte para pantallas muy pequeñas o dispositivos antiguos */
@media (max-width: 320px) {
  .logo {
    max-width: 90px;
  }

  .chat-bubble {
    font-size: 0.8rem;
  }

  .social-icon {
    width: 30px;
    height: 30px;
  }

  .social-icon svg {
    width: 16px;
    height: 16px;
  }
}
