/* ================================================================
 * HEADER & NAVIGATION
 * ================================================================ */

/* Ensure consistent font sizing for rem calculations */
html {
    font-size: 16px;
}

/* --- Base Header Layout --- */
#main-header {
    background-color: var(--background, #020617);
    padding: 1rem;
    position: sticky;
    top: 0;
    z-index: 100;
    border-bottom: 1px solid var(--border, #1e293b);
    height: 70px;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    height: 100%;
    padding: 0 1rem;
}

/* Logo styles */
.logo-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    text-decoration: none;
    z-index: 10;
}

.logo-img {
    width: 40px;
    height: 40px;
    border-radius: 8px;
}

.logo-text {
    color: var(--text-primary, #ffffff);
    font-size: 1.25rem;
    font-weight: 600;
}

/* Desktop Navigation */
.desktop-nav {
    display: none; /* Hidden by default on mobile */
}

@media (min-width: 1025px) {
    .desktop-nav {
        display: flex !important;
        margin: 0 2rem;
        flex-grow: 1;
        justify-content: center;
        align-items: center;
    }

    .nav-list {
        display: flex !important;
        visibility: visible !important;
        list-style: none !important;
        margin: 0 !important;
        padding: 0 !important;
        gap: 2rem;
        align-items: center;
    }

    .nav-list li {
        margin: 0 !important;
        padding: 0 !important;
        display: block !important;
        visibility: visible !important;
    }

    .nav-list a {
        color: #e2e8f0 !important;
        text-decoration: none !important;
        font-size: 1rem !important;
        padding: 0.5rem !important;
        transition: color 0.2s ease !important;
        white-space: nowrap !important;
        display: block !important;
        visibility: visible !important;
        opacity: 1 !important;
    }

    /* Solo cambiar color en hover */
    .nav-list a:hover {
        color: #facc15 !important;
    }

    /* Solo marcar como activas las páginas completas */
    .nav-list a[href$=".html"]:not([href*="#"]).active {
        color: #facc15 !important;
    }

    /* Los enlaces con # siempre en gris */
    .nav-list a[href*="#"]:not(.active) {
        color: #e2e8f0 !important;
    }

    /* Hide mobile elements on desktop */
    .nav-toggle,
    .mnav,
    .campus-btn-mobile {
        display: none !important;
    }

    /* Show logo text on desktop */
    .logo-text {
        display: block !important;
    }

    /* Show campus button on desktop */
    .campus-btn {
        display: inline-flex !important;
    }

    /* Asegurar que el logo NO sea clickable en desktop */
    .logo-link::after {
        display: none !important;
    }

    /* Header layout en desktop */
    .header-content {
        display: flex !important;
        align-items: center !important;
        justify-content: space-between !important;
        padding: 1rem 2rem !important;
    }

    /* Reset color for all nav links */
    .nav-list a {
        color: var(--text-secondary, #e2e8f0) !important;
    }

    /* Only change color on hover */
    .nav-list a:hover {
        color: var(--primary, #facc15) !important;
    }

    /* Only highlight current page (not fragments) */
    .nav-list a[href$=".html"]:not([href*="#"]).active {
        color: var(--primary, #facc15) !important;
    }
}

/* Mobile Navigation */
@media (max-width: 1024px) {
    /* Header layout for mobile */
    .header-content {
        display: grid;
        grid-template-columns: auto 1fr auto; /* Logo (izquierda) | Campus (centro) | Email (derecha) */
        gap: 1rem;
        align-items: center;
        padding: 0.5rem 1rem;
    }

    /* Hide logo text on mobile */
    .logo-text {
        display: none;
    }

    /* Logo como botón de menú */
    .logo-link {
        justify-self: start;
        cursor: pointer;
        position: relative;
    }

    /* Añadir indicador visual al logo en móvil */
    .logo-link::after {
        content: "▼";
        position: absolute;
        top: 50%;
        right: -15px;
        transform: translateY(-50%);
        color: var(--text-secondary, #e2e8f0);
        font-size: 12px;
        transition: transform 0.3s ease;
    }

    .logo-link.menu-open::after {
        transform: translateY(-50%) rotate(180deg);
    }

    /* Campus button mobile en el centro - segundo elemento del grid */
    .campus-btn-mobile {
        justify-self: center;
        grid-column: 2;
    }

    /* Header CTAs en la tercera columna */
    .header-ctas {
        justify-self: end;
        grid-column: 3;
        display: flex;
        align-items: center;
        gap: 1rem;
    }

    /* Ocultar hamburguesa tradicional en móvil */
    .nav-toggle {
        display: none !important;
    }



    /* Mobile menu panel */
    .mnav {
        position: fixed;
        inset: 0;
        background-color: rgba(0, 0, 0, 0.5);
        z-index: 1000;
        opacity: 0;
        visibility: hidden;
        transition: all 0.3s ease;
    }

    .mnav[aria-hidden="false"] {
        opacity: 1;
        visibility: visible;
    }

    .mnav__panel {
        position: fixed;
        top: 0;
        right: 0;
        width: 80%;
        max-width: 400px;
        height: 100%;
        background-color: var(--surface, #0f172a);
        padding: 2rem;
        transform: translateX(100%);
        transition: transform 0.3s ease;
        display: flex;
        flex-direction: column;
        gap: 2rem;
    }

    .mnav[aria-hidden="false"] .mnav__panel {
        transform: translateX(0);
    }

    .mnav__close {
        position: absolute;
        top: 1rem;
        right: 1rem;
        background: none;
        border: none;
        color: var(--text-primary, #ffffff);
        font-size: 1.5rem;
        cursor: pointer;
        padding: 0.5rem;
    }

    .mnav__links {
        list-style: none;
        margin: 0;
        padding: 0;
        display: flex;
        flex-direction: column;
        gap: 1rem;
    }

    .mnav__links a {
        color: var(--text-secondary, #e2e8f0);
        text-decoration: none;
        font-size: 1.25rem;
        padding: 1rem;
        display: block;
        border-radius: 0.5rem;
        transition: all 0.2s ease;
    }

    .mnav__links a:hover {
        color: var(--primary, #facc15);
        background-color: rgba(255, 255, 255, 0.05);
    }

    /* Mobile header icons */
    .icon-mail,
    .campus-btn-mobile {
        width: 40px;
        height: 40px;
        display: flex;
        align-items: center;
        justify-content: center;
        border-radius: 8px;
        transition: all 0.2s ease;
    }

    .campus-btn-mobile {
        background-color: transparent;
        color: var(--text-secondary, #e2e8f0);
    }

    .campus-btn-mobile:hover {
        color: var(--primary, #facc15);
    }

    /* Hide desktop campus button on mobile */
    .campus-btn:not(.campus-btn-mobile) {
        display: none;
    }
}

/* Header CTAs */
.header-ctas {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.campus-btn {
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    background-color: var(--primary, #facc15);
    color: var(--surface, #0f172a);
    text-decoration: none;
    font-weight: 500;
    transition: all 0.2s ease;
}

.campus-btn:hover {
    background-color: var(--primary-dark, #eab308);
}

.icon-mail {
    color: var(--text-secondary, #e2e8f0);
    padding: 0.5rem;
    border-radius: 0.5rem;
    transition: color 0.2s ease;
}

.icon-mail:hover {
    color: var(--primary, #facc15);
}

/* Prevent body scroll when mobile menu is open */
body.no-scroll {
    overflow: hidden;
}

/* Avatar Icon Styles */
.avatar-icon-wrapper {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary, #facc15) 0%, var(--secondary, #fb923c) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 30px;
    box-shadow: 0 8px 25px rgba(250, 204, 21, 0.15);
    position: relative;
    overflow: hidden;
}

.avatar-icon-wrapper::before {
    content: '';
    position: absolute;
    inset: 2px;
    border-radius: 50%;
    background: var(--surface, #0f172a);
    z-index: 1;
}

.avatar-icon {
    width: 60px;
    height: 60px;
    color: var(--primary, #facc15);
    position: relative;
    z-index: 2;
    stroke-width: 1.5;
}

/* Small Avatar Icons (for testimonials) */
.small-avatar-icon {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary, #facc15) 0%, var(--secondary, #fb923c) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 8px;
    position: relative;
    overflow: hidden;
}

.small-avatar-icon::before {
    content: '';
    position: absolute;
    inset: 2px;
    border-radius: 50%;
    background: var(--surface, #0f172a);
    z-index: 1;
}

.avatar-icon-small {
    width: 20px;
    height: 20px;
    color: var(--primary, #facc15);
    position: relative;
    z-index: 2;
    stroke-width: 2;
}

/* Medium Avatar Icons (for graduates) */
.medium-avatar-icon {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary, #facc15) 0%, var(--secondary, #fb923c) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    box-shadow: 0 6px 20px rgba(250, 204, 21, 0.1);
    position: relative;
    overflow: hidden;
}

.medium-avatar-icon::before {
    content: '';
    position: absolute;
    inset: 2px;
    border-radius: 50%;
    background: var(--surface, #0f172a);
    z-index: 1;
}

.avatar-icon-medium {
    width: 40px;
    height: 40px;
    color: var(--primary, #facc15);
    position: relative;
    z-index: 2;
    stroke-width: 2;
}

/* Leader Photo Styles */
.leader-photo {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    object-fit: cover;
    object-position: center;
    box-shadow: 0 8px 25px rgba(250, 204, 21, 0.15);
    border: 2px solid var(--primary, #facc15);
}

/* ================================================================
 * NAVIGATION AUDIT IMPROVEMENTS
 * ================================================================ */

/* Ensure proper desktop navigation visibility */
@media (min-width: 1025px) {
    /* Force desktop nav to be visible */
    .desktop-nav {
        display: block !important;
    }

    /* Ensure mobile nav is completely hidden */
    .mnav {
        display: none !important;
    }

    /* Hide mobile campus button */
    .campus-btn-mobile {
        display: none !important;
    }

    /* Ensure desktop campus button is visible */
    .campus-btn {
        display: inline-flex !important;
    }
}

/* Ensure proper mobile navigation */
@media (max-width: 1024px) {
    /* Hide desktop nav on mobile */
    .desktop-nav {
        display: none !important;
    }

    /* Show mobile campus button */
    .campus-btn-mobile {
        display: flex !important;
    }

    /* Hide desktop campus button */
    .campus-btn {
        display: none !important;
    }

    /* Ensure mobile nav can be shown */
    .mnav[aria-hidden="false"] {
        display: block !important;
    }

    .mnav[aria-hidden="true"] {
        display: none !important;
    }
}

/* Focus trap improvements for mobile nav */
.mnav[aria-hidden="false"] .mnav__panel {
    display: block;
}

/* Improved focus indicators */
.nav-list a:focus-visible,
.mnav__links a:focus-visible {
    outline: 2px solid var(--primary, #facc15);
    outline-offset: 2px;
}

/* Ensure proper z-indexing */
.mnav {
    z-index: 1000;
}

#main-header {
    z-index: 100;
}

.fab-agendar {
    z-index: 1100;
}