/* Estilos Modernos para el Sitio Web Escolar */

/* Estilos Globales */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* --- Navbar tipo píldoras y cursor de mano --- */
nav {
    width: 100%;
    margin-top: 10px;
}

nav ul {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
}

body.lan-connect-page nav ul #lan-connect-btn {
    margin-left: auto;
}

body.lan-connect-page nav ul #lan-connect-btn > a.lan-connect-link {
    background: rgba(255, 255, 255, 0.16);
    border: 1px solid rgba(255, 255, 255, 0.28);
    color: #ffffff;
    box-shadow: 0 6px 14px rgba(0, 0, 0, 0.18);
}

body.lan-connect-page nav ul #lan-connect-btn > a.lan-connect-link:hover {
    background: linear-gradient(135deg, #ff9900, #ff6a00);
    border-color: rgba(255, 255, 255, 0.3);
}

@media (max-width: 992px) {
    body.lan-connect-page nav ul #lan-connect-btn {
        margin-left: 0;
        width: 100%;
        display: flex;
        justify-content: center;
    }
}

nav ul li {
    position: relative;
}

/* Enlaces principales como píldoras */
nav ul li > a,
nav ul li > .dropbtn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 18px;
    background: #1a4b8c;
    color: #ffffff;
    border-radius: 999px;
    font-size: 0.9rem;
    font-weight: 500;
    text-decoration: none;
    border: 1px solid rgba(255,255,255,0.12);
    box-shadow: 0 2px 6px rgba(0,0,0,0.15);
    cursor: pointer;
    transition: background 0.25s ease, transform 0.15s ease, box-shadow 0.25s ease, color 0.25s ease;
    white-space: nowrap;
}

nav ul li > a i,
nav ul li > .dropbtn i {
    margin-right: 4px;
    font-size: 0.95rem;
}

/* Hover de las opciones principales */
nav ul li > a:hover,
nav ul li > .dropbtn:hover {
    background: #ff9900;
    color: #ffffff;
    transform: translateY(-1px);
    box-shadow: 0 4px 10px rgba(0,0,0,0.25);
}

/* Estado activo opcional */
nav ul li > a.active {
    background: #ff7700;
    color: #ffffff;
}

/* Asegurar cursor tipo mano en todo el menú superior */
.clean-navbar a,
.clean-navbar button,
.clean-navbar .dropbtn {
    cursor: pointer;
}

/* Ajuste específico para el dropdown de Transparencia: mover un poco hacia la derecha en escritorio */
@media (min-width: 992px) {
    nav ul li.dropdown:first-child > .dropdown-content {
        left: 0;
        right: auto;
        transform: translateX(10px) translateY(-10px);
    }
    nav ul li.dropdown:first-child:hover > .dropdown-content,
    nav ul li.dropdown:first-child:focus-within > .dropdown-content {
        transform: translateX(10px) translateY(0);
    }
}

/* Estilo destacado para 'Posgrado' dentro del dropdown */
.dropdown-content a[href$="posgrado.html"] {
    background: linear-gradient(135deg, #ff9900, #ff6a00);
    color: #ffffff !important;
    font-weight: 700;
    border: none;
    margin: 6px 10px;
    border-radius: 10px;
    position: relative;
    padding-top: 14px;
}

.dropdown-content a[href$="posgrado.html"]:hover {
    filter: brightness(0.95);
    transform: translateX(3px) scale(1.01);
}

.dropdown-content a[href$="posgrado.html"]::after {
    content: "Nuevo";
    margin-left: auto;
    background: rgba(255,255,255,0.2);
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 0.75rem;
    color: #fff;
}

/* Divider superior antes de Posgrado */
.dropdown-content a[href$="posgrado.html"] {
    margin-top: 10px;
}
.dropdown-content a[href$="posgrado.html"]::selection { background: transparent; }
.dropdown-content a[href$="posgrado.html"] {
    box-shadow: inset 0 10px 0 -9px rgba(255,255,255,0.6), inset 0 11px 0 -9px rgba(255,154,0,0.35);
}

/* Reemplazar el icono para Posgrado por un diploma */
.dropdown-content a[href$="posgrado.html"]::before {
    content: "\f5a2"; /* diploma icon */
    font-family: "Font Awesome 6 Free";
    font-weight: 900;
    color: #ffffff;
}

body {
    font-family: 'Poppins', 'Arial', sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f5f7fa;
    overflow-x: hidden;
    margin: 0;
    padding: 0;
}

.container {
    width: 90%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
}

section {
    padding: 80px 0;
    scroll-margin-top: 90px;
}

h1, h2, h3 {
    margin-bottom: 20px;
    font-weight: 700;
    color: #1a4b8c;
}

h2 {
    text-align: center;
    font-size: 2.2rem;
    position: relative;
    margin-bottom: 40px;
}

h2::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 4px;
    background: linear-gradient(90deg, #1a4b8c, #2a6eda);
    border-radius: 2px;
}

p {
    margin-bottom: 15px;
    font-size: 1rem;
    color: #444;
}

img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
}

/* Estilos para el encabezado (compacto) */
header {
    background: linear-gradient(135deg, #0c2d5c 0%, #1a4b8c 100%);
    color: white;
    padding: 8px 0;
    position: sticky;
    top: 0;
    z-index: 1002; /* Valor alto para asegurar que esté por encima de todo */
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.14);
}

header::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: linear-gradient(90deg, #ff9900, #ff7700);
}

.header-container {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    padding: 0 18px 6px;
    max-width: 1400px;
    margin: 0 auto;
}

.logo {
    display: flex;
    align-items: center;
    flex-wrap: nowrap;
    transition: all 0.3s ease;
}

#logo-img {
    height: 48px;
    margin-right: 10px;
    border-radius: 8px;
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.2);
    transition: transform 0.3s ease;
    object-fit: contain;
}

#logo-img:hover {
    transform: scale(1.05);
}

.logo h1 {
    font-size: 1.05rem;
    margin: 0;
    color: #ffffff;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.2);
    font-weight: 700;
    max-width: 430px;
    display: flex;
    align-items: center;
    line-height: 1.2;
}

/* Estilos para la navegación */
nav {
    width: 100%;
    margin-top: 10px;
}

/* Botón de menú móvil */
.menu-toggle {
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    width: 44px;
    height: 44px;
    background-color: rgba(255, 255, 255, 0.15);
    border-radius: 50%;
    cursor: pointer;
    z-index: 1001;
    border: none;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.menu-toggle:hover {
    background-color: rgba(255, 255, 255, 0.25);
    transform: scale(1.05);
}

.menu-toggle i {
    color: white;
    font-size: 1.5rem;
    transition: all 0.3s ease;
}

/* Botón de acceso (Acceder) alineado como las opciones del menú - versión compacta */
#login-btn {
    align-self: center;
    margin-left: auto;
    margin-top: 0;
    padding: 5px 10px;
    border-radius: 20px;
    border: none;
    background-color: rgba(255, 255, 255, 0.10);
    color: #e6f0ff;
    font-weight: 600;
    font-size: 0.75rem;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    cursor: pointer;
    transition: all 0.3s ease;
}

#login-btn:hover {
    background-color: rgba(255, 255, 255, 0.25);
    color: #ffffff;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

@media (max-width: 1100px) {
    #login-btn {
        align-self: flex-start;
        margin-top: 10px;
        margin-left: 0;
    }
}

/* Media Queries para Responsividad */
@media (max-width: 1100px) {
    .header-container {
        padding: 0 15px;
        position: relative;
    }
    
    .logo h1 {
        font-size: 1.2rem;
        max-width: 300px;
    }
    
    #logo-img {
        height: 60px;
    }
    
    .menu-toggle {
        display: flex;
    }

    nav {
        position: absolute;
        top: calc(100% + 8px); /* separa visualmente sin crear gap de hover */
        left: 0;
        background: linear-gradient(135deg, rgba(26, 75, 140, 0.97) 0%, rgba(42, 110, 218, 0.97) 100%);
        backdrop-filter: blur(10px);
        width: 100%;
        height: 0;
        overflow: hidden;
        transition: all 0.4s ease;
        box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
        opacity: 0;
        z-index: 1000;
        padding: 0;
    }

    nav.active {
        height: auto;
        opacity: 1;
        padding: 10px 0;
        max-height: 80vh;
        overflow-y: auto;
    }

    nav ul {
        flex-direction: column;
        width: 100%;
        padding: 15px 0;
        align-items: stretch;
    }

    nav ul li {
        margin-left: 0;
        margin-bottom: 12px;
        width: 100%;
    }
    
    nav ul li > a,
    nav ul li > .dropbtn {
        padding: 12px;
        width: 100%;
        border-radius: 8px;
        margin: 0 10px;
        font-size: 1rem;
        background-color: rgba(255, 255, 255, 0.1);
        justify-content: space-between;
    }
     
    nav ul li > a:hover,
    nav ul li > .dropbtn:hover {
        border-left: 3px solid #ffffff;
        background-color: rgba(255, 255, 255, 0.2);
        transform: translateX(5px);
    }

    /* En móvil, el dropdown debe comportarse como acordeón (no como popup absoluto) */
    nav ul li.dropdown > .dropdown-content {
        position: static;
        left: auto;
        right: auto;
        top: auto;
        transform: none;
        opacity: 1;
        width: calc(100% - 20px);
        margin: 6px 10px 0;
        border-radius: 10px;
        max-height: none;
        overflow: visible;
        box-shadow: 0 8px 16px rgba(0,0,0,0.18);
    }

    nav ul li.dropdown > .dropdown-content:not(.show) {
        display: none;
    }
}

/* Media Queries para dispositivos móviles */
@media (max-width: 768px) {
    .header-container {
        flex-direction: column;
        padding: 10px;
        position: relative;
    }
    
    .logo {
        margin-bottom: 10px;
        justify-content: center;
    }
    
    .logo h1 {
        font-size: 1rem;
        text-align: center;
    }
    
    #logo-img {
        height: 50px;
    }
    
    .menu-toggle {
        position: absolute;
        top: 15px;
        right: 15px;
    }
    
    section {
        padding: 50px 0;
    }
    
    .hero-content h2 {
        font-size: 2rem !important;
    }
    
    .hero-content p {
        font-size: 1rem !important;
    }
    
    .btn {
        padding: 12px 25px !important;
        font-size: 0.9rem !important;
    }
    
    .about-content {
        flex-direction: column;
    }
    
    .download-links {
        padding: 15px !important;
    }
    
    .download-links h3 {
        font-size: 1.2rem !important;
    }
}

/* Media Queries para dispositivos móviles pequeños */
@media (max-width: 480px) {
    .logo h1 {
        font-size: 0.9rem;
        margin-left: 5px;
    }
    
    #logo-img {
        height: 40px;
    }
    
    nav ul li a {
        padding: 10px;
        font-size: 0.9rem;
    }
    
    nav ul li a i {
        font-size: 0.85rem;
    }
    
    .section-title h2 {
        font-size: 1.8rem;
    }
    
    .hero-content h2 {
        font-size: 1.5rem !important;
        margin-bottom: 15px !important;
    }
    
    .hero-content p {
        font-size: 0.9rem !important;
        margin-bottom: 20px !important;
    }
    
    .btn {
        padding: 10px 20px !important;
        font-size: 0.85rem !important;
    }
    
    .download-links a {
        flex-direction: column;
        align-items: flex-start !important;
        padding: 10px !important;
    }
    
    .download-links a i {
        margin-bottom: 8px !important;
    }
    
    .download-links a span:last-child {
        margin-left: 0 !important;
        margin-top: 10px !important;
        align-self: flex-start !important;
    }
}

/* Estilos para secciones */
.section-title {
    text-align: center;
    margin-bottom: 50px;
    position: relative;
    padding-bottom: 15px;
}

.section-title h2 {
    color: #1a4b8c;
    font-size: 2.5rem;
    margin-bottom: 10px;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 4px;
    background: linear-gradient(90deg, #1a4b8c, #2a6eda);
    border-radius: 2px;
}

/* Estilos para tarjetas */
.card {
    background-color: #ffffff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
    margin-bottom: 30px;
}

.card:hover {
    transform: translateY(-10px);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.12);
}

.card-img {
    width: 100%;
    height: 200px;
    object-fit: cover;
}

.card-content {
    padding: 20px;
}

.card-title {
    font-size: 1.4rem;
    color: #1a4b8c;
    margin-bottom: 10px;
}

.card-text {
    color: #555;
    margin-bottom: 15px;
}

/* Animaciones */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    animation: fadeIn 0.6s ease forwards;
}

/* Estilos para Modales (Login y Contacto) */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.6);
    opacity: 0;
    transition: opacity 0.4s ease;
}

.modal.active {
    opacity: 1;
}

.modal-content {
    background-color: #fff;
    margin: 10% auto;
    padding: 30px;
    border-radius: 15px;
    width: 90%;
    max-width: 500px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.2);
    position: relative;
    transform: translateY(-50px);
    transition: transform 0.4s ease;
}

.modal.active .modal-content {
    transform: translateY(0);
}

.modal-close {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    transition: color 0.3s ease;
}

.modal-close:hover,
.modal-close:focus {
    color: #333;
    text-decoration: none;
}

.modal h2 {
    margin-top: 0;
    margin-bottom: 25px;
    color: #1a4b8c;
    text-align: center;
}

.modal .form-group {
    margin-bottom: 20px;
}

.modal .form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #555;
}

.modal .form-group input[type="text"],
.modal .form-group input[type="password"],
.modal .form-group textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid #ccc;
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.modal .form-group input:focus,
.modal .form-group textarea:focus {
    border-color: #1a4b8c;
    box-shadow: 0 0 0 3px rgba(26, 75, 140, 0.1);
    outline: none;
}

.modal .btn-submit {
    width: 100%;
    padding: 15px;
    background: linear-gradient(to right, #1a4b8c, #2a6edb);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.modal .btn-submit:hover {
    opacity: 0.9;
    box-shadow: 0 5px 15px rgba(26, 75, 140, 0.3);
}

/* Estilos para el pie de página */
.modern-footer {
    color: white;
    margin-top: 0;
    position: relative;
    overflow: hidden;
    box-shadow: none;
    border: none;
}

.footer-top {
    background: linear-gradient(135deg, #0c2d5c 0%, #1a4b8c 100%);
    padding: 60px 0 40px;
    position: relative;
    border-bottom: none;
    margin-bottom: 0;
}

.footer-top::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url('data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTAwJSIgaGVpZ2h0PSIxMDAlIiB2aWV3Qm94PSIwIDAgMTI4MCAxNDAiIHByZXNlcnZlQXNwZWN0UmF0aW89Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PGcgZmlsbD0icmdiYSgyNTUsMjU1LDI1NSwwLjA1KSI+PHBhdGggZD0iTTAgNTEuNzZjMzYuMjEtMi4yNSA3Ny41Ny0zLjU4IDEyNi40Mi0zLjU4IDMyMCAwIDMyMCA1NyA2NDAgNTcgMjcxLjE1IDAgMzEyLjU4LTQwLjkxIDUxMy41OC01Ny40VjBIMHoiIGZpbGwtb3BhY2l0eT0iLjMiLz48cGF0aCBkPSJNMCA5MC43MmMxNzEuMzQtNy4wMyAzNDMuMzYtMTEuMzMgNTEzLjU4IDkuNTcgMTk5LjI4IDI0LjMgMjk4LjQgNDcuNiA0MjYuNDIgNDcuNiAyNTcuNyAwIDMxMC41OS00NS43IDUxMy41OC01My40VjBIMHoiIGZpbGwtb3BhY2l0eT0iLjUiLz48cGF0aCBkPSJNMCAwdjMuNEMyOC4yIDEuNiA1OS40LjU5IDk0LjQyLjU5YzMyMCAwIDMyMCA4NC4zIDY0MCA4NC4zIDI4NSAwIDMxNi4xNy02Ni44NSA1NDUuNTgtODEuNDlWMHoiLz48L2c+PC9zdmc+');
    background-size: 100% 100px;
    background-repeat: no-repeat;
    background-position: top center;
    opacity: 0.2;
    pointer-events: none;
}

.footer-content {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 30px;
}

.footer-info {
    flex: 2;
    min-width: 280px;
}

.footer-logo {
    width: 80px;
    height: auto;
    margin-bottom: 15px;
    border-radius: 10px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}

.footer-info h3 {
    color: white;
    font-size: 1.4rem;
    margin-bottom: 10px;
    font-weight: 600;
}

.chatbot-header-left {
    display: flex;
    align-items: center;
    gap: 10px;
}

.chatbot-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid rgba(255,255,255,0.8);
    box-shadow: 0 0 0 3px rgba(255,255,255,0.2);
}

.chatbot-title span {
    display: block;
    font-size: 0.9rem;
    font-weight: 600;
}

.chatbot-title small {
    display: block;
    font-size: 0.7rem;
    opacity: 0.85;
}

.footer-motto {
    color: rgba(255, 255, 255, 0.8);
    font-style: italic;
    margin-bottom: 20px;
    font-size: 1.1rem;
}

.footer-contact {
    margin-top: 20px;
}

.footer-contact p {
    display: flex;
    align-items: center;
    margin-bottom: 12px;
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.95rem;
}

.footer-contact p i {
    margin-right: 12px;
    color: #ff9900;
    font-size: 1.1rem;
    width: 20px;
    text-align: center;
}

.footer-links {
    flex: 1;
    min-width: 250px;
}

.footer-links h3 {
    color: white;
    margin-bottom: 25px;
    font-size: 1.3rem;
    position: relative;
    padding-bottom: 12px;
}

.footer-links h3::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 50px;
    height: 3px;
    background: linear-gradient(90deg, #ff9900, #ff7700);
    border-radius: 2px;
}

.footer-links-columns {
    display: flex;
    gap: 30px;
}

.footer-links ul {
    list-style: none;
    padding: 0;
}

.footer-links ul li {
    margin-bottom: 12px;
}

.footer-links ul li a {
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
}

.footer-links ul li a i {
    margin-right: 8px;
    color: #ff9900;
    font-size: 0.8rem;
}

.footer-links ul li a:hover {
    color: white;
    transform: translateX(5px);
}

.footer-social {
    flex: 1;
    min-width: 250px;
}

.footer-social h3 {
    color: white;
    margin-bottom: 25px;
    font-size: 1.3rem;
    position: relative;
    padding-bottom: 12px;
}

.footer-social h3::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 50px;
    height: 3px;
    background: linear-gradient(90deg, #ff9900, #ff7700);
    border-radius: 2px;
}

.footer-social p {
    color: rgba(255, 255, 255, 0.8);
    margin-bottom: 20px;
    font-size: 0.95rem;
    line-height: 1.6;
}

.social-icons {
    display: flex;
    gap: 15px;
}

.social-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border-radius: 50%;
    text-decoration: none;
    transition: all 0.3s ease;
    font-size: 1.1rem;
}

.social-icon:hover {
    background: #ff9900;
    color: white;
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(255, 153, 0, 0.3);
}

.footer-bottom {
    background: linear-gradient(135deg, #0c2d5c 0%, #1a4b8c 100%);
    text-align: center;
    padding: 20px 0;
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.9rem;
    border-top: none;
    margin-top: -1px;
    position: relative;
    z-index: 10;
}

@media (max-width: 992px) {
    .footer-content {
        flex-direction: column;
    }
    
    .footer-links-columns {
        flex-direction: column;
        gap: 0;
    }
    
    .footer-links ul:first-child {
        margin-bottom: 0;
    }
    
    .social-icons {
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .footer-info h3,
    .footer-links h3,
    .footer-social h3 {
        font-size: 1.1rem;
    }
    
    .footer-motto {
        font-size: 0.9rem;
    }
    
    .footer-contact p {
        font-size: 0.85rem;
    }
    
    .footer-bottom {
        padding: 15px 0;
        font-size: 0.8rem;
    }
}

/* Ajustes extra para botones del navbar en móviles pequeños */
@media (max-width: 480px) {
    nav ul li > a,
    nav ul li > .dropbtn {
        font-size: 0.8rem;
        padding: 8px 12px;
        white-space: normal;
        line-height: 1.3;
    }
}

/* Estilos para el menú desplegable */
.dropdown {
    position: relative;
    display: inline-block;
}

.dropdown > .dropbtn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    border-radius: 30px;
    background-color: rgba(255, 255, 255, 0.12);
    color: #e6f0ff;
    font-weight: 600;
    transition: all 0.3s ease;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(0,0,0,0.08);
}

.dropdown:hover > .dropbtn,
.dropdown > .dropbtn:hover {
    background-color: rgba(255, 255, 255, 0.25);
    color: #ffffff;
    transform: translateY(-2px);
    box-shadow: 0 6px 14px rgba(0,0,0,0.12);
}

.dropdown-content {
    display: none;
    position: absolute;
    background-color: #f9f9f9;
    min-width: 300px;
    box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.2);
    z-index: 2000;
    border-radius: 8px;
    padding: 10px 0;
    /* Evitar gap que provoca cierre del hover al mover el mouse */
    margin-top: 0;
    opacity: 0;
    transform: translateY(-10px);
    top: 100%;
    pointer-events: auto;
    transition: all 0.3s ease;
    /* Evitar que se corte cuando está cerca del borde derecho y en pantallas pequeñas */
    right: 0;
    left: auto;
    max-height: calc(100vh - 140px); /* un poco más alto para mostrar mejor el último bloque */
    overflow-y: auto;
}

.dropdown-content a {
    color: #1d2a3b;
    padding: 12px 16px;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.95rem;
    background-color: transparent !important; /* Sobrescribir estilos existentes */
    text-align: left;
    transition: all 0.2s ease;
    border-bottom: 1px solid #eef2f7;
}

/* Encabezado dentro del dropdown (no clicable) */
.dropdown-content .dropdown-header {
    padding: 8px 16px;
    font-weight: 600;
    font-size: 0.95rem;
    color: #1a4b8c;
    background-color: #e0ecff;
    border-bottom: 1px solid #c9d8f5;
    cursor: default;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

/* Documentos dentro de la categoría de Transparencia como tarjetas internas */
.dropdown-content .dropdown-header + a,
.dropdown-content .dropdown-header ~ a {
    padding: 7px 16px;
    margin: 4px 10px;
    border-radius: 10px;
    background-color: #ffffff !important;
    border: 1px solid #e2e8f5;
    box-shadow: 0 2px 4px rgba(15, 23, 42, 0.06);
    font-size: 0.9rem;
}

.dropdown-content .dropdown-header + a {
    margin-top: 10px;
}

.dropdown-content .dropdown-header + a:hover,
.dropdown-content .dropdown-header ~ a:hover {
    background-color: #f4f7ff !important;
    border-color: #c3d3f5;
    transform: translateX(2px);
}

/* Secciones plegables (acordeón) dentro del dropdown de Transparencia */
.dropdown-section {
    border-bottom: 1px solid #dde7f5;
}

.dropdown-section-header {
    width: 100%;
    text-align: left;
    background: #e0ecff;
    border: none;
    padding: 8px 16px;
    font-weight: 600;
    font-size: 0.9rem;
    color: #1a4b8c;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.dropdown-section-header::after {
    content: '\f107'; /* caret-down */
    font-family: "Font Awesome 6 Free";
    font-weight: 900;
    font-size: 0.75rem;
}

.dropdown-section-body {
    display: none;
    padding: 4px 0 8px;
}

.dropdown-section-body.open {
    display: block;
}

/* Grupos de subtítulos dentro de Normatividad y Leyes (Transparencia) */
.dropdown-content .submenu-group {
    padding: 6px 0 4px;
    margin: 2px 0 4px;
}

.dropdown-content .submenu-group strong {
    display: block;
    padding: 4px 16px 2px;
    font-size: 0.85rem;
    font-weight: 600;
    color: #1a4b8c;            /* texto azul oscuro para buen contraste */
    text-transform: none;      /* respeta mayúsculas y minúsculas del texto original */
    letter-spacing: 0.01em;
    background-color: #eaf1ff; /* fondo ligeramente azulado para distinguir el grupo */
}

/* Texto interno de listas en bloques informativos de Transparencia
   (por ejemplo: "¿Qué es la transparencia proactiva?") */
.dropdown-content .submenu-group ol {
    margin: 4px 18px 6px;
    padding-left: 18px;
    color: #1d2a3b;            /* texto principal oscuro */
    font-size: 0.9rem;
}

.dropdown-content .submenu-group ol li {
    margin-bottom: 4px;
    color: #1d2a3b;            /* asegurar que no herede transparencias */
}

.dropdown-content .submenu-group + .submenu-group {
    border-top: 1px solid #dde7f5;
    margin-top: 6px;
    padding-top: 8px;
}

/* Buscador de licenciaturas dentro del menú Dirección */
.licenciatura-search-container {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 14px 8px;
    margin: 4px 10px 8px;
    border-radius: 8px;
    background-color: #eef3ff;
    border: 1px solid #d3ddfb;
}

.licenciatura-search-container i {
    color: #1a4b8c;
    font-size: 0.9rem;
}

.licenciatura-search-container input {
    flex: 1;
    border: none;
    outline: none;
    background: transparent;
    font-size: 0.85rem;
    color: #1d2a3b;
}

.licenciatura-search-container input::placeholder {
    color: #7b8ba8;
}

.licenciatura-item,
.licenciatura-posgrado-item {
    display: flex;
    align-items: center;
}

.licenciatura-icon {
    margin-right: 8px;
    color: #1a4b8c;
}

/* Icono por defecto para los elementos del dropdown (birrete) */
.dropdown-content a::before {
    content: "\f19d"; /* graduation-cap */
    font-family: "Font Awesome 6 Free";
    font-weight: 900;
    color: #1a4b8c;
    width: 18px;
    text-align: center;
}

.dropdown-content a:hover {
    background-color: #eef6ff !important;
    color: #1a4b8c !important;
    transform: translateX(3px);
}

.dropdown-content.show {
    display: block;
    opacity: 1;
    transform: translateY(0);
}

/* En escritorio, permitir abrir por hover además del click (no afecta móvil) */
@media (min-width: 992px) {
  nav ul li.dropdown:hover > .dropdown-content,
  nav ul li.dropdown:focus-within > .dropdown-content {
    display: block !important;
    opacity: 1;
    transform: translateY(0);
  }
}

.dropdown-icon {
    margin-left: 5px;
    font-size: 0.7rem;
    transition: transform 0.3s ease;
}

.dropdown:hover .dropdown-icon {
    transform: rotate(180deg);
}

/* También rotar cuando el submenú está activo (por clic en móvil) */
.dropdown.active .dropdown-icon {
    transform: rotate(180deg);
}

/* Evitar que el botón principal del dropdown parezca un enlace */
.dropdown > .dropbtn {
    cursor: default;
}

/* Icono de Facebook en el navbar con tooltip */
.facebook-nav-item > a.fb-tooltip {
    padding: 8px 14px;
    background: #1877f2;
    border-color: rgba(255,255,255,0.25);
}

.facebook-nav-item > a.fb-tooltip:hover {
    background: #145cbd;
}

.fb-tooltip {
    position: relative;
}

.fb-tooltip-text {
    position: absolute;
    bottom: -40px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0,0,0,0.85);
    color: #fff;
    padding: 6px 10px;
    border-radius: 6px;
    font-size: 0.75rem;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.2s ease, transform 0.2s ease;
    z-index: 3000;
}

.fb-tooltip-text::before {
    content: '';
    position: absolute;
    top: -5px;
    left: 50%;
    transform: translateX(-50%);
    border-width: 5px;
    border-style: solid;
    border-color: transparent transparent rgba(0,0,0,0.85) transparent;
}

.fb-tooltip:hover .fb-tooltip-text {
    opacity: 1;
    visibility: visible;
    transform: translate(-50%, -3px);
}

/* Botón flotante de chat */
.chatbot-toggle {
    position: fixed;
    right: 20px;
    bottom: 80px;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: radial-gradient(circle at 30% 20%, #ffe4b3 0, #ff9900 35%, #ff7700 100%);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 12px 28px rgba(0,0,0,0.45);
    z-index: 4000;
    transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
    border: 3px solid #ffffff;
    animation: chatbot-float 2.4s ease-in-out infinite;
}

.chatbot-toggle i {
    font-size: 1.9rem;
}

.chatbot-toggle:hover {
    transform: translateY(-4px) scale(1.03);
    box-shadow: 0 18px 40px rgba(0,0,0,0.55);
}

.chatbot-toggle::after {
    content: "Chat IESEN";
    position: absolute;
    right: 70px;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0,0,0,0.85);
    color: #fff;
    padding: 5px 10px;
    border-radius: 999px;
    font-size: 0.75rem;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.chatbot-toggle::before {
    content: "";
    position: absolute;
    right: 60px;
    top: 50%;
    transform: translateY(-50%);
    border-width: 6px;
    border-style: solid;
    border-color: transparent rgba(0,0,0,0.85) transparent transparent;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease;
}

.chatbot-toggle:hover::after,
.chatbot-toggle:hover::before {
    opacity: 1;
    visibility: visible;
}

/* Ventana de chat */
.chatbot-window {
    position: fixed;
    right: 20px;
    bottom: 150px;
    width: 320px;
    max-width: 90vw;
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 18px 40px rgba(15, 23, 42, 0.35);
    overflow: hidden;
    z-index: 3999;
    display: none;
    transform: translateY(10px);
    opacity: 0;
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.chatbot-window.open {
    display: block;
    opacity: 1;
    transform: translateY(0);
}

.chatbot-header {
    background: linear-gradient(135deg, #0c2d5c, #1a4b8c);
    color: #fff;
    padding: 10px 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-weight: 600;
}

.chatbot-close {
    background: transparent;
    border: none;
    color: #fff;
    font-size: 1.2rem;
    cursor: pointer;
}

.chatbot-body {
    padding: 14px;
    background: #f5f7fa;
}

.chatbot-message.bot {
    background: #ffffff;
    border-radius: 12px;
    padding: 10px 12px;
    box-shadow: 0 4px 12px rgba(15,23,42,0.12);
    font-size: 0.9rem;
    color: #333;
}

.chatbot-message.bot p {
    margin-bottom: 6px;
}

.chatbot-facebook-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-top: 8px;
    padding: 8px 14px;
    border-radius: 999px;
    background: #1877f2;
    color: #fff;
    text-decoration: none;
    font-weight: 500;
    font-size: 0.85rem;
    transition: background 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.chatbot-facebook-btn i {
    font-size: 1rem;
}

.chatbot-facebook-btn:hover {
    background: #145cbd;
    transform: translateY(-1px);
    box-shadow: 0 6px 14px rgba(0,0,0,0.25);
}

@media (max-width: 600px) {
    .chatbot-toggle {
        right: 15px;
        bottom: 70px;
    }

    .chatbot-window {
        right: 10px;
        left: 10px;
        bottom: 90px;
        width: auto;
    }
}

@keyframes chatbot-float {
    0% {
        transform: translateY(0);
        box-shadow: 0 12px 28px rgba(0,0,0,0.45);
    }
    50% {
        transform: translateY(-6px);
        box-shadow: 0 18px 40px rgba(0,0,0,0.55);
    }
    100% {
        transform: translateY(0);
        box-shadow: 0 12px 28px rgba(0,0,0,0.45);
    }
}

/* Ajustes para el menú desplegable en móvil */
@media (max-width: 991px) {
    .dropdown-content {
        position: static;
        box-shadow: none;
        background-color: rgba(255, 255, 255, 0.1);
        padding-left: 20px; /* Indentación para sub-items */
        /* Al estar dentro del flujo en móvil, no usar animación por opacidad */
        opacity: 1;
        transform: none;
        display: none; /* Opción B: oculto en móvil, navegación directa */
        margin-top: 6px;
    }

    .dropdown-content a {
        color: #e6f0ff;
        padding: 10px 15px;
        border-bottom: 1px solid rgba(255,255,255,0.12);
    }

    /* Desactivar cualquier intento de mostrar por hover/active en móvil */
    .dropdown:hover .dropdown-content { display: none; }
    .dropdown.active .dropdown-content { display: none; }

    /* En móvil, indicar interactividad del botón del dropdown */
    .dropdown > .dropbtn {
        cursor: pointer;
    }
}
