/* Friends System - MySpace Style with Berserk Theme */

.friends-container {
    max-width: 1200px;
    margin: 40px auto;
    padding: 0 20px;
}

.friends-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 40px;
    padding: 30px;
    background: linear-gradient(135deg, rgba(139, 0, 0, 0.1), rgba(220, 20, 60, 0.1));
    border-radius: 12px;
    border: 2px solid var(--blood-red);
}

.friends-title {
    font-family: 'Courier New', monospace;
    font-size: 32px;
    font-weight: 700;
    color: var(--crimson);
    text-shadow: 0 0 10px rgba(220, 20, 60, 0.5);
}

.friends-actions {
    display: flex;
    gap: 12px;
}

.btn-search,
.btn-requests,
.btn-back {
    padding: 12px 24px;
    background: linear-gradient(135deg, var(--blood-red), var(--crimson));
    color: white;
    text-decoration: none;
    border-radius: 6px;
    font-weight: 600;
    font-size: 14px;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-search:hover,
.btn-requests:hover,
.btn-back:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(139, 0, 0, 0.4);
}

.btn-requests {
    position: relative;
}

.badge {
    position: absolute;
    top: -8px;
    right: -8px;
    background: #ff4444;
    color: white;
    border-radius: 10px;
    padding: 2px 8px;
    font-size: 12px;
    font-weight: 700;
}

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

.tab-button {
    padding: 12px 24px;
    background: none;
    border: none;
    color: var(--text-color);
    cursor: pointer;
    font-weight: 600;
    font-size: 14px;
    border-bottom: 3px solid transparent;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.tab-button:hover {
    color: var(--crimson);
    background: rgba(139, 0, 0, 0.05);
}

.tab-button.active {
    color: var(--crimson);
    border-bottom-color: var(--crimson);
}

.status-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
}

.status-dot.online {
    background: #4ade80;
    box-shadow: 0 0 8px #4ade80;
}

.status-dot.offline {
    background: #666;
}

/* Content */
.friends-content {
    position: relative;
    min-height: 400px;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

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

.friend-card {
    background: var(--card-background);
    border: 2px solid var(--border-color);
    border-radius: 12px;
    padding: 20px;
    display: flex;
    gap: 15px;
    transition: all 0.3s ease;
}

.friend-card:hover {
    border-color: var(--blood-red);
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(139, 0, 0, 0.2);
}

.friend-avatar-wrapper {
    position: relative;
    flex-shrink: 0;
}

.friend-avatar {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--blood-red), var(--crimson));
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 700;
    font-size: 24px;
}

.status-indicator {
    position: absolute;
    bottom: 2px;
    right: 2px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    border: 3px solid var(--card-background);
}

.status-indicator.online {
    background: #4ade80;
}

.status-indicator.offline {
    background: #666;
}

.friend-info {
    flex: 1;
    min-width: 0;
}

.friend-name {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-color);
    margin-bottom: 6px;
}

.friend-status {
    font-size: 13px;
    color: #888;
    margin-bottom: 4px;
}

.friend-status-msg {
    font-size: 12px;
    color: #666;
    font-style: italic;
    margin-top: 6px;
}

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

.btn-message,
.btn-remove,
.btn-view-profile,
.btn-block {
    padding: 8px 16px;
    border: none;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.btn-message {
    background: linear-gradient(135deg, var(--blood-red), var(--crimson));
    color: white;
}

.btn-message:hover {
    transform: scale(1.05);
}

.btn-remove {
    background: rgba(139, 0, 0, 0.1);
    color: var(--crimson);
    border: 1px solid var(--border-color);
}

.btn-remove:hover {
    background: rgba(139, 0, 0, 0.2);
}

.btn-view-profile {
    background: linear-gradient(135deg, var(--blood-red), var(--crimson));
    color: white;
}

.btn-view-profile:hover {
    transform: scale(1.05);
}

/* Requests */
.requests-section {
    margin-bottom: 40px;
}

.section-title {
    font-size: 24px;
    font-weight: 700;
    color: var(--crimson);
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 2px solid var(--border-color);
}

.requests-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.request-card {
    background: var(--card-background);
    border: 2px solid var(--border-color);
    border-radius: 8px;
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 15px;
    transition: all 0.2s ease;
}

.request-card:hover {
    border-color: var(--blood-red);
}

.request-avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--blood-red), var(--crimson));
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 700;
    font-size: 20px;
    flex-shrink: 0;
}

.request-info {
    flex: 1;
}

.request-name {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-color);
    margin-bottom: 4px;
}

.request-time {
    font-size: 13px;
    color: #666;
}

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

.btn-accept,
.btn-decline,
.btn-cancel {
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-accept {
    background: linear-gradient(135deg, #4ade80, #22c55e);
    color: white;
}

.btn-accept:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(74, 222, 128, 0.4);
}

.btn-decline,
.btn-cancel {
    background: rgba(139, 0, 0, 0.1);
    color: var(--crimson);
    border: 1px solid var(--border-color);
}

.btn-decline:hover,
.btn-cancel:hover {
    background: rgba(139, 0, 0, 0.2);
}

/* Search */
.search-container {
    margin-bottom: 30px;
}

.search-input {
    width: 100%;
    padding: 16px 20px;
    background: var(--card-background);
    border: 2px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-color);
    font-size: 16px;
    font-family: inherit;
    transition: all 0.2s ease;
}

.search-input:focus {
    outline: none;
    border-color: var(--blood-red);
    box-shadow: 0 0 20px rgba(139, 0, 0, 0.2);
}

.search-results-container {
    min-height: 400px;
}

.user-result-card {
    background: var(--card-background);
    border: 2px solid var(--border-color);
    border-radius: 12px;
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 12px;
    transition: all 0.2s ease;
}

.user-result-card:hover {
    border-color: var(--blood-red);
}

.user-avatar {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--blood-red), var(--crimson));
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 700;
    font-size: 24px;
    flex-shrink: 0;
}

.user-info {
    flex: 1;
}

.user-name {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-color);
    margin-bottom: 6px;
}

.user-stats {
    font-size: 13px;
    color: #666;
    display: flex;
    align-items: center;
    gap: 8px;
}

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

.btn-add-friend,
.btn-already-friend,
.btn-pending,
.btn-blocked {
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-add-friend {
    background: linear-gradient(135deg, var(--blood-red), var(--crimson));
    color: white;
}

.btn-add-friend:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(139, 0, 0, 0.4);
}

.btn-already-friend {
    background: rgba(74, 222, 128, 0.2);
    color: #22c55e;
    cursor: default;
}

.btn-pending {
    background: rgba(255, 165, 0, 0.2);
    color: #ff8800;
    cursor: default;
}

.btn-blocked {
    background: rgba(139, 0, 0, 0.2);
    color: var(--crimson);
    cursor: default;
}

.status-badge {
    padding: 6px 12px;
    background: rgba(139, 0, 0, 0.1);
    border-radius: 6px;
    color: #666;
    font-size: 13px;
}

/* Loading & Empty States */
.loading,
.empty-state,
.error-state {
    text-align: center;
    padding: 60px 20px;
    color: #666;
    font-size: 16px;
}

.empty-state {
    font-style: italic;
}

.error-state {
    color: var(--crimson);
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .friends-grid {
        grid-template-columns: 1fr;
    }
    
    .friends-header {
        flex-direction: column;
        gap: 20px;
    }
    
    .friends-actions {
        width: 100%;
        flex-direction: column;
    }
    
    .btn-search,
    .btn-requests,
    .btn-back {
        width: 100%;
        justify-content: center;
    }
    
    .friend-card {
        flex-direction: column;
        text-align: center;
    }
    
    .friend-actions {
        width: 100%;
    }
    
    .btn-message,
    .btn-remove,
    .btn-view-profile {
        width: 100%;
    }
    
    .request-card {
        flex-direction: column;
        text-align: center;
    }
    
    .request-actions {
        width: 100%;
        flex-direction: column;
    }
    
    .btn-accept,
    .btn-decline,
    .btn-cancel {
        width: 100%;
    }
    
    .user-result-card {
        flex-direction: column;
        text-align: center;
    }
    
    .user-actions {
        width: 100%;
        flex-direction: column;
    }
    
    .btn-add-friend,
    .btn-already-friend,
    .btn-pending,
    .btn-blocked {
        width: 100%;
    }
}
