/* Reset y estilos básicos */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    background-color: #f5f5f5;
    color: #333;
    line-height: 1.6;
}

/* Animación 1: Fade-in para el encabezado */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Animación 2: Pulse para botones */
@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

/* Animación 3: Rotación para íconos */
@keyframes rotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* Estructura principal */
header {
    background: linear-gradient(135deg, #4b6cb7, #182848);
    color: white;
    padding: 2rem 0;
    text-align: center;
    animation: fadeIn 1s ease-out;
}

nav {
    background-color: #333;
    padding: 1rem;
}

nav ul {
    display: flex;
    justify-content: center;
    list-style: none;
}

nav li {
    margin: 0 1rem;
}

nav a {
    color: white;
    text-decoration: none;
    font-weight: bold;
    transition: color 0.3s;
}

nav a:hover {
    color: #4b6cb7;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
}

/* Posicionamiento de contenido 1: Destacado */
.featured {
    background-color: white;
    border-radius: 8px;
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    position: relative;
}

.featured h2 {
    color: #4b6cb7;
    margin-bottom: 1rem;
}

.featured::after {
    content: "¡Destacado!";
    position: absolute;
    top: -10px;
    right: 20px;
    background-color: #ff6b6b;
    color: white;
    padding: 0.3rem 0.8rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: bold;
}

/* Posicionamiento de contenido 2: Flotante */
.floating-box {
    background-color: #182848;
    color: white;
    padding: 1.5rem;
    border-radius: 8px;
    width: 300px;
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 100;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.floating-box button {
    background-color: #4b6cb7;
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    margin-top: 1rem;
    cursor: pointer;
    animation: pulse 2s infinite;
}

/* Contenido multimedia */
.math-image {
    width: 100%;
    max-width: 500px;
    border-radius: 8px;
    margin: 1rem 0;
    transition: transform 0.3s;
}

.math-image:hover {
    transform: scale(1.02);
}

/* Secciones */
section {
    margin-bottom: 3rem;
    background-color: white;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

h2 {
    color: #182848;
    margin-bottom: 1rem;
    border-bottom: 2px solid #4b6cb7;
    padding-bottom: 0.5rem;
}

/* Animación para íconos */
.icon {
    font-size: 2rem;
    margin-right: 1rem;
    display: inline-block;
}

.icon:hover {
    animation: rotate 1s linear;
}

footer {
    background-color: #333;
    color: white;
    text-align: center;
    padding: 2rem 0;
    margin-top: 2rem;
}

/* Estilos responsivos para móviles */
@media (max-width: 768px) {
    nav ul {
        flex-direction: column;
        align-items: center;
    }
    
    nav li {
        margin: 0.5rem 0;
    }
    
    .floating-box {
        width: 90%;
        right: 5%;
        bottom: 10px;
    }
    
    .container {
        padding: 1rem;
    }
    
    section {
        padding: 1.5rem;
    }
}