/* CSS pour le dropdown utilisateur FreeTCG */

/* Container du menu utilisateur */
.user-menu {
    position: relative;
    margin-left: 1rem;
}

/* Toggle button */
.user-menu-toggle {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem;
    background: transparent;
    border: none;
    cursor: pointer;
    color: var(--text-primary);
    text-decoration: none;
    border-radius: 0.5rem;
    transition: background-color 0.2s;
}

.user-menu-toggle:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

/* Avatar dans le menu */
.user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid transparent;
    transition: border-color 0.2s;
}

.user-menu-toggle:hover .user-avatar {
    border-color: var(--primary-color);
}

.user-name {
    font-weight: 500;
    max-width: 150px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Dropdown menu */
.user-dropdown {
    position: absolute;
    top: calc(100% + 0.5rem);
    right: 0;
    min-width: 280px;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 0.75rem;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1000;
}

.user-menu.show .user-dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* Header du dropdown */
.dropdown-header {
    padding: 1.25rem;
    border-bottom: 1px solid var(--border-color);
    background: rgba(0, 0, 0, 0.02);
}

.user-info {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.dropdown-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid var(--primary-color);
}

.user-details {
    flex: 1;
    min-width: 0;
}

.user-details .name {
    font-weight: 600;
    font-size: 1rem;
    color: var(--text-primary);
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.user-details .email {
    font-size: 0.875rem;
    color: var(--text-secondary);
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.user-details .points {
    font-size: 0.875rem;
    color: var(--primary-color);
    font-weight: 500;
    margin-top: 0.25rem;
}

/* Menu items */
.dropdown-menu-items {
    padding: 0.5rem;
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    color: var(--text-primary);
    text-decoration: none;
    border-radius: 0.5rem;
    transition: all 0.2s;
}

.dropdown-item:hover {
    background-color: rgba(99, 91, 255, 0.1);
    color: var(--primary-color);
    transform: translateX(4px);
}

.dropdown-item i {
    width: 20px;
    text-align: center;
    font-size: 1rem;
    color: var(--text-secondary);
    transition: color 0.2s;
}

.dropdown-item:hover i {
    color: var(--primary-color);
}

.dropdown-divider {
    margin: 0.5rem 0;
    border-top: 1px solid var(--border-color);
}

/* Items spéciaux */
.admin-item {
    color: #dc3545;
}

.admin-item:hover {
    background-color: rgba(220, 53, 69, 0.1);
    color: #dc3545;
}

.admin-item i {
    color: #dc3545;
}

.logout-item {
    color: var(--text-secondary);
}

.logout-item:hover {
    background-color: rgba(0, 0, 0, 0.05);
    color: var(--text-primary);
}

/* Points display dans le header principal */
.points-display {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: rgba(99, 91, 255, 0.1);
    border-radius: 2rem;
    font-weight: 500;
    color: var(--primary-color);
    margin-left: 1rem;
}

.points-icon {
    font-size: 1.1rem;
}

/* Responsive */
@media (max-width: 768px) {
    .user-name {
        display: none;
    }
    
    .user-dropdown {
        right: -1rem;
        min-width: 260px;
    }
    
    .points-display {
        padding: 0.5rem 0.75rem;
        font-size: 0.875rem;
    }
}

/* Animation d'entrée */
@keyframes dropdownIn {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.user-dropdown.animate-in {
    animation: dropdownIn 0.3s ease-out;
}

/* Overlay pour mobile */
.dropdown-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: transparent;
    z-index: 999;
    display: none;
}

.user-menu.show .dropdown-overlay {
    display: block;
}