/* search.html — page styles (extracted from the template) */

        body {
            background-color: var(--background);
            color: var(--text-dark);
            line-height: 1.6;
            overflow-x: hidden;
        }

        /* Гамбургер меню СЛЕВА */
        .hamburger-menu {
            display: flex;
            flex-direction: column;
            cursor: pointer;
            padding: 12px;
            gap: 4px;
            z-index: 2001;
            border-radius: 8px;
            transition: all 0.3s ease;
            background: rgba(139, 69, 19, 0.05);
            margin-right: 15px;
        }

        .hamburger-menu:hover {
            background: rgba(139, 69, 19, 0.1);
            transform: scale(1.05);
        }

        .hamburger-line {
            width: 25px;
            height: 3px;
            background: var(--primary);
            border-radius: 2px;
            transition: all 0.3s ease;
            transform-origin: center;
        }

        .hamburger-menu.active {
            background: rgba(139, 69, 19, 0.15);
        }

        .hamburger-menu.active .hamburger-line:nth-child(1) {
            transform: rotate(45deg) translate(6px, 6px);
            background: var(--primary);
        }

        .hamburger-menu.active .hamburger-line:nth-child(2) {
            opacity: 0;
            transform: scale(0);
        }

        .hamburger-menu.active .hamburger-line:nth-child(3) {
            transform: rotate(-45deg) translate(6px, -6px);
            background: var(--primary);
        }

        /* Боковое меню СЛЕВА */
        .sidebar-menu {
            position: fixed;
            top: 0;
            left: -420px;
            width: 380px;
            height: 100vh;
            background: linear-gradient(160deg, var(--white) 0%, #faf9f7 50%, #F3E9DA 100%);
            box-shadow: 15px 0 50px rgba(139, 69, 19, 0.15);
            z-index: 2000;
            transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
            padding: 0;
            overflow-y: auto;
            border-right: 1px solid rgba(139, 69, 19, 0.08);
        }

        .sidebar-menu.active {
            left: 0;
            transform: translateX(0);
        }

        .sidebar-menu::before {
            content: '';
            position: absolute;
            top: 0;
            right: 0;
            width: 5px;
            height: 100%;
            background: linear-gradient(to bottom, var(--primary) 0%, var(--accent) 100%);
            opacity: 0.9;
        }

        /* Заголовок меню */
        .menu-header {
            background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 100%);
            padding: 30px 35px;
            color: white;
            position: relative;
            overflow: hidden;
            margin-bottom: 20px;
        }

        .menu-header::before {
            content: '';
            position: absolute;
            top: -50%;
            left: -20%;
            width: 200px;
            height: 200px;
            background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 70%);
            border-radius: 50%;
        }

        .menu-title {
            font-size: 1.7rem;
            font-weight: 700;
            margin: 0;
            position: relative;
            z-index: 2;
        }

        .menu-subtitle {
            font-size: 0.9rem;
            opacity: 0.9;
            margin-top: 5px;
            font-weight: 400;
            position: relative;
            z-index: 2;
        }

        

        /* Секции меню */
        .menu-section {
            margin-bottom: 30px;
            padding: 0 25px;
        }

        .menu-section-title {
            font-size: 1.1rem;
            font-weight: 600;
            color: var(--primary);
            margin-bottom: 20px;
            padding-bottom: 12px;
            border-bottom: 2px solid rgba(139, 69, 19, 0.1);
            display: flex;
            align-items: center;
            gap: 10px;
        }

        .menu-section-title::before {
            content: '';
            width: 4px;
            height: 20px;
            background: var(--gradient);
            border-radius: 2px;
        }

        .menu-links {
            list-style: none;
        }

        .menu-links li {
            margin-bottom: 8px;
        }

        .menu-links a {
            color: var(--text-dark);
            text-decoration: none;
            display: flex;
            align-items: center;
            gap: 15px;
            padding: 14px 18px;
            border-radius: 12px;
            transition: all 0.3s ease;
            position: relative;
            overflow: hidden;
            font-weight: 500;
        }

        .menu-links a::before {
            content: '';
            position: absolute;
            left: 0;
            top: 0;
            height: 100%;
            width: 0;
            background: linear-gradient(90deg, rgba(139, 69, 19, 0.1) 0%, transparent 100%);
            transition: width 0.3s ease;
        }

        .menu-links a:hover {
            background: rgba(139, 69, 19, 0.05);
            color: var(--primary);
            transform: translateX(8px);
        }

        .menu-links a:hover::before {
            width: 100%;
        }

        .menu-links a:hover .menu-icon {
            transform: scale(1.2);
        }

        .menu-icon {
            font-size: 1.3rem;
            width: 24px;
            text-align: center;
            transition: transform 0.3s ease;
            flex-shrink: 0;
        }

        /* Активное состояние ссылок */
        .menu-links a.active {
            background: linear-gradient(135deg, rgba(139, 69, 19, 0.1) 0%, rgba(230, 126, 34, 0.05) 100%);
            color: var(--primary);
            border-left: 3px solid var(--primary);
        }

        /* Кнопка в меню */
        .menu-btn {
            background: var(--gradient);
            color: white;
            padding: 14px 25px;
            border-radius: 12px;
            text-decoration: none;
            display: flex;
            align-items: center;
            gap: 10px;
            font-weight: 600;
            transition: all 0.3s ease;
            margin: 25px;
            text-align: center;
            justify-content: center;
            box-shadow: 0 4px 15px rgba(139, 69, 19, 0.3);
        }

        .menu-btn:hover {
            transform: translateY(-2px);
            box-shadow: 0 6px 20px rgba(139, 69, 19, 0.4);
        }

        /* Аватар пользователя в меню */
        .user-profile {
            display: flex;
            align-items: center;
            gap: 15px;
            padding: 20px 25px;
            background: rgba(139, 69, 19, 0.05);
            margin: 20px 25px;
            border-radius: 15px;
            border-left: 4px solid var(--primary);
        }

        .user-avatar {
            width: 50px;
            height: 50px;
            background: var(--gradient);
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
            color: white;
            font-size: 1.2rem;
            font-weight: 600;
        }

        .user-info h4 {
            font-weight: 600;
            color: var(--text-dark);
            margin-bottom: 4px;
        }

        .user-info p {
            font-size: 0.9rem;
            color: var(--text-light);
        }

        /* Оверлей для закрытия */
        .menu-overlay {
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background: rgba(0, 0, 0, 0.5);
            z-index: 1999;
            display: none;
            opacity: 0;
            transition: opacity 0.3s ease;
        }

        .menu-overlay.active {
            display: block;
            opacity: 1;
        }

        /* Стильные иконки для меню */
        .menu-icon {
            width: 24px;
            height: 24px;
            display: flex;
            align-items: center;
            justify-content: center;
            border-radius: 8px;
            background: linear-gradient(135deg, rgba(139, 69, 19, 0.1) 0%, rgba(230, 126, 34, 0.05) 100%);
            color: var(--primary);
            font-size: 0.9rem;
            transition: all 0.3s ease;
            flex-shrink: 0;
            position: relative;
            overflow: hidden;
        }

        .menu-icon::before {
            content: '';
            position: absolute;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background: var(--gradient);
            opacity: 0;
            transition: opacity 0.3s ease;
        }

        .menu-links a:hover .menu-icon {
            background: var(--gradient);
            color: white;
            transform: scale(1.1) rotate(5deg);
            box-shadow: 0 4px 12px rgba(139, 69, 19, 0.3);
        }

        .menu-links a:hover .menu-icon::before {
            opacity: 1;
        }

        .menu-links a.active .menu-icon {
            background: var(--gradient);
            color: white;
            box-shadow: 0 4px 12px rgba(139, 69, 19, 0.3);
        }

        /* Конкретные иконки с кастомными стилями */
        .menu-icon[data-icon="home"] { background: linear-gradient(135deg, #B35B3F 0%, #C98A6E 100%); }

        .menu-icon[data-icon="search"] { background: linear-gradient(135deg, #8B7355 0%, #B29C7E 100%); }

        .menu-icon[data-icon="book"] { background: linear-gradient(135deg, #A0522D 0%, #C98A6E 100%); }

        .menu-icon[data-icon="info"] { background: linear-gradient(135deg, #D9956B 0%, #E3B294 100%); }

        .menu-icon[data-icon="user"] { background: linear-gradient(135deg, #8B6D4F 0%, #BFA080 100%); }

        .menu-icon[data-icon="books"] { background: linear-gradient(135deg, #D9A441 0%, #EAC98C 100%); }

        .menu-icon[data-icon="star"] { background: linear-gradient(135deg, #D9A441 0%, #EAC98C 100%); }

        .menu-icon[data-icon="chart"] { background: linear-gradient(135deg, #7A6A3A 0%, #A6915C 100%); }

        .menu-icon[data-icon="lock"] { background: linear-gradient(135deg, #B35B3F 0%, #C98A6E 100%); }

        .menu-icon[data-icon="dragon"] { background: linear-gradient(135deg, #7A5233 0%, #A68262 100%); }

        .menu-icon[data-icon="detective"] { background: linear-gradient(135deg, #A0522D 0%, #C98A6E 100%); }

        .menu-icon[data-icon="heart"] { background: linear-gradient(135deg, #C0653A 0%, #D9956B 100%); }

        .menu-icon[data-icon="science"] { background: linear-gradient(135deg, #6B5A30 0%, #9C8A52 100%); }

        /* Анимации */
        @keyframes slideInLeft {
            from {
                opacity: 0;
                transform: translateX(-30px);
            }
            to {
                opacity: 1;
                transform: translateX(0);
            }
        }

        .menu-section {
            animation: slideInLeft 0.5s ease-out;
        }

        .menu-section:nth-child(2) { animation-delay: 0.1s; }

        .menu-section:nth-child(3) { animation-delay: 0.2s; }

        .menu-section:nth-child(4) { animation-delay: 0.3s; }

        /* Прокрутка */
        .sidebar-menu::-webkit-scrollbar {
            width: 6px;
        }

        .sidebar-menu::-webkit-scrollbar-track {
            background: rgba(139, 69, 19, 0.05);
        }

        .sidebar-menu::-webkit-scrollbar-thumb {
            background: var(--primary);
            border-radius: 3px;
        }

        .sidebar-menu::-webkit-scrollbar-thumb:hover {
            background: var(--primary-dark);
        }

        /* Адаптивность */
        @media (max-width: 768px) {

            .hamburger-menu {
                display: flex;
            }
}

        @media (max-width: 480px) {

            .sidebar-menu {
                width: 100%;
                left: -100%;
            }

            .menu-header {
                padding: 25px 20px;
            }

            .menu-section {
                padding: 0 20px;
            }

            .menu-btn {
                margin: 20px;
            }

            .user-profile {
                margin: 15px 20px;
            }

            .hamburger-menu {
                padding: 10px;
                margin-right: 10px;
            }

            .hamburger-line {
                width: 22px;
                height: 2.5px;
            }
}

        .hero::before {
            content: '';
            position: absolute;
            top: -50%;
            right: -10%;
            width: 600px;
            height: 600px;
            background: radial-gradient(circle, rgba(139, 69, 19, 0.05) 0%, transparent 70%);
            border-radius: 50%;
        }

        .hero-image:hover img {
            transform: perspective(1000px) rotateY(0) rotateX(0);
        }

        .search-examples {
            text-align: center;
            margin-top: 20px;
        }

        .search-examples p {
            color: var(--text-light);
            margin-bottom: 12px;
            font-size: 0.9rem;
        }

        .example-tags {
            display: flex;
            gap: 10px;
            justify-content: center;
            flex-wrap: wrap;
        }

        .example-tag {
            background: var(--white);
            border: 1px solid rgba(139, 69, 19, 0.2);
            color: var(--primary);
            padding: 6px 14px;
            border-radius: 20px;
            font-size: 0.85rem;
            cursor: pointer;
            transition: all 0.3s ease;
        }

        /* Genre tags are anchors now, so they must not inherit link styling. */
        a.example-tag {
            text-decoration: none;
            display: inline-block;
            line-height: 1.4;
        }

        /* The category the visitor is currently viewing. */
        .example-tag--active {
            background: var(--primary);
            color: var(--white);
            border-color: var(--primary);
        }

        .example-tag:hover {
            background: var(--primary);
            color: var(--white);
            transform: translateY(-1px);
        }

        /* Results Section */
        .results-section {
            padding: 80px 0;
            background-color: var(--white);
        }

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

        .section-header h2 {
            font-size: 2.5rem;
            font-weight: 700;
            color: var(--text-dark);
            text-align: center;
            width: 100%;
        }

        /* Books Grid */
        .books-grid {
            display: grid;
            grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
            gap: 30px;
            margin-bottom: 40px;
        }

        .book-card {
            background: var(--white);
            border-radius: 20px;
            padding: 30px;
            box-shadow: var(--shadow);
            transition: all 0.3s ease;
            position: relative;
            border: 1px solid rgba(0, 0, 0, 0.05);
            overflow: hidden;
        }

        .book-card::before {
            content: '';
            position: absolute;
            top: 0;
            left: 0;
            width: 100%;
            height: 4px;
            background: var(--gradient);
        }

        .book-card:hover {
            transform: translateY(-10px);
            box-shadow: var(--shadow-hover);
        }

        /* Local catalogue results: the visitor already has what they need here. */
        .book-card-local::before {
            background: linear-gradient(135deg, #2e7d32 0%, #43a047 100%);
        }

        .local-badge {
            display: inline-block;
            padding: 4px 12px;
            border-radius: 999px;
            background: rgba(46, 125, 50, 0.12);
            color: #2e7d32;
            font-size: 0.75rem;
            font-weight: 600;
            letter-spacing: 0.02em;
            margin-bottom: 12px;
        }

        .book-card-local .book-title a {
            color: inherit;
            text-decoration: none;
        }

        .book-card-local .book-title a:hover {
            color: var(--brown);
        }

        .book-author {
            color: var(--text-light);
            font-size: 0.95rem;
            margin: -12px 0 12px;
        }

        .book-summary {
            color: var(--text-medium);
            line-height: 1.65;
            margin-bottom: 20px;
        }

        .btn-local {
            display: inline-block;
            padding: 10px 22px;
            border-radius: 12px;
            background: var(--gradient);
            color: var(--white);
            font-weight: 600;
            text-decoration: none;
            transition: opacity 0.2s ease;
        }

        .btn-local:hover {
            opacity: 0.9;
        }

        .search-section-title {
            font-size: 1.25rem;
            font-weight: 600;
            color: var(--text-dark);
            margin: 10px 0 0;
            padding-bottom: 8px;
            border-bottom: 2px solid rgba(0, 0, 0, 0.06);
        }

        .book-title {
            font-size: 1.4rem;
            font-weight: 600;
            color: var(--text-dark);
            margin-bottom: 20px;
            line-height: 1.4;
        }

        .book-links {
            display: flex;
            flex-direction: column;
            gap: 15px;
            margin-top: 20px;
        }

        .book-link {
            display: flex;
            align-items: center;
            gap: 15px;
            padding: 15px 20px;
            background: var(--gray-light);
            border-radius: 12px;
            text-decoration: none;
            color: var(--text-dark);
            transition: all 0.3s ease;
            border: 1px solid rgba(139, 69, 19, 0.1);
        }

        .book-link:hover {
            background: var(--primary);
            color: var(--white);
            transform: translateX(5px);
        }

        .link-icon {
            font-size: 1.3rem;
        }

        .link-text {
            flex: 1;
            font-weight: 500;
        }

        .link-format {
            background: var(--primary);
            color: var(--white);
            padding: 6px 12px;
            border-radius: 8px;
            font-size: 0.8rem;
            font-weight: 600;
        }

        .book-link:hover .link-format {
            background: var(--white);
            color: var(--primary);
        }

        .book-source {
            margin-top: 20px;
            font-size: 0.9rem;
            color: var(--text-light);
            padding-top: 15px;
            border-top: 1px solid rgba(0, 0, 0, 0.1);
        }

        /* Loading State */
        .loading {
            text-align: center;
            padding: 80px 20px;
            color: var(--text-light);
        }

        .loading-spinner {
            width: 60px;
            height: 60px;
            border: 4px solid var(--gray-light);
            border-top: 4px solid var(--primary);
            border-radius: 50%;
            animation: spin 1s linear infinite;
            margin: 0 auto 25px;
        }

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

        .loading-text {
            font-size: 1.2rem;
            margin-bottom: 10px;
            color: var(--text-dark);
        }

        .loading-subtext {
            color: var(--text-light);
            font-size: 0.95rem;
        }

        /* Empty State */
        .empty-state {
            text-align: center;
            padding: 100px 20px;
            color: var(--text-light);
            grid-column: 1 / -1;
        }

        .empty-icon {
            font-size: 5rem;
            margin-bottom: 25px;
            opacity: 0.5;
        }

        .empty-state h3 {
            font-size: 2rem;
            margin-bottom: 15px;
            color: var(--text-dark);
        }

        .empty-state p {
            font-size: 1.1rem;
            margin-bottom: 30px;
            color: var(--text-light);
            max-width: 500px;
            margin-left: auto;
            margin-right: auto;
        }

        /* Error State */
        .error-state {
            text-align: center;
            padding: 40px 20px;
            color: #B3423A;
            background: #f8d7da;
            border-radius: 12px;
            margin: 20px 0;
            border: 1px solid #f5c6cb;
        }

        /* Responsive Design */
        @media (max-width: 968px) {

            .books-grid {
                grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
            }
}

        @media (max-width: 768px) {

            .hamburger-menu {
                display: flex;
            }

            .books-grid {
                grid-template-columns: 1fr;
            }

            .section-header {
                flex-direction: column;
                align-items: center;
                text-align: center;
            }

            .example-tags {
                flex-direction: column;
                align-items: center;
            }

            .example-tag {
                width: 200px;
            }
}

        /* Animation for modern feel */
        @keyframes fadeInUp {
            from {
                opacity: 0;
                transform: translateY(30px);
            }
            to {
                opacity: 1;
                transform: translateY(0);
            }
        }

        .hero-info, .hero-image, .book-card {
            animation: fadeInUp 0.8s ease-out;
        }

        .book-card:nth-child(2) { animation-delay: 0.1s; }

        .book-card:nth-child(3) { animation-delay: 0.2s; }

        .book-card:nth-child(4) { animation-delay: 0.3s; }

        .close-menu {
    position: absolute;
    top: 25px;
    right: 25px;
    background: rgba(255, 255, 255, 0.2);
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    color: white;
    font-size: 1.2rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(10px);
    z-index: 2002; /* Важно: должен быть выше чем меню */
}

.close-menu:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: rotate(90deg);
}

/* Убедитесь что оверлей закрывает всё */

/* Success Messages */
.feedback-success {
    background: linear-gradient(135deg, #3D7A4E 0%, #2C5530 100%);
    color: white;
    padding: 25px;
    border-radius: 15px;
    text-align: center;
    margin-top: 30px;
    animation: fadeIn 0.5s ease;
}

.feedback-success h3 {
    margin-bottom: 10px;
    font-size: 1.3rem;
}
