/* ===== VARIABLES GLOBALES ===== */
:root {
    --color-primary: #0056b3;      /* Azul profesional */
    --color-secondary: #e91e63;    /* Rosa empático */
    --color-accent: #00c853;       /* Verde inclusión */
    --color-light: #f8f9fa;        /* Fondo claro */
    --color-dark: #212529;         /* Texto oscuro */
    --color-white: #ffffff;
    --shadow: 0 4px 12px rgba(0,0,0,0.1);
    --transition: all 0.3s ease;
    --border-radius: 12px;
    --spacing-sm: 1rem;
    --spacing-md: 2rem;
    --spacing-lg: 4rem;
}

/* ===== RESET Y BASE ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: var(--color-dark);
    background-color: var(--color-light);
    scroll-behavior: smooth;
}

h1, h2, h3, h4 {
    font-family: 'Poppins', sans-serif;
    font-weight: 600;
    line-height: 1.3;
}

img {
    max-width: 100%;
    height: auto;
    border-radius: var(--border-radius);
}

.container {
    width: 90%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
}

/* ===== HEADER ===== */
.header {
    background-color: var(--color-white);
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 1000;
    /*overflow-x: hidden;*/
}

.header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 0;
    flex-wrap: wrap;
    gap: 1rem;
}

.logo {
    font-family: 'Poppins', sans-serif;
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--color-primary);
    text-decoration: none;
}

/* ===== MENÚ DE NAVEGACIÓN ===== */
.nav-menu ul {
    display: flex;
    list-style: none;
    gap: 1.5rem;
    align-items: center;
    margin: 0;
    padding: 0;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    color: var(--color-dark);
    font-weight: 600;
    padding: 0.6rem 1.2rem;
    border-radius: var(--border-radius);
    transition: var(--transition);
    font-size: 1.05rem;
}

/* HOVER STATE PARA CADA OPCIÓN */
.nav-link:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

/* COLORES ESPECÍFICOS POR OPCIÓN */
.nav-link[href*="formulario"]:hover {
    background-color: #fff3e0;
    color: #e65100;
    border-left: 4px solid #e65100;
}

.nav-link[href*="chatbot"]:hover {
    background-color: #f3e5f5;
    color: #4a148c;
    border-left: 4px solid #4a148c;
}

.nav-link[href*="tpds"]:hover {
    background-color: #fadede;
    color: #5e1b1b;
    border-left: 4px solid #5e1b1b;
}

/* ===== MENÚ - NUEVA OPCIÓN "ACTIVIDADES EDUCATIVAS" ===== */
.nav-link[href="actividades.php"] {
    color: #FF6B6B; /* Color llamativo para destacar */
    font-weight: 500;
}

.nav-link[href="actividades.php"]:hover {
    color: #FF8E8E;
    background: rgba(255, 107, 107, 0.1);
    border-radius: 5px;
    padding: 8px 12px;
}

/* ===== ESTILOS PARA LA PÁGINA DE ACTIVIDADES (cuando se cargue) ===== */
/* Estilos generales para la página de actividades */
body.actividades {
    background: #f0f8ff;
    font-family: 'Poppins', sans-serif;
}

.menu-actividades {
    background: #fff;
    border: 2px solid #4A90E2;
    padding: 15px;
    border-radius: 10px;
    margin-bottom: 20px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.menu-actividades h3 {
    margin-top: 0;
    color: #4A90E2;
}

.menu-actividades button {
    display: block;
    width: 100%;
    padding: 10px;
    margin: 5px 0;
    background: #4A90E2;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 16px;
    transition: background 0.2s;
}

.menu-actividades button:hover {
    background: #3a7bd5;
}

.area-actividad {
    background: #fff;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    min-height: 400px;
}

.opciones button {
    background: #4A90E2;
    color: white;
    border: none;
    padding: 8px 15px;
    margin: 5px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
    transition: background 0.2s;
}

.opciones button:hover {
    background: #3a7bd5;
}

.tarjetas {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    margin-top: 10px;
}

.tarjeta {
    background: #f0f8ff;
    border: 2px solid #4A90E2;
    border-radius: 10px;
    padding: 10px;
    text-align: center;
    cursor: pointer;
    transition: transform 0.2s;
}

.tarjeta:hover {
    transform: scale(1.05);
}

.tarjeta span {
    font-size: 20px;
    font-weight: bold;
}

.opcion-video {
    display: inline-block;
    margin: 10px;
    text-align: center;
}

.opcion-video video {
    width: 100px;
    height: 100px;
    border-radius: 5px;
    border: 2px solid #ddd;
}

.pregunta {
    background: #e8f4fd;
    padding: 10px;
    margin: 10px 0;
    border-radius: 5px;
    border-left: 4px solid #4A90E2;
}

/* ===== BOTÓN DEL MENÚ EN MÓVIL ===== */
.hamburger {
    background: transparent;
    border: none;
    font-size: 24px;
    color: #333;
    cursor: pointer;
}

.hamburger:hover {
    color: #4A90E2;
}

/* ===== ANIMACIÓN DEL AVATAR (opcional) ===== */
.bot-avatar {
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

.nav-link[href*="acercade"]:hover {
    background-color: #ede7f6;
    color: #311b92;
    border-left: 4px solid #311b92;
}

/* ===== SUBMENU (DROPDOWN) ===== */
.dropdown {
    position: relative;
}

.dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    background: var(--color-white);
    list-style: none;
    min-width: 240px;
    max-width: 300px;
    padding: 0.5rem 0;
    border-radius: var(--border-radius);
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: var(--transition);
    z-index: 9999;
    border: 1px solid rgba(0,0,0,0.05);
    word-wrap: break-word;
    display: flex;
    flex-direction: column; /* ← Fuerza el comportamiento vertical */
}

/* Para desktop: mantener el hover como está */
@media (min-width: 769px) {
    .dropdown:hover .dropdown-menu {
        opacity: 1;
        visibility: visible;
        transform: translateY(0);
    }
}

/* Para móvil: usar active como antes */
@media (max-width: 768px) {
    .dropdown.active .dropdown-menu {
        opacity: 1;
        visibility: visible;
        transform: translateY(0);
    }
}

.dropdown-menu a {
    display: flex;
    align-items: left;
    gap: 12px;
    padding: 0.85rem 1.5rem;
    color: var(--color-dark);
    text-decoration: none;
    font-weight: 500;
    transition: var(--transition);
    position: relative;
    border-left: 4px solid transparent;
    white-space: nowrap; /* ← Fuerza una sola línea */
    overflow: hidden;     /* ← Oculta el desbordamiento */
    text-overflow: ellipsis; /* ← Muestra ... si el texto es muy largo */
    line-height: 1.4;
    max-width: 500px; /* ← Opcional: limita el ancho máximo para evitar que se haga muy grande */
}

.dropdown-menu a:hover {
    transform: translateX(4px);
    border-left-color: var(--color-primary);
}

.dropdown:hover .dropdown-menu,
.dropdown.active .dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* Colores específicos para submenu */
.dropdown-menu a[href*="abecedario"]:hover { background-color: #e3f2fd; border-left-color: #0d47a1; color: #0d47a1; }
.dropdown-menu a[href*="dias"]:hover { background-color: #f3e5f5; border-left-color: #4a148c; color: #4a148c; }
.dropdown-menu a[href*="numeros"]:hover { background-color: #e8f5e9; border-left-color: #1b5e20; color: #1b5e20; }

/* ===== HAMBURGER PARA MÓVIL ===== */
.hamburger {
    display: none;
    background: none;
    border: none;
    font-size: 1.8rem;
    cursor: pointer;
    color: var(--color-primary);
    z-index: 1001;
}

/* ===== TABLET GRANDE / LAPTOP PEQUEÑO (hasta 1024px) ===== */
@media (max-width: 1024px) {
    .nav-menu ul {
        flex-wrap: wrap;
        gap: 0.8rem;
        justify-content: center;
    }

    .nav-link {
        padding: 0.5rem 0.8rem;
        font-size: 0.95rem;
    }

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

    .section-header h2 {
        font-size: 2.2rem;
    }
}

/* ===== TABLET VERTICAL / MÓVIL GRANDE (hasta 768px) ===== */
@media (max-width: 768px) {
    .hamburger {
        display: block;
    }

    .nav-menu {
        position: fixed;
        top: 70px;
        left: 0;
        right: 0;
        background: var(--color-white);
        padding: 2rem;
        box-shadow: 0 5px 15px rgba(0,0,0,0.1);
        transform: translateY(-100%);
        opacity: 0;
        visibility: hidden;
        transition: all 0.4s ease;
        z-index: 1000;
        max-height: calc(100vh - 80px);
        overflow-y: auto;
    }

    .nav-menu.active {
        transform: translateY(0);
        opacity: 1;
        visibility: visible;
    }

    .nav-menu ul {
        display: flex;
        flex-direction: column;
        gap: 1rem;
        align-items: stretch;
    }

    .nav-menu li {
        width: 100%;
    }

    .nav-link {
        justify-content: flex-start;
        padding: 0.85rem 1rem;
        font-size: 1.1rem;
        border-radius: 8px;
    }

    /* Submenu en móvil */
    .dropdown .nav-link {
        display: flex;
        justify-content: space-between;
        background: #e3f2fd;
        padding: 1rem;
        border-radius: var(--border-radius);
        margin-bottom: 0.5rem;
    }

    .dropdown-menu {
        background: var(--color-white);
        padding: 0.5rem 0;
        margin: 0.5rem 0 1rem 0;
        border-radius: var(--border-radius);
        box-shadow: var(--shadow);
        list-style: none;
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.3s ease, padding 0.3s ease;
        border: 1px solid rgba(0,0,0,0.05);
    }

    .dropdown.active .dropdown-menu {
        max-height: 300px;
        padding: 0.5rem 0;
    }

    /* Contenido */
    .hero {
        flex-direction: column;
        padding: 2rem 1rem;
        text-align: center;
    }

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

    .section {
        padding: 2rem 1rem;
    }

    .section-header h2 {
        font-size: 1.8rem;
    }

    .content-grid,
    .content-grid.reverse {
        flex-direction: column;
        gap: 1.5rem;
    }

    .text-content p,
    .quote-box {
        font-size: 1rem;
    }

    .grid-3,
    .grid-2 {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .feature-card,
    .card {
        padding: 1.2rem;
    }
}

/* ===== MÓVIL PEQUEÑO (hasta 480px) ===== */
@media (max-width: 480px) {
    .container {
        width: 95%;
        padding: 0 10px;
    }

    .logo {
        font-size: 1.5rem;
    }

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

    .hero-content p {
        font-size: 1rem;
    }

    .section-header h2 {
        font-size: 1.6rem;
    }

    .nav-link {
        font-size: 1rem;
        padding: 0.75rem 0.5rem;
    }

    .feature-card h4,
    .card h4 {
        font-size: 1.1rem;
    }

    .feature-card p {
        font-size: 0.9rem;
    }

    .footer-grid {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .social-links {
        justify-content: center;
    }
}

/* ===== ORIENTACIÓN HORIZONTAL EN MÓVIL (landscape) ===== */
@media (max-height: 500px) and (orientation: landscape) {
    .nav-menu {
        max-height: 70vh;
        overflow-y: auto;
        top: 60px;
        padding: 1rem;
    }

    .hero {
        padding: 1rem;
    }

    .section {
        padding: 1.5rem 1rem;
    }
}

/* ===== PANTALLAS MUY GRANDES (4K) ===== */
@media (min-width: 1920px) {
    .container {
        max-width: 1600px;
    }

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

    .section-header h2 {
        font-size: 3rem;
    }
}

/* ===== HERO SECTION ===== */
.hero {
    background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-secondary) 100%);
    color: var(--color-white);
    padding: var(--spacing-lg) 0;
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    flex-wrap: wrap;
}

.hero-content {
    flex: 1;
    min-width: 300px;
}

.hero-content h1 {
    font-size: 3rem;
    margin-bottom: 1rem;
    color: var(--color-white);
}

.hero-content p {
    font-size: 1.2rem;
    margin-bottom: 2rem;
    max-width: 600px;
}

.hero-image {
    flex: 1;
    min-width: 300px;
    text-align: center;
}

.hero-image img {
    max-width: 100%;
    height: auto;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
}

.btn {
    display: inline-block;
    padding: 0.8rem 2rem;
    border-radius: var(--border-radius);
    text-decoration: none;
    font-weight: 600;
    transition: var(--transition);
    text-align: center;
}

.btn-primary {
    background-color: var(--color-accent);
    color: var(--color-white);
    border: 2px solid var(--color-accent);
}

.btn-primary:hover {
    background-color: transparent;
    color: var(--color-accent);
}

/* ===== SECCIONES ===== */
.section {
    padding: var(--spacing-lg) 0;
}

.section-header {
    text-align: center;
    margin-bottom: var(--spacing-md);
}

.section-header h2 {
    font-size: 2.5rem;
    color: var(--color-primary);
    position: relative;
    display: inline-block;
    margin-bottom: 1rem;
}

.section-header h2:after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 4px;
    background: var(--color-secondary);
    border-radius: 2px;
}

.subtitle {
    font-size: 1.2rem;
    color: var(--color-secondary);
    font-weight: 500;
}

.bg-light {
    background-color: #f0f4f8;
}

.accent-bg {
    background: linear-gradient(135deg, #e3f2fd 0%, #bbdefb 100%);
}

.content-grid {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    flex-wrap: wrap;
}

.content-grid.reverse {
    flex-direction: row-reverse;
}

.text-content {
    flex: 1;
    min-width: 300px;
}

.text-content p {
    font-size: 1.1rem;
    margin-bottom: 1.5rem;
    line-height: 1.8;
}

.responsive-img {
    width: 100%;
    max-width: 500px;
    margin: 1rem auto;
    display: block;
    box-shadow: var(--shadow);
}

.image-content {
    flex: 1;
    min-width: 300px;
    text-align: center;
}

.image-content img {
    width: 100%;
    max-width: 400px;
    box-shadow: var(--shadow);
}

/* ===== GRID DE 3 COLUMNAS (APRENDIZAJES) ===== */
.grid-3 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: var(--spacing-md);
    margin-top: var(--spacing-md);
}

.card {
    background: var(--color-white);
    padding: var(--spacing-md);
    border-radius: var(--border-radius);
    text-align: center;
    box-shadow: var(--shadow);
    transition: var(--transition);
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0,0,0,0.15);
}

.card-icon {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

.card h4 {
    font-size: 1.2rem;
    color: var(--color-primary);
}

/* ===== GRID DE 2 COLUMNAS (RAZONES) ===== */
.grid-2 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: var(--spacing-md);
    margin-top: var(--spacing-md);
}

.feature-card {
    background: var(--color-white);
    padding: var(--spacing-md);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    transition: var(--transition);
    text-align: center;
}

.feature-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0,0,0,0.15);
}

.feature-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto var(--spacing-sm);
    object-fit: contain;
}

.feature-card h4 {
    font-size: 1.3rem;
    color: var(--color-primary);
    margin-bottom: 0.5rem;
}

.feature-card p {
    font-size: 0.95rem;
    color: var(--color-dark);
}

/* ===== CITA DESTACADA ===== */
.quote-box {
    background: var(--color-white);
    padding: 2rem;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    margin: var(--spacing-md) 0;
    font-style: italic;
    font-size: 1.2rem;
    text-align: center;
    border-left: 5px solid var(--color-secondary);
}

/* ===== FOOTER ===== */
.footer {
    background: var(--color-dark);
    color: var(--color-white);
    padding: var(--spacing-lg) 0 0;
}

.footer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: var(--spacing-md);
    margin-bottom: var(--spacing-md);
}

.footer-col h4 {
    font-size: 1.3rem;
    margin-bottom: 1rem;
    color: var(--color-accent);
}

.footer-col ul {
    list-style: none;
}

.footer-col ul li {
    margin-bottom: 0.5rem;
}

.footer-col a {
    color: var(--color-light);
    text-decoration: none;
    transition: var(--transition);
}

.footer-col a:hover {
    color: var(--color-accent);
}

.social-links {
    display: flex;
    gap: 1rem;
    margin-top: 1rem;
}

.social-links img {
    width: 40px;
    height: 40px;
    transition: var(--transition);
}

.social-links img:hover {
    transform: scale(1.1);
}

.footer-bottom {
    text-align: center;
    padding: 1rem 0;
    border-top: 1px solid rgba(255,255,255,0.1);
    font-size: 0.9rem;
    color: #aaa;
}

/* ===== ANIMACIONES Y ACCESIBILIDAD ===== */
@media (prefers-reduced-motion: reduce) {
    * {
        animation: none !important;
        transition: none !important;
    }
}
/* --- ESTILOS ESPECÍFICOS PARA RECURSOS ACCESIBLES --- */

.resource-section {
    margin: 3rem 0;
    padding: 2rem 0;
}

.resource-section h2 {
    color: var(--color-primary);
    margin-bottom: 1.5rem;
    position: relative;
}

.resource-section h2:after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 0;
    width: 60px;
    height: 4px;
    background: var(--color-accent);
    border-radius: 2px;
}

.resource-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
    margin-top: 1.5rem;
}

.resource-card {
    background-color: var(--color-white);
    border-radius: var(--border-radius);
    padding: 1.5rem;
    box-shadow: var(--shadow);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.resource-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0,0,0,0.1);
}

.resource-card h3 {
    color: var(--color-primary);
    margin-top: 0;
    margin-bottom: 0.75rem;
}

.resource-card p {
    color: var(--color-dark);
    margin-bottom: 1rem;
    line-height: 1.6;
}

.resource-card ul {
    list-style-type: none;
    padding: 0;
    margin: 0;
}

.resource-card li {
    margin-bottom: 0.5rem;
    font-size: 0.95rem;
}

.resource-card a {
    color: var(--color-secondary);
    text-decoration: none;
    font-weight: 500;
}

.resource-card a:hover {
    text-decoration: underline;
}

glossary,
.faq {
    margin-top: 1.5rem;
}

.glossary-item,
.faq-item {
    background-color: var(--color-light); /* Asegura el fondo claro */
    border-radius: var(--border-radius);
    margin-bottom: 1rem;
    overflow: hidden; /* Contiene el contenido cuando está oculto */
    box-shadow: 0 2px 4px rgba(0,0,0,0.1); /* Sombra ligera */
}

/* Estilo para el 'summary' (el encabezado que se puede clickear) */
.glossary-item > summary,
.faq-item > summary {
    padding: 1rem 1.5rem;
    margin: 0;
    background-color: var(--color-primary); /* Fondo del encabezado */
    color: var(--color-white); /* Texto del encabezado */
    font-weight: 500;
    cursor: pointer;
    position: relative;
    list-style: none; /* Elimina la flecha por defecto del summary en algunos navegadores si se quiere personalizar */
    transition: background-color 0.2s ease; /* Suaviza el cambio de color al pasar el mouse */
}

/* Eliminar la flecha nativa de summary (opcional, si se quiere usar una personalizada) */
.glossary-item > summary::-webkit-details-marker,
.faq-item > summary::-webkit-details-marker {
    display: none;
}

/* Flecha personalizada */
.glossary-item > summary::after,
.faq-item > summary::after {
    content: '+';
    position: absolute;
    right: 1.5rem;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1.2rem;
    transition: transform 0.2s ease; /* Animación al abrir/cerrar */
}

/* Rotar la flecha cuando está abierto */
.glossary-item[open] > summary::after,
.faq-item[open] > summary::after {
    transform: translateY(-50%) rotate(45deg); /* '+' se convierte en 'x' */
}

/* Contenido oculto por defecto dentro de details */
.glossary-item > :not(summary),
.faq-item > :not(summary) {
    display: none;
}

/* Mostrar contenido cuando details está abierto */
.glossary-item[open] > :not(summary),
.faq-item[open] > :not(summary) {
    display: block;
}

/* Estilo específico para la definición dentro del glossary-item */
.glossary-definition,
.faq-answer {
    padding: 1rem 1.5rem;
    margin: 0;
    color: var(--color-dark);
    line-height: 1.7;
    background-color: var(--color-white); /* Fondo del contenido desplegado */
    border-top: 1px solid rgba(0,0,0,0.05); /* Línea divisoria opcional */
}

/* Opcional: Efecto de transición suave al abrir/cerrar (requiere JS adicional para manipular altura, o usar max-height) */
/*
.glossary-definition,
.faq-answer {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease-out;
}

.glossary-item[open] .glossary-definition,
.faq-item[open] .faq-answer {
  max-height: 500px;  Ajusta según altura máxima esperada
}
*/
/* La solución con display:block/none es más simple y confiable para este caso. */