/* Base y Variables Únicas (Tema Claro por defecto) */
:root {
    --primary-color: #007bff; /* Azul moderno */
    --secondary-color: #6c757d;
    --text-color: #343a40;
    --background-light: #f8f9fa;
    --background-dark: #2c3e50;
    --card-bg: #ffffff;
    --shadow-color: rgba(0, 0, 0, 0.1);
}

/* Estilos Generales y Reseteo */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Poppins', sans-serif;
    color: var(--text-color);
    line-height: 1.6;
    background-color: var(--background-light);
    scroll-behavior: smooth;
}

/* Header (Navegación) */
#navbar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 3rem;
    background: var(--card-bg);
    box-shadow: 0 2px 10px var(--shadow-color);
    z-index: 1000;
}

.logo {
    font-size: 1.5rem;
    font-weight: 900;
    color: var(--primary-color);
    text-decoration: none;
}

#navbar nav a {
    margin-left: 1.5rem;
    text-decoration: none;
    color: var(--text-color);
    font-weight: 600;
    transition: color 0.3s;
}

#navbar nav a:hover {
    color: var(--primary-color);
}

/* Estilos de las Secciones */
.section {
    min-height: 100vh;
    padding: 100px 5vw 50px 5vw;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
}

.section h2 {
    font-size: 3rem;
    margin-bottom: 3rem;
    font-weight: 700;
    color: var(--primary-color);
}

/* Secciones Oscuras (para contraste visual) */
.dark-section {
    background-color: var(--background-dark);
    color: var(--card-bg);
}
.dark-section h2 {
    color: var(--primary-color);
}

/* Sección Hero */
.hero {
    /* **IMPORTANTE: Cambia 'hero-bg.jpg' por la ruta de tu imagen de fondo** */
    background: linear-gradient(rgba(0,0,0,0.5), rgba(0,0,0,0.7)), url('hero-bg.jpg') no-repeat center center fixed; 
    background-size: cover;
    color: var(--card-bg); 
    position: relative; 
    overflow: hidden; 
    animation: fadeInBackground 2s ease-out forwards; 
}

@keyframes fadeInBackground {
    from { opacity: 0.8; }
    to { opacity: 1; }
}

.hero::before { 
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at 10% 20%, rgba(255,255,255,0.05) 0%, transparent 50%);
    opacity: 0.7;
    z-index: 1;
}

.hero-content {
    position: relative;
    z-index: 2; 
    max-width: 900px;
    padding: 0 20px;
}

.hero h1 {
    font-size: 4.2rem; 
    margin-bottom: 1.2rem;
    font-weight: 900;
    line-height: 1.1;
    text-shadow: 2px 2px 8px rgba(0, 0, 0, 0.4); 
    animation: slideInLeft 1s ease-out forwards;
    animation-delay: 0.5s;
    opacity: 0;
}

.hero p {
    font-size: 1.4rem;
    margin-bottom: 1.5rem;
    max-width: 700px;
    opacity: 0;
    animation: fadeInText 1s ease-out forwards;
    animation-delay: 1.2s;
}

.hero .subtitle {
    font-size: 1.8rem; 
    font-weight: 600;
    color: #a7d9ff; 
    margin-bottom: 1rem;
    opacity: 0;
    animation: fadeInText 1s ease-out forwards;
    animation-delay: 0.9s;
}

#cta-button {
    padding: 1rem 2.5rem; 
    font-size: 1.25rem;
    border: none;
    border-radius: 50px;
    background-color: var(--primary-color); 
    color: var(--card-bg); 
    cursor: pointer;
    font-weight: 700;
    transition: background-color 0.3s, transform 0.2s, box-shadow 0.3s;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
    opacity: 0;
    animation: popIn 0.6s ease-out forwards;
    animation-delay: 1.8s;
}

#cta-button:hover {
    background-color: var(--secondary-color); 
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
}

/* Animaciones específicas para la sección Hero */
@keyframes slideInLeft {
    from { opacity: 0; transform: translateX(-50px); }
    to { opacity: 1; transform: translateX(0); }
}

@keyframes fadeInText {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes popIn {
    from { opacity: 0; transform: scale(0.8); }
    to { opacity: 1; transform: scale(1); }
}

/* Contenido y Cards */
.content-box {
    max-width: 900px;
    padding: 2rem;
    border-left: 5px solid var(--primary-color);
    background-color: var(--card-bg);
    box-shadow: 0 4px 15px var(--shadow-color);
    text-align: left;
    color: var(--text-color);
}
.card-container {
    display: flex;
    gap: 30px;
    margin-bottom: 3rem;
    flex-wrap: wrap;
    justify-content: center;
}
.card {
    background: var(--card-bg);
    padding: 25px;
    border-radius: 15px;
    width: 300px;
    box-shadow: 0 5px 20px var(--shadow-color);
    cursor: pointer;
    transition: transform 0.3s, box-shadow 0.3s, background 0.3s;
    border: 3px solid transparent;
}
.card i {
    font-size: 2rem;
    color: var(--primary-color);
    margin-bottom: 10px;
}
.card:hover, .card.selected {
    transform: translateY(-8px);
    box-shadow: 0 12px 25px var(--shadow-color);
    border-color: var(--primary-color);
}

/* Área de Detalle (Corregido con Máxima Especificidad para la animación) */
.detail-area {
    background-color: var(--card-bg);
    padding: 2.5rem;
    border-radius: 10px;
    max-width: 900px;
    width: 100%;
    text-align: left;
    box-shadow: 0 0 25px var(--shadow-color);
    
    /* Estado inicial: invisible y escalado */
    opacity: 0;
    transform: scale(0.9);
    transition: opacity 0.5s, transform 0.5s;
    color: var(--text-color);
}

/* ESTADO VISIBLE (Con !important para forzar el despliegue) */
.detail-area.visible {
    opacity: 1 !important;
    transform: scale(1) !important;
}

/* Timeline (Evolución) */
.timeline {
    display: flex;
    justify-content: center;
    gap: 50px;
    max-width: 1200px;
    margin-top: 20px;
}
.timeline-item {
    width: 300px;
    padding: 20px;
    border-radius: 10px;
    background: var(--background-dark); 
    border-top: 5px solid var(--primary-color);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
    text-align: left;
    color: var(--card-bg);
}
.timeline-item h3 {
    color: var(--primary-color);
    margin-bottom: 10px;
    font-size: 1.4rem;
}
.timeline-item.challenge {
    border-top-color: #dc3545; 
}

/* Estadísticas (Stats) */
.stats-container {
    display: flex;
    gap: 40px;
    justify-content: center;
    max-width: 1000px;
    margin-top: 20px;
}
.stat-box {
    width: 250px;
    padding: 25px;
    border-radius: 10px;
    background: var(--primary-color);
    color: var(--card-bg);
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.3);
}
.stat-number {
    font-size: 4rem;
    font-weight: 900;
    display: block;
    margin-bottom: 5px;
}
.stat-box p {
    font-weight: 300;
    opacity: 0.8;
}
.note {
    margin-top: 30px;
    font-style: italic;
    color: rgba(255, 255, 255, 0.7);
}

/* Animación de Entrada (Scroll Reveal Imitation) */
@keyframes slideUpFade {
    from { opacity: 0; transform: translateY(50px); }
    to { opacity: 1; transform: translateY(0); }
}
.animate-in {
    opacity: 0; 
}
.animate-in.visible {
    animation: slideUpFade 0.8s ease-out forwards;
}

/* Footer */
footer {
    background-color: var(--background-dark);
    color: rgba(255, 255, 255, 0.7);
    text-align: center;
    padding: 1.5rem;
    font-size: 0.9rem;
}

/* Media Queries para Responsividad */
@media (max-width: 1024px) {
    .timeline, .stats-container {
        flex-direction: column;
        gap: 30px;
    }
    .timeline-item, .stat-box {
        width: 80%;
        max-width: 500px;
    }
}
@media (max-width: 768px) {
    #navbar { padding: 1rem 1rem; }
    #navbar nav { display: none; }
    .section h2 { font-size: 2rem; }
    .hero h1 { font-size: 2.8rem; }
    .hero .subtitle { font-size: 1.3rem; }
    .hero p { font-size: 1rem; }
    #cta-button { font-size: 1rem; padding: 0.8rem 2rem; }
}