/* ========================================
   TATIN - ESTILOS DE AUTENTICACIÓN
   Sistema de usuario en el header
   ======================================== */

/* ==================== USER INFO EN HEADER ==================== */
.header-user-info {
    margin-left: auto;
    position: relative;
}

/* ==================== BOTÓN DE USUARIO ==================== */
.user-button {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 15px;
    background: linear-gradient(180deg,
        rgba(255, 255, 255, 0.95) 0%,
        rgba(240, 245, 255, 0.9) 100%);
    border: 1px solid rgba(200, 220, 255, 0.6);
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 
        0 2px 8px rgba(0, 0, 0, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

.user-button:hover {
    background: linear-gradient(180deg, #2196F3 0%, #1976D2 100%);
    color: white;
    transform: translateY(-2px);
    box-shadow: 
        0 4px 12px rgba(33, 150, 243, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

.user-button:hover .user-avatar {
    background: white;
    color: #2196F3;
}

/* ==================== AVATAR ==================== */
.user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, #2196F3 0%, #1976D2 100%);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.85rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
}

/* ==================== NOMBRE Y PUNTOS ==================== */
.user-name {
    font-weight: 600;
    color: #2C3E50;
    font-size: 0.95rem;
}

.user-button:hover .user-name {
    color: white;
}

.user-points {
    padding: 3px 8px;
    background: linear-gradient(135deg, #FFD54F 0%, #FFC107 100%);
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 700;
    color: #5D4037;
    box-shadow: 0 2px 4px rgba(255, 193, 7, 0.3);
}

/* ==================== DROPDOWN MENU ==================== */
.user-dropdown {
    position: relative;
}

.user-menu {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    min-width: 280px;
    background: linear-gradient(180deg,
        rgba(255, 255, 255, 0.98) 0%,
        rgba(245, 248, 255, 0.95) 100%);
    border-radius: 15px;
    box-shadow: 
        0 8px 32px rgba(0, 0, 0, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(200, 220, 255, 0.8);
    padding: 15px;
    z-index: 1000;
    animation: dropdownSlide 0.3s ease;
}

@keyframes dropdownSlide {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ==================== MENU HEADER ==================== */
.user-menu-header {
    padding-bottom: 12px;
    border-bottom: 2px solid rgba(33, 150, 243, 0.2);
    margin-bottom: 12px;
}

.user-menu-header strong {
    display: block;
    font-size: 1.1rem;
    color: #2C3E50;
    margin-bottom: 5px;
}

.user-rank {
    display: inline-block;
    padding: 3px 10px;
    background: linear-gradient(135deg, #2196F3 0%, #1976D2 100%);
    color: white;
    border-radius: 10px;
    font-size: 0.75rem;
    font-weight: 600;
    box-shadow: 0 2px 4px rgba(33, 150, 243, 0.3);
}

/* Colores de rangos */
.user-rank[data-rank="Novato"] { background: linear-gradient(135deg, #999999 0%, #757575 100%); }
.user-rank[data-rank="NFU"] { background: linear-gradient(135deg, #0066CC 0%, #004C99 100%); }
.user-rank[data-rank="Full User"] { background: linear-gradient(135deg, #00CC66 0%, #009950 100%); }
.user-rank[data-rank="Great User"] { background: linear-gradient(135deg, #FF6600 0%, #CC5200 100%); }
.user-rank[data-rank="Top User"] { background: linear-gradient(135deg, #CC0099 0%, #990073 100%); }
.user-rank[data-rank="Heavy User"] { background: linear-gradient(135deg, #CC0000 0%, #990000 100%); }
.user-rank[data-rank="Elite User"] { background: linear-gradient(135deg, #FFD700 0%, #FFC107 100%); color: #5D4037; }

/* ==================== ESTADÍSTICAS ==================== */
.user-menu-stats {
    padding: 12px 0;
    border-bottom: 2px solid rgba(33, 150, 243, 0.2);
    margin-bottom: 12px;
}

.stat {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.stat:last-child {
    margin-bottom: 0;
}

.stat-label {
    color: #7F8C8D;
    font-size: 0.85rem;
}

.stat-value {
    font-weight: 700;
    color: #2196F3;
    font-size: 0.95rem;
}

/* ==================== LINKS DEL MENU ==================== */
.user-menu-links {
    display: flex;
    flex-direction: column;
    gap: 5px;
    margin-bottom: 10px;
}

.menu-link {
    padding: 10px 12px;
    background: linear-gradient(180deg,
        rgba(255, 255, 255, 0.9) 0%,
        rgba(240, 245, 255, 0.85) 100%);
    border: 1px solid rgba(200, 220, 255, 0.4);
    border-radius: 10px;
    text-decoration: none;
    color: #2C3E50;
    font-weight: 600;
    font-size: 0.9rem;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.menu-link:hover {
    background: linear-gradient(180deg,
        rgba(150, 200, 255, 0.9) 0%,
        rgba(120, 180, 245, 0.85) 100%);
    color: white;
    transform: translateX(3px);
}

/* ==================== BOTÓN LOGOUT ==================== */
.logout-btn {
    background: linear-gradient(180deg, #E57373 0%, #F44336 100%);
    color: white;
    border: 1px solid #D32F2F;
    width: 100%;
    cursor: pointer;
    font-family: inherit;
}

.logout-btn:hover {
    background: linear-gradient(180deg, #EF5350 0%, #E53935 100%);
    transform: translateX(0);
}

/* ==================== BOTONES DE AUTH (NO LOGUEADO) ==================== */
.header-auth-buttons {
    display: flex;
    gap: 10px;
    align-items: center;
    margin-left: auto;
}

.btn-header {
    padding: 8px 18px;
    border-radius: 20px;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.btn-login {
    background: linear-gradient(180deg,
        rgba(255, 255, 255, 0.95) 0%,
        rgba(240, 245, 255, 0.9) 100%);
    border: 1px solid rgba(200, 220, 255, 0.6);
    color: #2196F3;
}

.btn-login:hover {
    background: linear-gradient(180deg, #2196F3 0%, #1976D2 100%);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(33, 150, 243, 0.4);
}

.btn-register {
    background: linear-gradient(180deg, #FFD54F 0%, #FFC107 100%);
    border: 1px solid rgba(255, 193, 7, 0.8);
    color: #5D4037;
    box-shadow: 0 2px 8px rgba(255, 193, 7, 0.3);
}

.btn-register:hover {
    background: linear-gradient(180deg, #FFECB3 0%, #FFD54F 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 193, 7, 0.5);
}

/* ==================== RESPONSIVE ==================== */
@media (max-width: 768px) {
    .user-button {
        padding: 6px 12px;
        gap: 8px;
    }

    .user-name {
        display: none; /* Ocultar nombre en móvil */
    }

    .user-menu {
        right: -10px;
        min-width: 260px;
    }

    .header-auth-buttons {
        gap: 8px;
    }

    .btn-header {
        padding: 6px 14px;
        font-size: 0.85rem;
    }
}

@media (max-width: 480px) {
    .user-points {
        padding: 2px 6px;
        font-size: 0.75rem;
    }

    .user-menu {
        position: fixed;
        left: 10px;
        right: 10px;
        top: auto;
        bottom: 80px;
        min-width: auto;
    }

    .btn-login {
        display: none; /* Solo mostrar registro en móvil muy pequeño */
    }
}

/* ==================== ELEMENTOS CONDICIONALES ==================== */
/* Estos elementos solo se muestran según el estado de autenticación */
/* Usar con data-auth-required="true" o data-guest-only="true" */

[data-auth-required="true"] {
    /* Por defecto oculto, se muestra si hay usuario */
}

[data-guest-only="true"] {
    /* Por defecto visible, se oculta si hay usuario */
}