.friends-subscribers-page {
    min-height: calc(100vh - 72px);
    background: var(--body-bg);
    padding: 2rem 0;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

/* Заголовок страницы */
.page-header {
    background: var(--post-bg);
    border-radius: 16px;
    padding: 2rem;
    margin-bottom: 2rem;
    border: 1px solid var(--post-border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.page-title {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
}

.page-stats {
    display: flex;
    gap: 2rem;
}

.stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
}

.stat-label {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-top: 0.25rem;
}

.stat-item.pending .stat-value {
    color: var(--accent-color);
}

.stat-item.mutual .stat-value {
    color: #44b700;
}

/* Переключатель вкладок */
.tabs-container {
    background: var(--post-bg);
    border-radius: 16px;
    padding: 1.5rem;
    margin-bottom: 2rem;
    border: 1px solid var(--post-border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1.5rem;
}

.tabs {
    display: flex;
    gap: 0.5rem;
    background: var(--sidebar-bg);
    padding: 0.25rem;
    border-radius: 12px;
}

.tab-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    background: transparent;
    border: none;
    border-radius: 10px;
    color: var(--text-secondary);
    font-size: 0.9375rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
    min-width: 0;
}

.tab-btn:hover {
    color: var(--text-primary);
    background: rgba(var(--accent-color-rgb), 0.1);
}

.tab-btn.active {
    background: var(--button-primary-bg);
    color: var(--button-primary-text);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.tab-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    height: 20px;
    padding: 0 0.375rem;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 10px;
    font-size: 0.75rem;
    font-weight: 600;
    flex: 0 0 auto;
}

.tab-btn:not(.active) .tab-badge {
    background: var(--post-bg);
    color: var(--text-secondary);
}

.tab-notification {
    position: static;
    min-width: 18px;
    height: 18px;
    padding: 0 0.25rem;
    background: #ff4444;
    color: white;
    border-radius: 9px;
    font-size: 0.6875rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.8; transform: scale(1.05); }
}

/* Поиск */
.search-container {
    position: relative;
    max-width: 300px;
    flex-shrink: 0;
}

.search-icon {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-secondary);
    pointer-events: none;
}

.search-input {
    width: 100%;
    padding: 0.75rem 1rem 0.75rem 3rem;
    background: var(--input-bg);
    border: 1px solid var(--input-border);
    border-radius: 12px;
    font-size: 0.875rem;
    color: var(--text-primary);
    outline: none;
    transition: all 0.2s ease;
}

.search-input:focus {
    border-color: var(--accent-color);
    box-shadow: 0 0 0 3px rgba(var(--accent-color-rgb), 0.1);
}

/* Содержимое вкладок */
.tab-content {
    display: none;
    animation: fadeIn 0.3s ease;
}

.tab-content.active {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Секции */
.section {
    background: var(--post-bg);
    border-radius: 16px;
    padding: 1.5rem;
    margin-bottom: 2rem;
    border: 1px solid var(--post-border);
}

.pending-section {
    background: linear-gradient(135deg, rgba(var(--accent-color-rgb), 0.05), rgba(var(--accent-color-rgb), 0.02));
}

.outgoing-section {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.08), rgba(59, 130, 246, 0.025));
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.section-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

.section-title svg {
    color: var(--accent-color);
}

.outgoing-section .section-title svg {
    color: #3b82f6;
}

.section-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 24px;
    height: 24px;
    padding: 0 0.45rem;
    border-radius: 999px;
    background: rgba(var(--accent-color-rgb), 0.13);
    color: var(--accent-color);
    font-size: 0.75rem;
    font-weight: 700;
}

.outgoing-section .section-count {
    background: rgba(59, 130, 246, 0.14);
    color: #3b82f6;
}

.btn-text {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 8px;
    transition: all 0.2s ease;
}

.btn-text:hover {
    background: var(--sidebar-bg);
    color: var(--text-primary);
}

.request-section .btn-text svg {
    transition: transform 0.3s ease;
}

.request-section.collapsed .btn-text svg {
    transform: rotate(-90deg);
}

.request-section.collapsed .pending-grid {
    display: none;
}

/* Сетка карточек */
.grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
}

/* Карточка пользователя */
.card {
    background: var(--sidebar-bg);
    border-radius: 12px;
    padding: 1.5rem;
    transition: all 0.2s ease;
    position: relative;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.card.hidden {
    display: none;
}

.card-header {
    display: flex;
    justify-content: center;
    position: relative;
    margin-bottom: 1rem;
}

.card-avatar,
.card-avatar-placeholder {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    object-fit: cover;
}

.card-avatar-placeholder {
    background: linear-gradient(135deg, var(--accent-color), var(--button-primary-bg));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--button-primary-text);
}

.online-indicator {
    position: absolute;
    bottom: 5px;
    right: calc(50% - 45px);
    width: 16px;
    height: 16px;
    background: #44b700;
    border-radius: 50%;
    border: 3px solid var(--sidebar-bg);
}

.card-menu {
    position: absolute;
    top: 0;
    right: 0;
}

.card-menu-btn {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: transparent;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--text-secondary);
    transition: all 0.2s ease;
}

.card-menu-btn:hover {
    background: var(--post-bg);
    color: var(--text-primary);
}

.card-menu-btn.active {
    background: var(--post-bg);
    color: var(--accent-color);
}

/* Тело карточки */
.card-body {
    text-align: center;
    flex: 1 1 auto;
}

.card-name {
    display: block;
    font-weight: 600;
    color: var(--text-primary);
    text-decoration: none;
    font-size: 1rem;
    margin-bottom: 0.25rem;
    transition: color 0.2s ease;
}

.card-name:hover {
    color: var(--accent-color);
}

.card-username {
    display: block;
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-bottom: 0.75rem;
}

.card-location {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.25rem;
    font-size: 0.8125rem;
    color: var(--text-secondary);
    margin-bottom: 0.75rem;
}

.card-location svg {
    flex-shrink: 0;
}

.card-status {
    display: flex;
    justify-content: center;
    font-size: 0.8125rem;
    margin-bottom: 0.5rem;
}

.status-online,
.status-offline {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    max-width: 100%;
    padding: 0.34rem 0.62rem;
    border-radius: 999px;
    border: 1px solid rgba(148, 163, 184, 0.2);
    background: rgba(148, 163, 184, 0.1);
    color: var(--text-secondary);
    font-size: 0.75rem;
    font-weight: 650;
    line-height: 1;
}

.status-online::before,
.status-offline::before {
    content: '';
    width: 0.45rem;
    height: 0.45rem;
    flex: 0 0 0.45rem;
    border-radius: 50%;
    background: currentColor;
}

.status-online {
    color: #22c55e;
    border-color: rgba(34, 197, 94, 0.32);
    background: rgba(34, 197, 94, 0.12);
}

.status-online::before {
    box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.45);
    animation: connection-status-pulse 2s infinite;
}

.status-offline {
    color: var(--text-secondary);
    border-color: rgba(148, 163, 184, 0.24);
    background: rgba(148, 163, 184, 0.1);
}

.status-offline::before {
    background: #9ca3af;
}

@keyframes connection-status-pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.45);
    }
    70% {
        box-shadow: 0 0 0 7px rgba(34, 197, 94, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(34, 197, 94, 0);
    }
}

.card-date {
    display: block;
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-top: 0.5rem;
    margin-bottom: 0.75rem;
}

.request-direction-badge {
    display: inline-flex;
    align-items: center;
    width: fit-content;
    margin: 0.1rem auto 0.2rem;
    padding: 0.3rem 0.58rem;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 700;
    line-height: 1.15;
}

.request-direction-badge.outgoing {
    border: 1px solid rgba(59, 130, 246, 0.25);
    background: rgba(59, 130, 246, 0.12);
    color: #3b82f6;
}

.card-stats {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin: 0.75rem 0;
    padding: 0.75rem;
    background: var(--post-bg);
    border-radius: 8px;
}

.card-stats .stat {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    font-size: 0.8125rem;
    color: var(--text-secondary);
}

.card-stats .stat svg {
    flex-shrink: 0;
    opacity: 0.7;
}

/* Действия карточки */
.card-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 1rem;
}

.card-actions .btn {
    flex: 1;
}

.cancel-request-btn:hover:not(:disabled) {
    border-color: rgba(239, 68, 68, 0.45);
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
}

/* Кнопки */
/* Кнопки */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.625rem 1rem;
    font-size: 0.875rem;
    font-weight: 500;
    line-height: 1.2; /* Уменьшено */
    border-radius: 8px;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
}

.btn-primary {
    background: var(--button-primary-bg);
    color: var(--button-primary-text);
}

.btn-primary:hover:not(:disabled) {
    opacity: 0.9;
    transform: translateY(-1px);
}

.btn-secondary {
    background: var(--button-secondary-bg);
    color: var(--text-primary);
    border: 1px solid var(--post-border);
}

.btn-secondary:hover:not(:disabled) {
    background: var(--sidebar-bg);
}

.btn-sm {
    padding: 0.5rem 0.875rem; /* Вернул меньший padding */
    font-size: 0.8125rem;
    line-height: 1.2;
    height: auto;
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.btn .spinner {
    display: inline-block;
    width: 14px;
    height: 14px;
    border: 2px solid currentColor;
    border-right-color: transparent;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Выпадающее меню друга (из friends.css) */
.friend-dropdown {
    position: fixed;
    background: var(--post-bg);
    border: 1px solid var(--post-border);
    border-radius: 12px;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.15);
    min-width: 200px;
    z-index: 1000;
    overflow: hidden;
}

.friend-menu-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    width: 100%;
    padding: 0.75rem 1rem;
    background: transparent;
    border: none;
    color: var(--text-primary);
    font-size: 0.875rem;
    cursor: pointer;
    transition: background 0.2s ease;
    text-align: left;
}

.friend-menu-item:hover {
    background: var(--sidebar-bg);
}

.friend-menu-item.text-danger {
    color: var(--error-color);
}

/* Пустые состояния */
.empty-state,
.no-results {
    text-align: center;
    padding: 3rem 2rem;
    color: var(--text-secondary);
}

.empty-state svg,
.no-results svg {
    margin-bottom: 1.5rem;
    opacity: 0.3;
}

.empty-state h3 {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.empty-state p,
.no-results p {
    margin-bottom: 1.5rem;
}

.no-results {
    display: none;
    padding: 2rem;
}

/* Анимации */
@keyframes fadeOut {
    from { opacity: 1; transform: scale(1); }
    to { opacity: 0; transform: scale(0.95); }
}

.card.removing {
    animation: fadeOut 0.3s ease forwards;
}

/* Адаптивность */
@media (max-width: 768px) {
    .page-header {
        flex-direction: column;
        gap: 1.5rem;
        text-align: center;
    }
    
    .page-stats {
        justify-content: center;
        flex-wrap: wrap;
    }
    
    .tabs-container {
        flex-direction: column;
    }
    
    .tabs {
        width: 100%;
        justify-content: center;
    }
    
    .search-container {
        max-width: 100%;
        width: 100%;
    }
    
    .grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .page-title {
        font-size: 1.5rem;
    }
    
    .page-stats {
        gap: 1rem;
    }
    
    .stat-value {
        font-size: 1.25rem;
    }
    
    .tabs {
        flex-direction: column;
        width: 100%;
    }
    
    .tab-btn {
        justify-content: center;
        width: 100%;
        padding: 0.75rem 1rem;
    }
    
    .card {
        padding: 1rem;
    }
    
    .card-actions {
        flex-direction: column;
    }
    
    .card-stats {
        flex-direction: column;
        gap: 0.5rem;
    }
}
