/* User Profile Hover Popup Styles */
.user-profile-popup {
    position: absolute;
    background: var(--secondary-bg);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(10px);
    z-index: 10000;
    width: 320px;
    max-width: 90vw;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: all 0.3s ease;
    pointer-events: none;
}

.user-profile-popup.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    pointer-events: auto;
}

.profile-popup-content {
    padding: 1.5rem;
    position: relative;
}

.profile-popup-header {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
}

.profile-popup-avatar {
    flex-shrink: 0;
}

.profile-avatar {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid #4CAF50;
    transition: transform 0.2s ease;
}

.profile-avatar:hover {
    transform: scale(1.05);
}

.profile-popup-info {
    flex: 1;
    min-width: 0;
}

.profile-popup-name {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
    line-height: 1.2;
}

.profile-popup-username {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 0.75rem;
    font-weight: 500;
}

.profile-popup-stats {
    display: flex;
    gap: 1rem;
}

.profile-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.stat-number {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1;
}

.stat-label {
    font-size: 0.75rem;
    color: var(--text-secondary);
    font-weight: 500;
    margin-top: 0.25rem;
}

.profile-popup-bio {
    color: var(--text-secondary);
    font-size: 0.9rem;
    line-height: 1.4;
    margin-bottom: 1rem;
    padding: 0.75rem;
    background: var(--primary-bg);
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

.profile-popup-actions {
    display: flex;
    justify-content: center;
    margin-bottom: 1rem;
}

.profile-follow-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 2rem;
    border: none;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
}

.profile-follow-btn {
    background: #4CAF50;
    color: white;
}

.profile-follow-btn:hover {
    background: #45a049;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(76, 175, 80, 0.3);
}

.profile-follow-btn.following {
    background: var(--text-secondary);
    color: var(--text-primary);
}

.profile-follow-btn.following:hover {
    background: #ff4757;
    color: white;
}

.profile-follow-btn.following i::before {
    content: "\f00c"; /* Check icon */
}

.profile-popup-footer {
    border-top: 1px solid var(--border-color);
    padding-top: 0.75rem;
}

.profile-joined {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-secondary);
    font-size: 0.8rem;
}

.profile-joined i {
    font-size: 0.75rem;
}

/* Arrow pointing to username */
.profile-popup-arrow {
    position: absolute;
    top: -8px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 8px solid transparent;
    border-right: 8px solid transparent;
    border-bottom: 8px solid var(--secondary-bg);
    z-index: 1;
}

.profile-popup-arrow::before {
    content: '';
    position: absolute;
    top: 1px;
    left: -8px;
    width: 0;
    height: 0;
    border-left: 8px solid transparent;
    border-right: 8px solid transparent;
    border-bottom: 8px solid var(--border-color);
}

/* Loading state */
.profile-popup-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    color: var(--text-secondary);
}

.profile-popup-loading i {
    font-size: 1.5rem;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .user-profile-popup {
        width: 280px;
        left: 50% !important;
        transform: translateX(-50%) translateY(10px);
    }
    
    .user-profile-popup.active {
        transform: translateX(-50%) translateY(0);
    }
    
    .profile-popup-content {
        padding: 1rem;
    }
    
    .profile-popup-header {
        flex-direction: column;
        text-align: center;
        gap: 0.75rem;
    }
    
    .profile-popup-stats {
        justify-content: center;
    }
    
    .profile-popup-actions {
        justify-content: center;
    }
}

/* Animation for follow button state change */
@keyframes followSuccess {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

.profile-follow-btn.follow-success {
    animation: followSuccess 0.3s ease;
}
