/* ========================================
   ENHANCED HEADER STYLES
   Version: 2.0 - Ultra-optimized for 14 menus
   ======================================== */

/* BANNER SUPERIOR */
.enhanced-banner {
    background: linear-gradient(to bottom, #ffffff 0%, #f8f9fa 100%);
    border-bottom: 2px solid #dee2e6;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
    padding: 0 !important;
    margin: 0 !important;
}

.banner-row {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 85px;
    margin: 0 !important;
    padding: 0 !important;
}

.logo-area {
    display: flex;
    align-items: center;
    gap: 0;
    margin: 0 !important;
    padding: 0 !important;
}

.logo-area img {
    height: 85px !important;
    width: auto;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.1));
    margin: 0 !important;
    padding: 0 !important;
}

.logo-area .school-name {
    font-size: 15px;
    font-weight: 700;
    color: #0c2a5e;
}

.year-text {
    font-size: 13px;
    font-weight: 600;
    color: #495057;
    white-space: nowrap;
}

/* PILLS DE ROLES - MEJORADOS */
.roles-area {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    align-items: center;
}

.role-pill {
    padding: 5px 11px;
    font-size: 11.5px;
    font-weight: 600;
    border-radius: 14px;
    border: 1.5px solid #d1d5db;
    background: white;
    color: #6b7280;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    white-space: nowrap;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    text-decoration: none;
    display: inline-block;
}

.role-pill:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.12);
    border-color: #9ca3af;
}

/* Colores específicos por rol */
.role-pill.btn-light.border-dark,
.role-pill.role-WEBMASTER {
    background: linear-gradient(135deg, #f3f4f6 0%, #e5e7eb 100%);
    border-color: #1f2937;
    color: #1f2937;
    box-shadow: 0 2px 6px rgba(31, 41, 55, 0.2);
}

.role-pill.btn-danger,
.role-pill.role-FULLACCESS,
.role-pill.role-ZUZENDARIA {
    background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%);
    border-color: #dc2626;
    color: white;
    box-shadow: 0 4px 12px rgba(220, 38, 38, 0.3);
}

.role-pill.btn-dark,
.role-pill.role-DIRUZAINTZA,
.role-pill.role-KONTUHARTZAILEA,
.role-pill.role-IKASKETABURUA {
    background: linear-gradient(135deg, #1f2937 0%, #111827 100%);
    border-color: #1f2937;
    color: white;
    box-shadow: 0 4px 12px rgba(31, 41, 55, 0.3);
}

.role-pill.btn-primary,
.role-pill.role-IDAZKARIA {
    background: linear-gradient(135deg, #2563eb 0%, #1e40af 100%);
    border-color: #2563eb;
    color: white;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

.role-pill.btn-info,
.role-pill.role-ADMINISTRARIA {
    background: linear-gradient(135deg, #06b6d4 0%, #0891b2 100%);
    border-color: #06b6d4;
    color: white;
    box-shadow: 0 4px 12px rgba(6, 182, 212, 0.3);
}

.role-pill.btn-success,
.role-pill.role-IRAKASLEA {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    border-color: #10b981;
    color: white;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

.role-pill.btn-secondary,
.role-pill.role-FAMILIA {
    background: linear-gradient(135deg, #6b7280 0%, #4b5563 100%);
    border-color: #6b7280;
    color: white;
    box-shadow: 0 4px 12px rgba(107, 114, 128, 0.3);
}

.role-pill.btn-warning,
.role-pill.role-IKASLEA {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    border-color: #f59e0b;
    color: white;
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.3);
}

.banner-spacer {
    flex: 1;
}

.lang-selector-enhanced {
    display: flex;
    gap: 5px;
    font-weight: 600;
    font-size: 12px;
    align-items: center;
}

.lang-selector-enhanced a {
    color: #6b7280;
    text-decoration: none;
    padding: 4px 8px;
    border-radius: 5px;
    transition: all 0.2s;
}

.lang-selector-enhanced a:hover,
.lang-selector-enhanced a.active {
    background: linear-gradient(135deg, #0c2a5e 0%, #1e3a8a 100%);
    color: white;
    box-shadow: 0 2px 6px rgba(12, 42, 94, 0.3);
}

.work-status-enhanced {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 4px 10px;
    border-radius: 7px;
    font-size: 11px;
    font-weight: 600;
    border: 1px solid transparent;
    text-decoration: none;
    transition: all 0.2s;
}

.work-status-enhanced.status-open {
    background: linear-gradient(135deg, #dcfce7 0%, #bbf7d0 100%);
    border-color: #86efac;
    color: #166534;
}

.work-status-enhanced.status-closed {
    background: linear-gradient(135deg, #fee2e2 0%, #fecaca 100%);
    border-color: #fca5a5;
    color: #991b1b;
}

.work-status-enhanced:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.user-menu-enhanced {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 5px 13px;
    background: white;
    border: 1.5px solid #d1d5db;
    border-radius: 18px;
    cursor: pointer;
    transition: all 0.2s;
    font-weight: 600;
    font-size: 12px;
    color: #374151;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.user-menu-enhanced:hover {
    border-color: #0c2a5e;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    transform: translateY(-1px);
}

/* ========================================
   MENÚ NAVEGACIÓN - OPTIMIZADO
   ======================================== */
.enhanced-nav {
    background: linear-gradient(135deg, #0a1f44 0%, #0c2a5e 50%, #1e3a8a 100%);
    box-shadow: 0 4px 16px rgba(10, 31, 68, 0.3);
    position: sticky;
    top: 0;
    z-index: 999;
}

.nav-container-enhanced {
    display: flex;
    align-items: center;
    padding: 0 12px;
    min-height: 46px;
    gap: 0;
    flex-wrap: wrap;
    /* Permitir salto de línea si no cabe */
}

.nav-item-enhanced {
    position: relative;
}

.nav-link-enhanced {
    display: flex;
    align-items: center;
    gap: 5px;
    /* Restaurado a 5px */
    padding: 12px 6px;
    /* Restaurado a 6px */
    color: rgba(255, 255, 255, 0.95);
    text-decoration: none;
    font-size: 15px;
    /* Mantenido en 15px */
    font-weight: 500;
    border-radius: 4px;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.nav-link-enhanced:hover {
    background: rgba(255, 255, 255, 0.15);
    color: white;
    transform: translateY(-1px);
}

.nav-link-enhanced.active {
    background: rgba(255, 255, 255, 0.2);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

/* BRANDING / HOME BUTTON ENHANCED */
.nav-home-enhanced {
    background: linear-gradient(135deg, #ffc107 0%, #ff9800 100%) !important;
    color: #0a1f44 !important;
    margin: 4px 12px 4px 4px;
    padding: 8px 12px !important;
    border-radius: 10px !important;
    box-shadow: 0 4px 10px rgba(255, 193, 7, 0.4);
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275) !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}

.nav-home-enhanced:hover {
    transform: scale(1.1) translateY(-1px) !important;
    background: linear-gradient(135deg, #ffca28 0%, #ffb300 100%) !important;
    box-shadow: 0 6px 15px rgba(255, 193, 7, 0.5);
    color: #0a1f44 !important;
}

.nav-home-enhanced i {
    font-size: 19px !important;
    margin: 0 !important;
}

@media (max-width: 991px) {
    .nav-home-enhanced {
        margin: 10px 20px;
        justify-content: center;
    }
}

.nav-link-enhanced i:first-child {
    font-size: 13px;
}

.nav-chevron {
    font-size: 8px;
    opacity: 0.8;
}

/* Dropdowns mejorados */
.dropdown-menu-enhanced {
    position: absolute;
    top: calc(100% + 10px);
    left: 0;
    min-width: 230px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.2);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1000;
    overflow: hidden;
    list-style: none;
    padding: 8px 0;
    margin: 0;
}

.nav-item-enhanced:hover .dropdown-menu-enhanced {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-item-enhanced {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 18px;
    color: #374151;
    text-decoration: none;
    font-size: 13px;
    transition: all 0.15s;
}

.dropdown-item-enhanced:hover {
    background: linear-gradient(to right, #e0f2fe 0%, #bae6fd 100%);
    color: #0c2a5e;
}

.dropdown-item-enhanced i {
    width: 18px;
    text-align: center;
    color: inherit;
    /* Hereda el color del texto (itxura) */
    opacity: 0.9;
}

.dropdown-item-enhanced:hover i {
    color: inherit;
}

.dropdown-divider-enhanced {
    height: 1px;
    background: linear-gradient(to right, transparent 0%, #e5e7eb 50%, transparent 100%);
    margin: 5px 0;
}

/* Mobile responsive */
@media (max-width: 991px) {
    .enhanced-banner {
        padding: 8px 15px;
    }

    .banner-row {
        flex-wrap: wrap;
        gap: 10px;
    }

    .roles-area {
        display: none;
        /* Ocultar pills en móvil, usar menú de usuario */
    }

    .enhanced-nav {
        position: relative;
    }

    /* Menú colapsable en móvil */
    .nav-container-enhanced {
        flex-direction: column;
        flex-wrap: nowrap;
        /* Asegurar una sola columna vertical */
        align-items: stretch;
        padding: 0;
        display: none;
        /* Oculto por defecto en móvil */
        background: #0a1f44;
        max-height: 80vh;
        overflow-y: auto;
    }

    .nav-container-enhanced.show {
        display: flex;
    }

    .nav-link-enhanced {
        padding: 15px 20px;
        justify-content: flex-start;
        /* Todo a la izquierda */
        border-bottom: 1px solid rgba(255, 255, 255, 0.05);
        font-size: 14px;
        /* Texto un poco más grande en móvil */
    }

    .nav-link-enhanced i:first-child {
        width: 24px;
        /* Ancho fijo para iconos para alinear texto */
        text-align: center;
        margin-right: 10px;
    }

    .nav-chevron {
        margin-left: auto;
        /* Empujar chevron a la derecha */
        font-size: 12px;
        transition: transform 0.3s;
    }

    /* Rotar chevron al abrir */
    .nav-item-enhanced.open .nav-chevron {
        transform: rotate(180deg);
    }

    .dropdown-menu-enhanced {
        position: static;
        opacity: 1;
        visibility: visible;
        transform: none;
        box-shadow: none;
        background: #f8f9fa;
        /* Fondo blanco/gris muy claro */
        display: none;
        /* Oculto por defecto */
        padding: 5px 0;
        margin: 5px 10px;
        /* Un poco de margen para separar */
        border-radius: 6px;
    }

    .nav-item-enhanced.open .dropdown-menu-enhanced {
        display: block;
    }

    .dropdown-item-enhanced {
        padding: 10px 20px;
        color: #374151;
        /* Texto oscuro por defecto para fondo claro */
    }

    .dropdown-item-enhanced:hover {
        background: #e5e7eb;
        color: #1e3a8a;
    }

    /* El borde divisorio en móvil */
    .dropdown-divider-enhanced {
        background: #e5e7eb;
        margin: 4px 0;
    }
}