/**
 * Estilos para UI de Usuario Autenticado
 * Sistema de Autenticación SBAP
 * Adaptado al estilo nativo del tema
 */

/* Header User Menu - Estructura nativa del tema */
.header__user__menu {
    display: inline-block;
    position: relative;
}

.header__user__menu > a {
    letter-spacing: 0.5px;
    position: relative;
    padding: 5px 10px;
    line-height: 50px;
    font-size: 15px;
    letter-spacing: 1px;
    font-weight: 500;
    color: #fff;
    cursor: pointer;
    display: inline-block;
}

.header__user__menu > a:hover {
    background-color: transparent;
    color: #fff;
}

.header__user__avatar {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid rgba(255, 255, 255, 0.4);
    vertical-align: middle;
    display: inline-block;
}

.header__user__avatar--default {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.2);
    color: #fff;
    font-size: 12px;
    vertical-align: middle;
}

.header__user__name {
    color: #fff;
    font-size: 15px;
    font-weight: 500;
    letter-spacing: 1px;
    vertical-align: middle;
    display: inline-block;
    margin-left: 5px;
}

/* Flecha del menú - usa el estilo del tema */
.header__user__menu > a .fa-angle-down {
    margin-left: 5px;
    vertical-align: middle;
}

/* Submenu - Usa estilos nativos del tema */
@media (min-width: 1090px) {
    .header__user__menu.is-open .sub-menu {
        display: block;
    }
    
    .header__user__menu .sub-menu {
        position: absolute;
        top: 98%;
        height: auto;
        right: 0;
        background: #fff;
        width: 200px;
        padding: 10px 0;
        display: none;
        -webkit-animation: heightMd 0.5s ease;
        animation: heightMd 0.5s ease;
        box-shadow: 0px 3px 6px rgba(0, 0, 0, 0.161);
    }
    
    .header__user__menu .sub-menu li {
        display: block;
        border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    }
    
    .header__user__menu .sub-menu li:last-child {
        border-bottom: none;
    }
    
    .header__user__menu .sub-menu li:hover {
        background-color: #fafafa;
    }
    
    .header__user__menu .sub-menu li a {
        display: block;
        font-size: 14px;
        line-height: 18px;
        padding: 10px 20px;
        color: #13162f;
    }
    
    .header__user__menu .sub-menu li a:after {
        display: none;
    }
    
    .header__user__menu .sub-menu li a:hover {
        opacity: 1;
        color: #13162f;
    }
}

/* Header Nav User - Mobile */
.header__nav__user {
    padding: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.header__nav__user__info {
    margin-bottom: 20px;
}

.header__nav__user__details {
    display: flex;
    flex-direction: column;
    gap: 0px;
    text-align: center;
}

.header__nav__user__name {
    color: #13162f;
    font-size: 14px;
    font-weight: 700;
    line-height: 1.3;
}

.header__nav__user__email {
    color: #13162f;
    font-size: 14px;
    font-weight: 400;
    opacity: 0.6;
}

.header__nav__user__actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.header__nav__user__actions .btn {
    width: 100%;
    justify-content: center;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Responsive - Ocultar nombre en móvil */
@media (max-width: 1089px) {
    .header__user__name {
        display: none;
    }
    
    .header__user__menu > a {
        padding: 15px 8px;
    }
}

/* Loading State */
.header__user__menu.loading > a {
    opacity: 0.6;
    pointer-events: none;
}

/* Message States */
.header__auth-error,
.header__auth-success {
    position: fixed;
    top: 80px;
    right: 20px;
    color: #fff;
    padding: 15px 45px 15px 20px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 9999;
    animation: slideInRight 0.3s ease;
    max-width: 400px;
    font-size: 14px;
    line-height: 1.5;
}

.header__auth-error {
    background: #f44336;
}

.header__auth-success {
    background: #4caf50;
}

.header__auth-message__close {
    position: absolute;
    top: 10px;
    right: 10px;
    background: none;
    border: none;
    color: #fff;
    font-size: 24px;
    cursor: pointer;
    padding: 0;
    width: 24px;
    height: 24px;
    line-height: 1;
    opacity: 0.8;
    transition: opacity 0.2s ease;
}

.header__auth-message__close:hover {
    opacity: 1;
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Dark Mode Support */
body.dark-mode .header__user__dropdown {
    background: #2a2a2a;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
}

body.dark-mode .header__user__dropdown__item {
    color: #fff;
    border-bottom-color: #444;
}

body.dark-mode .header__user__dropdown__item:hover {
    background-color: #333;
}

body.dark-mode .header__user__dropdown__item i {
    color: #aaa;
}
