/* GBCM Custom Styles for User Profile in Topbar */

.layout-topbar .user-profile-link {
    display: flex !important;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 0.75rem;
    border-radius: 0.5rem;
    transition: background-color 0.2s;
}

.layout-topbar .user-profile-link:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

.layout-topbar .user-profile-link img,
.layout-topbar .user-profile-link .user-avatar {
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid rgba(255, 255, 255, 0.2);
    transition: border-color 0.2s;
}

.layout-topbar .user-profile-link:hover img,
.layout-topbar .user-profile-link:hover .user-avatar {
    border-color: rgba(255, 255, 255, 0.4);
}

.layout-topbar .user-info {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    line-height: 1.2;
}

.layout-topbar .user-name {
    font-weight: 600;
    font-size: 0.875rem;
    color: var(--text-color);
    margin-bottom: 0.125rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.layout-topbar .user-email {
    font-size: 0.75rem;
    color: var(--text-color-secondary);
    opacity: 0.8;
}

.layout-topbar .user-role {
    font-size: 0.75rem;
    color: var(--primary-color);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.layout-topbar .user-separator {
    color: var(--text-color-secondary);
    opacity: 0.6;
    font-weight: 300;
}

.layout-topbar .user-status {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
}

.layout-topbar .user-status.online {
    background-color: #4CAF50;
    box-shadow: 0 0 0 2px rgba(76, 175, 80, 0.3);
}

.layout-topbar .user-status.offline {
    background-color: #9E9E9E;
}

.layout-topbar .user-status.away {
    background-color: #FF9800;
    box-shadow: 0 0 0 2px rgba(255, 152, 0, 0.3);
}

/* User Profile Dropdown Menu */
.layout-topbar .user-dropdown-menu {
    min-width: 280px;
    max-width: 320px;
    padding: 0;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
    border: 1px solid var(--surface-border);
    background: var(--surface-card);
    overflow: hidden;
}

/* En-tête du menu utilisateur */
.user-dropdown-header {
    padding: 1.25rem 1rem;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-600));
    color: white;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.user-dropdown-avatar {
    position: relative;
    flex-shrink: 0;
}

.user-dropdown-avatar img {
    width: 3rem;
    height: 3rem;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid rgba(255, 255, 255, 0.3);
}

.user-status-indicator {
    position: absolute;
    bottom: 2px;
    right: 2px;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    border: 2px solid white;
}

.user-status-indicator.online {
    background-color: #4CAF50;
}

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

.user-dropdown-name {
    font-weight: 600;
    font-size: 1rem;
    margin-bottom: 0.25rem;
    color: white;
}

.user-dropdown-email {
    font-size: 0.875rem;
    opacity: 0.9;
    margin-bottom: 0.25rem;
    color: rgba(255, 255, 255, 0.9);
}

.user-dropdown-role {
    font-size: 0.75rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    background: rgba(255, 255, 255, 0.2);
    padding: 0.25rem 0.5rem;
    border-radius: 12px;
    display: inline-block;
    color: white;
}

/* Séparateurs */
.user-dropdown-divider {
    height: 1px;
    background-color: var(--surface-border);
    margin: 0;
}

/* Sections du menu */
.user-dropdown-section {
    padding: 0.75rem 0;
}

.section-title {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-color-secondary);
    padding: 0 1rem 0.5rem 1rem;
    margin-bottom: 0.25rem;
}

.section-items {
    display: flex;
    flex-direction: column;
}

/* Éléments du menu */
.dropdown-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    color: var(--text-color);
    text-decoration: none;
    transition: all 0.2s ease;
    border: none;
    background: none;
    width: 100%;
    text-align: left;
    cursor: pointer;
    font-size: 0.875rem;
}

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

.dropdown-item i {
    width: 1.25rem;
    text-align: center;
    color: var(--text-color-secondary);
    transition: color 0.2s ease;
}

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

.dropdown-item span {
    flex: 1;
}

.item-arrow {
    margin-left: auto;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.dropdown-item:hover .item-arrow {
    opacity: 1;
}

/* Badges */
.item-badge {
    background-color: var(--primary-color);
    color: white;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.125rem 0.5rem;
    border-radius: 12px;
    min-width: 1.25rem;
    text-align: center;
    margin-left: auto;
}

/* Élément de déconnexion */
.logout-item {
    color: var(--red-500) !important;
}

.logout-item:hover {
    background-color: var(--red-50);
    color: var(--red-600) !important;
}

.logout-item i {
    color: var(--red-500) !important;
}

.logout-item:hover i {
    color: var(--red-600) !important;
}

/* Animations et transitions */
.user-dropdown-menu {
    animation: dropdownFadeIn 0.3s ease-out;
    transform-origin: top right;
}

@keyframes dropdownFadeIn {
    0% {
        opacity: 0;
        transform: translateY(-10px) scale(0.95);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Mode sombre */
.layout-wrapper.layout-topbar-dark .user-dropdown-menu {
    background: var(--surface-900);
    border-color: var(--surface-700);
}

.layout-wrapper.layout-topbar-dark .user-dropdown-header {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-700));
}

.layout-wrapper.layout-topbar-dark .user-dropdown-divider {
    background-color: var(--surface-700);
}

.layout-wrapper.layout-topbar-dark .section-title {
    color: var(--text-color-secondary);
}

.layout-wrapper.layout-topbar-dark .dropdown-item {
    color: var(--text-color);
}

.layout-wrapper.layout-topbar-dark .dropdown-item:hover {
    background-color: var(--surface-800);
}

/* Responsive */
@media (max-width: 768px) {
    .user-dropdown-menu {
        min-width: 260px;
        max-width: 280px;
    }

    .user-dropdown-header {
        padding: 1rem 0.75rem;
    }

    .dropdown-item {
        padding: 0.625rem 0.75rem;
        font-size: 0.8125rem;
    }

    .section-title {
        padding: 0 0.75rem 0.5rem 0.75rem;
    }
}

/* Dark mode adjustments */
.layout-wrapper.layout-topbar-dark .user-name {
    color: rgba(255, 255, 255, 0.87);
}

.layout-wrapper.layout-topbar-dark .user-email {
    color: rgba(255, 255, 255, 0.6);
}

.layout-wrapper.layout-topbar-dark .user-profile-link:hover {
    background-color: rgba(255, 255, 255, 0.08);
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .layout-topbar .user-info {
        display: none;
    }
    
    .layout-topbar .user-profile-link {
        padding: 0.5rem;
    }
}
