:root {
    --primary-color: #0088cc;
    --secondary-color: #f8f9fa;
    --accent-color: #17bf63;
    --text-color: #333333;
    --light-text: #6c757d;
    --shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    --transition: all 0.3s ease;
    /* Новые переменные для лайка */
    --like-button-bg: white;
    --like-button-border: #e0e0e0;
    --like-icon-default: #9e9e9e;
    --like-icon-liked: #ff5252;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
}

body {
    background-color: var(--secondary-color);
    color: var(--text-color);
    padding-bottom: 120px;
    transition: var(--transition);
}

.container {
    max-width: 100%;
    padding: 15px;
    animation: fadeIn 0.5s ease;
    position: relative;
}

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

.header {
    text-align: center;
    margin-bottom: 25px;
    padding-top: 15px;
}

.header h2 {
    color: var(--primary-color);
    font-size: 1.8rem;
    margin-bottom: 8px;
}

.header p {
    color: var(--light-text);
    font-size: 1rem;
}

.bottom-tabs {
    position: fixed;
    /* Фиксируем внизу экрана без смещений */
    bottom: 16px;
    left: 16px;  /* Отступ от левого края */
    right: 16px; /* Отступ от правого края */
    /* Убираем transform и left: 50% */
    /* width: calc(100% - 32px); */
    max-width: 500px;
    /* Центрируем блок с максимальной шириной */
    margin: 0 auto;
    
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: white;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12), 0 1px 0 rgba(0, 0, 0, 0.03);
    border-radius: 20px;
    padding: 8px;
    box-sizing: border-box;
    z-index: 1000;
}

/* Стиль индикатора остается без изменений */
.tab-indicator {
    position: absolute;
    left: 0;
    bottom: 8px;
    height: 44px;
    width: 0;
    background-color: var(--primary-color);
    border-radius: 14px;
    box-shadow: 0 2px 6px rgba(0, 136, 204, 0.3);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 0;
}

/* Стиль вкладок остается без изменений */
.bottom-tab {
    flex: 1;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.0rem;
    font-weight: 500;
    cursor: pointer;
    color: var(--light-text);
    border-radius: 14px;
    background-color: transparent;
    transition: color 0.2s ease;
    margin: 0;
    user-select: none;
    -webkit-user-select: none;
    /* white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    z-index: 1;
    position: relative;
    padding: 0 8px; */
    white-space: normal; 
    text-align: center; /* Центрируем текст */
    z-index: 1;
    position: relative;
    padding: 4px 8px; /* Немного увеличен вертикальный padding */
}

.bottom-tab:hover {
    color: var(--primary-color);
}

.bottom-tab.active {
    color: white; 
    background-color: transparent;
    box-shadow: none;
}

@keyframes tabUnderline {
    from { transform: scaleX(0); }
    to { transform: scaleX(1); }
}

.tab-content {
    display: none;
    animation: fadeInContent 0.4s ease;
}

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

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

.card {
    background: white;
    border-radius: 14px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: var(--shadow);
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

/* Стиль для основного контента карточки (информация + плашки) */
.card-content {
    display: flex;
    flex-direction: column;
    /* Убедимся, что контент не перекрывается кнопкой лайка */
    padding-right: 50px; /* Примерный размер кнопки лайка + отступ */
    position: relative; /* Для позиционирования относительно этого блока */
}

.card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12);
}

.premium-card {
    border: 2px solid #ffc107;
    background: linear-gradient(135deg, #fff9e6 0%, #fff3cc 100%);
}

.premium-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    background-color: #ffc107;
    color: #333;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.7rem;
    font-weight: bold;
}

.channel-icon-container {
    display: flex;
    align-items: center;
    margin-bottom: 10px;
}

.channel-icon {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    object-fit: cover;
    margin-right: 12px;
    border: 2px solid #e5e7eb;
}

.channel-info {
    flex: 1;
}

.card h3 {
    font-size: 1.2rem;
    margin-bottom: 5px;
    color: var(--primary-color);
}

.card p {
    color: var(--light-text);
    margin-bottom: 8px;
    font-size: 0.95rem;
}

/* === СТИЛИ ДЛЯ КНОПОК ДЕЙСТВИЙ === */
/* Обновленный стиль для области действий (только кнопка лайка) */
.actions {
    display: flex;
    justify-content: flex-end;
    /* Позиционируем абсолютно относительно .card-content */
    position: absolute;
    top: 10px; /* Отступ сверху, совпадает с padding кликабельной области */
    right: 0;
    margin: 0;
    height: auto;
    width: auto;
    z-index: 1; /* Убедимся, что кнопка поверх */
}

.btn {
    display: inline-block;
    padding: 10px 20px;
    background: var(--primary-color);
    color: white;
    border-radius: 12px;
    text-decoration: none;
    text-align: center;
    font-weight: 500;
    border: none;
    cursor: pointer;
    transition: var(--transition);
    flex: 1; /* Кнопка "Перейти" занимает всё доступное пространство */
}

.btn:hover {
    background: #0078b4;
    transform: translateY(-2px);
}

/* Стиль для увеличенной кнопки лайка */
.like-btn {
    background: transparent;
    border: none;
    width: auto;
    height: auto;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition);
    flex-shrink: 0;
    padding: 12px; /* Увеличенный отступ вокруг иконки */
    border-radius: 6px; /* Немного больше скругление */
}

/*
.like-btn:hover {
    background-color: rgba(0, 0, 0, 0.05);
    transform: scale(1.1);
}
*/

/* Увеличенная иконка лайка */
.like-icon {
    width: 28px; /* Увеличена с 20px до 28px */
    height: 28px; /* Увеличена с 20px до 28px */
    fill: var(--like-icon-default);
    transition: fill 0.3s ease;
}

.like-btn.liked .like-icon {
    fill: var(--like-icon-liked);
}

/* Анимация при клике */
.like-btn.clicked .like-icon {
    animation: pulse 0.3s ease;
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.2); }
    100% { transform: scale(1); }
}

.likes {
    display: flex;
    align-items: center;
    margin-top: 12px;
    color: var(--light-text);
    font-size: 0.9rem;
}

.likes span {
    margin-left: 5px;
}

.loading {
    text-align: center;
    padding: 20px;
    color: var(--light-text);
}

.fade-out {
    animation: fadeOut 0.3s ease;
}

.help-section {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 14px;
    margin-top: 30px;
    text-align: center;
}

.help-btn {
    background: #6c757d;
    margin: 15px auto;
}

.help-section h3 {
    color: var(--primary-color);
    margin-bottom: 15px;
}

.to-top-btn {
    position: fixed;
    bottom: 80px;
    right: 20px;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    font-size: 20px;
    cursor: pointer;
    display: none;
    z-index: 1000;
}

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

.search-container {
    display: flex;
    align-items: center;
    margin-bottom: 20px;
    gap: 10px;
    position: relative;
}

.search-bar {
    flex: 1;
    display: flex;
    align-items: center;
    background: white;
    border-radius: 12px;
    padding: 12px 15px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    transition: var(--transition);
    margin-bottom: 0;
    min-height: 46px;
}

.search-bar input {
    border: none;
    outline: none;
    flex: 1;
    font-size: 1rem;
    color: var(--text-color);
    height: 22px;
    line-height: 22px;
}

.search-bar input::placeholder {
    color: var(--light-text);
}

.search-bar:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.1);
}

.filter-btn {
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 12px;
    padding: 12px 15px;
    cursor: pointer;
    font-weight: 500;
    transition: var(--transition);
    white-space: nowrap;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    min-width: 100px;
    min-height: 46px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.filter-btn:hover {
    background: #0078b4;
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.1);
}

.filter-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    background: white;
    border-radius: 12px;
    box-shadow: var(--shadow);
    z-index: 1000;
    display: none;
    flex-direction: column;
    padding: 10px 0;
    margin-top: 5px;
    min-width: 180px;
    border: 1px solid #e5e7eb;
}

.filter-dropdown.show {
    display: flex;
}

.filter-option {
    padding: 12px 20px;
    cursor: pointer;
    transition: background-color 0.2s ease;
    color: var(--text-color);
    text-decoration: none;
    display: block;
}

.filter-option:hover {
    background-color: var(--secondary-color);
}

.filter-option.active {
    background-color: #e3f2fd;
    color: var(--primary-color);
    font-weight: 500;
}

.no-results {
    text-align: center;
    padding: 20px;
    color: var(--light-text);
    font-style: italic;
}

/* Стили для плашек подписчиков и лайков */
.subscribers-mini {
    display: flex;
    justify-content: flex-start;
    align-items: center;
    gap: 10px;
    margin-top: 0; /* Убираем верхний отступ, так как он теперь после кликабельной области */
    padding: 0 10px 10px 10px; /* Внутренние отступы, особенно снизу */
}

.subscribers-badge,
.likes-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.9em;
    font-weight: 500;
    border: 1px solid;
    text-align: center;
    min-height: 32px;
}

.subscribers-badge {
    background: #e8f4fd;
    color: #1976d2;
    border-color: #bbdefb;
}

.likes-badge {
    background: #ffebee;
    color: #c62828;
    border-color: #ffcdd2;
    cursor: pointer;
}

.likes-badge:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 8px rgba(255, 97, 97, 0.2);
}

.likes-badge.clicked {
    transform: scale(1.1);
    box-shadow: 0 8px 16px rgba(255, 97, 97, 0.3);
    animation: pulse 0.3s ease-out;
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); }
}

/* Иконка лайка рядом с числом */
.likes-icon-inline {
    width: 16px;
    height: 16px;
    fill: #c62828;
    vertical-align: middle;
    margin-right: 4px;
}

/* Стиль для контейнера иконки/буквы */
.channel-icon-container {
    display: flex;
    align-items: center;
    margin-bottom: 10px;
}

/* Стиль для изображения-иконки */
.channel-icon {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    object-fit: cover;
    margin-right: 12px;
    border: 2px solid #e5e7eb;
    /* Скрываем, если нет src */
    display: none;
}

/* Показываем иконку, только если у нее есть src */
.channel-icon[src]:not([src=""]) {
    display: block;
}

/* Новый стиль для элемента с буквой */
.channel-letter-badge {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 12px;
    border: 2px solid #e5e7eb;
    font-size: 20px;
    font-weight: bold;
    color: white;
    background-color: var(--primary-color); /* Используем основной цвет из :root */
    flex-shrink: 0; /* Не сжимается */
}

/* Стиль для кликабельной области */
.channel-clickable-area {
    display: flex;
    align-items: center;
    text-decoration: none;
    color: inherit;
    cursor: pointer;
    border-radius: 12px;
    padding: 10px;
    transition: background-color 0.2s ease;
    /* Убираем нижний margin, так как плашки теперь ниже */
    margin-bottom: 10px;
}

.channel-clickable-area:hover {
    background-color: rgba(0, 0, 0, 0.05);
}

/* Стили для текста внутри кликабельной области */
.channel-info h3 {
    margin-bottom: 0;
    transition: color 0.2s ease;
}

.channel-clickable-area:hover .channel-info h3 {
    color: var(--primary-color);
}