/* Reset básico y variables CSS */
:root {
  --primary-color: #4a90e2; /* Azul moderno */
  --secondary-color: #2c3e50; /* Azul oscuro */
  --accent-color: #f5a623; /* Naranja para detalles */
  --bg-color: #0f172a; /* Fondo oscuro (Modo Oscuro Premium) */
  --card-bg: #1e293b; /* Fondo de tarjetas */
  --text-color: #f1f5f9; /* Texto claro */
  --text-muted: #94a3b8; /* Texto secundario */
  --neon-glow:
    0 0 10px rgba(74, 144, 226, 0.7), 0 0 20px rgba(74, 144, 226, 0.5); /* Brillo neón */
  --font-main: "Poppins", sans-serif;
}

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

body {
  font-family: var(--font-main);
  background-color: var(--bg-color);
  color: var(--text-color);
  line-height: 1.6;
  overflow-x: hidden; /* Evitar scroll horizontal por efectos 3D */
}

/* Contenedor general */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

/* Barra de Navegación con efecto cristal */
.navbar {
  background-color: rgba(15, 23, 42, 0.8);
  padding: 20px 0;
  position: sticky;
  top: 0;
  z-index: 1000;
  backdrop-filter: blur(15px); /* Efecto vidrio esmerilado */
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.1);
}

.navbar .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo {
  display: flex;
  align-items: center;
  text-decoration: none;
  color: var(--text-color);
  font-weight: 700;
  font-size: 1.5rem;
  text-shadow: 0 0 10px rgba(74, 144, 226, 0.5); /* Brillo sutil */
}

.logo img {
  height: 40px;
  margin-right: 10px;
  transition: transform 0.5s ease;
}

.logo:hover img {
  transform: rotate(360deg); /* Pequeño giro al pasar el mouse */
}

.nav-links {
  list-style: none;
  display: flex;
  gap: 30px;
}

.nav-links a {
  text-decoration: none;
  color: var(--text-color);
  font-weight: 500;
  transition: all 0.3s;
  position: relative;
}

.nav-links a:hover {
  color: var(--primary-color);
  text-shadow: 0 0 8px var(--primary-color);
}

.nav-links a::after {
  content: "";
  position: absolute;
  width: 0;
  height: 2px;
  bottom: -5px;
  left: 0;
  background-color: var(--primary-color);
  transition: width 0.3s;
  box-shadow: 0 0 10px var(--primary-color);
}

.nav-links a:hover::after {
  width: 100%;
}

.hamburger {
  display: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: var(--text-color);
}

/* Sección Hero Futurista */
.hero {
  padding: 100px 0;
  display: flex;
  align-items: center;
  min-height: 80vh;
  position: relative;
  overflow: hidden;
}

/* Fondo decorativo futurista (círculos difusos) */
.hero::before {
  content: "";
  position: absolute;
  top: -20%;
  right: -10%;
  width: 600px;
  height: 600px;
  background: radial-gradient(
    circle,
    rgba(74, 144, 226, 0.15) 0%,
    rgba(0, 0, 0, 0) 70%
  );
  border-radius: 50%;
  z-index: -1;
  pointer-events: none;
}

.hero .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  perspective: 1000px; /* Perspectiva 3D para la imagen */
}

.hero-content {
  flex: 1;
  min-width: 300px;
  padding-right: 50px;
  z-index: 1;
}

.hero-content h1 {
  font-size: 3.5rem;
  margin-bottom: 20px;
  line-height: 1.2;
  filter: drop-shadow(0 0 5px rgba(74, 144, 226, 0.3));
}

.hero-content h1 .text-gradient {
  background: linear-gradient(to right, #fff, #4a90e2, #6dd5fa);
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-content p {
  font-size: 1.1rem;
  color: var(--text-muted);
  margin-bottom: 30px;
}

.btn {
  display: inline-block;
  padding: 14px 35px;
  border-radius: 50px;
  text-decoration: none;
  font-weight: 600;
  transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275); /* Efecto rebote */
  position: relative;
  overflow: hidden;
}

.btn-primary {
  background-color: var(--primary-color);
  color: white;
  box-shadow: var(--neon-glow);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.btn-primary:hover {
  transform: translateY(-3px) scale(1.05);
  box-shadow:
    0 0 20px rgba(74, 144, 226, 0.8),
    0 0 40px rgba(74, 144, 226, 0.4);
}

.btn-primary i {
  position: relative;
  z-index: 2; /* Asegurar que el icono esté sobre las partículas */
}

/* Efecto de partículas Matrix en el botón */
.matrix-particle {
  position: absolute;
  top: -10px;
  color: rgba(100, 255, 218, 0.9); /* Color tecno verde-azulado brillante */
  font-family: "Courier New", monospace;
  font-weight: bold;
  pointer-events: none;
  user-select: none;
  z-index: 1;
  animation: matrixFall linear forwards;
  text-shadow: 0 0 5px rgba(100, 255, 218, 0.8);
}

@keyframes matrixFall {
  0% {
    transform: translateY(0);
    opacity: 1;
  }
  100% {
    transform: translateY(60px); /* Caída suficiente para salir del botón */
    opacity: 0;
  }
}

.hero-image {
  flex: 1;
  display: flex;
  justify-content: center;
  min-width: 300px;
  perspective: 1500px; /* Profundidad 3D aumentada */
  transform-style: preserve-3d;
}

.app-preview {
  max-width: 100%;
  height: auto;
  max-height: 500px;
  filter: drop-shadow(0 0 30px rgba(74, 144, 226, 0.3));
  border-radius: 20px;
  transition: transform 0.1s linear; /* Transición suave para el script */
  will-change: transform; /* Optimización de rendimiento */
}

/* Sección de Características */
.features {
  padding: 80px 0;
  background-color: var(--card-bg);
  position: relative;
}

.section-title {
  text-align: center;
  font-size: 2.5rem;
  margin-bottom: 50px;
  color: var(--text-color);
  text-shadow: 0 0 10px rgba(255, 255, 255, 0.1);
}

.features-grid {
  display: grid;
  /* Por defecto para móviles: 1 columna */
  grid-template-columns: 1fr;
  gap: 30px;
  perspective: 1000px;
}

/* Responsividad para features-grid */
@media (min-width: 768px) {
  .features-grid {
    /* Tablets: 2 columnas */
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1024px) {
  .features-grid {
    /* Escritorio: 3 columnas exactas para lograr el layout 3x2 */
    grid-template-columns: repeat(3, 1fr);
  }
}

.feature-card {
  background: rgba(15, 23, 42, 0.6);
  padding: 30px;
  border-radius: 20px;
  text-align: center;
  transition: all 0.4s ease;
  border: 1px solid rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(5px);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
  transform-style: preserve-3d;
}

.feature-card:hover {
  transform: translateY(-15px) rotateX(5deg);
  border-color: var(--primary-color);
  box-shadow:
    0 20px 40px rgba(0, 0, 0, 0.4),
    0 0 15px rgba(74, 144, 226, 0.2);
}

.feature-card i {
  font-size: 3.5rem;
  color: var(--primary-color);
  margin-bottom: 20px;
  filter: drop-shadow(0 0 10px rgba(74, 144, 226, 0.5));
  transition: transform 0.3s;
}

.feature-card:hover i {
  transform: scale(1.1) translateZ(20px); /* El icono "salta" hacia el usuario */
}

.feature-card h3 {
  margin-bottom: 15px;
  font-size: 1.3rem;
}

.feature-card p {
  color: var(--text-muted);
}

/* Sección de Galería - Teléfono Android 3D */
.gallery {
  padding: 100px 0;
  display: flex;
  justify-content: center;
  background: radial-gradient(circle at center, #1e293b 0%, #0f172a 100%);
}

.phone-container {
  display: flex;
  justify-content: center;
  margin-top: 20px;
  perspective: 2000px; /* Perspectiva profunda para el teléfono */
}

/* Marco del teléfono */
.phone-frame {
  width: 300px;
  height: 600px;
  background-color: #050505;
  border-radius: 40px;
  border: 8px solid #222;
  position: relative;
  box-shadow:
    0 0 0 2px #333,
    0 20px 50px rgba(0, 0, 0, 0.7),
    0 0 30px rgba(74, 144, 226, 0.1); /* Brillo externo sutil */
  overflow: hidden;
  transform-style: preserve-3d;
  transition: transform 0.5s ease-out;
}

/* Efecto al pasar el mouse sobre el teléfono */
.phone-frame:hover {
  transform: rotateY(-10deg) rotateX(5deg);
  box-shadow:
    0 0 0 2px #333,
    -20px 30px 60px rgba(0, 0, 0, 0.8),
    -5px 0 40px rgba(74, 144, 226, 0.2);
}

.camera-notch {
  position: absolute;
  top: 15px;
  left: 50%;
  transform: translateX(-50%);
  width: 12px;
  height: 12px;
  background-color: #111;
  border-radius: 50%;
  z-index: 10;
  box-shadow: inset 0 0 2px rgba(255, 255, 255, 0.1);
}

.phone-screen {
  width: 100%;
  height: 100%;
  background-color: #1a1a1a;
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.slider {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 20px;
  animation: slideShow 5s infinite ease-in-out alternate;
}

@keyframes slideShow {
  0% {
    opacity: 0.8;
    transform: scale(1);
  }
  100% {
    opacity: 1;
    transform: scale(1.05);
  }
}

.slide-content {
  color: #fff;
}

.slide-content i {
  font-size: 4rem;
  color: var(--primary-color);
  margin-bottom: 20px;
  animation: floatIcon 3s ease-in-out infinite;
  text-shadow: 0 0 20px rgba(74, 144, 226, 0.8);
}

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

.slide-content h3 {
  font-size: 1.8rem;
  margin-bottom: 10px;
  background: linear-gradient(to right, #4a90e2, #6dd5fa);
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.slide-content p {
  color: var(--text-muted);
  font-size: 1rem;
}

/* Sección de Contacto */
.contact {
  padding: 80px 0;
  text-align: center;
}

.contact-content p {
  margin-bottom: 15px;
  font-size: 1.1rem;
}

.contact-content a {
  color: var(--primary-color);
  text-decoration: none;
  font-weight: 600;
}

.contact-content a:hover {
  text-decoration: underline;
}

/* Pie de Página */
footer {
  background-color: #020617;
  padding: 40px 0;
  text-align: center;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}

footer p {
  color: var(--text-muted);
  margin-bottom: 10px;
}

footer .legal-links a {
  color: var(--text-muted);
  text-decoration: none;
  margin: 0 10px;
  font-size: 0.9rem;
  transition: color 0.3s;
}

footer .legal-links a:hover {
  color: var(--primary-color);
}

/* Media Queries para Responsividad */
@media (max-width: 768px) {
  .nav-links {
    display: none;
    flex-direction: column;
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    background-color: rgba(15, 23, 42, 0.95);
    padding: 20px;
    text-align: center;
  }

  .nav-links.active {
    display: flex;
  }

  .hamburger {
    display: block;
  }

  .hero-content h1 {
    font-size: 2.5rem;
  }

  .hero .container {
    flex-direction: column;
    text-align: center;
  }

  .hero-content {
    padding-right: 0;
    margin-bottom: 50px;
  }
}

/* Clases utilitarias dinámicas */
.visible {
  opacity: 1 !important;
  transform: translateY(0) scale(1) !important;
}
