/* Importar fuentes de Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;600;700&family=Roboto:wght@400;700&display=swap');

:root {
    /* Paleta de colores */
    --primary-color: #0956a4; /* Azul vibrante */
    --secondary-color: #c7b124; /* Verde azulado */
    --accent-color: #b7ced3; /* Amarillo para acentos */
    --text-color-dark: #264f78;
    --text-color-light: #ffffff;
    --background-light: #fcfdff; /* Fondo muy claro */
    --background-dark: #b7cfd3; /* Blanco para contenedores */
    --border-color: #4a3b08;

    /* Sombras */
    --shadow-light: 0 4px 10px rgba(0, 0, 0, 0.08);
    --shadow-medium: 0 8px 20px rgba(0, 0, 0, 0.12);

    /* Otros */
    --border-radius: 8px;
    --transition-speed: 0.3s;
}

/* --- Base y tipografía --- */
body {
    margin: 0;
    padding: 0;
    font-family: 'Poppins', sans-serif; /* Fuente principal */
    color: var(--text-color-dark);
    line-height: 1.7;
    background-color: var(--background-light);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

h1, h2, h3, h4, h5, h6 {
    font-family: 'Roboto', sans-serif; /* Fuente secundaria para títulos */
    color: var(--primary-color);
    margin-top: 0;
    margin-bottom: 1rem;
}

h1 {
    font-size: 2.5em;
    font-weight: 700;
}

h2 {
    font-size: 2em;
    font-weight: 600;
    border-bottom: 2px solid var(--border-color);
    padding-bottom: 0.75rem;
    margin-bottom: 2rem;
}

p {
    margin-bottom: 1rem;
}

a {
    color: var(--primary-color);
    text-decoration: none;
    transition: color var(--transition-speed) ease;
}

a:hover {
    color: var(--secondary-color);
}

/* --- Header --- */
header {
    background-color: var(--accent-color);
    box-shadow: var(--shadow-light);
    padding: 15px 40px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap; /* Permite que los elementos se envuelvan en pantallas pequeñas */
    gap: 20px; /* Espacio entre elementos en el header */
    position: sticky;
    top: 0;
    z-index: 1000;
}

header h1 {
    margin: 0;
    color: var(--primary-color);
    font-size: 1.8em;
    flex-shrink: 0; /* Evita que el título se encoja */
}

header nav {
    flex-grow: 1; /* Permite que la navegación ocupe espacio disponible */
    display: flex;
    justify-content: center; /* Centra la navegación */
}

header nav ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    gap: 30px; /* Espacio entre los elementos de la lista */
}

header nav ul li a {
    text-decoration: none;
    color: var(--text-color-dark);
    font-weight: 600;
    padding: 8px 0;
    position: relative; /* Para el efecto de subrayado */
    transition: color var(--transition-speed) ease;
}

header nav ul li a::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: 0;
    width: 0;
    height: 2px;
    background-color: var(--primary-color);
    transition: width var(--transition-speed) ease-in-out;
}

header nav ul li a:hover {
    color: var(--primary-color);
}

header nav ul li a.active::after { /* Clase 'active' para el enlace de la página actual */
    width: 100%;
}

header button {
    background-color: var(--primary-color);
    color: var(--text-color-light);
    border: none;
    padding: 12px 25px;
    border-radius: var(--border-radius);
    cursor: pointer;
    font-size: 1em;
    font-weight: 600;
    transition: background-color var(--transition-speed) ease, transform 0.2s ease;
    flex-shrink: 0; /* Evita que el botón se encoja */
}

header button:hover {
    background-color: #3a7bd5; /* Tono más oscuro de azul */
    transform: translateY(-2px);
    box-shadow: var(--shadow-light);
}

header button:active {
    transform: translateY(0);
}

/* --- Main Content --- */
main {
    flex-grow: 1;
    padding: 40px 20px;
    max-width: 1200px;
    margin: 30px auto;
    background-color: var(--background-dark);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-medium);
}

section {
    padding: 20px 0;
    margin-bottom: 2rem;
}

/* --- Scroll to Top Button --- */
.scroll-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background-color: var(--secondary-color);
    color: var(--text-color-light);
    border: none;
    border-radius: 50%;
    width: 55px;
    height: 55px;
    font-size: 1.8em;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    box-shadow: var(--shadow-medium);
    transition: opacity var(--transition-speed) ease, transform var(--transition-speed) ease, visibility var(--transition-speed) ease;
    opacity: 0;
    visibility: hidden;
    z-index: 999;
    transform: translateY(20px); /* Oculto y un poco abajo por defecto */
}

.scroll-to-top.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0); /* Vuelve a su posición */
}

.scroll-to-top:hover {
    background-color: #40c7ae; /* Tono más oscuro */
    transform: translateY(-5px);
}

/* --- Chart Section Specifics --- */
.chart-container {
    background-color: var(--background-light);
    border: 1px solid var(--border-color);
    padding: 25px;
    border-radius: var(--border-radius);
    min-height: 350px;
    display: flex;
    justify-content: center;
    align-items: center;
    margin-top: 20px;
    box-shadow: inset 0 2px 5px rgba(0,0,0,0.05); /* Sombra interna sutil */
}

/* Si estás usando Chart.js directamente, el canvas se estilizará a sí mismo */
#myChart {
    width: 100% !important; /* Asegura que ocupe el ancho disponible */
    height: 300px !important; /* Altura fija para el ejemplo */
}

/* --- Contact Form Styling --- */
.contact-form {
    display: flex;
    flex-direction: column;
    gap: 15px; /* Espacio entre los elementos del formulario */
    max-width: 600px;
    margin-top: 20px;
}

.contact-form label {
    font-weight: 600;
    color: var(--text-color-dark);
    margin-bottom: 5px;
}

.contact-form input[type="text"],
.contact-form input[type="email"],
.contact-form textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    box-sizing: border-box; /* Incluye padding en el ancho */
    font-family: 'Poppins', sans-serif;
    font-size: 1em;
    transition: border-color var(--transition-speed) ease, box-shadow 0.2s ease;
}

.contact-form input[type="text"]:focus,
.contact-form input[type="email"]:focus,
.contact-form textarea:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(74, 144, 226, 0.2); /* Sombra de enfoque */
    outline: none; /* Eliminar el contorno predeterminado del navegador */
}

.contact-form textarea {
    resize: vertical; /* Permite redimensionar verticalmente */
    min-height: 120px;
}

.contact-form button[type="submit"] {
    background-color: var(--primary-color);
    color: var(--text-color-light);
    border: none;
    padding: 12px 25px;
    border-radius: var(--border-radius);
    cursor: pointer;
    font-size: 1.1em;
    font-weight: 600;
    margin-top: 10px;
    transition: background-color var(--transition-speed) ease, transform 0.2s ease;
    align-self: flex-start; /* Alinea el botón a la izquierda */
}

.contact-form button[type="submit"]:hover {
    background-color: #3a7bd5;
    transform: translateY(-2px);
    box-shadow: var(--shadow-light);
}

.contact-form button[type="submit"]:active {
    transform: translateY(0);
}

.contact-info ul {
    list-style: none;
    padding: 0;
    margin-top: 1rem;
}

.contact-info li {
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Iconos de contacto (ejemplo, si usaras FontAwesome u otros) */
.contact-info li::before {
    content: "•"; /* O un ícono como '\f0e0' para email si usas Font Awesome */
    color: var(--secondary-color);
    font-weight: bold;
    display: inline-block;
    width: 1em;
    margin-left: -1em;
}


/* --- Responsive Adjustments --- */
@media (max-width: 768px) {
    header {
        flex-direction: column;
        padding: 15px 20px;
        text-align: center;
    }

    header nav {
        margin-top: 15px;
        width: 100%;
        justify-content: center;
    }

    header nav ul {
        flex-direction: column;
        gap: 15px;
        width: 100%;
        align-items: center;
    }

    header nav ul li {
        margin-left: 0;
        width: 100%;
    }

    header nav ul li a {
        padding: 5px 0;
        display: block; /* Ocupa el ancho completo */
    }

    header button {
        margin-top: 15px;
    }

    main {
        padding: 20px 15px;
        margin: 20px auto;
    }

    h1 {
        font-size: 2em;
    }

    h2 {
        font-size: 1.7em;
    }

    .scroll-to-top {
        width: 45px;
        height: 45px;
        font-size: 1.5em;
        bottom: 20px;
        right: 20px;
    }
}

@media (max-width: 480px) {
    header h1 {
        font-size: 1.5em;
    }

    header button {
        padding: 10px 20px;
        font-size: 0.9em;
    }

    h2 {
        font-size: 1.5em;
    }
}