/**
 * CMS Source - Users Module CSS
 * Styles pour les profils et comptes utilisateurs
 * @version 1.0.0
 */

/* =========================================================================
   USER PROFILE
   ========================================================================= */
.profile-page {
    padding: var(--spacing-6) 0;
}

.profile-header {
    background: var(--gradient-primary);
    border-radius: var(--border-radius-lg);
    padding: var(--spacing-8);
    margin-bottom: var(--spacing-6);
    position: relative;
    overflow: hidden;
}

.profile-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><circle cx="20" cy="20" r="2" fill="rgba(255,255,255,0.1)"/><circle cx="80" cy="80" r="3" fill="rgba(255,255,255,0.1)"/><circle cx="60" cy="30" r="1.5" fill="rgba(255,255,255,0.1)"/></svg>');
}

.profile-header__content {
    position: relative;
    display: flex;
    align-items: center;
    gap: var(--spacing-6);
}

@media (max-width: 640px) {
    .profile-header__content {
        flex-direction: column;
        text-align: center;
    }
}

.profile-avatar {
    position: relative;
}

.profile-avatar__image {
    width: 120px;
    height: 120px;
    border-radius: var(--border-radius-full);
    border: 4px solid var(--white);
    object-fit: cover;
    box-shadow: var(--shadow-lg);
}

.profile-avatar__edit {
    position: absolute;
    bottom: 0;
    right: 0;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--white);
    border-radius: var(--border-radius-full);
    box-shadow: var(--shadow-md);
    cursor: pointer;
    transition: transform var(--transition);
}

.profile-avatar__edit:hover {
    transform: scale(1.1);
}

.profile-avatar__badge {
    position: absolute;
    top: 0;
    right: 0;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--warning);
    border-radius: var(--border-radius-full);
    border: 2px solid var(--white);
    font-size: var(--font-size-xs);
}

.profile-info {
    color: var(--white);
}

.profile-info__name {
    font-size: var(--font-size-2xl);
    font-weight: var(--font-weight-bold);
    margin-bottom: var(--spacing-1);
}

.profile-info__username {
    opacity: 0.8;
    margin-bottom: var(--spacing-2);
}

.profile-info__role {
    display: inline-block;
    padding: var(--spacing-1) var(--spacing-3);
    background: rgba(255,255,255,0.2);
    border-radius: var(--border-radius-full);
    font-size: var(--font-size-sm);
}

.profile-stats {
    display: flex;
    gap: var(--spacing-6);
    margin-left: auto;
}

@media (max-width: 640px) {
    .profile-stats {
        margin-left: 0;
        margin-top: var(--spacing-4);
    }
}

.profile-stat {
    text-align: center;
    color: var(--white);
}

.profile-stat__value {
    font-size: var(--font-size-2xl);
    font-weight: var(--font-weight-bold);
}

.profile-stat__label {
    font-size: var(--font-size-sm);
    opacity: 0.8;
}

/* =========================================================================
   PROFILE LAYOUT
   ========================================================================= */
.profile-layout {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: var(--spacing-6);
}

@media (max-width: 1024px) {
    .profile-layout {
        grid-template-columns: 1fr;
    }
}

.profile-sidebar {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-4);
}

.profile-nav {
    background: var(--bg-primary);
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}

.profile-nav__item {
    display: flex;
    align-items: center;
    gap: var(--spacing-3);
    padding: var(--spacing-4);
    color: var(--text-secondary);
    text-decoration: none;
    border-left: 3px solid transparent;
    transition: all var(--transition);
}

.profile-nav__item:hover {
    background: var(--bg-secondary);
    color: var(--text-primary);
}

.profile-nav__item.active {
    background: var(--bg-secondary);
    color: var(--primary);
    border-left-color: var(--primary);
}

.profile-nav__icon {
    width: 20px;
    text-align: center;
}

.profile-content {
    min-width: 0;
}

.profile-section {
    background: var(--bg-primary);
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-sm);
    padding: var(--spacing-6);
    margin-bottom: var(--spacing-6);
}

.profile-section:last-child {
    margin-bottom: 0;
}

.profile-section__title {
    font-size: var(--font-size-xl);
    font-weight: var(--font-weight-bold);
    margin-bottom: var(--spacing-4);
    padding-bottom: var(--spacing-3);
    border-bottom: 1px solid var(--border-light);
}

/* =========================================================================
   USER DASHBOARD
   ========================================================================= */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: var(--spacing-4);
    margin-bottom: var(--spacing-6);
}

.dashboard-card {
    background: var(--bg-primary);
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-sm);
    padding: var(--spacing-5);
    display: flex;
    align-items: center;
    gap: var(--spacing-4);
}

.dashboard-card__icon {
    width: 56px;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--border-radius);
    font-size: var(--font-size-xl);
}

.dashboard-card__icon--primary {
    background: rgba(99, 102, 241, 0.1);
    color: var(--primary);
}

.dashboard-card__icon--success {
    background: rgba(16, 185, 129, 0.1);
    color: var(--success);
}

.dashboard-card__icon--warning {
    background: rgba(245, 158, 11, 0.1);
    color: var(--warning);
}

.dashboard-card__icon--danger {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger);
}

.dashboard-card__content {
    flex: 1;
}

.dashboard-card__value {
    font-size: var(--font-size-2xl);
    font-weight: var(--font-weight-bold);
    margin-bottom: var(--spacing-1);
}

.dashboard-card__label {
    font-size: var(--font-size-sm);
    color: var(--text-muted);
}

/* =========================================================================
   ACTIVITY FEED
   ========================================================================= */
.activity-feed {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-4);
}

.activity-item {
    display: flex;
    gap: var(--spacing-3);
}

.activity-item__icon {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-secondary);
    border-radius: var(--border-radius-full);
    flex-shrink: 0;
}

.activity-item__content {
    flex: 1;
    padding-bottom: var(--spacing-4);
    border-bottom: 1px solid var(--border-light);
}

.activity-item:last-child .activity-item__content {
    border-bottom: none;
    padding-bottom: 0;
}

.activity-item__text {
    margin-bottom: var(--spacing-1);
}

.activity-item__time {
    font-size: var(--font-size-sm);
    color: var(--text-muted);
}

/* =========================================================================
   USER SETTINGS
   ========================================================================= */
.settings-form {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-4);
}

.settings-group {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: var(--spacing-4);
}

.settings-toggle {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--spacing-4);
    background: var(--bg-secondary);
    border-radius: var(--border-radius);
}

.settings-toggle__info {
    flex: 1;
}

.settings-toggle__label {
    font-weight: var(--font-weight-medium);
    margin-bottom: var(--spacing-1);
}

.settings-toggle__description {
    font-size: var(--font-size-sm);
    color: var(--text-muted);
}

/* =========================================================================
   USER CARDS (for lists)
   ========================================================================= */
.users-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: var(--spacing-4);
}

.user-card {
    background: var(--bg-primary);
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-sm);
    padding: var(--spacing-5);
    text-align: center;
    transition: transform var(--transition), box-shadow var(--transition);
}

.user-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.user-card__avatar {
    width: 80px;
    height: 80px;
    border-radius: var(--border-radius-full);
    object-fit: cover;
    margin: 0 auto var(--spacing-3);
}

.user-card__name {
    font-weight: var(--font-weight-semibold);
    margin-bottom: var(--spacing-1);
}

.user-card__username {
    font-size: var(--font-size-sm);
    color: var(--text-muted);
    margin-bottom: var(--spacing-3);
}

.user-card__stats {
    display: flex;
    justify-content: center;
    gap: var(--spacing-4);
    padding-top: var(--spacing-3);
    border-top: 1px solid var(--border-light);
}

.user-card__stat {
    text-align: center;
}

.user-card__stat-value {
    font-weight: var(--font-weight-bold);
}

.user-card__stat-label {
    font-size: var(--font-size-xs);
    color: var(--text-muted);
}

/* =========================================================================
   ONLINE USERS WIDGET
   ========================================================================= */
.online-users {
    display: flex;
    flex-wrap: wrap;
    gap: var(--spacing-2);
}

.online-user {
    position: relative;
    display: inline-block;
}

.online-user__avatar {
    width: 40px;
    height: 40px;
    border-radius: var(--border-radius-full);
    object-fit: cover;
    border: 2px solid var(--bg-primary);
}

.online-user__status {
    position: absolute;
    bottom: 0;
    right: 0;
    width: 12px;
    height: 12px;
    background: var(--success);
    border: 2px solid var(--bg-primary);
    border-radius: var(--border-radius-full);
}

/* =========================================================================
   RESPONSIVE
   ========================================================================= */
@media (max-width: 640px) {
    .profile-header {
        padding: var(--spacing-5);
    }

    .profile-avatar__image {
        width: 80px;
        height: 80px;
    }

    .profile-info__name {
        font-size: var(--font-size-xl);
    }

    .profile-stats {
        justify-content: center;
    }

    .dashboard-card {
        flex-direction: column;
        text-align: center;
    }
}
