/* Основные стили для всего сайта */
:root {
    --primary-color: #b69e40;
    --secondary-color: #2c3e50;
    --accent-color: #e67e22;
    --light-bg: #f8f9fa;
    --dark-bg: #2c3e50;
    --text-color: #333;
    --text-light: #666;
    --border-color: #ddd;
    --success-color: #27ae60;
    --warning-color: #f39c12;
    --shadow: 0 2px 10px rgba(0,0,0,0.1);
    --transition: all 0.3s ease;
}

/* Общие стили */
body {
    font-family: 'Open Sans', sans-serif;
    color: var(--text-color);
    line-height: 1.6;
    margin: 0;
    padding: 0;
}

h1, h2, h3, h4 {
    font-family: 'Playfair Display', serif;
    font-weight: 700;
}

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

/* Шапка */
.header-top {
    background: #ffffff;
    padding: 15px 0;
    border-bottom: 1px solid #eaeaea;
}

.header-top-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 30px;
}

.site-logo {
    display: flex;
    align-items: center;
    gap: 15px;
    text-decoration: none;
}

.logo-mark {
    position: relative;
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, #b69e40 0%, #d4af37 100%);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 15px rgba(182, 158, 64, 0.25);
    transition: transform 0.3s ease;
}

.logo-link {
    text-decoration: none;
    color: inherit;
    transition: transform 0.2s ease;
}

.logo-link:hover {
    transform: scale(1.02);
}

.logo-link:hover .logo-mark {
    transform: rotate(5deg) scale(1.05);
}

.logo-initial {
    font-family: 'Playfair Display', serif;
    font-size: 36px;
    font-weight: 900;
    color: white;
    text-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.logo-dot {
    position: absolute;
    bottom: 10px;
    right: 10px;
    width: 10px;
    height: 10px;
    background: white;
    border-radius: 50%;
    border: 2px solid #b69e40;
}

.logo-name {
    display: flex;
    flex-direction: column;
    line-height: 1.1;
}

.logo-nake {
    font-family: 'Playfair Display', serif;
    font-size: 32px;
    font-weight: 700;
    color: #b69e40;
    letter-spacing: -0.5px;
}

.logo-rosine {
    font-family: 'Playfair Display', serif;
    font-size: 32px;
    font-weight: 700;
    color: #2c3e50;
    letter-spacing: -0.5px;
}

.site-slogan {
    font-size: 13px;
    color: #7f8c8d;
    margin-top: 5px;
    font-weight: 500;
    letter-spacing: 0.5px;
}

/* Рекламный блок */
.top-ad {
    flex: 1;
    max-width: 728px;
    text-align: center;
    min-height: 90px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f8f9fa;
    border-radius: 6px;
    padding: 5px;
}

/* Основная навигация */
.main-navigation {
    background: #2c3e50;
    padding: 0;
}

.nav-menu {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
}

.nav-menu li {
    flex: 1;
    text-align: center;
}

.nav-menu a {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 15px 10px;
    color: rgba(255, 255, 255, 0.9);
    text-decoration: none;
    font-size: 15px;
    font-weight: 500;
    transition: all 0.3s ease;
    border-bottom: 3px solid transparent;
}

.nav-menu a:hover {
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border-bottom-color: #b69e40;
}

.nav-menu .active a {
    background: rgba(182, 158, 64, 0.2);
    color: white;
    border-bottom-color: #b69e40;
}

.nav-menu i {
    font-size: 16px;
    opacity: 0.9;
}

/* Нижняя часть шапки */
.header-bottom {
    background: #f8f9fa;
    padding: 15px 0;
    border-bottom: 1px solid #eaeaea;
}

.header-bottom-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

/* Поиск */
.search-container {
    flex: 1;
    max-width: 600px;
}

.search-form {
    width: 100%;
}

.search-group {
    display: flex;
    position: relative;
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0,0,0,0.08);
    border: 2px solid transparent;
    transition: border-color 0.3s ease;
}

.search-group:focus-within {
    border-color: #b69e40;
}

.search-input {
    flex: 1;
    padding: 12px 20px;
    border: none;
    font-size: 15px;
    color: #2c3e50;
    background: transparent;
    outline: none;
}

.search-input::placeholder {
    color: #95a5a6;
}

.search-input:focus {
    background: #f8f9fa;
}

.search-btn {
    background: linear-gradient(135deg, #b69e40 0%, #d4af37 100%);
    color: white;
    border: none;
    padding: 0 25px;
    cursor: pointer;
    font-weight: 600;
    font-size: 15px;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
    min-width: 100px;
    justify-content: center;
}

.search-btn:hover {
    background: linear-gradient(135deg, #a58c36 0%, #c4a028 100%);
}

.search-btn i {
    font-size: 16px;
}

.search-text {
    display: inline-block;
}

.search-hint {
    margin-top: 8px;
    font-size: 12px;
    color: #7f8c8d;
    padding: 0 5px;
}

/* Действия пользователя */
.user-actions {
    display: flex;
    align-items: center;
    gap: 15px;
}

.theme-switcher {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 2px solid #dfe6e9;
    background: white;
    color: #f39c12;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    transition: all 0.3s ease;
}

.theme-switcher:hover {
    background: #f39c12;
    color: white;
    border-color: #f39c12;
    transform: rotate(30deg);
}

.notifications-btn {
    position: relative;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 2px solid #dfe6e9;
    background: white;
    color: #3498db;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    transition: all 0.3s ease;
}

.notifications-btn:hover {
    background: #3498db;
    color: white;
    border-color: #3498db;
}

.notification-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background: #e74c3c;
    color: white;
    font-size: 11px;
    font-weight: bold;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.auth-buttons {
    display: flex;
    gap: 10px;
}

.btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: 6px;
    text-decoration: none;
    font-weight: 600;
    font-size: 14px;
    transition: all 0.3s ease;
}

.btn-login {
    background: white;
    color: #2c3e50;
    border: 2px solid #dfe6e9;
}

.btn-login:hover {
    background: #f8f9fa;
    border-color: #b69e40;
    color: #b69e40;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.btn-register {
    background: linear-gradient(135deg, #3498db 0%, #2980b9 100%);
    color: white;
    border: 2px solid transparent;
}

.btn-register:hover {
    background: linear-gradient(135deg, #2980b9 0%, #21618c 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(41, 128, 185, 0.2);
}

/* Мобильное меню */
.mobile-menu-btn {
    display: none;
    flex-direction: column;
    justify-content: space-between;
    width: 30px;
    height: 24px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
}

.mobile-menu-btn span {
    width: 100%;
    height: 3px;
    background: #2c3e50;
    border-radius: 3px;
    transition: all 0.3s ease;
}

.mobile-menu-btn:hover span {
    background: #b69e40;
}

/* Герой баннер */
.hero-banner {
    background: linear-gradient(135deg, var(--dark-bg) 0%, #34495e 100%);
    color: white;
    padding: 60px 0;
    text-align: center;
}

.hero-banner h1 {
    font-size: 2.5rem;
    margin-bottom: 20px;
}

.hero-description {
    font-size: 1.2rem;
    max-width: 600px;
    margin: 0 auto 30px;
    opacity: 0.9;
}

.hero-stats {
    display: flex;
    justify-content: center;
    gap: 40px;
    margin: 30px 0;
}

.stat-item {
    text-align: center;
}

.stat-number {
    display: block;
    font-size: 2rem;
    font-weight: bold;
    color: var(--primary-color);
}

.stat-label {
    font-size: 0.9rem;
    opacity: 0.8;
}

.hero-search {
    max-width: 600px;
    margin: 30px auto;
    display: flex;
    gap: 10px;
}

.hero-search input {
    flex: 1;
    padding: 15px 20px;
    border: none;
    border-radius: 5px;
    font-size: 1rem;
}

.btn-primary {
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 15px 30px;
    border-radius: 5px;
    cursor: pointer;
    font-weight: 600;
    transition: var(--transition);
}

.btn-primary:hover {
    background: #a58c36;
}

/* Подвал */
.main-footer {
    background: var(--dark-bg);
    color: white;
    padding: 50px 0 20px;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 40px;
    margin-bottom: 40px;
}

.footer-section h3 {
    color: white;
    margin-bottom: 20px;
    font-size: 1.3rem;
}

.footer-links {
    list-style: none;
    padding: 0;
    margin: 0;
}

.footer-links li {
    margin-bottom: 10px;
}

.footer-links a {
    color: #ccc;
    text-decoration: none;
    transition: var(--transition);
}

.footer-links a:hover {
    color: var(--primary-color);
}

.social-links {
    display: flex;
    gap: 15px;
    margin-top: 20px;
}

.social-links a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: rgba(255,255,255,0.1);
    border-radius: 50%;
    color: white;
    text-decoration: none;
    transition: var(--transition);
}

.social-links a:hover {
    background: var(--primary-color);
    transform: translateY(-3px);
}

.subscribe-form {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.subscribe-form input {
    padding: 10px 15px;
    border: none;
    border-radius: 4px;
    font-size: 0.9rem;
}

.btn-subscribe-footer {
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 10px;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 600;
    transition: var(--transition);
}

.btn-subscribe-footer:hover {
    background: #a58c36;
}

.footer-bottom {
    text-align: center;
    padding-top: 20px;
    border-top: 1px solid rgba(255,255,255,0.1);
    color: #aaa;
    font-size: 0.9rem;
}

.disclaimer {
    font-style: italic;
    margin: 10px 0;
    font-size: 0.85rem;
}

/* Выпадающее меню для подписки */
.dropdown {
    position: relative;
}

.dropdown-toggle {
    display: flex;
    align-items: center;
    gap: 6px;
}

.dropdown-arrow {
    font-size: 10px;
    margin-left: 4px;
    transition: transform 0.3s ease;
}

.dropdown:hover .dropdown-arrow {
    transform: rotate(180deg);
}

.search-box {
    position: relative;
    max-width: 400px;
}

.search-box input {
    width: 100%;
    padding: 10px 15px;
    border: none;
    border-radius: 25px;
    font-size: 0.9rem;
}

.search-box button {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--primary-color);
    cursor: pointer;
}

/* Основной контент */
.content-wrapper {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 30px;
    margin: 40px 0;
}

/* Боковая колонка */
.sidebar {
    width: 320px;
    display: flex;
    flex-direction: column;
    gap: 25px;
    position: sticky;
    top: 20px;
    align-self: flex-start;
}

/* Виджеты */
.sidebar-widget {
    background: white;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
}

.sidebar-widget:hover {
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.12);
    transform: translateY(-5px);
}

.widget-records-enhanced {
    background: white;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.08);
    margin-bottom: 25px;
    position: relative;
    border: 1px solid #eaeaea;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.widget-records-enhanced:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 40px rgba(243, 156, 18, 0.12);
    border-color: #f39c12;
}

/* Виджет поиска по жанрам - обновленные стили */
.widget-genres-search .search-section {
    padding: 10px;
}

.search-section .search-box {
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #eaeaea;
    transition: all 0.3s ease;
    overflow: hidden;
    padding: 8px;
}

.search-section .search-box:hover {
    border-color: #667eea;
    box-shadow: 0 5px 20px rgba(102, 126, 234, 0.1);
}

.search-section .search-input-container {
    position: relative;
    border-bottom: 1px solid #f0f0f0;
    display: flex;
    gap: 4px;
    margin-bottom: 6px;
    width: 100%;
}

.search-section .search-input {
    flex: 1;
    height: 36px;
    padding: 0 40px 0 10px;
    font-size: 0.9rem;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    background: white;
    min-width: 0;
    width: 100%;
    box-sizing: border-box;
}

.search-section .search-input:focus {
    background: #f8f9fa;
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 2px rgba(52, 152, 219, 0.2);
}

.search-section .search-input::placeholder {
    color: #95a5a6;
    font-weight: 400;
}

.search-section .search-btn {
    width: 28px !important;
    height: 28px;
    background: linear-gradient(135deg, #3498db 0%, #764ba2 100%);
    border: none;
    border-radius: 6px;
    color: white;
    font-size: 14px;
    cursor: pointer;
    flex: 0 0 28px; /* Запрещаем растягивание и сжатие */
    flex-shrink: 0; /* Не позволяет сжиматься меньше 28px */
    flex-grow: 0;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
    box-shadow: 0 4px 10px rgba(102, 126, 234, 0.3);
    box-sizing: border-box;
    right: 4px; /* Отступ от правого края */
    padding: 0;

}

.search-section .search-btn:hover {
    background: #2980b9;
    box-shadow: 0 6px 15px rgba(102, 126, 234, 0.4);
}

.search-section .search-hint {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 13px;
    color: #7f8c8d;
    padding: 15px 20px;
    background: linear-gradient(135deg, #f8f9fa 0%, #ecf0f1 100%);
    border-top: 1px solid #f0f0f0;
}

.search-section .search-hint i {
    color: #f1c40f;
    font-size: 14px;
    flex-shrink: 0;
}

.search-section .search-hint span {
    line-height: 1.4;
    font-weight: 500;
}

/* Популярные жанры */
.popular-genres {
    margin-bottom: 25px;
}

.popular-genres .section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 12px;
    border-bottom: 1px solid #eaeaea;
}

.popular-genres .section-header h4 {
    margin: 0 auto;
    font-size: 16px;
    color: #2c3e50;
    font-weight: 700;
}

.popular-genres .genre-count {
    font-size: 12px;
    color: #7f8c8d;
    background: #f8f9fa;
    padding: 4px 10px;
    border-radius: 12px;
    font-weight: 600;
}

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

.genre-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    background: white;
    border-radius: 10px;
    text-decoration: none;
    border: 1px solid #f0f0f0;
    transition: all 0.3s ease;
}

.genre-item:hover {
    border-color: #667eea;
    background: #f8f9fa;
    transform: translateX(5px);
    box-shadow: 0 3px 10px rgba(102, 126, 234, 0.1);
}

/* Иконки жанров */
.genre-icon {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    color: white;
    flex-shrink: 0;
}

/* Цвета иконок по жанрам */
.genre-item[data-genre="romance"] .genre-icon {
    background: linear-gradient(135deg, #fd79a8 0%, #e84393 100%);
}

.genre-item[data-genre="detective"] .genre-icon {
    background: linear-gradient(135deg, #636e72 0%, #2d3436 100%);
}

.genre-item[data-genre="fantasy"] .genre-icon {
    background: linear-gradient(135deg, #00b894 0%, #00a085 100%);
}

.genre-item[data-genre="scifi"] .genre-icon {
    background: linear-gradient(135deg, #0984e3 0%, #0652dd 100%);
}

.genre-item[data-genre="business"] .genre-icon {
    background: linear-gradient(135deg, #fdcb6e 0%, #e17055 100%);
}

.genre-item[data-genre="psychology"] .genre-icon {
    background: linear-gradient(135deg, #a29bfe 0%, #6c5ce7 100%);
}

.genre-item[data-genre="history"] .genre-icon {
    background: linear-gradient(135deg, #e17055 0%, #d63031 100%);
}

.genre-item[data-genre="poetry"] .genre-icon {
    background: linear-gradient(135deg, #81ecec 0%, #00cec9 100%);
}

.genre-item[data-genre="horror"] .genre-icon {
    background: linear-gradient(135deg, #2d3436 0%, #000000 100%);
}

.genre-item[data-genre="adventure"] .genre-icon {
    background: linear-gradient(135deg, #f9ca24 0%, #f0932b 100%);
}

/* Текст жанра */
.genre-text {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.genre-name {
    font-size: 14px;
    font-weight: 600;
    color: #2c3e50;
    line-height: 1.2;
}

.book-count {
    font-size: 11px;
    color: #7f8c8d;
    font-weight: 500;
}

.genre-count {
    display: flex;
    align-items: baseline;
    gap: 5px;
    background: #f8f9fa;
    padding: 6px 12px;
    border-radius: 20px;
}

.count-number {
    font-size: 18px;
    font-weight: 800;
    color: #667eea;
}

.count-label {
    font-size: 12px;
    color: #7f8c8d;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Кнопка всех жанров */
.view-all-section {
    margin: 20px 0;
}

.view-all-section .view-all-btn {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    text-decoration: none;
    border-radius: 12px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.2);
}

.view-all-section .view-all-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.3);
}

.view-all-section .btn-content {
    display: flex;
    align-items: center;
    gap: 12px;
}

.view-all-section .btn-icon {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 6px;
}

.view-all-section .btn-text {
    font-weight: 600;
    font-size: 14px;
}

.view-all-section .btn-arrow {
    font-size: 12px;
    transition: transform 0.3s ease;
}

.view-all-section .view-all-btn:hover .btn-arrow {
    transform: translateX(4px);
}

/* Быстрые фильтры */
.quick-filters {
    background: white;
    border-radius: 12px;
    padding: 15px;
    margin-bottom: 20px;
    border: 1px solid #eaeaea;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
}

.quick-filters:hover {
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.08);
    border-color: #667eea;
}

.filters-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid #f0f0f0;
}

.filters-icon {
    width: 32px;
    height: 32px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 14px;
    box-shadow: 0 3px 8px rgba(102, 126, 234, 0.2);
}

.filters-title {
    margin: 0;
    font-size: 16px;
    color: #2c3e50;
    font-weight: 700;
    flex: 1;
}

.filters-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.filter-tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    background: #f8f9fa;
    border: 1px solid #eaeaea;
    border-radius: 8px;
    color: #7f8c8d;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    outline: none;
    line-height: 1;
    position: relative;
    overflow: hidden;
}

.filter-tag::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 0;
}

.filter-tag:hover {
    border-color: #667eea;
    color: #667eea;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.1);
}

.filter-tag:hover .tag-text,
.filter-tag:hover i {
    position: relative;
    z-index: 1;
}

.filter-tag:hover::before {
    opacity: 0.1;
}

.filter-tag.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-color: transparent;
    color: white;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.2);
    transform: translateY(-2px);
}

.filter-tag.active:hover {
    background: linear-gradient(135deg, #5a6fd8 0%, #693e8a 100%);
    box-shadow: 0 6px 16px rgba(102, 126, 234, 0.3);
}

.filter-tag.active::before {
    opacity: 0;
}

.filter-tag i {
    font-size: 12px;
    transition: transform 0.3s ease;
}

.filter-tag:hover i {
    transform: scale(1.1);
}

.filter-tag.active i {
    color: white;
}

.tag-text {
    position: relative;
    z-index: 1;
}

/* Анимация для активного фильтра */
@keyframes pulseActive {
    0% {
        box-shadow: 0 4px 12px rgba(102, 126, 234, 0.2);
    }
    50% {
        box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
    }
    100% {
        box-shadow: 0 4px 12px rgba(102, 126, 234, 0.2);
    }
}

.filter-tag.active {
    animation: pulseActive 2s infinite;
}

/* Адаптивность */
@media (max-width: 768px) {
    .quick-filters {
        padding: 12px;
    }
    
    .filters-tags {
        gap: 6px;
    }
    
    .filter-tag {
        padding: 7px 12px;
        font-size: 12px;
    }
}

@media (max-width: 480px) {
    .filters-tags {
        flex-direction: column;
    }
    
    .filter-tag {
        width: 100%;
        justify-content: center;
    }
}

/* Виджет авторов */
.authors-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.author-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 12px;
    border-radius: 12px;
    transition: all 0.3s ease;
}

.author-item:hover {
    background: #f8f9fa;
    transform: translateX(5px);
}

.author-item.top-author {
    background: linear-gradient(135deg, #fff9e6 0%, #fff3cc 100%);
    border: 2px solid #ffd700;
}

.author-rank {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    width: 40px;
    flex-shrink: 0;
}

.rank-number {
    font-size: 20px;
    font-weight: 900;
    color: #2c3e50;
    line-height: 1;
}

.rank-badge {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
}

.rank-badge.gold {
    background: linear-gradient(135deg, #ffd700 0%, #ffed4e 100%);
    color: #b8860b;
    box-shadow: 0 3px 10px rgba(255, 215, 0, 0.3);
}

.rank-badge.silver {
    background: linear-gradient(135deg, #c0c0c0 0%, #e0e0e0 100%);
    color: #696969;
    box-shadow: 0 3px 10px rgba(192, 192, 192, 0.3);
}

.rank-badge.bronze {
    background: linear-gradient(135deg, #cd7f32 0%, #e49b5d 100%);
    color: #8b4513;
    box-shadow: 0 3px 10px rgba(205, 127, 50, 0.3);
}

.author-info {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    flex: 1;
}

.author-avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    overflow: hidden;
    flex-shrink: 0;
    border: 3px solid #f8f9fa;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1);
}

.author-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.author-details {
    flex: 1;
}

.author-name {
    margin: 0 0 5px;
    font-size: 15px;
    color: #2c3e50;
    font-weight: 700;
    line-height: 1.2;
}

.author-stats {
    display: flex;
    gap: 10px;
    font-size: 11px;
    color: #7f8c8d;
}

.author-stats .stat {
    display: flex;
    align-items: center;
    gap: 4px;
}

.author-stats i {
    font-size: 10px;
}

.view-all-authors {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #eaeaea;
}

.view-all-authors a {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 15px;
    background: #3498db;
    color: white;
    text-decoration: none;
    border-radius: 10px;
    font-weight: 600;
    font-size: 15px;
    transition: all 0.3s ease;
}

.view-all-authors a:hover {
    background: #2980b9;
    transform: translateX(5px);
}

.view-all-authors a i:first-child {
    margin-right: 8px;
}

.view-all-authors a i:last-child {
    font-size: 12px;
    transition: transform 0.3s ease;
}

.view-all-authors a:hover i:last-child {
    transform: translateX(5px);
}

/* Виджет форматов */
.widget-content {
    padding: 25px;
}

.widget-header {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 25px;
    border-bottom: 1px solid #eaeaea;
}

.header-content {
    display: flex;
    align-items: center;
    gap: 15px;
}

.widget-icon {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 18px;
    flex-shrink: 0;
}

.widget-title-section {
    flex: 1;
    min-width: 0; /* Для корректной работы text-overflow */
}

.widget-title {
    margin: 0 0 4px 0;
    font-size: 1.1rem;
    font-weight: 600;
    line-height: 1.2;
    color: #2c3e50;
}

.widget-subtitle {
    margin: 0;
    font-size: 0.85rem;
    line-height: 1.3;
    color: #7f8c8d;
}

.records-stats {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 20px 25px;
    background: linear-gradient(135deg, #f8f9fa 0%, #ecf0f1 100%);
    border-bottom: 1px solid #eaeaea;
    border-radius: 15px;
}

.stat-counter {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.stat-number {
    font-size: 28px;
    font-weight: 800;
    color: #f39c12;
    line-height: 1;
}

.stat-label {
    font-size: 12px;
    color: #7f8c8d;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stats-info {
    width: 36px;
    height: 36px;
    margin-left: auto;
    background: white;
    border: 1px solid #eaeaea;
    border-radius: 50%;
    color: #95a5a6;
    font-size: 14px;
    cursor: help;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.stats-info:hover {
    background: #f39c12;
    color: white;
    border-color: #f39c12;
    transform: scale(1.1);
}

/* Список рекордов */
.records-list {
    padding: 10px 0;
    display: flex;
    flex-direction: column;
    gap: 12px;
    width: 100%;
    margin: 0;
    border-radius: 0;
}

.record-item {
    display: flex;
    gap: 12px;
    padding: 15px 20px;
    background: white;
    border-radius: 12px;
    border: 1px solid #f0f0f0;
    transition: all 0.2s ease;
    margin: 0;
    min-height: 85px; /* Фиксированная высота */
    align-items: center;
}

.record-item:hover {
    border-color: #f39c12;
    box-shadow: 0 4px 15px rgba(243, 156, 18, 0.1);
    transform: translateX(-2px);
    background: #fef9f3;
}

.record-item.record-hidden {
    display: none;
}

.record-item.show {
    display: flex;
    animation: slideDown 0.4s ease;
}

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

/* Ранг и иконка */
.record-rank {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
    min-width: 50px;
}

.rank-number {
    width: 24px;
    height: 24px;
    background: #f8f9fa;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 800;
    color: #2c3e50;
    border: 1px solid #eaeaea;
}

.record-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 26px;
    color: white;
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.1);
}

.record-gold {
    background: linear-gradient(135deg, #ffd700 0%, #ffed4e 100%);
    animation: goldGlow 2s infinite alternate;
}

.record-silver {
    background: linear-gradient(135deg, #c0c0c0 0%, #e0e0e0 100%);
}

.record-bronze {
    background: linear-gradient(135deg, #cd7f32 0%, #e49b5d 100%);
}

@keyframes goldGlow {
    0% {
        box-shadow: 0 5px 15px rgba(255, 215, 0, 0.3);
    }
    100% {
        box-shadow: 0 5px 20px rgba(255, 215, 0, 0.6);
    }
}

/* Контент рекорда */
.record-content {
    flex: 1;
    min-width: 0;
}

.record-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 8px;
}

.record-title {
    margin: 0;
    font-size: 15px;
    color: #2c3e50;
    font-weight: 700;
    line-height: 1.3;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 200px;
}

.record-share {
    width: 26px;
    height: 26px;
    background: #f8f9fa;
    border: 1px solid #eaeaea;
    border-radius: 6px;
    color: #95a5a6;
    font-size: 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.record-share:hover {
    background: #f39c12;
    color: white;
    border-color: #f39c12;
    transform: scale(1.1);
}

.record-description {
    margin: 0 0 10px;
    font-size: 14px;
    color: #f39c12;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.record-details {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 10px;
}

.detail-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: #7f8c8d;
    white-space: nowrap;
}

.detail-item i {
    color: #f39c12;
    font-size: 11px;
    min-width: 12px;
}

.record-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: #3498db;
    text-decoration: none;
    font-size: 13px;
    font-weight: 600;
    transition: all 0.3s ease;
    padding: 6px 12px;
    background: #f8f9fa;
    border-radius: 8px;
    white-space: nowrap;
}

.record-link:hover {
    background: #3498db;
    color: white;
    gap: 12px;
}

.record-link i {
    font-size: 11px;
    transition: transform 0.2s ease;
}

.record-link:hover i {
    transform: translateX(3px);
}

/* Кнопки действий */
.records-actions {
    padding: 0 25px 25px;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.btn-show-more {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 12px;
    background: #f8f9fa;
    border: 1px solid #eaeaea;
    border-radius: 10px;
    color: #2c3e50;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-show-more:hover {
    background: #f39c12;
    color: white;
    border-color: #f39c12;
    transform: translateY(-2px);
}

.btn-show-more i {
    font-size: 12px;
    transition: transform 0.3s ease;
}

.btn-show-more[aria-expanded="true"] i {
    transform: rotate(180deg);
}

.action-buttons {
    display: flex;
    gap: 10px;
    align-items: center;
    justify-content: center;
}

.action-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px;
    background: white;
    border: 1px solid #eaeaea;
    border-radius: 8px;
    color: #2c3e50;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.action-btn:hover {
    background: #f8f9fa;
    border-color: #f39c12;
    color: #f39c12;
    transform: translateY(-2px);
}

.action-btn i {
    font-size: 12px;
}

/* Нижняя часть */
.more-records-enhanced {
    padding: 20px 25px;
    background: linear-gradient(135deg, #f8f9fa 0%, #ecf0f1 100%);
    border-top: 1px solid #eaeaea;
    border-radius: 12px;
}

.btn-all-records {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 14px;
    background: linear-gradient(135deg, #f39c12 0%, #e67e22 100%);
    color: white;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 700;
    font-size: 15px;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    margin-bottom: 15px;
}

.btn-all-records:hover {
    background: linear-gradient(135deg, #e67e22 0%, #d35400 100%);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(243, 156, 18, 0.3);
}

.badge-new {
    position: absolute;
    top: 4px;
    right: 4px;
    background: #e74c3c;
    color: white;
    padding: 4px 10px;
    border-radius: 8px;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    animation: badgePulse 1.2s infinite alternate;
}

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

.record-hint {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 13px;
    color: #7f8c8d;
    padding: 12px;
    background: white;
    border-radius: 10px;
    border: 1px solid #eaeaea;
}

.record-hint i {
    color: #f1c40f;
    font-size: 14px;
}

.record-hint a {
    color: #f39c12;
    font-weight: 600;
    text-decoration: none;
}

.record-hint a:hover {
    text-decoration: underline;
}

/* Подсказка */
.tooltip {
    position: absolute;
    top: 20px;
    right: 20px;
    background: #2c3e50;
    color: white;
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 13px;
    max-width: 200px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
    z-index: 1000;
    opacity: 0;
    transform: translateY(-10px);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.tooltip::before {
    content: '';
    position: absolute;
    top: -6px;
    right: 20px;
    width: 12px;
    height: 12px;
    background: #2c3e50;
    transform: rotate(45deg);
}

.tooltip[hidden] {
    display: none;
}

/* Адаптивность */
@media (max-width: 768px) {
    .widget-records-enhanced .widget-header {
        padding: 20px;
    }
    
    .records-list,
    .records-actions {
        padding: 20px;
    }
    
    .records-stats {
        padding: 15px 20px;
    }
    
    .record-item {
        padding: 12px 15px !important;
        min-height: 80px;
        gap: 10px !important;
    }
    
    .record-icon {
        width: 36px !important;
        height: 36px !important;
        font-size: 14px !important;
    }
    
    .record-title {
        font-size: 14px !important;
        max-width: 150px;
    }
    
    .record-description {
        font-size: 13px !important;
    }
    
    .record-details {
        gap: 8px !important;
    }
    
    .detail-item {
        font-size: 11px !important;
    }
    
    .record-rank {
        flex-direction: row;
        gap: 15px;
    }
    
    .action-buttons {
        flex-direction: column;
    }
    
    .more-records-enhanced {
        padding: 15px 20px;
    }
}

@media (max-width: 480px) {
    .records-details {
        flex-direction: column;
        gap: 8px;
    }
    
    .stat-counter {
        flex: 1;
    }
    
    .record-item {
        flex-wrap: wrap;
        min-height: auto;
        padding: 10px !important;
    }
    
    .record-rank {
        flex-direction: row;
        gap: 10px !important;
        min-width: auto;
    }
    
    .record-content {
        width: 100%;
    }
    
    .record-header {
        flex-wrap: wrap;
    }
    
    .record-title {
        max-width: 100%;
        margin-bottom: 5px;
    }
}

/* Компактный виджет форматов */
.widget-formats-compact {
    background: white;
    border-radius: 12px;
    padding: 15px;
    margin-bottom: 20px;
    border: 1px solid #eaeaea;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.widget-header-compact {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid #f0f0f0;
}

.widget-header--compact i {
    color: #3498db;
    font-size: 16px;
    width: 20px;
}

.widget-header-compact h3 {
    margin: 0;
    font-size: 16px;
    color: #2c3e50;
    font-weight: 700;
}

.formats-list-compact {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.format-item-compact {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px;
    background: #f8f9fa;
    border-radius: 8px;
    transition: all 0.2s ease;
}

.format-item-compact:hover {
    background: white;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    transform: translateX(3px);
}

.format-badge {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 800;
    color: white;
    border-radius: 8px;
    flex-shrink: 0;
}

.fb2-badge {
    background: linear-gradient(135deg, #27ae60 0%, #219653 100%);
}

.epub-badge {
    background: linear-gradient(135deg, #3498db 0%, #2980b9 100%);
}

.pdf-badge {
    background: linear-gradient(135deg, #e74c3c 0%, #c0392b 100%);
}

.format-info-compact {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.format-name-compact {
    font-size: 13px;
    color: #2c3e50;
    font-weight: 600;
    line-height: 1.2;
}

.format-count-compact {
    font-size: 11px;
    color: #7f8c8d;
    font-weight: 500;
}

/* Полезные ссылки */
.useful-links {
    list-style: none;
    padding: 0;
    margin: 0;
}

.useful-links li {
    margin-bottom: 12px;
}

.useful-links li:last-child {
    margin-bottom: 0;
}

.useful-links a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 15px;
    background: #f8f9fa;
    border-radius: 10px;
    text-decoration: none;
    color: #2c3e50;
    transition: all 0.3s ease;
}

.useful-links a:hover {
    background: #667eea;
    color: white;
    transform: translateX(5px);
}

.useful-links i {
    font-size: 16px;
    width: 20px;
}

/* Рекламный виджет */
.widget-ad {
    background: #f8f9fa;
    border: 2px dashed #dfe6e9;
}

.ad-label {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 15px 25px;
    background: rgba(182, 158, 64, 0.1);
    color: #7f8c8d;
    font-size: 13px;
    font-weight: 600;
}

.ad-label i {
    color: #b69e40;
}

.ad-content {
    padding: 25px;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 250px;
    background: white;
}

.ad-footer {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 15px 25px;
    background: rgba(52, 152, 219, 0.1);
    color: #7f8c8d;
    font-size: 12px;
    border-top: 1px solid #dfe6e9;
}

.ad-footer i {
    color: #3498db;
}

/* Адаптивность */
@media (max-width: 1024px) {
    .header-top-content {
        flex-direction: column;
        gap: 15px;
    }
    
    .top-ad {
        max-width: 100%;
        width: 100%;
    }
    
    .nav-menu a {
        font-size: 14px;
        padding: 12px 5px;
    }
    
    .nav-menu i {
        font-size: 14px;
    }
}

@media (max-width: 992px) {
    .sidebar {
        width: 100%;
        position: static;
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 25px;
        margin-top: 40px;
    }
    
    .content-wrapper {
        grid-template-columns: 1fr;
    }
    
    .hero-stats {
        flex-direction: column;
        gap: 20px;
    }
    
    .hero-search {
        flex-direction: column;
    }
}

@media (max-width: 768px) {
    .logo-name {
        display: none;
    }
    
    .site-slogan {
        display: none;
    }
    
    .nav-menu {
        flex-wrap: wrap;
    }
    
    .nav-menu li {
        flex: 0 0 33.333%;
    }
    
    .header-bottom-content {
        flex-direction: column;
        gap: 15px;
    }
    
    .search-container {
        width: 100%;
        max-width: 100%;
    }
    
    .search-text {
        display: none;
    }
    
    .search-btn {
        min-width: 60px;
        padding: 0 15px;
    }
    
    .auth-buttons .btn span {
        display: none;
    }
    
    .auth-buttons .btn {
        padding: 10px 15px;
    }
    
    .mobile-menu-btn {
        display: flex;
        position: absolute;
        top: 15px;
        right: 15px;
        z-index: 1001;
    }
    
    .main-navigation {
        position: relative;
    }
    
    .nav-menu {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: #2c3e50;
        flex-direction: column;
        z-index: 1000;
        box-shadow: 0 5px 15px rgba(0,0,0,0.2);
    }
    
    .nav-menu.active {
        display: flex;
    }
    
    .nav-menu li {
        flex: none;
        width: 100%;
    }
    
    .nav-menu a {
        justify-content: flex-start;
        padding: 15px 20px;
        text-align: left;
        border-bottom: 1px solid rgba(255,255,255,0.1);
    }
    
    .sidebar {
        grid-template-columns: 1fr;
    }
    
    .books-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    }
}

@media (max-width: 480px) {
    .logo-mark {
        width: 50px;
        height: 50px;
    }
    
    .logo-initial {
        font-size: 28px;
    }
    
    .user-actions {
        width: 100%;
        justify-content: space-between;
    }
    
    .theme-switcher,
    .notifications-btn {
        width: 36px;
        height: 36px;
        font-size: 16px;
    }
    
    .genres-grid {
        grid-template-columns: 1fr;
    }
}

/* Анимации */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.book-card, .genre-card {
    animation: fadeIn 0.5s ease-out;
}