@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@400;500;600;700&display=swap');

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Montserrat', sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f5f5f5;
    overflow-x: hidden;
    padding-top: 80px; /* Compensar navbar fijo */
}

/* ===== ANIMACIONES OPTIMIZADAS ===== */
@keyframes slideInFromRight {
    0% {
        transform: translateX(50px);
        opacity: 0;
    }
    100% {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes fadeInUp {
    0% {
        transform: translateY(20px);
        opacity: 0;
    }
    100% {
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes slideTopBar {
    0% {
        transform: translateY(-100%);
    }
    100% {
        transform: translateY(0);
    }
}

@keyframes shimmer {
    0% {
        transform: translateX(-100%);
    }
    100% {
        transform: translateX(100%);
    }
}

@keyframes expandLine {
    0% {
        width: 0;
    }
    100% {
        width: 80px;
    }
}

/* ===== NAVBAR OPTIMIZADO ===== */
.navbar {
    background: rgba(255, 255, 255, 0.95);
    padding: 15px 0;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    animation: slideTopBar 0.4s ease-out;
    backdrop-filter: blur(8px);
    height: 70px;
    display: flex;
    align-items: center;
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 20px;
    width: 100%;
}

.logo {
    display: flex;
    align-items: center;
    color: #4a90e2;
    font-weight: bold;
    font-size: 18px;
}

.logo::before {
    content: "🏢";
    margin-right: 10px;
    font-size: 24px;
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 30px;
}

.nav-menu a {
    color: #4a90e2;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.2s ease;
    position: relative;
    padding: 5px 0;
}

.nav-menu a:hover {
    transform: translateY(-2px);
    color: #2c5aa0;
}

.nav-menu a::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: -5px;
    left: 50%;
    background: #4a90e2;
    transition: all 0.3s ease;
    transform: translateX(-50%);
}

.nav-menu a:hover::after {
    width: 100%;
}

/* ===== MENÚ HAMBURGUESA MEJORADO ===== */
.hamburger {
    display: none;
    flex-direction: column;
    cursor: pointer;
    padding: 10px;
    z-index: 1002;
    position: relative;
    transition: all 0.3s ease;
    margin-left: auto; /* Esto lo empuja a la derecha */
}

.hamburger span {
    width: 25px;
    height: 3px;
    background-color: #4a90e2;
    margin: 3px 0;
    transition: all 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    border-radius: 2px;
    transform-origin: center;
}

/* Animación de hamburguesa a X mejorada */
.hamburger.active span {
    background-color: #4a90e2; /* Mantener el color azul */
}

.hamburger.active span:nth-child(1) {
    transform: rotate(45deg) translate(6px, 6px);
}

.hamburger.active span:nth-child(2) {
    opacity: 0;
    transform: scale(0);
}

.hamburger.active span:nth-child(3) {
    transform: rotate(-45deg) translate(6px, -6px);
}

/* ===== CONTENEDOR PRINCIPAL ===== */
.educacion-container {
    max-width: 1000px;
    margin: 20px auto;
    padding: 20px;
    background-color: #fff;
    color: #333;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    border-radius: 8px;
    animation: slideInFromRight 0.6s ease-out;
    will-change: transform;
}

/* ===== CONTENIDO EDUCATIVO ===== */
.educacion-container h1 {
    text-align: center;
    color: #070707;
    margin-bottom: 20px;
    padding-top: 20px;
    animation: fadeInUp 0.5s ease-out 0.2s both;
    position: relative;
}

.educacion-container h1::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 50%;
    width: 0;
    height: 3px;
    background: linear-gradient(90deg, #f16623, #d1551e);
    animation: expandLine 0.8s ease-out 0.8s both;
    transform: translateX(-50%);
    border-radius: 2px;
}

.educacion-container p {
    margin-bottom: 20px;
    animation: fadeInUp 0.4s ease-out 0.4s both;
    transition: color 0.2s ease;
}

/* Hover solo para párrafos normales */
.educacion-container p:hover {
    color: #f16623;
}

/* Anular el hover para párrafos dentro de contenedores naranjas */
.fondo-naranja p:hover,
.fondo-naranja-claro p:hover,
.fondo-amarillo p:hover,
.fondo-verde p:hover {
    color: white !important;
}

.educacion-bloque {
    display: flex;
    flex-wrap: wrap;
    align-items: stretch;
    gap: 20px;
    margin-bottom: 40px;
    animation: slideInFromRight 0.5s ease-out both;
}

.educacion-bloque:nth-child(even) {
    animation-delay: 0.1s;
}

.educacion-bloque:nth-child(odd) {
    animation-delay: 0.2s;
}

.educacion-bloque.reverso {
    flex-direction: row-reverse;
}

.educacion-imagen, .educacion-texto {
    display: flex;
    flex-direction: column;
}

.educacion-imagen {
    flex: 1 1 300px;
    max-width: 400px;
    position: relative;
    border-radius: 6px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.educacion-imagen:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

/* Efecto shimmer optimizado solo al hover */
.educacion-imagen::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: left 0.5s ease;
    z-index: 1;
    opacity: 0;
}

.educacion-imagen:hover::before {
    left: 100%;
    opacity: 1;
}

.educacion-imagen img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 6px;
    transition: transform 0.3s ease;
}

.educacion-imagen:hover img {
    transform: scale(1.02);
}

.foto-etiqueta {
    font-size: 0.8rem;
    margin-top: 5px;
    color: #ffffff;
    font-style: italic;
}

.educacion-texto {
    flex: 2 1 400px;
    padding: 20px;
    border-radius: 6px;
    box-sizing: border-box;
    transition: transform 0.2s ease;
    position: relative;
}

.educacion-texto:hover {
    transform: translateX(-3px);
}

.fondo-naranja {
    background-color: #f16623;
    color: white;
}

.fondo-naranja-claro {
    background-color: #f16623;
    color: white;
}

.fondo-amarillo {
    background-color: #f16623;
}

.fondo-verde {
    background-color: #f16623;
}

p {
    text-align: justify;
}

/* ===== EFECTO DE DESENFOQUE ===== */
.blur-background {
    filter: blur(5px);
    transition: filter 0.3s ease;
}

/* Prevenir scroll cuando el menú está abierto */
body.menu-open {
    overflow: hidden;
    height: 100vh;
}

/* ===== OPTIMIZACIONES DE RENDIMIENTO ===== */
.educacion-container,
.educacion-bloque,
.educacion-imagen,
.educacion-texto {
    transform: translateZ(0);
    backface-visibility: hidden;
}

/* ===== MEDIA QUERIES RESPONSIVE ===== */

/* Tablets - 768px y menos */
@media (max-width: 768px) {
    body {
        padding-top: 70px;
    }
    
    .navbar {
        height: 60px;
        padding: 10px 0;
    }
    
    .hamburger {
        display: flex;
    }
    
    .nav-menu {
        position: fixed;
        top: 0;
        left: 0;
        width: 100vw;
        height: 100vh;
        /* FONDO BLANCO EN LUGAR DE AZUL */
        background: rgba(255, 255, 255, 0.97);
        backdrop-filter: blur(20px);
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        gap: 40px;
        
        /* Animación de entrada */
        transform: translateX(-100%);
        opacity: 0;
        visibility: hidden;
        transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
        
        z-index: 1001;
    }
    
    .nav-menu.active {
        transform: translateX(0);
        opacity: 1;
        visibility: visible;
    }
    
    .nav-menu li {
        margin: 0;
        transform: translateY(50px);
        opacity: 0;
        transition: all 0.3s ease;
    }
    
    .nav-menu.active li {
        transform: translateY(0);
        opacity: 1;
    }
    
    /* Animación escalonada de los elementos del menú */
    .nav-menu.active li:nth-child(1) { transition-delay: 0.1s; }
    .nav-menu.active li:nth-child(2) { transition-delay: 0.15s; }
    .nav-menu.active li:nth-child(3) { transition-delay: 0.2s; }
    .nav-menu.active li:nth-child(4) { transition-delay: 0.25s; }
    .nav-menu.active li:nth-child(5) { transition-delay: 0.3s; }
    
    .nav-menu a {
        /* TEXTO AZUL EN LUGAR DE BLANCO */
        color: #4a90e2;
        font-size: 2rem;
        font-weight: 600;
        text-decoration: none;
        padding: 15px 30px;
        border-radius: 15px;
        transition: all 0.3s ease;
        position: relative;
        overflow: hidden;
        display: block;
        text-align: center;
        min-width: 200px;
        border: 2px solid transparent;
    }
    
    .nav-menu a::before {
        content: '';
        position: absolute;
        top: 0;
        left: -100%;
        width: 100%;
        height: 100%;
        background: rgba(74, 144, 226, 0.1);
        transition: left 0.3s ease;
        z-index: -1;
    }
    
    .nav-menu a:hover {
        transform: scale(1.05);
        background: rgba(74, 144, 226, 0.1);
        box-shadow: 0 10px 30px rgba(74, 144, 226, 0.2);
        border: 2px solid #4a90e2;
        color: #2c5aa0;
    }
    
    .nav-menu a:hover::before {
        left: 0;
    }
    
    .nav-menu a::after {
        display: none; /* Quitar la línea inferior del hover */
    }
    
    /* Efecto de ondas al hacer click */
    .nav-menu a:active {
        transform: scale(0.95);
    }
    
    .nav-container {
        padding: 0 15px;
    }
    
    .educacion-container {
        margin: 20px auto;
        padding: 15px;
    }
    
    .educacion-container h1 {
        padding-top: 15px;
        font-size: 1.8rem;
    }
    
    .educacion-bloque {
        flex-direction: column;
        gap: 15px;
    }
    
    .educacion-bloque.reverso {
        flex-direction: column;
    }
    
    .educacion-imagen {
        max-width: 100%;
        flex: 1 1 auto;
    }
    
    .educacion-imagen:hover {
        transform: translateY(-3px);
    }
    
    .educacion-texto {
        flex: 1 1 auto;
        padding: 15px;
    }
    
    .educacion-texto:hover {
        transform: translateX(-2px);
    }
    
    .logo {
        font-size: 16px;
    }
    
    .logo::before {
        font-size: 20px;
        margin-right: 8px;
    }
    
    /* Reducir animaciones en móviles */
    .educacion-bloque {
        animation-duration: 0.3s;
    }
    
    .educacion-container h1 {
        animation-duration: 0.3s;
    }
    
    /* Ajustar sombras para mejor rendimiento en móviles */
    .educacion-imagen {
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    }
    
    .educacion-imagen:hover {
        box-shadow: 0 4px 15px rgba(0, 0, 0, 0.12);
    }
}

/* Móviles pequeños - 480px y menos */
@media (max-width: 480px) {
    body {
        padding-top: 60px;
    }
    
    .navbar {
        height: 55px;
        padding: 8px 0;
    }
    
    .nav-menu a {
        font-size: 1.6rem;
        min-width: 180px;
    }
    
    .nav-menu {
        gap: 30px;
    }
    
    .educacion-container {
        margin: 10px;
        padding: 10px;
        border-radius: 6px;
    }
    
    .educacion-texto {
        padding: 12px;
    }
    
    .educacion-container h1 {
        font-size: 1.5rem;
        margin-bottom: 15px;
        padding-top: 10px;
    }
    
    .educacion-container p {
        font-size: 0.9rem;
        margin-bottom: 15px;
    }
    
    .nav-container {
        padding: 0 10px;
    }
    
    .logo {
        font-size: 14px;
    }
    
    .logo::before {
        font-size: 18px;
        margin-right: 6px;
    }
    
    .hamburger span {
        width: 22px;
        height: 2px;
    }
    
    .educacion-bloque {
        margin-bottom: 25px;
    }
}

/* Móviles muy pequeños - 320px y menos */
@media (max-width: 320px) {
    body {
        padding-top: 55px;
    }
    
    .nav-menu a {
        font-size: 1.4rem;
        min-width: 160px;
        padding: 12px 25px;
    }
    
    .nav-menu {
        gap: 25px;
    }
    
    .educacion-container {
        margin: 5px;
        padding: 8px;
    }
    
    .educacion-texto {
        padding: 10px;
    }
    
    .educacion-container h1 {
        font-size: 1.3rem;
    }
    
    .educacion-container p {
        font-size: 0.85rem;
    }
    
    .logo {
        font-size: 13px;
    }
}

/* Tablets horizontales y escritorios pequeños - 769px a 1024px */
@media (min-width: 769px) and (max-width: 1024px) {
    .educacion-container {
        max-width: 900px;
        margin: 30px auto;
        padding: 25px;
    }
    
    .educacion-imagen {
        max-width: 350px;
    }
    
    .nav-container {
        max-width: 1000px;
        padding: 0 25px;
    }
    
    .nav-menu {
        gap: 25px;
    }
}

/* Escritorios grandes - 1025px y más */
@media (min-width: 1025px) {
    .educacion-container {
        max-width: 1200px;
    }
    
    .nav-container {
        max-width: 1400px;
    }
}

/* Preferencias de movimiento reducido */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}