/**
 * MemberSphere Profile Styles
 *
 * Styles for profile cards (popups) and full profile pages
 *
 * @package MemberSphere
 * @since 1.0.13
 */

/* ==========================================================================
   CSS Custom Properties
   ========================================================================== */
.ms-profile-card-container,
.ms-profile-page {
    /* Primary Colors - Match Messages System */
    --ms-profile-primary: #4F46E5;
    --ms-profile-primary-hover: #4338CA;
    --ms-profile-primary-light: #EEF2FF;
    
    /* Background Colors */
    --ms-profile-bg: #ffffff;
    --ms-profile-bg-secondary: #F9FAFB;
    --ms-profile-bg-hover: #F3F4F6;
    
    /* Border Colors */
    --ms-profile-border: #E5E7EB;
    --ms-profile-border-light: #F3F4F6;
    
    /* Text Colors */
    --ms-profile-text: #111827;
    --ms-profile-text-secondary: #374151;
    --ms-profile-text-muted: #6B7280;
    
    /* Status Colors */
    --ms-profile-success: #059669;
    --ms-profile-online: #22c55e;
    --ms-profile-offline: #9CA3AF;
    --ms-profile-danger: #DC2626;
    
    /* Cover Gradient - Vibrant modern gradient */
    --ms-profile-cover-gradient: linear-gradient(135deg, #4F46E5 0%, #7C3AED 50%, #EC4899 100%);
    
    /* Border Radius */
    --ms-profile-radius: 8px;
    --ms-profile-radius-lg: 12px;
    --ms-profile-radius-full: 9999px;
    
    /* Shadows */
    --ms-profile-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    --ms-profile-shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --ms-profile-shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    --ms-profile-shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    
    /* Typography */
    --ms-profile-font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    
    /* Transitions */
    --ms-profile-transition: all 0.2s ease;
}

/* ==========================================================================
   PROFILE CARD (Popup) - Modern Design
   ========================================================================== */
.ms-profile-card-container {
    position: fixed;
    z-index: 999998;
    opacity: 0;
    visibility: hidden;
    transform: translateY(8px) scale(0.98);
    transition: opacity 0.25s ease, visibility 0.25s ease, transform 0.25s ease;
}

.ms-profile-card-container.ms-profile-card--visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

.ms-profile-card {
    width: 340px;
    background: var(--ms-profile-bg);
    border-radius: var(--ms-profile-radius-lg);
    box-shadow: var(--ms-profile-shadow-xl);
    overflow: hidden;
    font-family: var(--ms-profile-font);
}

/* Profile Card Cover */
.ms-profile-card__cover {
    position: relative;
    height: 70px;
    background: var(--ms-profile-cover-gradient);
    overflow: hidden;
}

.ms-profile-card__cover-gradient {
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, 
        rgba(79, 70, 229, 0.9) 0%, 
        rgba(147, 51, 234, 0.9) 50%,
        rgba(236, 72, 153, 0.8) 100%);
}

/* Profile Card Main Content */
.ms-profile-card__main {
    position: relative;
    padding: 0 1.25rem 1rem;
}

/* Avatar Wrapper - Positioned to overlap cover */
.ms-profile-card__avatar-wrapper {
    display: flex;
    justify-content: center;
    margin-top: -40px;
    margin-bottom: 0.75rem;
}

.ms-profile-card__avatar {
    position: relative;
    flex-shrink: 0;
}

.ms-profile-card__avatar img {
    width: 80px;
    height: 80px;
    border-radius: var(--ms-profile-radius-full);
    object-fit: cover;
    border: 4px solid var(--ms-profile-bg);
    box-shadow: var(--ms-profile-shadow-md);
    background: var(--ms-profile-bg-secondary);
}

.ms-profile-card__avatar .ms-online-indicator {
    position: absolute;
    bottom: 4px;
    right: 4px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    border: 3px solid var(--ms-profile-bg);
    background: var(--ms-profile-offline);
}

.ms-profile-card__avatar .ms-online-indicator--online {
    background: var(--ms-profile-online);
    box-shadow: 0 0 0 2px rgba(34, 197, 94, 0.3);
}

/* Identity Section */
.ms-profile-card__identity {
    text-align: center;
    margin-bottom: 1rem;
}

.ms-profile-card__name {
    margin: 0 0 0.125rem 0;
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--ms-profile-text);
    line-height: 1.3;
}

.ms-profile-card__username {
    display: block;
    font-size: 0.8125rem;
    color: var(--ms-profile-text-muted);
    margin-bottom: 0.625rem;
}

.ms-profile-card__badges {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 0.375rem;
}

/* Profile Card Bio */
.ms-profile-card__bio {
    text-align: center;
    margin-bottom: 1rem;
}

.ms-profile-card__bio p {
    margin: 0;
    font-size: 0.8125rem;
    color: var(--ms-profile-text-secondary);
    line-height: 1.5;
}

/* Profile Card Meta (Location, Joined) */
.ms-profile-card__meta {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 1rem;
}

.ms-profile-card__meta-item {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.75rem;
    color: var(--ms-profile-text-muted);
}

.ms-profile-card__meta-item .dashicons {
    font-size: 14px;
    width: 14px;
    height: 14px;
    color: var(--ms-profile-text-muted);
}

/* Profile Card Stats */
.ms-profile-card__stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.5rem;
    padding: 0.875rem;
    background: var(--ms-profile-bg-secondary);
    border-radius: var(--ms-profile-radius);
    margin-bottom: 0.875rem;
}

.ms-profile-card__stat {
    text-align: center;
}

.ms-profile-card__stat-value {
    display: block;
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--ms-profile-primary);
    line-height: 1.2;
}

.ms-profile-card__stat-label {
    font-size: 0.6875rem;
    color: var(--ms-profile-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Profile Card Mutual Friends */
.ms-profile-card__mutual {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.625rem;
    padding: 0.75rem;
    background: var(--ms-profile-bg-secondary);
    border-radius: var(--ms-profile-radius);
    margin-bottom: 0.875rem;
}

.ms-profile-card__mutual-avatars {
    display: flex;
}

.ms-profile-card__mutual-avatars img {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 2px solid var(--ms-profile-bg);
    margin-left: -8px;
    object-fit: cover;
    background: var(--ms-profile-bg-secondary);
}

.ms-profile-card__mutual-avatars img:first-child {
    margin-left: 0;
}

.ms-profile-card__mutual-text {
    font-size: 0.75rem;
    color: var(--ms-profile-text-muted);
}

/* Profile Card Footer */
.ms-profile-card__footer {
    padding: 1rem 1.25rem;
    background: var(--ms-profile-bg-secondary);
    border-top: 1px solid var(--ms-profile-border-light);
}

/* Friendship Button */
.ms-profile-card__friendship-btn {
    width: 100%;
    margin-bottom: 0.75rem;
    padding: 0.625rem 1rem;
    font-size: 0.875rem;
    font-weight: 600;
}

.ms-profile-card__friendship-btn .dashicons {
    font-size: 16px;
    width: 16px;
    height: 16px;
    margin-right: 0.375rem;
}

/* Request Actions */
.ms-profile-card__request-actions {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

.ms-profile-card__request-actions .ms-btn {
    flex: 1;
    padding: 0.5rem 0.75rem;
    font-size: 0.8125rem;
}

/* Secondary Actions */
.ms-profile-card__actions {
    display: flex;
    justify-content: center;
    gap: 0.25rem;
}

.ms-profile-card__actions .ms-btn {
    padding: 0.375rem 0.75rem;
    font-size: 0.75rem;
}

.ms-profile-card__actions .ms-btn .dashicons {
    font-size: 14px;
    width: 14px;
    height: 14px;
    margin-right: 0.25rem;
}

/* Profile Card Loading */
.ms-profile-card__loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 4rem 2rem;
}

/* Profile Card Error */
.ms-profile-card__error {
    padding: 2rem 1.5rem;
    text-align: center;
    color: var(--ms-profile-text-muted);
}

.ms-profile-card__error .dashicons {
    font-size: 2.5rem;
    width: 2.5rem;
    height: 2.5rem;
    margin-bottom: 0.75rem;
    color: var(--ms-gray-300, #d1d5db);
}

.ms-profile-card__error p {
    margin: 0;
    font-size: 0.875rem;
}

/* Profile Card Spinner */
.ms-profile-card .ms-spinner {
    display: inline-block;
    width: 24px;
    height: 24px;
    border: 3px solid var(--ms-profile-border);
    border-top-color: var(--ms-profile-primary);
    border-radius: 50%;
    animation: ms-profile-spin 0.8s linear infinite;
}

@keyframes ms-profile-spin {
    to {
        transform: rotate(360deg);
    }
}

.ms-spinner--sm {
    width: 14px;
    height: 14px;
    border-width: 2px;
}

/* ==========================================================================
   ONLINE INDICATOR
   ========================================================================== */
.ms-online-indicator {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--ms-profile-offline);
}

.ms-online-indicator--online {
    background: var(--ms-profile-online);
}

.ms-online-indicator--sm {
    width: 8px;
    height: 8px;
}

.ms-online-indicator--lg {
    width: 14px;
    height: 14px;
}

/* ==========================================================================
   BADGES
   ========================================================================== */
.ms-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.1875rem 0.625rem;
    font-size: 0.6875rem;
    font-weight: 600;
    border-radius: var(--ms-profile-radius-full);
    text-transform: uppercase;
    letter-spacing: 0.025em;
}

.ms-badge--primary {
    background: var(--ms-profile-primary-light);
    color: var(--ms-profile-primary);
}

.ms-badge--success {
    background: #D1FAE5;
    color: #059669;
}

.ms-badge--admin {
    background: linear-gradient(135deg, #FEF3C7, #FDE68A);
    color: #B45309;
}

.ms-badge--moderator {
    background: linear-gradient(135deg, #E0E7FF, #C7D2FE);
    color: #4F46E5;
}

.ms-badge--mentor {
    background: linear-gradient(135deg, #DBEAFE, #BFDBFE);
    color: #2563EB;
}

.ms-badge--vip {
    background: linear-gradient(135deg, #F5D0FE, #E9D5FF);
    color: #9333EA;
}

.ms-badge--premium {
    background: linear-gradient(135deg, #FED7AA, #FDBA74);
    color: #C2410C;
}

.ms-badge--friend {
    background: linear-gradient(135deg, #FCE7F3, #FBCFE8);
    color: #DB2777;
}

.ms-badge .dashicons {
    font-size: 0.6875rem;
    width: 0.6875rem;
    height: 0.6875rem;
}

/* ==========================================================================
   BUTTONS (Profile Card Specific)
   ========================================================================== */
.ms-profile-card .ms-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.375rem;
    padding: 0.5rem 1rem;
    font-size: 0.8125rem;
    font-weight: 600;
    border-radius: var(--ms-profile-radius);
    border: none;
    cursor: pointer;
    transition: var(--ms-profile-transition);
    text-decoration: none;
    line-height: 1.25;
}

.ms-profile-card .ms-btn:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.2);
}

.ms-profile-card .ms-btn--primary {
    background: var(--ms-profile-primary);
    color: white;
}

.ms-profile-card .ms-btn--primary:hover {
    background: var(--ms-profile-primary-hover);
}

.ms-profile-card .ms-btn--secondary {
    background: var(--ms-profile-bg-secondary);
    color: var(--ms-profile-text-secondary);
    border: 1px solid var(--ms-profile-border);
}

.ms-profile-card .ms-btn--secondary:hover {
    background: var(--ms-profile-bg-hover);
}

.ms-profile-card .ms-btn--success {
    background: #059669;
    color: white;
}

.ms-profile-card .ms-btn--success:hover {
    background: #047857;
}

.ms-profile-card .ms-btn--danger {
    background: var(--ms-profile-danger);
    color: white;
}

.ms-profile-card .ms-btn--danger:hover {
    background: #B91C1C;
}

.ms-profile-card .ms-btn--outline {
    background: transparent;
    color: var(--ms-profile-primary);
    border: 1px solid var(--ms-profile-primary);
}

.ms-profile-card .ms-btn--outline:hover {
    background: var(--ms-profile-primary-light);
}

.ms-profile-card .ms-btn--ghost {
    background: transparent;
    color: var(--ms-profile-text-muted);
}

.ms-profile-card .ms-btn--ghost:hover {
    background: var(--ms-profile-bg-hover);
    color: var(--ms-profile-text);
}

.ms-profile-card .ms-btn--block {
    width: 100%;
}

.ms-profile-card .ms-btn--sm {
    padding: 0.375rem 0.75rem;
    font-size: 0.75rem;
}

.ms-profile-card .ms-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.ms-profile-card .ms-btn .dashicons {
    font-size: 14px;
    width: 14px;
    height: 14px;
}
}

/* ==========================================================================
   PROFILE PAGE - Full Profile
   ========================================================================== */
.ms-profile-page {
    font-family: var(--ms-profile-font);
    color: var(--ms-profile-text);
    background: var(--ms-profile-bg);
    border-radius: var(--ms-profile-radius-lg);
    box-shadow: var(--ms-profile-shadow);
    overflow: hidden;
}

/* ==========================================================================
   PROFILE COVER
   ========================================================================== */
.ms-profile-cover {
    position: relative;
    height: 200px;
    background: var(--ms-profile-cover-gradient);
    background-size: cover;
    background-position: center;
}

.ms-profile-cover--has-image {
    background: none;
}

.ms-profile-cover__image {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.ms-profile-cover__overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to bottom, transparent 0%, rgba(0, 0, 0, 0.3) 100%);
}

.ms-profile-cover__edit {
    position: absolute;
    bottom: 1rem;
    right: 1rem;
    padding: 0.5rem 0.75rem;
    background: rgba(0, 0, 0, 0.5);
    color: #fff;
    border: none;
    border-radius: var(--ms-profile-radius);
    font-size: 0.8125rem;
    cursor: pointer;
    transition: var(--ms-profile-transition);
}

.ms-profile-cover__edit:hover {
    background: rgba(0, 0, 0, 0.7);
}

@media (max-width: 640px) {
    .ms-profile-cover {
        height: 150px;
    }
}

/* ==========================================================================
   PROFILE HEADER
   ========================================================================== */
.ms-profile-header {
    position: relative;
    padding: 0 1.5rem 1.5rem;
    margin-top: -60px;
}

.ms-profile-header__top {
    display: flex;
    align-items: flex-end;
    gap: 1.25rem;
    margin-bottom: 1rem;
}

.ms-profile-header__avatar {
    position: relative;
    flex-shrink: 0;
}

.ms-profile-header__avatar-img {
    width: 120px;
    height: 120px;
    border-radius: var(--ms-profile-radius-full);
    object-fit: cover;
    border: 4px solid var(--ms-profile-bg);
    box-shadow: var(--ms-profile-shadow-md);
    background: var(--ms-profile-bg);
}

.ms-profile-header__avatar .ms-online-indicator {
    bottom: 8px;
    right: 8px;
    width: 20px;
    height: 20px;
    border-width: 3px;
}

.ms-profile-header__avatar-edit {
    position: absolute;
    bottom: 0;
    right: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--ms-profile-bg);
    border: 1px solid var(--ms-profile-border);
    border-radius: 50%;
    cursor: pointer;
    transition: var(--ms-profile-transition);
}

.ms-profile-header__avatar-edit:hover {
    background: var(--ms-profile-bg-hover);
}

.ms-profile-header__info {
    flex: 1;
    min-width: 0;
    padding-bottom: 0.5rem;
}

.ms-profile-header__name {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--ms-profile-text);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.ms-profile-header__username {
    font-size: 1rem;
    color: var(--ms-profile-text-muted);
    margin-bottom: 0.5rem;
}

.ms-profile-header__badges {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.ms-profile-header__actions {
    display: flex;
    gap: 0.5rem;
    flex-shrink: 0;
}

@media (max-width: 640px) {
    .ms-profile-header {
        padding: 0 1rem 1rem;
    }
    
    .ms-profile-header__top {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }
    
    .ms-profile-header__avatar-img {
        width: 100px;
        height: 100px;
    }
    
    .ms-profile-header__name {
        font-size: 1.25rem;
        justify-content: center;
    }
    
    .ms-profile-header__actions {
        width: 100%;
        justify-content: center;
    }
}

/* ==========================================================================
   PROFILE STATS
   ========================================================================== */
.ms-profile-stats {
    display: flex;
    gap: 2rem;
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--ms-profile-border);
    border-bottom: 1px solid var(--ms-profile-border);
    background: var(--ms-profile-bg-secondary);
}

.ms-profile-stats__item {
    text-align: center;
}

.ms-profile-stats__value {
    display: block;
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--ms-profile-text);
}

.ms-profile-stats__label {
    font-size: 0.8125rem;
    color: var(--ms-profile-text-muted);
}

.ms-profile-stats__item a {
    text-decoration: none;
    color: inherit;
}

.ms-profile-stats__item a:hover .ms-profile-stats__value {
    color: var(--ms-profile-primary);
}

@media (max-width: 640px) {
    .ms-profile-stats {
        justify-content: center;
        gap: 1.5rem;
        padding: 1rem;
    }
}

/* ==========================================================================
   PROFILE META INFO
   ========================================================================== */
.ms-profile-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--ms-profile-border);
}

.ms-profile-meta__item {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    font-size: 0.875rem;
    color: var(--ms-profile-text-secondary);
}

.ms-profile-meta__item .dashicons {
    font-size: 1rem;
    width: 1rem;
    height: 1rem;
    color: var(--ms-profile-text-muted);
}

.ms-profile-meta__item a {
    color: var(--ms-profile-primary);
    text-decoration: none;
}

.ms-profile-meta__item a:hover {
    text-decoration: underline;
}

/* ==========================================================================
   PROFILE TABS
   ========================================================================== */
.ms-profile-tabs {
    display: flex;
    border-bottom: 1px solid var(--ms-profile-border);
    background: var(--ms-profile-bg);
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.ms-profile-tabs::-webkit-scrollbar {
    height: 0;
}

.ms-profile-tab {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 1rem 1.25rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--ms-profile-text-muted);
    text-decoration: none;
    border-bottom: 2px solid transparent;
    white-space: nowrap;
    transition: var(--ms-profile-transition);
}

.ms-profile-tab:hover {
    color: var(--ms-profile-text);
    background: var(--ms-profile-bg-hover);
}

.ms-profile-tab--active {
    color: var(--ms-profile-primary);
    border-bottom-color: var(--ms-profile-primary);
}

.ms-profile-tab .dashicons {
    font-size: 1rem;
    width: 1rem;
    height: 1rem;
}

.ms-profile-tab__count {
    padding: 0 0.5rem;
    font-size: 0.75rem;
    background: var(--ms-profile-bg-hover);
    border-radius: var(--ms-profile-radius-full);
}

/* Mobile Tab Dropdown */
.ms-profile-tabs-mobile {
    display: none;
    padding: 1rem;
    border-bottom: 1px solid var(--ms-profile-border);
}

.ms-profile-tabs-mobile select {
    width: 100%;
    padding: 0.75rem 1rem;
    font-size: 0.875rem;
    border: 1px solid var(--ms-profile-border);
    border-radius: var(--ms-profile-radius);
    background: var(--ms-profile-bg);
}

@media (max-width: 640px) {
    .ms-profile-tabs {
        display: none;
    }
    
    .ms-profile-tabs-mobile {
        display: block;
    }
}

/* ==========================================================================
   PROFILE CONTENT
   ========================================================================== */
.ms-profile-content {
    padding: 1.5rem;
}

.ms-profile-tab-pane {
    display: none;
}

.ms-profile-tab-pane--active {
    display: block;
}

/* ==========================================================================
   PROFILE SECTION
   ========================================================================== */
.ms-profile-section {
    margin-bottom: 2rem;
}

.ms-profile-section:last-child {
    margin-bottom: 0;
}

.ms-profile-section__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
}

.ms-profile-section__title {
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
    color: var(--ms-profile-text);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.ms-profile-section__title .dashicons {
    color: var(--ms-profile-text-muted);
}

.ms-profile-section__link {
    font-size: 0.8125rem;
    color: var(--ms-profile-primary);
    text-decoration: none;
}

.ms-profile-section__link:hover {
    text-decoration: underline;
}

/* ==========================================================================
   PROFILE BIO
   ========================================================================== */
.ms-profile-bio {
    font-size: 0.9375rem;
    color: var(--ms-profile-text-secondary);
    line-height: 1.7;
}

.ms-profile-bio p {
    margin: 0 0 1rem;
}

.ms-profile-bio p:last-child {
    margin-bottom: 0;
}

/* ==========================================================================
   PROFILE ACTIVITY
   ========================================================================== */
.ms-profile-activity-filters {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.ms-profile-activity-filter {
    padding: 0.375rem 0.75rem;
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--ms-profile-text-muted);
    background: var(--ms-profile-bg-secondary);
    border: 1px solid transparent;
    border-radius: var(--ms-profile-radius-full);
    cursor: pointer;
    transition: var(--ms-profile-transition);
}

.ms-profile-activity-filter:hover {
    background: var(--ms-profile-bg-hover);
}

.ms-profile-activity-filter--active {
    color: var(--ms-profile-primary);
    background: var(--ms-profile-primary-light);
    border-color: var(--ms-profile-primary);
}

.ms-profile-activity-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.ms-profile-activity-item {
    display: flex;
    gap: 1rem;
    padding: 1rem;
    background: var(--ms-profile-bg-secondary);
    border-radius: var(--ms-profile-radius);
    transition: var(--ms-profile-transition);
}

.ms-profile-activity-item:hover {
    background: var(--ms-profile-bg-hover);
}

.ms-profile-activity-item__icon {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--ms-profile-bg);
    border-radius: var(--ms-profile-radius);
    color: var(--ms-profile-primary);
    flex-shrink: 0;
}

.ms-profile-activity-item__content {
    flex: 1;
    min-width: 0;
}

.ms-profile-activity-item__title {
    font-weight: 500;
    color: var(--ms-profile-text);
    margin-bottom: 0.25rem;
}

.ms-profile-activity-item__title a {
    color: inherit;
    text-decoration: none;
}

.ms-profile-activity-item__title a:hover {
    color: var(--ms-profile-primary);
}

.ms-profile-activity-item__excerpt {
    font-size: 0.8125rem;
    color: var(--ms-profile-text-muted);
    margin-bottom: 0.375rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.ms-profile-activity-item__meta {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.75rem;
    color: var(--ms-profile-text-muted);
}

.ms-profile-activity-item__meta span {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

/* ==========================================================================
   PROFILE FRIENDS TAB
   ========================================================================== */
.ms-profile-friends-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.ms-profile-friends-count {
    font-size: 0.875rem;
    color: var(--ms-profile-text-muted);
}

.ms-profile-friends-filters {
    display: flex;
    gap: 0.5rem;
}

.ms-profile-friends-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1rem;
}

.ms-profile-friend-card {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.875rem;
    background: var(--ms-profile-bg-secondary);
    border-radius: var(--ms-profile-radius);
    transition: var(--ms-profile-transition);
}

.ms-profile-friend-card:hover {
    background: var(--ms-profile-bg-hover);
}

.ms-profile-friend-card--mutual {
    border: 1px solid var(--ms-profile-success);
    background: rgba(5, 150, 105, 0.05);
}

.ms-profile-friend-card__avatar {
    position: relative;
    flex-shrink: 0;
}

.ms-profile-friend-card__avatar img {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    object-fit: cover;
}

.ms-profile-friend-card__info {
    flex: 1;
    min-width: 0;
}

.ms-profile-friend-card__name {
    font-weight: 500;
    color: var(--ms-profile-text);
    display: block;
    text-decoration: none;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ms-profile-friend-card__name:hover {
    color: var(--ms-profile-primary);
}

.ms-profile-friend-card__meta {
    font-size: 0.75rem;
    color: var(--ms-profile-text-muted);
}

.ms-profile-friend-card__actions {
    display: flex;
    gap: 0.375rem;
}

.ms-profile-friend-card__actions .ms-btn {
    padding: 0.375rem;
}

/* ==========================================================================
   PROFILE BADGES TAB
   ========================================================================== */
.ms-profile-badges-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
}

.ms-profile-reputation {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: linear-gradient(135deg, var(--ms-profile-primary-light) 0%, #faf5ff 100%);
    border-radius: var(--ms-profile-radius);
    margin-bottom: 1.5rem;
}

.ms-profile-reputation__icon {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--ms-profile-primary);
    color: #fff;
    border-radius: 50%;
    font-size: 1.5rem;
}

.ms-profile-reputation__info {
    flex: 1;
}

.ms-profile-reputation__level {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--ms-profile-primary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.ms-profile-reputation__points {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--ms-profile-text);
}

.ms-profile-reputation__progress {
    height: 6px;
    background: rgba(0, 0, 0, 0.1);
    border-radius: 3px;
    margin-top: 0.5rem;
    overflow: hidden;
}

.ms-profile-reputation__progress-bar {
    height: 100%;
    background: var(--ms-profile-primary);
    border-radius: 3px;
    transition: width 0.3s ease;
}

.ms-profile-badges-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 1rem;
}

.ms-profile-badge-card {
    text-align: center;
    padding: 1rem;
    background: var(--ms-profile-bg-secondary);
    border-radius: var(--ms-profile-radius);
    transition: var(--ms-profile-transition);
}

.ms-profile-badge-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--ms-profile-shadow-md);
}

.ms-profile-badge-card--locked {
    opacity: 0.5;
}

.ms-profile-badge-card__icon {
    width: 48px;
    height: 48px;
    margin: 0 auto 0.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--ms-profile-bg);
    border-radius: 50%;
    font-size: 1.5rem;
    box-shadow: var(--ms-profile-shadow);
}

.ms-profile-badge-card__name {
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--ms-profile-text);
    margin-bottom: 0.25rem;
}

.ms-profile-badge-card__desc {
    font-size: 0.6875rem;
    color: var(--ms-profile-text-muted);
}

.ms-profile-badge-card__date {
    font-size: 0.6875rem;
    color: var(--ms-profile-text-muted);
    margin-top: 0.5rem;
}

/* Badge Rarity Colors */
.ms-profile-badge-card--common .ms-profile-badge-card__icon {
    background: #f3f4f6;
    color: #6b7280;
}

.ms-profile-badge-card--rare .ms-profile-badge-card__icon {
    background: #dbeafe;
    color: #2563eb;
}

.ms-profile-badge-card--epic .ms-profile-badge-card__icon {
    background: #e9d5ff;
    color: #9333ea;
}

.ms-profile-badge-card--legendary .ms-profile-badge-card__icon {
    background: linear-gradient(135deg, #fef3c7 0%, #fcd34d 100%);
    color: #d97706;
}

/* ==========================================================================
   PROFILE COURSES GRID
   ========================================================================== */
.ms-profile-courses-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1rem;
}

.ms-profile-course-card {
    background: var(--ms-profile-bg-secondary);
    border-radius: var(--ms-profile-radius);
    overflow: hidden;
    transition: var(--ms-profile-transition);
}

.ms-profile-course-card:hover {
    box-shadow: var(--ms-profile-shadow-md);
}

.ms-profile-course-card__image {
    height: 140px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    position: relative;
}

.ms-profile-course-card__image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.ms-profile-course-card__progress-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: rgba(0, 0, 0, 0.3);
}

.ms-profile-course-card__progress-bar {
    height: 100%;
    background: var(--ms-profile-success);
}

.ms-profile-course-card__content {
    padding: 1rem;
}

.ms-profile-course-card__title {
    font-weight: 600;
    color: var(--ms-profile-text);
    margin-bottom: 0.375rem;
}

.ms-profile-course-card__title a {
    color: inherit;
    text-decoration: none;
}

.ms-profile-course-card__title a:hover {
    color: var(--ms-profile-primary);
}

.ms-profile-course-card__meta {
    font-size: 0.8125rem;
    color: var(--ms-profile-text-muted);
}

/* ==========================================================================
   PROFILE CERTIFICATES GRID
   ========================================================================== */
.ms-profile-certificates-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1rem;
}

.ms-profile-certificate-card {
    text-align: center;
    padding: 1.25rem;
    background: linear-gradient(135deg, #fef3c7 0%, #fefce8 100%);
    border: 1px solid #fcd34d;
    border-radius: var(--ms-profile-radius);
    transition: var(--ms-profile-transition);
}

.ms-profile-certificate-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--ms-profile-shadow-md);
}

.ms-profile-certificate-card__icon {
    font-size: 2rem;
    color: #d97706;
    margin-bottom: 0.75rem;
}

.ms-profile-certificate-card__title {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--ms-profile-text);
    margin-bottom: 0.25rem;
}

.ms-profile-certificate-card__date {
    font-size: 0.75rem;
    color: var(--ms-profile-text-muted);
    margin-bottom: 0.75rem;
}

.ms-profile-certificate-card__link {
    font-size: 0.8125rem;
    color: var(--ms-profile-primary);
    text-decoration: none;
}

.ms-profile-certificate-card__link:hover {
    text-decoration: underline;
}

/* ==========================================================================
   PRIVATE PROFILE MESSAGE
   ========================================================================== */
.ms-profile-private {
    text-align: center;
    padding: 3rem 2rem;
}

.ms-profile-private__icon {
    font-size: 3rem;
    color: var(--ms-gray-300, #d1d5db);
    margin-bottom: 1rem;
}

.ms-profile-private__title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--ms-profile-text);
    margin: 0 0 0.5rem;
}

.ms-profile-private__text {
    color: var(--ms-profile-text-muted);
    margin: 0;
}

/* ==========================================================================
   USER PROFILE LINK (Trigger for popup)
   ========================================================================== */
.ms-user-profile-link {
    color: inherit;
    text-decoration: none;
    font-weight: 500;
    cursor: pointer;
    transition: var(--ms-profile-transition);
}

.ms-user-profile-link:hover {
    color: var(--ms-profile-primary);
}

/* ==========================================================================
   RESPONSIVE ADJUSTMENTS
   ========================================================================== */
@media (max-width: 480px) {
    .ms-profile-card {
        width: 100%;
        max-width: 320px;
    }
    
    .ms-profile-content {
        padding: 1rem;
    }
    
    .ms-profile-badges-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .ms-profile-friends-grid {
        grid-template-columns: 1fr;
    }
}
