/* estilos_index.css - CSS Potenciado al MÁXIMO (con Banner Original Restaurado) */

/* Estilos Generales y Reset */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #fdfdfd;
    color: #333;
    line-height: 1.6;
}

/* =========================================
ANIMACIONES GLOBALES
========================================= */

/* Animación para la entrada de contenido principal (dinamismo al cargar) */
@keyframes slideInUp {
    0% {
        opacity: 0;
        transform: translateY(50px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Animación de Pulso para Misión/Visión */
@keyframes pulse-shadow {
    0% {
        box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2), 0 0 0 0 rgba(244, 162, 97, 0.4);
    }
    50% {
        box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3), 0 0 15px 5px rgba(244, 162, 97, 0.8);
    }
    100% {
        box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2), 0 0 0 0 rgba(244, 162, 97, 0.4);
    }
}

/* Animación para el botón de donación */
@keyframes button-pulse {
    0% {
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    }
    50% {
        box-shadow: 0 0 0 8px rgba(244, 162, 97, 0.3);
    }
    100% {
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    }
}

/* ANIMACIÓN DE FONDO CONSTANTE (SHINE) para el footer */
@keyframes footer-shine {
    0% {
        background-position: 0 0;
    }
    100% {
        background-position: 200px 0; 
    }
}

/* Animación para un sutil movimiento del texto del banner */
@keyframes floatText {
    0% {
        transform: translateX(-50%) translateY(0);
    }
    50% {
        transform: translateX(-50%) translateY(-5px);
    }
    100% {
        transform: translateX(-50%) translateY(0);
    }
}

/* Aplicación de animación de entrada a secciones */
.content, .mision-vision, .historias-de-esperanza {
    animation: slideInUp 0.8s ease-out backwards;
}
.mision-vision {
    animation-delay: 0.3s;
}
.historias-de-esperanza {
    animation-delay: 0.6s;
}

/* Header (Encabezado) - Potenciado con Estado de Scroll */
.header {
    background: linear-gradient(135deg, #064420 0%, #0b6e4f 100%);
    color: white;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 40px;
    flex-wrap: wrap;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transition: all 0.4s ease; /* Transición para el estado de scroll */
}

/* NUEVO ESTADO: Se aplicará con JavaScript cuando el usuario haga scroll */
.header.scrolled {
    padding: 10px 40px; /* Reduce la altura del encabezado */
    background: rgba(6, 68, 32, 0.95); /* Fondo ligeramente transparente y oscuro */
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(3px); /* Efecto de desenfoque detrás del header */
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 1.4em;
    font-weight: 700;
    transition: transform 0.3s ease;
}

.logo:hover {
    transform: scale(1.05);
}

.logo img {
    height: 60px;
    width: auto;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    transition: height 0.4s ease; /* Transición para el estado de scroll */
}

.header.scrolled .logo img {
    height: 40px; /* Logo más pequeño en scroll */
}


.menu-toggle {
    display: none;
    font-size: 32px;
    cursor: pointer;
    color: white;
}

.menu {
    list-style: none;
    display: flex;
    gap: 30px;
}

.menu li {
    position: relative;
}

.menu li a {
    color: white;
    text-decoration: none;
    padding: 12px 18px;
    display: block;
    transition: all 0.3s ease;
    font-weight: 600;
    border-radius: 8px;
    position: relative;
    overflow: hidden;
}

/* Animación de línea para el menú principal */
.menu li a::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: 0;
    width: 0;
    height: 3px;
    background: linear-gradient(to right, #f4a261, #ffbc80);
    transition: width 0.4s ease-in-out;
}

.menu li a:hover::after {
    width: 100%;
}

/* Estilos al pasar el cursor por el menú principal */
.menu li a:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #ffbc80;
    transform: scale(1.05);
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.2);
}

/* Submenú */
.submenu {
    display: none;
    position: absolute;
    background: linear-gradient(135deg, #0b6e4f 0%, #064420 100%);
    top: 100%;
    left: 0;
    list-style: none;
    min-width: 240px;
    z-index: 999;
    border-radius: 8px;
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.25);
    opacity: 0;
    transform: translateY(-10px);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.menu li:hover .submenu {
    display: block;
    opacity: 1;
    transform: translateY(0);
}

/* Estilos de los enlaces del submenú */
.submenu li a {
    padding: 14px 18px;
    white-space: nowrap;
    color: white;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

/* Efecto de línea para el submenú */
.submenu li a::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: 0;
    width: 0;
    height: 2px;
    background: #ffbc80;
    transition: width 0.4s ease-in-out;
}

.submenu li a:hover::after {
    width: 100%;
}

/* Estilos al pasar el cursor por el submenú */
.submenu li a:hover {
    background: rgba(255, 255, 255, 0.15);
    color: #ffbc80;
}

.donate-btn {
    background: linear-gradient(135deg, #f4a261 0%, #e76f51 100%);
    color: white;
    padding: 12px 24px;
    text-decoration: none;
    border-radius: 50px;
    font-weight: 700;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    display: inline-block;
    position: relative;
    overflow: hidden;
    animation: button-pulse 2s infinite ease-in-out;
}

/* Efecto de onda en el botón */
.donate-btn::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.5s ease, height 0.5s ease;
}

.donate-btn:hover::after {
    width: 200%;
    height: 200%;
}

.donate-btn:hover {
    background: linear-gradient(135deg, #e76f51 0%, #f4a261 100%);
    transform: translateY(-3px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.4);
    animation: none;
}

/* Banner Principal - Restaurado con Carrousel de Imágenes */
.banner {
    position: relative;
    width: 100%;
    height: 60vh;
    overflow: hidden;
    /* Revertido a la configuración original de tu carrusel */
}

.banner img {
    position: absolute;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0;
    transition: opacity 1s ease-in-out;
}

.banner img.active {
    opacity: 1;
}

.banner-text {
    position: absolute;
    bottom: 40px;
    left: 50%;
    transform: translateX(-50%); /* Base para floatText */
    color: white;
    font-size: 2.8rem;
    font-weight: bold;
    text-shadow: 2px 2px 5px rgba(0, 0, 0, 0.7);
    text-align: center;
    width: 100%;
    z-index: 10;
    animation: floatText 6s ease-in-out infinite; /* Animación de flotado sutil */
}

/* Contenido Principal */
.content {
    padding: 60px 20px;
    max-width: 900px;
    margin: 0 auto;
    text-align: center;
}

.content h2 {
    font-size: 2.5rem;
    color: #064420;
    margin-bottom: 20px;
}

/* Misión y Visión (Mejorado) */
.mision-vision {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 30px;
    padding: 80px 20px;
    background: linear-gradient(to right, #064420, #0b6e4f);
    color: white;
    text-align: center;
}

.mision, .vision {
    flex: 1 1 350px;
    margin: 10px;
    padding: 40px;
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    backdrop-filter: blur(5px);
    transition: transform 0.2s ease, background-color 0.3s ease; 
    border: 1px solid rgba(255, 255, 255, 0.2);
    animation: pulse-shadow 4s infinite alternate ease-in-out; 
}

.mision:hover, .vision:hover {
    transform: translateY(-10px); 
    background-color: rgba(255, 255, 255, 0.25); 
}

.mision h3, .vision h3 {
    font-size: 2rem;
    margin-bottom: 20px;
    font-weight: bold;
    color: #f4a261;
}

.mision p, .vision p {
    font-size: 1rem;
    line-height: 1.8;
}

/* =========================================
SECCIÓN HISTORIAS DE ESPERANZA (2x2 FORZADO Y DINÁMICO)
========================================= */

.historias-de-esperanza {
    display: grid; 
    grid-template-columns: repeat(2, 1fr);
    gap: 40px; 
    padding: 80px 5%;
    background-color: #f0f4f8; 
    max-width: 1200px;
    margin: 0 auto;
}

.historia {
    background: #ffffff;
    border-radius: 18px; 
    overflow: hidden;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
    transition: all 0.5s cubic-bezier(0.25, 0.8, 0.25, 1);
    display: flex;
    flex-direction: column;
    position: relative;
}

/* Efecto de Elevación y Sombra Dramática (Añadido sombra interna) */
.historia:hover {
    transform: translateY(-12px); 
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.25), 
                inset 0 0 10px rgba(244, 162, 97, 0.5); /* Sombra interna */
    z-index: 10;
    cursor: pointer;
}

/* Acento de color dinámico en la parte superior */
.historia::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 6px;
    background: linear-gradient(90deg, #f4a261 0%, #064420 100%);
    transition: all 0.4s ease;
    z-index: 2;
}

.historia:hover::before {
    height: 100%;
    opacity: 0.05;
}


.historia img {
    width: 100%;
    height: 250px;
    object-fit: cover;
    border-bottom: none; 
    transition: transform 0.6s cubic-bezier(0.25, 0.8, 0.25, 1), filter 0.6s ease;
}

/* Efecto de Zoom y brillo en la imagen al pasar el mouse (Añadido desaturado) */
.historia:hover img {
    transform: scale(1.08);
    filter: brightness(1.1) grayscale(10%);
}

.historia-content {
    padding: 30px; 
    text-align: left;
    flex-grow: 1;
}

.historia-content h4 {
    color: #064420;
    margin-bottom: 12px;
    font-size: 1.6rem;
    font-weight: 800;
    line-height: 1.3;
    transition: color 0.3s ease;
}

/* Cambio de color en el título al hacer hover */
.historia:hover .historia-content h4 {
    color: #f4a261;
}

.historia-content p {
    color: #555;
    font-size: 1.05rem; 
    line-height: 1.6;
}
/* Fin de Sección Historias Potenciadas */


/* Footer (Pie de página) - Potenciado con brillo animado */
footer {
    color: white;
    padding: 50px 30px 30px;
    font-size: 15px;
    margin-top: 60px;
    position: relative; 
    overflow: hidden; 
    background: linear-gradient(135deg, #064420 0%, #0b6e4f 100%);
}

/* NUEVO: Pseudo-elemento para el efecto de rayado animado */
footer::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 200%; 
    height: 100%;
    z-index: 1;
    opacity: 0.15; 
    background: repeating-linear-gradient(
        -45deg,
        transparent,
        transparent 10px,
        #f4a261 10px,
        #ffbc80 11px
    );
    animation: footer-shine 60s linear infinite; 
    pointer-events: none;
}


.footer-container {
    display: flex;
    flex-wrap: wrap;
    gap: 40px;
    justify-content: space-between;
    max-width: 1280px;
    margin: 0 auto;
    position: relative; 
    z-index: 2;
}

.footer-section {
    flex: 1 1 280px;
    padding: 20px; 
    border-radius: 8px;
    transition: all 0.3s ease;
}

/* Mejora de hover en footer */
.footer-section:hover {
    background-color: rgba(255, 255, 255, 0.08);
    transform: translateY(-5px);
    box-shadow: 0 8px 15px rgba(0, 0, 0, 0.3);
}

.footer-section h3,
.footer-section h4 {
    margin-bottom: 20px;
    font-size: 1.4em;
    font-weight: 700;
    border-bottom: 2px solid #ffbc80;
    padding-bottom: 8px;
}

.footer-section p,
.footer-section a {
    color: white;
    text-decoration: none;
}

.footer-section ul {
    list-style: none;
    padding: 0;
}

.footer-section ul li a {
    color: white;
    text-decoration: none;
    transition: color 0.3s ease;
}

.footer-section ul li a:hover {
    color: #ffbc80;
    text-decoration: underline;
}

.social-icons img {
    height: 35px;
    margin-right: 20px;
    transition: transform 0.3s ease, filter 0.3s ease;
}

.social-icons a:hover img {
    transform: scale(1.3) rotate(5deg); 
    filter: drop-shadow(0 0 5px #ffbc80); 
}

.footer-bottom {
    text-align: center;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
    padding-top: 25px;
    margin-top: 40px;
    position: relative; 
    z-index: 2;
}

.footer-bottom a {
    display: block;
    margin: 12px 0;
    color: white;
    text-decoration: none;
    transition: color 0.3s ease;
}

.footer-bottom a:hover {
    color: #ffbc80;
    text-decoration: underline;
}

/* Efecto de burbujas (partículas) - SIN CAMBIOS */
.particle {
    position: absolute;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.6);
    pointer-events: none;
    animation: fly 1s ease-out forwards;
}

@keyframes fly {
    0% {
        opacity: 1;
        transform: scale(1);
    }
    100% {
        opacity: 0;
        transform: translateY(-50px) scale(0.5);
    }
}

/* Responsive */
@media (max-width: 768px) {
    /* Mantenemos una sola columna para móviles */
    .historias-de-esperanza {
        grid-template-columns: 1fr; 
        padding: 40px 10px;
        gap: 25px;
    }
    
    .historia {
        max-width: 100%; 
    }

    .historia img {
        height: 200px;
    }
    
    .historia-content {
        padding: 20px;
    }

    .historia-content h4 {
        font-size: 1.4rem;
    }

    /* Estilos del menú y otros elementos en móvil */
    .menu {
        display: none;
        flex-direction: column;
        width: 100%;
        background-color: #064420;
        position: absolute;
        top: 80px;
        left: 0;
    }

    .menu li {
        width: 100%;
    }

    .menu-toggle {
        display: block;
    }

    .menu.active {
        display: flex;
    }

    .banner-text {
        font-size: 2rem;
    }

    .mision-vision,
    .footer-container {
        flex-direction: column;
        align-items: center;
    }
    
    .header {
        padding: 15px 25px;
    }

    .logo span {
        font-size: 1.1em;
    }

    .menu {
        top: 70px;
    }

    .menu li a {
        padding: 15px 12px;
        font-size: 1.1em;
    }

    .submenu {
        position: static;
        background: linear-gradient(135deg, #0b6e4f 0%, #064420 100%);
        width: 100%;
        box-shadow: none;
        border-radius: 0;
        opacity: 1;
        transform: none;
    }

    .donate-btn {
        padding: 10px 20px;
        font-size: 0.95em;
        margin-left: auto;
    }

    .footer-container {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    .footer-section {
        width: 100%;
    }

    .social-icons {
        display: flex;
        justify-content: center;
    }

    .footer-bottom a {
        display: block;
        margin: 12px 0;
    }
}