/* ===========================
   FRIENDS SYSTEM STYLES
   Стили для системы друзей
   =========================== */

/* Friends Page Container */
.friends-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 24px;
}

/* Friends Header */
.friends-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.friends-header h1 {
    font-size: 28px;
    color: var(--text-primary);
    margin: 0;
}

.friends-stats {
    display: flex;
    gap: 16px;
    font-size: 14px;
    color: var(--text-secondary);
}

.friends-stat {
    display: flex;
    align-items: center;
    gap: 6px;
}

.friends-stat i {
    color: var(--primary-color);
}

/* Friends Tabs */
.friends-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 24px;
    border-bottom: 2px solid var(--border-color);
}

.friends-tab {
    padding: 12px 24px;
    background: none;
    border: none;
    border-bottom: 3px solid transparent;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 16px;
    font-weight: 500;
    transition: all 0.3s ease;
    position: relative;
}

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

.friends-tab.active {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
}

.friends-tab .badge {
    display: inline-block;
    background: var(--primary-color);
    color: white;
    font-size: 12px;
    padding: 2px 6px;
    border-radius: 10px;
    margin-left: 6px;
    min-width: 20px;
    text-align: center;
}

/* Tab Content */
.friends-tab-content {
    display: none;
}

.friends-tab-content.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Friends Grid */
.friends-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}

/* Friend Card */
.friend-card {
    background: var(--card-bg);
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    cursor: pointer;
}

.friend-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
}

.friend-card-header {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 16px;
}

.friend-avatar {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid var(--primary-color);
}

.friend-info {
    flex: 1;
}

.friend-name {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0 0 4px 0;
}

.friend-username {
    font-size: 14px;
    color: var(--text-secondary);
    margin: 0;
}

.friend-meta {
    display: flex;
    gap: 16px;
    margin-bottom: 16px;
    font-size: 13px;
    color: var(--text-secondary);
}

.friend-meta-item {
    display: flex;
    align-items: center;
    gap: 6px;
}

.friend-meta-item i {
    color: var(--primary-color);
}

.friend-actions {
    display: flex;
    gap: 8px;
}

.friend-action-btn {
    flex: 1;
    padding: 10px 16px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.friend-action-btn.primary {
    background: var(--primary-color);
    color: white;
}

.friend-action-btn.primary:hover {
    background: var(--primary-hover);
    transform: translateY(-2px);
}

.friend-action-btn.secondary {
    background: var(--bg-secondary);
    color: var(--text-primary);
}

.friend-action-btn.secondary:hover {
    background: var(--border-color);
}

.friend-action-btn.danger {
    background: #fee;
    color: #c00;
}

.friend-action-btn.danger:hover {
    background: #fcc;
}

.friend-action-btn.success {
    background: #22c55e;
    color: white;
}

.friend-action-btn.success:hover {
    background: #16a34a;
}

/* Friend Since Badge */
.friend-since {
    font-size: 12px;
    color: var(--text-secondary);
    text-align: center;
    margin-top: 8px;
    padding-top: 12px;
    border-top: 1px solid var(--border-color);
}

/* Empty State */
.friends-empty {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-secondary);
}

.friends-empty i {
    font-size: 64px;
    color: var(--text-tertiary);
    margin-bottom: 16px;
}

.friends-empty h3 {
    font-size: 20px;
    color: var(--text-primary);
    margin: 0 0 8px 0;
}

.friends-empty p {
    font-size: 14px;
    margin: 0;
}

/* Friend Status in Profile Modal */
.friend-status-section {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
}

.friend-status-btn {
    width: 100%;
    padding: 12px 20px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.friend-status-btn.add-friend {
    background: var(--primary-color);
    color: white;
}

.friend-status-btn.add-friend:hover {
    background: var(--primary-hover);
    transform: translateY(-2px);
}

.friend-status-btn.request-sent {
    background: var(--bg-secondary);
    color: var(--text-secondary);
    cursor: not-allowed;
}

.friend-status-btn.accept-request {
    background: #22c55e;
    color: white;
}

.friend-status-btn.accept-request:hover {
    background: #16a34a;
}

.friend-status-btn.already-friends {
    background: var(--bg-secondary);
    color: var(--text-secondary);
    cursor: default;
}

.friend-status-actions {
    display: flex;
    gap: 8px;
    margin-top: 12px;
}

.friend-status-actions button {
    flex: 1;
}

/* Loading State */
.friends-loading {
    text-align: center;
    padding: 40px;
    color: var(--text-secondary);
}

.friends-loading i {
    font-size: 32px;
    animation: spin 1s linear infinite;
}

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

/* Mobile Optimization */
@media (max-width: 768px) {
    .friends-container {
        padding: 16px;
    }
    
    .friends-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }
    
    .friends-header h1 {
        font-size: 24px;
    }
    
    .friends-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }
    
    .friends-tabs {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    .friends-tab {
        white-space: nowrap;
        padding: 10px 16px;
        font-size: 14px;
    }
    
    .friend-card {
        padding: 16px;
    }
    
    .friend-actions {
        flex-direction: column;
    }
    
    .friend-action-btn {
        width: 100%;
    }
}

/* Dark Theme */
[data-theme="dark"] .friend-card {
    background: var(--bg-secondary);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

[data-theme="dark"] .friend-card:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
}

[data-theme="dark"] .friend-action-btn.secondary {
    background: var(--bg-primary);
}

[data-theme="dark"] .friend-action-btn.danger {
    background: rgba(239, 68, 68, 0.2);
    color: #ff6b6b;
}

[data-theme="dark"] .friend-action-btn.danger:hover {
    background: rgba(239, 68, 68, 0.3);
}

/* Christmas Theme */
[data-theme="christmas"] .friend-card {
    border: 2px solid rgba(196, 30, 58, 0.2);
}

[data-theme="christmas"] .friend-avatar {
    border-color: #c41e3a;
}

[data-theme="christmas"] .friends-tab.active {
    color: #c41e3a;
    border-bottom-color: #c41e3a;
}

[data-theme="christmas"] .friend-action-btn.primary {
    background: linear-gradient(135deg, #c41e3a 0%, #165b33 100%);
}

[data-theme="christmas"] .friend-meta-item i {
    color: #c41e3a;
}
