/* =============================================================================
   ANIME WEBSITE - UNIFIED STYLESHEET
   Оптимизированный и структурированный CSS с полной поддержкой тем
============================================================================= */

/* =============================================================================
   1. БАЗОВЫЕ НАСТРОЙКИ И ПЕРЕМЕННЫЕ
============================================================================= */

/* Сброс стилей */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: "Roboto", "Arial", sans-serif;
}

/* CSS Переменные - Темная тема (по умолчанию) */
:root,
body.dark-theme {
    /* Цвета фона */
    --yt-bg-primary: #0f0f0f;
    --yt-bg-secondary: #212121;
    --yt-bg-hover: #3f3f3f;
    
    /* Цвета текста */
    --yt-text-primary: #f1f1f1;
    --yt-text-secondary: #aaaaaa;
    
    /* Акцентные цвета */
    --yt-accent: #ff0000;
    --yt-accent-color: #ff0000;
    --accent-color: #ff0000;
    
    /* Границы */
    --yt-border: #3f3f3f;
    --yt-border-color: #3f3f3f;
    
    /* Дополнительные переменные */
    --yt-spec-10-percent-layer: rgba(255, 255, 255, 0.1);
    --yt-spec-brand-background-solid: #ff0000;
    --yt-spec-text-primary: #f1f1f1;
    --yt-spec-text-secondary: #aaaaaa;
    
    /* Размеры */
    --yt-sidebar-width: 240px;
    --yt-sidebar-collapsed: 72px;
    --yt-header-height: 0px;
}

/* Светлая тема */
body.light-theme {
    /* Цвета фона */
    --yt-bg-primary: #ffffff;
    --yt-bg-secondary: #f9f9f9;
    --yt-bg-hover: #f2f2f2;
    
    /* Цвета текста */
    --yt-text-primary: #0f0f0f;
    --yt-text-secondary: #606060;
    
    /* Акцентные цвета */
    --yt-accent: #ff0000;
    --yt-accent-color: #ff0000;
    --accent-color: #ff0000;
    
    /* Границы */
    --yt-border: #e5e5e5;
    --yt-border-color: #e5e5e5;
    
    /* Дополнительные переменные */
    --yt-spec-10-percent-layer: rgba(0, 0, 0, 0.1);
    --yt-spec-brand-background-solid: #ff0000;
    --yt-spec-text-primary: #0f0f0f;
    --yt-spec-text-secondary: #606060;
}

/* Базовые стили body */
body {
    background: var(--yt-bg-primary);
    color: var(--yt-text-primary);
    min-height: 100vh;
    max-width: 100%;
    transition: background-color 0.3s ease, color 0.3s ease;
}

/* =============================================================================
   2. HEADER (ШАПКА САЙТА)
============================================================================= */

header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    min-height: var(--yt-header-height);
    background: var(--yt-bg-primary);
    border-bottom: 1px solid var(--yt-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 16px;
    z-index: 500;
    flex-wrap: wrap;
    gap: 16px;
    transition: background-color 0.3s ease, border-color 0.3s ease;
}

/* Левый блок header */
.header-left {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-shrink: 0;
    width: 200px;
}

/* Центральный блок header */
.header-center {
    flex: 1 1 auto;
    display: flex;
    justify-content: center;
    min-width: 300px;
}

/* Правый блок header */
.header-right {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
    flex-wrap: wrap;
}

/* Блок поиска */
.search-box {
    width: 100%;
    max-width: 600px;
    display: flex;
    align-items: center;
}

/* Заголовок */
header h1 {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 16px;
    font-weight: 500;
    margin: 0;
    color: var(--yt-text-primary);
}

header h1 a {
    color: var(--yt-text-primary);
    text-decoration: none;
    display: flex;
    align-items: center;
}

header h1::after {
    display: none;
}

header p {
    color: var(--yt-text-secondary);
    font-size: 14px;
    margin: 16px 0 0 0;
}

/* =============================================================================
   3. КНОПКИ УПРАВЛЕНИЯ
============================================================================= */

/* Кнопка меню */
.menu-btn {
    width: 40px;
    height: 40px;
    border: none;
    background: none;
    color: var(--yt-text-primary);
    cursor: pointer;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    transition: background 0.2s, color 0.3s ease;
}

.menu-btn:hover {
    background: var(--yt-bg-hover);
}

/* Кнопка переключения темы */
.theme-toggle-btn {
    width: 40px;
    height: 40px;
    border: none;
    background: none;
    color: var(--yt-text-primary);
    cursor: pointer;
    border-radius: 50%;
    font-size: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-left: 8px;
    transition: background 0.2s, color 0.3s ease;
}

.theme-toggle-btn:hover {
    background: var(--yt-bg-hover);
}

/* =============================================================================
   4. ЛОГОТИП
============================================================================= */

.logo-container {
    position: relative;
    height: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: visible;
}

.logo {
    position: absolute;
    max-height: 150px;
    width: auto;
    pointer-events: none;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 0;
    padding-left: 150px;
}

/* =============================================================================
   5. ПОИСК
============================================================================= */

/* Форма поиска */
.search-form {
    display: flex;
    width: 100%;
    position: relative;
    max-width: 400px;
}

/* Поле ввода поиска */
.search-input {
    flex: 1;
    height: 40px;
    background: var(--yt-bg-primary);
    border: 1px solid var(--yt-border);
    border-radius: 40px 0 0 40px;
    padding: 0 16px 0 100px;
    color: var(--yt-text-primary);
    font-size: 16px;
    transition: border-color 0.2s, background-color 0.3s ease, color 0.3s ease;
}

.search-input:focus {
    outline: none;
    border-color: #1c62b9;
}

/* Выбор типа поиска */
.search-type {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    background: var(--yt-bg-secondary);
    border: 1px solid var(--yt-border);
    border-radius: 4px;
    color: var(--yt-text-primary);
    padding: 4px 8px;
    font-size: 12px;
    cursor: pointer;
    appearance: none;
    width: auto;
    z-index: 1;
    transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
}

/* Кнопка поиска */
.search-button {
    width: 64px;
    height: 40px;
    background: var(--yt-bg-secondary);
    border: 1px solid var(--yt-border);
    border-left: none;
    border-radius: 0 40px 40px 0;
    color: var(--yt-text-primary);
    cursor: pointer;
    font-size: 18px;
    padding: 0;
    transition: background 0.2s, color 0.3s ease, border-color 0.3s ease;
    flex-shrink: 0;
}

.search-button:hover {
    background: var(--yt-bg-hover);
}

/* Результаты мгновенного поиска */
.instant-search-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--yt-bg-primary);
    border: 1px solid var(--yt-border-color);
    border-radius: 8px;
    margin-top: 8px;
    max-height: 400px;
    overflow-y: auto;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 1000;
    transition: background-color 0.3s ease, border-color 0.3s ease;
}

body.light-theme .instant-search-results {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.instant-search-results::-webkit-scrollbar {
    width: 8px;
}

.instant-search-results::-webkit-scrollbar-track {
    background: transparent;
}

.instant-search-results::-webkit-scrollbar-thumb {
    background: var(--yt-text-secondary);
    border-radius: 4px;
}

.instant-search-results::-webkit-scrollbar-thumb:hover {
    background: var(--yt-text-primary);
}

/* Список результатов */
.search-results-list {
    padding: 4px 0;
}

/* Элемент результата поиска */
.search-result-item {
    display: block;
    padding: 12px 16px;
    color: var(--yt-text-primary);
    text-decoration: none;
    border-left: 3px solid transparent;
    transition: all 0.2s ease;
}

.search-result-item:hover {
    background: var(--yt-bg-hover);
    border-left-color: var(--yt-accent-color);
}

.search-result-title {
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 2px;
    color: var(--yt-text-primary);
}

.search-result-subtitle {
    font-size: 12px;
    color: var(--yt-text-secondary);
}

/* Состояния загрузки и ошибок */
.search-loading,
.search-no-results {
    padding: 16px;
    text-align: center;
    color: var(--yt-text-secondary);
    font-size: 14px;
}

.search-loading::before {
    content: '';
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid var(--yt-text-secondary);
    border-top-color: transparent;
    border-radius: 50%;
    margin-right: 8px;
    animation: spin 0.6s linear infinite;
    vertical-align: middle;
}

.search-error {
    padding: 16px;
    text-align: center;
    color: #e74c3c;
    font-size: 14px;
}

/* =============================================================================
   6. ФИЛЬТРЫ
============================================================================= */

/* Контейнер кнопок фильтров */
.filter-buttons-container {
    display: flex;
    gap: 8px;
    align-items: center;
    margin-left: 8px;
}

/* Кнопка фильтра */
.filter-button {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    background: var(--yt-bg-secondary);
    border: 1px solid var(--yt-border);
    border-radius: 20px;
    color: var(--yt-text-primary);
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s ease;
    position: relative;
    max-width: 150px;
}

.filter-button:hover {
    background: var(--yt-bg-hover);
    border-color: var(--accent-color);
}

.filter-button.active {
    background: var(--accent-color);
    border-color: var(--accent-color);
}

.filter-icon {
    font-size: 16px;
}

.filter-text {
    font-weight: 500;
    white-space: nowrap;
}

/* Бейдж с количеством выбранных фильтров */
.filter-badge {
    position: absolute;
    top: -6px;
    right: -6px;
    background: var(--accent-color);
    color: white;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: bold;
    border: 2px solid var(--yt-bg-primary);
    transition: border-color 0.3s ease;
}

/* Кнопка сброса фильтров */
.filter-reset {
    padding: 8px 12px;
    background: rgba(255, 0, 0, 0.1);
    border: 1px solid rgba(255, 0, 0, 0.3);
    border-radius: 20px;
    color: var(--accent-color);
    cursor: pointer;
    font-size: 14px;
    font-weight: bold;
    transition: all 0.3s ease;
}

.filter-reset:hover {
    background: rgba(255, 0, 0, 0.2);
    border-color: var(--accent-color);
}

/* Информация о примененных фильтрах */
.filter-info {
    background: var(--yt-bg-secondary);
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 14px;
    transition: background-color 0.3s ease;
}

.filter-info strong {
    color: var(--yt-text-primary);
}

.clear-filter {
    background: var(--yt-bg-primary);
    border: 1px solid var(--yt-border);
    color: var(--yt-text-primary);
    padding: 8px 16px;
    border-radius: 18px;
    cursor: pointer;
    text-decoration: none;
    font-size: 14px;
    transition: all 0.3s ease;
}

.clear-filter:hover {
    background: var(--yt-bg-hover);
}

/* =============================================================================
   7. МОДАЛЬНЫЕ ОКНА ФИЛЬТРОВ
============================================================================= */

/* Модальное окно */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2000;
    padding: 20px;
}

/* Контент модального окна */
.modal-content {
    background: var(--yt-bg-secondary);
    border-radius: 12px;
    width: 100%;
    max-width: 900px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    overflow: hidden;
    transition: background-color 0.3s ease;
}

body.light-theme .modal-content {
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
}

/* Заголовок модального окна */
.modal-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--yt-border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: border-color 0.3s ease;
}

.modal-header h3 {
    font-size: 20px;
    font-weight: 600;
    color: var(--yt-text-primary);
    margin: 0;
    transition: color 0.3s ease;
}

.modal-header h2 {
    font-size: 20px;
    font-weight: 600;
    color: var(--yt-text-primary);
    margin: 0;
    transition: color 0.3s ease;
}

/* Кнопка закрытия модального окна */
.modal-close {
    background: none;
    border: none;
    color: var(--yt-text-secondary);
    font-size: 28px;
    cursor: pointer;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.modal-close:hover {
    background: var(--yt-bg-hover);
    color: var(--yt-text-primary);
}

/* Тело модального окна */
.modal-body {
    flex: 1;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

/* Подвал модального окна */
.modal-footer {
    padding: 16px 24px;
    border-top: 1px solid var(--yt-border);
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    transition: border-color 0.3s ease;
}

/* Кнопки модального окна */
.btn-apply,
.btn-cancel,
.btn-select-all,
.btn-clear-all {
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    border: none;
}

.btn-apply {
    background: var(--accent-color);
    color: white;
}

.btn-apply:hover {
    background: #cc0000;
}

.btn-cancel {
    background: transparent;
    color: var(--yt-text-primary);
    border: 1px solid var(--yt-border);
}

.btn-cancel:hover {
    background: var(--yt-bg-hover);
}

.btn-select-all,
.btn-clear-all {
    background: transparent;
    color: var(--yt-text-primary);
    border: 1px solid var(--yt-border);
    padding: 8px 16px;
    font-size: 13px;
}

.btn-select-all:hover,
.btn-clear-all:hover {
    background: var(--yt-bg-hover);
    border-color: var(--accent-color);
}

/* =============================================================================
   8. ФИЛЬТР ЖАНРОВ
============================================================================= */

/* Фиксированные элементы управления */
.fixed-controls {
    background: var(--yt-bg-secondary);
    padding: 20px 24px;
    border-bottom: 1px solid var(--yt-border);
    transition: background-color 0.3s ease, border-color 0.3s ease;
}

/* Элементы управления фильтром */
.filter-controls {
    display: flex;
    gap: 12px;
    align-items: center;
    margin-bottom: 16px;
}

/* Поле поиска жанров */
.search-genre-input {
    flex: 1;
    padding: 10px 16px;
    background: var(--yt-bg-primary);
    border: 1px solid var(--yt-border);
    border-radius: 8px;
    color: var(--yt-text-primary);
    font-size: 14px;
    min-width: 200px;
    transition: all 0.3s ease;
}

.search-genre-input:focus {
    outline: none;
    border-color: var(--accent-color);
}

.search-genre-input::placeholder {
    color: var(--yt-text-secondary);
}

/* Заголовки колонок жанров */
.genres-headers {
    display: flex;
    gap: 24px;
}

.genre-header {
    flex: 1;
}

.genre-header h4 {
    font-size: 16px;
    font-weight: 600;
    color: var(--yt-text-primary);
    margin: 0;
    transition: color 0.3s ease;
}

/* Прокручиваемая область с жанрами */
.scrollable-genres {
    flex: 1;
    overflow-y: auto;
    padding: 20px 24px;
}

.scrollable-genres::-webkit-scrollbar {
    width: 8px;
}

.scrollable-genres::-webkit-scrollbar-track {
    background: transparent;
}

.scrollable-genres::-webkit-scrollbar-thumb {
    background: var(--yt-bg-hover);
    border-radius: 4px;
}

.scrollable-genres::-webkit-scrollbar-thumb:hover {
    background: var(--yt-text-secondary);
}

/* Контейнер колонок жанров */
.genres-columns-container {
    display: flex;
    gap: 24px;
}

.genres-column {
    flex: 1;
}

/* Список жанров */
.genres-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* Чекбокс жанра */
.genre-checkbox {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    border-radius: 8px;
    background: var(--yt-bg-primary);
    cursor: pointer;
    transition: all 0.3s ease;
    border: 1px solid var(--yt-border);
}

body.dark-theme .genre-checkbox {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.genre-checkbox:hover {
    background: var(--yt-bg-hover);
    border-color: var(--accent-color);
}

body.dark-theme .genre-checkbox:hover {
    background: rgba(255, 255, 255, 0.1);
}

.genre-checkbox input[type="checkbox"] {
    appearance: none;
    -webkit-appearance: none;
    width: 20px;
    height: 20px;
    border: 2px solid var(--yt-border);
    border-radius: 4px;
    cursor: pointer;
    position: relative;
    transition: all 0.3s;
    background: var(--yt-bg-primary);
}

body.dark-theme .genre-checkbox input[type="checkbox"] {
    border: 2px solid rgba(255, 255, 255, 0.3);
    background: rgba(255, 255, 255, 0.05);
}

.genre-checkbox input[type="checkbox"]:checked {
    background: var(--accent-color);
    border-color: var(--accent-color);
}

.genre-checkbox input[type="checkbox"]:checked::after {
    content: '✓';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 12px;
    font-weight: bold;
}

.genre-checkbox input[type="checkbox"]:hover {
    border-color: var(--accent-color);
}

.genre-name {
    font-size: 14px;
    color: var(--yt-text-primary);
    font-weight: 500;
    flex: 1;
    transition: color 0.3s ease;
}

/* =============================================================================
   9. ФИЛЬТРЫ ТИПА И РЕЙТИНГА
============================================================================= */

.filter-options {
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-height: 400px;
    overflow-y: auto;
}

.filter-option {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    border-radius: 8px;
    background: var(--yt-bg-primary);
    cursor: pointer;
    transition: all 0.3s ease;
    border: 1px solid var(--yt-border);
}

body.dark-theme .filter-option {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.filter-option:hover {
    background: var(--yt-bg-hover);
    border-color: var(--accent-color);
}

body.dark-theme .filter-option:hover {
    background: rgba(255, 255, 255, 0.1);
}

.filter-option input[type="radio"] {
    appearance: none;
    -webkit-appearance: none;
    width: 20px;
    height: 20px;
    border: 2px solid var(--yt-border);
    border-radius: 50%;
    cursor: pointer;
    position: relative;
    transition: all 0.3s;
    background: var(--yt-bg-primary);
}

body.dark-theme .filter-option input[type="radio"] {
    border: 2px solid rgba(255, 255, 255, 0.3);
    background: rgba(255, 255, 255, 0.05);
}

.filter-option input[type="radio"]:checked {
    background: var(--accent-color);
    border-color: var(--accent-color);
}

.filter-option input[type="radio"]:checked::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 8px;
    height: 8px;
    background: white;
    border-radius: 50%;
}

.filter-option label {
    font-size: 14px;
    color: var(--yt-text-primary);
    font-weight: 500;
    flex: 1;
    cursor: pointer;
    transition: color 0.3s ease;
}



/* =============================================================================
   10. БОКОВАЯ ПАНЕЛЬ (SIDEBAR)
============================================================================= */

.sidebar {
    position: fixed;
    left: 0;
    top: var(--yt-header-height);
    width: var(--yt-sidebar-width);
    height: calc(100vh - var(--yt-header-height));
    background: var(--yt-bg-primary);
    border-right: 1px solid var(--yt-border);
    overflow-y: auto;
    overflow-x: hidden;
    transition: width 0.2s, transform 0.2s, background-color 0.3s ease, border-color 0.3s ease;
    z-index: 400;
}

.sidebar.collapsed {
    width: var(--yt-sidebar-collapsed);
}

.sidebar-item {
    display: flex;
    align-items: center;
    gap: 24px;
    padding: 10px 24px;
    color: var(--yt-text-primary);
    text-decoration: none;
    cursor: pointer;
    transition: background 0.2s, color 0.3s ease;
    white-space: nowrap;
}

.sidebar-item:hover {
    background: var(--yt-bg-hover);
}

.sidebar-item.active {
    background: var(--yt-bg-secondary);
}

.sidebar-icon {
    font-size: 20px;
    width: 24px;
    text-align: center;
    flex-shrink: 0;
}

.sidebar-text {
    font-size: 14px;
    font-weight: 400;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar.collapsed .sidebar-text {
    display: none;
}

.sidebar-divider {
    height: 1px;
    background: var(--yt-border);
    margin: 12px 0;
    transition: background-color 0.3s ease;
}

/* =============================================================================
   11. ОСНОВНОЙ КОНТЕНТ
============================================================================= */

.container {
    margin-left: var(--yt-sidebar-width);
    margin-top: var(--yt-header-height);
    padding: 24px;
    transition: margin-left 0.2s;
    max-width: 100%;
}

.container.expanded {
    margin-left: var(--yt-sidebar-collapsed);
}

/* =============================================================================
   12. СЕТКА АНИМЕ
============================================================================= */

.anime-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 16px;
    margin-bottom: 32px;
}

/* Карточка аниме */
.anime-card {
    cursor: pointer;
    text-decoration: none;
    color: var(--yt-text-primary);
    border-radius: 12px;
    overflow: hidden;
    transition: none;
}

/* Постер аниме */
.anime-poster {
    width: 100%;
    aspect-ratio: 2/3;
    object-fit: cover;
    border-radius: 12px;
    background: var(--yt-bg-secondary);
    transition: transform 0.2s, background-color 0.3s ease;
}

.anime-card:hover .anime-poster {
    transform: scale(1.02);
}

/* Информация об аниме */
.anime-info {
    padding: 12px 0;
}

.anime-title {
    font-size: 14px;
    font-weight: 500;
    line-height: 1.4;
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.anime-link {
    color: var(--yt-text-primary);
    text-decoration: none;
    display: block;
}

.anime-link:hover {
    color: var(--yt-text-primary);
}

/* =============================================================================
   13. ПАГИНАЦИЯ
============================================================================= */

.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    padding: 32px 0;
    flex-wrap: wrap;
}

.pagination a,
.pagination span {
    padding: 8px 16px;
    border-radius: 4px;
    text-decoration: none;
    color: var(--yt-text-primary);
    background: var(--yt-bg-secondary);
    border: 1px solid var(--yt-border);
    font-size: 14px;
    transition: background 0.2s, color 0.3s ease, border-color 0.3s ease;
}

.pagination a:hover {
    background: var(--yt-bg-hover);
}

.pagination .active {
    background: var(--yt-accent);
    border-color: var(--yt-accent);
}

.pagination .disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

/* =============================================================================
   14. ИНДИКАТОР ЗАГРУЗКИ
============================================================================= */

.loading-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    z-index: 9999;
    justify-content: center;
    align-items: center;
}

body.light-theme .loading-overlay {
    background: rgba(0, 0, 0, 0.5);
}

.loading-overlay.active {
    display: flex;
}

.loading-spinner {
    border: 4px solid var(--yt-border);
    border-top: 4px solid var(--yt-accent);
    border-radius: 50%;
    width: 50px;
    height: 50px;
    animation: spin 1s linear infinite;
}

.loading-text {
    color: var(--yt-text-primary);
    margin-top: 16px;
    font-size: 14px;
}

/* =============================================================================
   15. ПУСТОЕ СОСТОЯНИЕ
============================================================================= */

.container > div[style*="text-align: center"] {
    padding: 80px 20px;
    text-align: center;
}

.container > div[style*="text-align: center"] h2 {
    font-size: 24px;
    margin-bottom: 12px;
    color: var(--yt-text-primary);
}

.container > div[style*="text-align: center"] p {
    color: var(--yt-text-secondary);
    margin-bottom: 24px;
}

/* =============================================================================
   16. FOOTER (ПОДВАЛ)
============================================================================= */

footer {
    text-align: center;
    margin: 40px 0 0 0;
    padding: 25px;
    color: var(--yt-text-secondary);
    border-top: 1px solid var(--yt-border);
    transition: color 0.3s ease, border-color 0.3s ease;
}

/* =============================================================================
   17. АНИМАЦИИ
============================================================================= */

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* =============================================================================
   18. АДАПТИВНОСТЬ
============================================================================= */

/* Планшеты */
@media (max-width: 1024px) {
    .anime-list {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    }
}

/* Мобильные устройства - только минимальные изменения */
@media (max-width: 768px) {
    .container {
        padding: 16px;
        margin-left: 0;
    }
    
    .sidebar {
        transform: translateX(-100%);
    }

    .sidebar.show {
        transform: translateX(0);
    }

    .anime-list {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 12px;
    }
    
    /* Мгновенный поиск */
    .instant-search-results {
        max-height: 60vh;
        border-radius: 0 0 8px 8px;
    }
    
    .search-result-item {
        padding: 14px 16px;
    }
    
    .search-result-title {
        font-size: 15px;
    }
    
    /* Фильтры - минимальные изменения */
    .filter-button .filter-text {
        display: none;
    }
    
    /* Модальные окна */
    .modal-content {
        width: 95%;
        max-height: 85vh;
        margin: 20px;
    }
    
    .fixed-controls {
        padding: 20px 20px 16px 20px;
    }
    
    .scrollable-genres {
        padding: 0 20px 20px 20px;
    }
    
    .filter-controls {
        flex-direction: column;
        align-items: stretch;
    }
    
    .search-genre-input {
        min-width: 100%;
    }
    
    .genres-columns-container {
        flex-direction: column;
        gap: 16px;
    }
    
    .genres-headers {
        gap: 16px;
    }
    
    .btn-select-all, 
    .btn-clear-all, 
    .btn-apply, 
    .btn-cancel {
        flex: 1;
        text-align: center;
    }
    
    .filter-controls > * {
        width: 100%;
    }
}

/* Малые мобильные устройства */
@media (max-width: 640px) {
    .fixed-controls {
        padding: 16px;
    }
    
    .scrollable-genres {
        padding: 0 16px 16px 16px;
    }
    
    .modal-header, 
    .modal-footer {
        padding: 16px;
    }
    
    .genres-headers {
        flex-direction: column;
        gap: 12px;
    }
}

/* Десктоп - схлопнутый sidebar */
@media (min-width: 769px) {
    .sidebar.collapsed ~ .container {
        margin-left: var(--yt-sidebar-collapsed);
    }
}

/* =============================================================================
   КОНЕЦ ФАЙЛА
============================================================================= */