/* === USER ACTIONS COMPONENT === */
/* Componente de acciones de usuario: autenticación, perfil y chat */

/* Importar variables compartidas */
@import url('../../shared/styles/variables.css');

/* ===== CONTENEDOR PRINCIPAL ===== */
.user-actions {
    display: flex;
    align-items: center;
    height: 100%;
    margin-left: auto; /* Empuja hacia la derecha del header */
    gap: 8px; /* Separación entre elementos */
}

/* ===== BOTONES BASE ===== */
.btn {
    padding: 1px 18px;
    border-radius: 8px;
    font-family: sans-serif;
    font-weight: 500;
    font-size: 0.75em;
    letter-spacing: 0.5px;
    transition: background-color 0.3s ease, transform 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    border: 1px solid transparent;
    cursor: pointer;
}

/* ===== BOTÓN PRIMARIO (REGISTRARSE) ===== */
.btn-primary {
    background-color: var(--accent-color);
    color: white;
    border: 1px solid var(--accent-color);
}

.btn-primary:hover {
    background-color: #e74faa;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(184, 50, 128, 0.4);
}

.btn-primary:active {
    transform: translateY(-1px);
}

/* ===== BOTÓN SECUNDARIO (INICIAR SESIÓN) ===== */
.btn-secondary {
    background-color: transparent;
    color: var(--text-color-light);
    border: 1px solid var(--text-color-light);
}

.btn-secondary:hover {
    background-color: rgba(255, 255, 255, 0.1);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 255, 255, 0.2);
}

.btn-secondary:active {
    transform: translateY(-1px);
}

/* ===== BOTONES EN USER-ACTIONS (ESPECÍFICOS) ===== */
.user-actions .btn {
    margin-left: 0; /* Sin margin adicional */
    font-size: 0.7em;
    display: flex;
    align-items: center;
    height: 32px;
    padding: 2px 12px; /* Más compacto para header */
}

/* ===== PERFIL DE USUARIO ===== */
.user-profile {
    margin-left: 0;
    font-size: 1.1em;
    color: var(--text-color-light);
    display: flex;
    align-items: center;
    height: 32px;
    position: relative; /* Para badge absoluto */
    text-decoration: none;
    padding: 6px;
    border-radius: 4px;
    transition: all 0.3s ease;
}

/* ===== ICONO DE USUARIO (UNICODE) ===== */
.user-icon {
    font-size: 1.2em;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
}

.user-profile:hover {
    color: var(--accent-text);
    background-color: rgba(255, 255, 255, 0.1);
}

.user-profile:focus {
    outline: 2px solid var(--accent-color);
    outline-offset: 2px;
}

/* ===== BADGE DE NOTIFICACIONES ===== */
.notification-badge {
    position: absolute;
    top: -2px;
    right: -6px;
    background: var(--accent-color);
    color: white;
    border-radius: 50%;
    width: 16px;
    height: 16px;
    font-size: 9px;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: notification-pulse 2s infinite;
    border: 1px solid white;
    z-index: 1;
}

/* Badge oculto por defecto (sin login) */
.notification-badge.hidden {
    display: none;
}

@keyframes notification-pulse {
    0%, 100% { 
        transform: scale(1);
        opacity: 1;
    }
    50% { 
        transform: scale(1.1);
        opacity: 0.8;
    }
}

/* ===== BOTÓN DE CHAT TOGGLE ===== */
.user-dropdown-arrow {
    position: absolute;
    top: 100%;
    right: 0px; /* Pegado al borde derecho */
    transform: translateY(5px) scaleX(-1);
    color: var(--text-color-light);
    font-size: 0.8em;
    z-index: 960;
    transition: all 0.3s ease;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 2px;
    border-radius: 4px;
}

.user-dropdown-arrow:hover {
    color: var(--accent-text);
    transform: translateY(5px) scaleX(-1) scale(1.1);
    background-color: rgba(255, 255, 255, 0.1);
}

.user-dropdown-arrow:focus {
    outline: 2px solid var(--accent-color);
    outline-offset: 2px;
}

.user-dropdown-arrow:active {
    transform: translateY(6px) scaleX(-1) scale(0.95);
}

/* ===== RESPONSIVE DESIGN ===== */
/* Mobile - mantener fix del header móvil */
@media (max-width: 768px) {
    .user-actions .btn {
        font-size: 0.65em; /* Más compacto en móvil */
        height: 28px;
        padding: 2px 8px; /* Padding reducido */
    }
    
    .user-actions .user-profile {
        font-size: 1em; /* Ligeramente más pequeño */
        height: 28px;
    }
    
    .notification-badge {
        width: 14px;
        height: 14px;
        font-size: 8px;
        top: -1px;
        right: -4px;
    }
    
    .user-dropdown-arrow {
        font-size: 0.75em;
        padding: 1px;
    }
}

/* Pantallas muy pequeñas - Sin overflow garantizado */
@media (max-width: 480px) {
    .user-actions {
        gap: 2px !important; /* Gap mínimo para evitar overflow */
        flex-shrink: 0 !important; /* No comprimir */
        justify-content: flex-end !important; /* Alineación derecha */
    }
    
    .user-actions .btn {
        font-size: 0.55em !important;
        height: 24px !important;
        padding: 1px 4px !important;
        margin-left: 1px !important;
        min-width: 30px !important; /* Ancho mínimo reducido */
        white-space: nowrap !important;
    }
    
    .user-actions .user-profile {
        font-size: 0.85em !important;
        height: 24px !important;
        margin-left: 2px !important;
        padding: 4px !important; /* Más padding para evitar cortes */
        overflow: visible !important; /* Asegurar visibilidad */
    }
    
    .user-icon {
        font-size: 1em !important;
        width: 16px !important;
        height: 16px !important;
    }
    
    .notification-badge {
        width: 12px !important;
        height: 12px !important;
        font-size: 7px !important;
        top: -1px !important;
        right: 2px !important; /* Mover hacia adentro para evitar overflow */
    }
    
    .user-dropdown-arrow {
        font-size: 0.7em !important;
        padding: 2px !important;
        min-width: 20px !important;
    }
}

/* ===== ESTADOS INTERACTIVOS ===== */
/* Feedback visual para touch devices */
.user-actions .btn:active,
.user-profile:active {
    transform: scale(0.95);
}

/* Estados de loading (preparado para auth real) */
.btn.loading {
    opacity: 0.7;
    cursor: not-allowed;
    pointer-events: none;
}

.btn.loading::after {
    content: '...';
    animation: loading-dots 1.5s infinite;
}

@keyframes loading-dots {
    0%, 20% { content: '...'; }
    40% { content: '..'; }
    60% { content: '.'; }
    80%, 100% { content: ''; }
}

/* RECORDATORIO: Este componente requiere:
   - Font Awesome icons: fa-user, fa-chevron-right
   - Variables CSS: --accent-color, --text-color-light, --accent-text
   - JavaScript: click handlers, authentication flow, chat toggle
   - Integration: Event Bus para comunicación con chat system
*/
