/* Variables de colores */
:root {
  --azulGeneral: #3e2149;
  --azulFosforecente: #8a4aa0;
  --azulVivido: #51046e;
  --azulVividoDegragado: #7c02a8;
  --azulPastel: #6ea1f7;
  --azulPastelDegradado20: #7aa7ff;
  --azulPastelDegradado40: #7ea1eb;
  --azulPastelDegradado60: #96c1ff;
  --moradoFosforecente: #8c00ff;
  --negro: #000000;
  --negroDegradado20: #00000070;
  --negroDegradado80: #0000002f;
  --blanco: #ffffff;
  --blancoDegradado: #ffffffa5;
}

/* Reset */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* Body */
body {
  background: var(--blanco);
  font-family: "Roboto", sans-serif;
  overflow-x: hidden;
}

/* Loader */
#loader {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: var(--blanco);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  z-index: 9999;
  transition: transform 1s ease-out, opacity 1s ease-out;
}

#loader img {
  width: 15vw;
  max-width: 180px;
  min-width: 100px;
  animation: pulse 2s infinite alternate;
}

#neuralCanvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

#loader p {
  color: var(--azulPastel);
  font-size: 40px;
  margin-top: 20px;
  text-shadow: 0 0 10px var(--azulPastel);
  letter-spacing: 2px;
  font-family: "Orbitron", sans-serif;
}

.loading {
  color: var(--azulFosforecente);
  font-size: 25px;
  margin-top: 20px;
  text-shadow: 0 0 10px var(--azulFosforecente);
  font-family: "Orbitron", sans-serif;
}

/* Animaciones */
@keyframes pulse {
  from {
    transform: scale(1);
    opacity: 1;
  }
  to {
    transform: scale(1.1);
    opacity: 0.8;
  }
}

.hidden {
  transform: translateY(-100%);
  opacity: 0;
}

/* Contenido */
#content {
  color: var(--blanco);
  text-align: center;
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 1.5s ease, transform 1.5s ease;
}

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

/* Header */
header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 50px;
  background: var(--negro);
}

header .logo img {
  font-family: "Orbitron", sans-serif;
  font-size: 1.5rem;
  color: var(--blanco);
  width: 8vw;
  max-width: 180px;
  min-width: 100px;
}

/* Navegación */
nav {
  display: flex;
  align-items: center;
  gap: 20px;
  font-size: 20px;
}

nav a {
  color: var(--blanco);
  text-decoration: none;
  font-family: "Orbitron", sans-serif;
}

nav a:hover {
  color: var(--azulFosforecente);
}

/* Botón */
.btn {
  background: var(--azulGeneral);
  color: var(--blanco);
  padding: 10px 20px;
  border-radius: 25px;
  text-decoration: none;
  font-family: "Orbitron", sans-serif;
  transition: background 0.9s ease;
}
/* Boton Hover */
.btn:hover {
  background-color: var(--azulPastelDegradado60);
  color: var(--azulFosforecente);
}

/* Slider o Carrousel */
.hero-slider {
  position: relative;
  height: 80vh;
  overflow: hidden;
}

.slides {
  height: 100%;
  position: relative;
}

.slide {
  position: absolute;
  width: 100%;
  height: 100%;
  opacity: 0;
  transition: opacity 1s ease;
}

.slide.active {
  opacity: 1;
  z-index: 1;
}

.slide-content {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  height: 100%;
  color: var(--blanco);
  text-align: center;
  background: linear-gradient(
    to right,
    var(--azulFosforecente),
    var(--moradoFosforecente)
  );
}

.slide-content h1 {
  font-size: 4rem;
  margin-bottom: 1rem;
}

.slide-content p {
  font-size: 1.5rem;
  margin-bottom: 2rem;
}

.slide-content .btn {
  padding: 1rem 2rem;
  background-color: var(--blanco);
  color: var(--azulVividoDegragado);
  text-decoration: none;
  border-radius: 5px;
  font-weight: bold;
  transition: 0.3s;
}

.slide-content .btn:hover {
  background-color: var(--azulGeneral);
  color: var(--blanco);
}

/* Slides con imagen de fondo */
.slide-image {
  width: 100%;
  height: 100%;
  background-size: cover;
  background-position: center;
}

/* Flechas */
.arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  font-size: 3rem;
  color: var(--blanco);
  background-color: var(--negroDegradado80);
  border: none;
  padding: 0.5rem 1rem;
  cursor: pointer;
  z-index: 2;
  border-radius: 50%;
  transition: background 0.3s;
}

.arrow:hover {
  background-color: var(--negroDegradado20);
}

.arrow.left {
  left: 20px;
}

.arrow.right {
  right: 20px;
}

/* Indicadores */
.indicators {
  position: absolute;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 10px;
  z-index: 2;
}

.indicator {
  width: 15px;
  height: 15px;
  background-color: var(--negroDegradado80);
  border-radius: 50%;
  cursor: pointer;
  transition: background 0.3s;
}

.indicator.active {
  background-color: var(--blanco);
}

/* Hamburger */
.hamburger {
  display: none;
  flex-direction: column;
  cursor: pointer;
}

.hamburger span {
  height: 3px;
  width: 25px;
  background: var(--blanco);
  margin: 4px 0;
  transition: all 0.3s ease;
}
.hero {
  text-align: center;
  padding: 100px 20px;
  background: linear-gradient(
    135deg,
    var(--azulFosforecente),
    var(--moradoFosforecente)
  );
}
.hero h1 {
  font-family: "Orbitron", sans-serif;
  font-size: 48px;
  margin-bottom: 20px;
}
.hero p {
  font-size: 20px;
  margin-bottom: 30px;
}
/* Services */
.services {
  padding: 60px 20px;
  background: var(--negro);
  text-align: center;
}
.services h2 {
  font-family: "Orbitron", sans-serif;
  color: var(--azulVividoDegragado);
  font-size: 35px;
  margin-bottom: 35px;
}
.service-cards {
  display: flex;
  justify-content: center;
  gap: 20px;
  flex-wrap: wrap;
  padding: 20px;
}

/* Tarjeta contenedora */
.card {
  perspective: 1000px; /* Necesario para el efecto 3D */
  width: 100%;
  max-width: 300px; /* No crece más que esto */
  aspect-ratio: 3 / 4; /* Mantiene proporción en pantallas chicas */
  flex: 1 1 200px; /* Se adapta según espacio */
}

/* Interior de la tarjeta (lo que gira) */
.card-inner {
  position: relative;
  width: 100%;
  height: 100%;
  transition: transform 0.8s;
  transform-style: preserve-3d;
  border-radius: 10px;
}

/* Hover: gira */
.card:hover .card-inner {
  transform: rotateY(180deg);
}

/* Lados */
.card-front,
.card-back {
  position: absolute;
  width: 100%;
  height: 100%;
  border-radius: 10px;
  backface-visibility: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  padding: 15px;
  box-sizing: border-box;
  overflow: hidden;
  font-size: clamp(0.9rem, 2vw, 1rem); /* Ajusta tamaño texto */
}

/* Frente */
.card-front {
  background: var(--negroDegradado20);
  border: 1px solid var(--moradoFosforecente);
  color: white;
  transition: box-shadow 0.3s, transform 0.3s;
}

/* Hover sombra */
.card:hover .card-front {
  box-shadow: 0 0 15px var(--moradoFosforecente);
  transform: translateY(-10px);
}

/* Animación llenado */
.card-front::before {
  content: "";
  position: absolute;
  width: 300%;
  height: 300%;
  background: var(--moradoFosforecente);
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0);
  border-radius: 50%;
  transition: transform 0.6s ease-out;
  z-index: 0;
}
.card:hover .card-front::before {
  transform: translate(-50%, -50%) scale(1);
}
.card-front * {
  position: relative;
  z-index: 1;
}

/* Reverso */
.card-back {
  background: linear-gradient(135deg, var(--moradoFosforecente), var(--azulFosforecente));
  color: white;
  transform: rotateY(180deg);
}

/* Ajuste en móviles muy chicos */
@media (max-width: 480px) {
  .service-cards {
    gap: 10px;
  }
  .card {
    max-width: 180px;
  }
}

footer {
  background: var(--negro);
  text-align: center;
  padding: 20px;
  border-top: 1px solid var(--negroDegradado20);
}

/* Mensaje flotante tipo burbuja */
#chat-tooltip {
  position: fixed;
  right: 20px;
  background: var(--azulPastelDegradado60);
  color: var(--azulFosforecente);
  padding: 8px 12px;
  border-radius: 15px;
  font-size: 14px;
  font-family: "Roboto", sans-serif;
  box-shadow: 0 4px 10px var(--negroDegradado20);
  white-space: nowrap;
  z-index: 9998;
  opacity: 1;
  animation: float 2s ease-in-out infinite;
}

/* Animación de flotación */
@keyframes float {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-5px);
  }
}

#chat-tooltip.hidden {
  opacity: 0;
  transform: translateY(10px);
  pointer-events: none;
  transition: opacity 0.3s ease, transform 0.3s ease;
}

/* Burbuja de chat */
#chat-toggle {
  position: fixed;
  bottom: 0px;
  right: 20px;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: var(--azulPastelDegradado60);
  color: var(--blanco);
  font-size: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 4px 10px var(--negroDegradado20);
  z-index: 9999;
  transition: transform 0.2s ease;
}

/* Caja del chat */
#chat-bot {
  position: fixed;
  top: 70%; /* centrado verticalmente */
  transform: translateY(-70%);
  right: 20px;
  width: 320px;
  height: 200px;
  max-height: 600px;
  border-radius: 12px;
  box-shadow: 0 4px 15px var(--negroDegradado20);
  background: #fff;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  font-family: Arial, sans-serif;
  opacity: 0;
  transform: scale(0.8);
  pointer-events: none;
  transition: all 0.3s ease;
  z-index: 9998;
}

#chat-bot.show {
  opacity: 1;
  transform: scale(1);
  pointer-events: auto;
}

#chat-header {
  background: var(--azulPastelDegradado40);
  color: var(--azulFosforecente);
  padding: 10px;
  text-align: center;
  position: relative;
  font-weight: bolder;
}

#close-chat {
  position: absolute;
  right: 10px;
  top: 5px;
  cursor: pointer;
  font-size: 18px;
}

/* Cuerpo del chat */
#chat-body {
  flex: 1;
  padding: 10px;
  overflow-y: auto;
  background: var(--blancoDegradado);
}
#chat-body div {
  margin-bottom: 10px;
}
.user-msg {
  text-align: right;
  margin-right: 5px;
  margin-left: 25px;
  color: var(--negro);
  background-color: var(--azulPastelDegradado60);
  border-radius: 5px;
}
.bot-msg {
  text-align: left;
  margin-right: 25px;
  color: var(--negro);
  background-color: var(--azulPastel);
  border-radius: 5px;
}

#send-btn {
  background: var(--azulGeneral);
  color: var(--blanco);
  border: none;
  padding: 10px 15px;
  cursor: pointer;
  font-size: 15px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-left: 10px;
  transition: background 0.3s;
}

#send-btn:hover {
  background-color: var(--azulPastelDegradado60);
  color: var(--azulFosforecente);
}

/* Contenedor input + botón */
#chat-input-container {
  display: flex;
  border-top: 1px solid var(--azulPastelDegradado60);
}

/* Input de chat */
#chat-input {
  flex: 1;
  border: none;
  padding: 10px;
  font-size: 14px;
  outline: none;
  box-sizing: border-box;
  color: var(--negroDegradado20);
}

/* Responsive */
@media (max-width: 768px) {
  nav {
    overflow: hidden;
    max-height: 0;
    opacity: 0;
    flex-direction: column;
    position: absolute;
    top: 70px;
    right: 0;
    width: 220px;
    background: var(--negro);
    border-left: 1px solid var(--negroDegradado80);
    padding: 0 20px;
    z-index: 1000;
    gap: 15px;
    transition: max-height 0.4s ease, opacity 0.4s ease, padding 0.3s ease;
  }

  nav.active {
    max-height: 500px;
    opacity: 1;
    padding: 20px;
  }

  .hamburger {
    display: flex;
  }
  .btn {
    display: block;
    text-align: center;
    width: 100%;
    margin-top: 10px;
  }
  .slide-content h1 {
    font-size: 2.5rem;
  }

  .slide-content p {
    font-size: 1rem;
  }

  .arrow {
    font-size: 2rem;
  }

  #chat-bot {
    width: 100%;
    max-height: 90vh;
    right: 0;
    bottom: 0;
    border-radius: 0;
  }

  #chat-toggle {
    bottom: 15px;
    right: 15px;
  }
}
