/* ===== HERENCIA ===== */
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #2c3e50;
    background: linear-gradient(135deg, #f5f7fa 0%, #e4edf9 100%);
    margin: 0;
    padding: 0;
}

h1, h2 {
    color: #2980b9;
    text-align: center;
}

p {
    text-align: center;
    font-size: 1.05rem;
    max-width: 700px;
    margin: 0.8rem auto;
    color: #34495e;
}

/* ===== CABECERA ===== */
#cabecera-principal {
    background: linear-gradient(120deg, #3498db, #2c3e50);
    color: white;
    text-align: center;
    padding: 2.5rem 1rem;
    position: relative;
    animation: fadeInDown 1s ease-out;
}

.badge {
    position: absolute;
    top: 15px;
    right: 20px;
    background: #e74c3c;
    color: white;
    padding: 0.25rem 0.7rem;
    border-radius: 20px;
    font-weight: bold;
    font-size: 0.85rem;
    animation: bounce 1.5s infinite;
}

/* ===== MENÚ ===== */
.menu-principal {
    background: #2c3e50;
    padding: 0.8rem 0;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.menu-principal ul {
    list-style: none;
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 2rem;
    margin: 0;
    padding: 0;
}

.menu-principal a {
    color: white;
    text-decoration: none;
    font-weight: bold;
    padding: 0.4rem 0.8rem;
    border-radius: 6px;
    transition: all 0.3s ease;
}

.menu-principal a:hover {
    background: #3498db;
    transform: translateY(-2px);
}

/* ===== SECCIONES ===== */
.seccion {
    padding: 2.5rem 1.5rem;
    max-width: 900px;
    margin: 0 auto;
    opacity: 0;
    transform: translateY(20px);
    animation: fadeInUp 0.8s forwards;
}

.seccion:nth-child(2) { animation-delay: 0.2s; }
.seccion:nth-child(3) { animation-delay: 0.4s; }
.seccion:nth-child(4) { animation-delay: 0.6s; }

/* Imagen animada */
.imagen-animada {
    width: 100%;
    max-width: 500px;
    border-radius: 12px;
    display: block;
    margin: 1.2rem auto;
    box-shadow: 0 6px 20px rgba(0,0,0,0.12);
    transition: all 0.4s ease;
}

.imagen-animada:hover {
    transform: scale(1.02) rotate(1deg);
    box-shadow: 0 12px 30px rgba(0,0,0,0.2);
}

/* Tarjetas animadas */
.tarjetas {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 1.2rem;
    margin-top: 1.5rem;
}

.tarjeta {
    background: white;
    padding: 1.2rem 1.5rem;
    border-radius: 12px;
    font-weight: bold;
    color: #2980b9;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    transition: all 0.3s ease;
    cursor: default;
    animation: float 3s ease-in-out infinite;
}

.tarjeta:hover {
    transform: translateY(-8px) scale(1.05);
    box-shadow: 0 8px 20px rgba(52, 152, 219, 0.3);
}

/* GIF */
.gif-educativo {
    width: 100%;
    max-width: 320px;
    display: block;
    margin: 1.5rem auto;
    border-radius: 12px;
    box-shadow: 0 6px 16px rgba(0,0,0,0.1);
    animation: pulse 2s infinite;
}

/* Footer y botón subir */
footer {
    background: #2c3e50;
    color: white;
    text-align: center;
    padding: 1.8rem 1rem;
    margin-top: 2.5rem;
    position: relative;
}

.subir {
    position: absolute;
    top: -30px;
    left: 50%;
    transform: translateX(-50%);
    background: #f1c40f;
    color: #2c3e50;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    font-weight: bold;
    transition: all 0.3s ease;
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

.subir:hover {
    background: #f39c12;
    transform: translateX(-50%) rotate(90deg) scale(1.1);
}

/* ===== ANIMACIONES KEYFRAMES ===== */

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-8px); }
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-6px); }
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.03); }
}

/* Responsivo */
@media (max-width: 600px) {
    .tarjetas {
        flex-direction: column;
        align-items: center;
    }
    
    .menu-principal ul {
        gap: 1rem;
        flex-direction: column;
    }
}