/**
 * Follow System Integration CSS
 * 
 * Styles for inline follow controls, profile panels, and user suggestions
 * Requirements: 6.1, 6.2, 6.3, 6.4, 6.5
 */

/* Follow Button Styles */
.follow-btn,
.unfollow-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    min-height: 36px;
}

.follow-btn {
    background: var(--CS-blue);
    color: #fff;
    border: 1px solid var(--CS-blue);
}

.follow-btn:hover {
    background: #0056b3;
    border-color: #0056b3;
    transform: translateY(-1px);
}

.unfollow-btn {
    background: transparent;
    color: #888;
    border: 1px solid #333;
}

.unfollow-btn:hover {
    background: #333;
    color: #fff;
    border-color: #555;
}

/* Loading state for buttons */
.follow-btn.loading,
.unfollow-btn.loading {
    opacity: 0.7;
    cursor: not-allowed;
    pointer-events: none;
}

.follow-btn.loading i,
.unfollow-btn.loading i {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* Small button variants */
.follow-btn.btn-sm,
.unfollow-btn.btn-sm {
    padding: 6px 12px;
    font-size: 12px;
    min-height: 28px;
}

/* Inline follow controls */
.inline-follow-controls {
    display: flex;
    align-items: center;
    gap: 8px;
}

.inline-follow-controls .follow-stats {
    display: flex;
    gap: 12px;
    font-size: 13px;
    color: #888;
}

.inline-follow-controls .follow-stats span {
    display: flex;
    align-items: center;
    gap: 4px;
}

/* User card with follow controls */
.user-card-with-follow {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: #222;
    border-radius: 8px;
    margin-bottom: 8px;
    transition: background-color 0.2s ease;
}

.user-card-with-follow:hover {
    background: #2a2a2a;
}

.user-card-with-follow .user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-size: cover;
    background-position: center;
    background-color: #333;
    flex-shrink: 0;
    cursor: pointer;
}

.user-card-with-follow .user-info {
    flex: 1;
    min-width: 0;
    cursor: pointer;
}

.user-card-with-follow .user-name {
    margin: 0 0 4px 0;
    color: #fff;
    font-size: 14px;
    font-weight: 500;
}

.user-card-with-follow .user-username {
    margin: 0 0 4px 0;
    color: #888;
    font-size: 13px;
}

.user-card-with-follow .user-stats {
    display: flex;
    gap: 12px;
    font-size: 12px;
    color: #666;
}

.user-card-with-follow .user-actions {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
}

/* Profile Modal Styles */
.profile-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    padding: 20px;
}

.profile-modal {
    background: #1a1a1a;
    border-radius: 12px;
    width: 100%;
    max-width: 500px;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5);
}

.profile-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px;
    border-bottom: 1px solid #333;
    background: #222;
    border-radius: 12px 12px 0 0;
}

.profile-modal-header h3 {
    margin: 0;
    color: #fff;
    font-size: 18px;
}

.profile-modal-header .close-btn {
    background: none;
    border: none;
    color: #888;
    cursor: pointer;
    padding: 8px;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.profile-modal-header .close-btn:hover {
    background: #333;
    color: #fff;
}

.profile-modal-content {
    padding: 20px;
}

.profile-info {
    text-align: center;
    margin-bottom: 20px;
}

.profile-info .profile-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background-size: cover;
    background-position: center;
    background-color: #333;
    margin: 0 auto 16px;
}

.profile-info h4 {
    margin: 0 0 8px 0;
    color: #fff;
    font-size: 20px;
}

.profile-info .profile-username {
    margin: 0 0 12px 0;
    color: #888;
    font-size: 16px;
}

.profile-info .profile-bio {
    margin: 0 0 16px 0;
    color: #ccc;
    line-height: 1.5;
}

.profile-info .profile-stats {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-bottom: 20px;
    font-size: 14px;
    color: #ccc;
}

.profile-info .profile-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
}

.recent-posts {
    border-top: 1px solid #333;
    padding-top: 20px;
}

.recent-posts h5 {
    margin: 0 0 16px 0;
    color: #fff;
    font-size: 16px;
}

.recent-post {
    background: #222;
    border-radius: 8px;
    padding: 12px;
    margin-bottom: 12px;
}

.recent-post .post-content {
    margin: 0 0 8px 0;
    color: #ccc;
    line-height: 1.4;
}

.recent-post .post-meta {
    display: flex;
    gap: 12px;
    font-size: 12px;
    color: #888;
}

/* User Suggestions Styles */
.user-suggestions {
    background: #222;
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 20px;
}

.user-suggestions h4 {
    margin: 0 0 16px 0;
    color: #fff;
    font-size: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.user-suggestions .suggestions-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.user-suggestions .suggestion-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px;
    border-radius: 6px;
    transition: background-color 0.2s ease;
}

.user-suggestions .suggestion-item:hover {
    background: #2a2a2a;
}

.user-suggestions .suggestion-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background-size: cover;
    background-position: center;
    background-color: #333;
    flex-shrink: 0;
}

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

.user-suggestions .suggestion-name {
    margin: 0 0 2px 0;
    color: #fff;
    font-size: 13px;
    font-weight: 500;
}

.user-suggestions .suggestion-username {
    margin: 0;
    color: #888;
    font-size: 12px;
}

.user-suggestions .suggestion-follow-btn {
    padding: 4px 8px;
    font-size: 11px;
    min-height: 24px;
}

/* Empty state for no follows */
.no-follows-state {
    text-align: center;
    padding: 40px 20px;
    background: #222;
    border-radius: 8px;
    margin-bottom: 20px;
}

.no-follows-state .empty-icon {
    font-size: 48px;
    color: #555;
    margin-bottom: 16px;
}

.no-follows-state h3 {
    margin: 0 0 8px 0;
    color: #fff;
    font-size: 18px;
}

.no-follows-state p {
    margin: 0 0 20px 0;
    color: #888;
    line-height: 1.5;
}

.no-follows-state .suggestions-btn {
    background: var(--CS-blue);
    color: #fff;
    border: none;
    padding: 12px 24px;
    border-radius: 6px;
    font-size: 14px;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.no-follows-state .suggestions-btn:hover {
    background: #0056b3;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .profile-modal {
        margin: 10px;
        max-height: 90vh;
    }
    
    .profile-modal-content {
        padding: 16px;
    }
    
    .profile-info .profile-stats {
        flex-direction: column;
        gap: 8px;
    }
    
    .profile-info .profile-actions {
        flex-direction: column;
    }
    
    .user-card-with-follow {
        padding: 8px;
    }
    
    .user-card-with-follow .user-actions {
        flex-direction: column;
        gap: 4px;
    }
    
    .follow-btn,
    .unfollow-btn {
        padding: 6px 12px;
        font-size: 12px;
        min-height: 32px;
    }
    
    .inline-follow-controls {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
}

/* Touch-friendly interactions */
@media (hover: none) and (pointer: coarse) {
    .follow-btn,
    .unfollow-btn {
        min-height: 44px;
        padding: 12px 16px;
    }
    
    .user-card-with-follow .user-avatar {
        width: 48px;
        height: 48px;
    }
    
    .profile-modal-header .close-btn {
        min-width: 44px;
        min-height: 44px;
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .follow-btn {
        border: 2px solid var(--CS-blue);
    }
    
    .unfollow-btn {
        border: 2px solid #666;
    }
    
    .user-card-with-follow {
        border: 1px solid #444;
    }
    
    .profile-modal {
        border: 2px solid #666;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    .follow-btn,
    .unfollow-btn,
    .user-card-with-follow,
    .profile-modal-overlay {
        transition: none;
    }
    
    .follow-btn.loading i,
    .unfollow-btn.loading i {
        animation: none;
    }
}

/* Focus styles for accessibility */
.follow-btn:focus,
.unfollow-btn:focus {
    outline: 2px solid var(--CS-blue);
    outline-offset: 2px;
}

.user-card-with-follow .user-avatar:focus,
.user-card-with-follow .user-info:focus {
    outline: 2px solid var(--CS-blue);
    outline-offset: 2px;
    border-radius: 4px;
}

/* Loading skeleton for user suggestions */
.suggestions-loading {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.suggestion-skeleton {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px;
}

.suggestion-skeleton .skeleton-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: linear-gradient(90deg, #333 25%, #444 50%, #333 75%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s infinite;
}

.suggestion-skeleton .skeleton-info {
    flex: 1;
}

.suggestion-skeleton .skeleton-name {
    height: 14px;
    background: linear-gradient(90deg, #333 25%, #444 50%, #333 75%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s infinite;
    border-radius: 4px;
    margin-bottom: 4px;
    width: 60%;
}

.suggestion-skeleton .skeleton-username {
    height: 12px;
    background: linear-gradient(90deg, #333 25%, #444 50%, #333 75%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s infinite;
    border-radius: 4px;
    width: 40%;
}

@keyframes skeleton-loading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}