/* --- VARIABLES DE COLOR Y FUENTES --- */
:root {
    --primary-bg: #1a1a2e;
    --secondary-bg: #16213e;
    --container-border: #0f3460;
    --text-color: #e0e0e0;
    --header-color: #a29bfe;
    --accent-color: #55efc4;
    --yellow-accent: #fdcb6e;
    --font-title: 'Cinzel', serif;
    --font-body: 'Segoe UI', sans-serif;
    --glow-shadow: 0 0 15px rgba(85, 239, 196, 0.4);
}

/* --- ESTILOS GENERALES Y RESETEO --- */
html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-body);
    background-color: var(--primary-bg);
    color: var(--text-color);
    margin: 0;
    line-height: 1.7;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    position: relative;
    z-index: 2;
}

section {
    padding: 80px 20px;
    text-align: center;
}

h1, h2, h3 {
    font-family: var(--font-title);
    color: var(--header-color);
    text-shadow: 0 0 8px rgba(162, 155, 254, 0.3);
}

h2 {
    font-size: 3em;
    margin-bottom: 50px;
}

/* --- FONDO DE PARTÍCULAS --- */
#particle-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
}

/* --- BARRA DE NAVEGACIÓN FIJA --- */
#navbar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    background-color: rgba(22, 33, 62, 0.9);
    backdrop-filter: blur(10px);
    z-index: 100;
    padding: 10px 0;
    border-bottom: 1px solid var(--container-border);
    transform: translateY(-100%);
    transition: transform 0.3s ease-in-out;
}

#navbar.visible {
    transform: translateY(0);
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-logo {
    font-family: var(--font-title);
    font-size: 1.5em;
    font-weight: bold;
    color: var(--accent-color);
}

.nav-links a {
    color: var(--text-color);
    text-decoration: none;
    margin: 0 15px;
    font-weight: bold;
    transition: color 0.2s;
}

.nav-links a:hover {
    color: var(--accent-color);
}

.nav-button {
    padding: 8px 20px;
    font-size: 0.9em;
    margin-left: 15px;
}

/* --- BOTÓN DE LLAMADA A LA ACCIÓN (CTA) --- */
.cta-button {
    display: inline-block;
    padding: 18px 40px;
    font-size: 1.2em;
    font-weight: bold;
    font-family: var(--font-body);
    text-transform: uppercase;
    color: var(--primary-bg);
    background: linear-gradient(145deg, var(--accent-color), #48d1b0);
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 20px rgba(85, 239, 196, 0.4);
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.2);
}

.cta-button:hover {
    transform: translateY(-5px) scale(1.05);
    box-shadow: 0 8px 25px rgba(85, 239, 196, 0.6);
}

.cta-button.secondary {
    background: linear-gradient(145deg, var(--header-color), #8e85e0);
    box-shadow: 0 4px 20px rgba(162, 155, 254, 0.4);
}

.cta-button.secondary:hover {
    box-shadow: 0 8px 25px rgba(162, 155, 254, 0.6);
}

/* --- SECCIÓN HERO --- */
.hero {
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;
    color: white;
    position: relative;
    overflow: hidden;
}

.hero .logo {
    width: 150px;
    margin-bottom: 20px;
    animation: float 6s ease-in-out infinite;
}

.hero h1 {
    font-size: 4.5em;
    margin: 0;
    color: white;
    text-shadow: 0 0 20px var(--accent-color);
    animation: pulseGlowTitle 4s ease-in-out infinite;
}

.hero .slogan {
    font-size: 1.6em;
    margin: 10px 0 40px 0;
    opacity: 0.9;
}

/* --- SECCIÓN DE CARACTERÍSTICAS (HEXÁGONOS) --- */
/* --- SECCIÓN DE CARACTERÍSTICAS (HEXÁGONOS) --- */
.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 40px;
}

.feature-card {
    background-color: transparent;
    padding: 40px 30px;
    position: relative;
    clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
    transition: transform 0.3s ease; /* Transición solo para el transform */
    animation: float 6s ease-in-out infinite;
}

/* ¡LÓGICA CORREGIDA Y SIMPLIFICADA! */
/* El ::before ahora maneja tanto el fondo como el brillo pulsante. */
.feature-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    z-index: -1; /* Lo ponemos detrás del contenido */
    clip-path: inherit;
    background-color: var(--secondary-bg);
    border: 2px solid transparent;
    
    /* Aplicamos la animación de pulso directamente aquí */
    animation: pulseGlowCard 4s ease-in-out infinite;

    /* Añadimos transiciones para que el cambio en hover sea suave */
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

/* Eliminamos la regla .feature-card::after por completo, ya no es necesaria. */

/* Retrasos escalonados para un movimiento natural (sin cambios) */
.features-grid .feature-card:nth-child(1) { animation-delay: 0s; }
.features-grid .feature-card:nth-child(2) { animation-delay: -1.5s; }
.features-grid .feature-card:nth-child(3) { animation-delay: -3s; }
.features-grid .feature-card:nth-child(4) { animation-delay: -4.5s; }


/* Efecto Hover mejorado y corregido */
.feature-card:hover {
    animation-play-state: paused; /* Pausa la levitación */
    transform: translateY(-15px) scale(1.03);
}

/* Al pasar el cursor, modificamos el ::before para el nuevo brillo y borde */
.feature-card:hover::before {
    /* Desactivamos la animación de pulso para que no interfiera */
    animation: none;
    /* Aplicamos el nuevo brillo más intenso y estático */
    box-shadow: 0 10px 30px rgba(0,0,0,0.5), 0 0 30px rgba(85, 239, 196, 0.7);
    /* Y mostramos el borde */
    border-color: var(--accent-color);
}


.feature-icon {
    font-size: 3.5em;
    margin-bottom: 20px;
    color: var(--accent-color);
    text-shadow: var(--glow-shadow);
}

.feature-card h3 {
    margin-bottom: 15px;
}

/* --- SECCIÓN DE GALERÍA --- */
.gallery-section {
    background-color: var(--secondary-bg);
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
}

.gallery-grid img {
    width: 100%;
    border-radius: 8px;
    border: 3px solid var(--container-border);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.gallery-grid img:hover {
    transform: scale(1.05);
    box-shadow: 0 10px 25px rgba(0,0,0,0.5);
    border-color: var(--header-color);
}

/* --- SECCIÓN DE COMUNIDAD --- */
.community-section p {
    max-width: 600px;
    margin: 0 auto 30px auto;
}
.community-buttons {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-top: 30px;
}

/* --- FOOTER --- */
.footer {
    background-color: var(--secondary-bg);
    text-align: center;
    padding: 25px;
    font-size: 0.9em;
    color: #b2bec3;
    position: relative;
    z-index: 2;
}

/* --- ANIMACIONES --- */
@keyframes float {
    0% { transform: translateY(0px); }
    50% { transform: translateY(-15px); }
    100% { transform: translateY(0px); }
}

@keyframes pulseGlowTitle {
    0%, 100% { text-shadow: 0 0 20px var(--accent-color); }
    50% { text-shadow: 0 0 35px #aaffec; }
}
@keyframes pulseGlowCard {
  0%, 100% {
    box-shadow: 0 0 15px rgba(85, 239, 196, 0.3);
  }
  50% {
    box-shadow: 0 0 25px rgba(85, 239, 196, 0.6);
  }
}

/* Animación para aparecer al hacer scroll */
.animate-on-scroll {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.animate-on-scroll.is-visible {
    opacity: 1;
    transform: translateY(0);
}

/* --- ESTILOS PARA EL CANVAS DE PLANETAS --- */
#planet-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0; /* Por encima de las partículas (-1), pero por debajo del contenido (1+) */
}
/* --- ESTILOS PARA IMAGEN DENTRO DE FEATURE ICON --- */
.feature-icon img {
    height: 100px; /* Ajusta el tamaño de la imagen de la ciudadela */
    width: auto;
    /* Aplicamos un brillo similar al de los emojis para mantener la coherencia */
    filter: drop-shadow(0 0 8px var(--accent-color));
}

/* --- ESTILOS ADICIONALES PARA LA GALERÍA CON CARRUSEL --- */
.gallery-grid {
    /* Ajustamos el tamaño mínimo para que las tarjetas se vean mejor */
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 30px; /* Un poco más de espacio */
}

.gallery-item {
    position: relative;
    border-radius: 8px;
    overflow: hidden; /* Oculta cualquier cosa que se salga del borde redondeado */
    border: 3px solid var(--container-border);
    transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
    aspect-ratio: 16 / 9; /* Mantiene una proporción de pantalla ancha */
    background-color: var(--primary-bg); /* Fondo mientras carga la imagen */
}

.gallery-item:hover {
    transform: scale(1.05);
    box-shadow: 0 10px 30px rgba(0,0,0,0.6);
    border-color: var(--header-color);
}

.carousel-container {
    width: 100%;
    height: 100%;
    position: relative;
}

.carousel-container img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover; /* Asegura que la imagen cubra todo el contenedor sin deformarse */
    opacity: 0;
    transition: opacity 0.8s ease-in-out; /* La transición suave que pediste */
    border: none; /* Quitamos bordes individuales de las imágenes */
	image-rendering: high-quality;
}

.carousel-container img.active {
    opacity: 1; /* La imagen activa es la única visible */
}

.gallery-item-title {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    margin: 0;
    padding: 15px;
    font-family: var(--font-body);
    font-size: 1.1em;
    text-align: center;
    color: var(--text-color);
    background: linear-gradient(to top, rgba(16, 33, 62, 0.95), rgba(16, 33, 62, 0));
    text-shadow: 1px 1px 3px #000;
    z-index: 5;
    transition: all 0.3s ease;
}

.gallery-item:hover .gallery-item-title {
    color: var(--accent-color);
    padding-bottom: 20px;
}

/* Eliminamos los estilos antiguos para que no interfieran */
.gallery-grid img, .gallery-grid img:hover {
    width: 100%;
    border-radius: 0;
    border: none;
    transform: none;
    box-shadow: none;
    border-color: transparent;
}


/* --- AJUSTES DE CALIDAD ESPECÍFICOS PARA IMÁGENES DE BAJA RESOLUCIÓN --- */

/* 
  CASO 1: Imágenes pequeñas que deben mostrarse completas, no estiradas.
  Usamos 'contain' para que se ajusten dentro del contenedor sin recortar ni pixelar en exceso.
*/
.carousel-container img[src*="mercados_1.png"],
.carousel-container img[src*="mercados_2.png"],
.carousel-container img[src*="caldero_1.png"],
.carousel-container img[src*="ingredients_1.png"] {
    object-fit: contain; /* Evita el estiramiento excesivo, muestra la imagen completa */
    image-rendering: auto; /* El navegador elegirá el mejor método para no alisar demasiado */
}

/* 
  CASO 2: Imagen extremadamente pequeña (mapa_galactico_7.png).
  La forzamos a mostrarse en un tamaño pequeño y centrada, para evitar una pixelación masiva.
  La tratamos como un "icono" o "detalle".
*/
.carousel-container img[src*="mapa_galactico_7.png"] {
    object-fit: none;      /* No escalar la imagen en absoluto */
    width: auto;           /* Usa el ancho intrínseco de la imagen */
    height: auto;          /* Usa el alto intrínseco de la imagen */
    max-width: 230px;      /* Un límite por seguridad */
    max-height: 230px;     /* Un límite por seguridad */

    /* Centramos la imagen pequeña dentro del contenedor grande */
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

/* 
  CASO 3: Imágenes panorámicas de alta resolución (Flota y Drones).
  Se cambia a 'contain' para evitar que 'cover' recorte los lados de la imagen.
  Así se asegura que la escena completa sea visible.
*/
.carousel-container img[src*="astilleros_1.png"],
.carousel-container img[src*="hangar_drones_1.png"] {
    object-fit: contain;
}

/* --- NUEVO ESTILO: BOTN DE DONACIN --- */
.donate-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px; /* Espacio entre el corazn y el texto */
    padding: 18px 50px;
    font-size: 1.4em;
    font-weight: 800;
    font-family: var(--font-body);
    text-transform: uppercase;
    text-decoration: none;
    color: white;
    
    /* Gradiente clido y vivo que destaca sobre el fondo azul oscuro */
    background: linear-gradient(45deg, #ff6b6b, #ff4757, #ffa502);
    background-size: 200% 200%;
    
    border-radius: 50px; /* Bordes totalmente redondeados (pldora) */
    border: 2px solid rgba(255, 255, 255, 0.2);
    
    /* Sombra resplandeciente */
    box-shadow: 0 0 20px rgba(255, 71, 87, 0.5);
    transition: all 0.4s ease;
    
    /* Animacin sutil del fondo */
    animation: gradientMove 3s ease infinite;
}

.donate-btn:hover {
    transform: translateY(-5px) scale(1.05);
    box-shadow: 0 10px 40px rgba(255, 71, 87, 0.8);
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.8);
}

/* Animacin del corazn */
.heart-icon {
    font-size: 1.2em;
    display: inline-block;
    animation: heartBeat 1.5s infinite ease-in-out;
}

/* Animaciones Keyframes */
@keyframes heartBeat {
    0% { transform: scale(1); }
    14% { transform: scale(1.3); }
    28% { transform: scale(1); }
    42% { transform: scale(1.3); }
    70% { transform: scale(1); }
}

@keyframes gradientMove {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

