@import url('https://fonts.googleapis.com/css2?family=Shantell+Sans:ital,wght@0,300..800;1,300..800&display=swap');



:root {
    --primary-secondly: #3E3A35;
    --primary-text: #3E3A35;
    --bg-dark: #FDF9ED;
}

body {
    background-color: var(--bg-dark);
    color: var(--primary-text);
    font-family: "Shantell Sans", cursive;
}

img {
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

::selection {
    background-color: #dbd9d9;
}

.container {
    width: 1440px;
    padding: 0;
    margin: 0 auto;
}

h2 {
    font-size: 48px;
    text-transform: uppercase;
}

i {
    font-style: normal;
}

.btn {
    border: 1px solid var(--primary-text);
    border-radius: 8px;
    padding: 4px 8px;
    color: var(--primary-text);
    transition: 0.3s ease;
}

.btn:hover {
    background-color: var(--primary-text);
    color: var(--bg-dark);
}

.arrow_up {
    width: 50px;
    height: 80px;
    position: fixed;
    bottom: 10px;
    right: 25px;
}

/* ========== HEADER ========== */
.header {
    padding-top: 60px;
}

.title {
    font-size: 96px;
    font-weight: 700;
    text-transform: uppercase;
    text-align: center;
    margin-bottom: 50px;
    text-shadow: 2px 6px 4px rgba(0, 0, 0, 25%);
}

.nav {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
}

.logo {
    width: 47px;
    height: 56px;
    z-index: 102;
    justify-self: start;
}

.nav_list {
    display: flex;
    gap: 40px;
    z-index: 102;
    justify-self: center;
}

.nav_item {
    font-size: 24px;
    transition: 0.3s ease-in-out;
    color: var(--primary-text);
}

.nav_item:hover {
    text-decoration: underline;
}

.nav_button {
    display: flex;
    align-items: flex-end;
    gap: 40px;
    justify-self: end;
}

.btn_nav {
    font-size: 24px;
}

/* Базовые стили */
.profile_dropdown {
    position: relative;
}

.profile_btn {
    cursor: pointer;
    background: transparent;
    border: 1px solid var(--primary-text);
    padding: 8px 16px;
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.profile_btn i {
    font-style: normal;
}

/* Выпадающее меню */
/* ========== ВЫПАДАЮЩЕЕ МЕНЮ ПРОФИЛЯ - ИСПРАВЛЕНИЕ ДЛИННЫХ СТРОК ========== */

/* Базовые стили для выпадающего меню */
.profile_do {
    position: absolute;
    top: 100%;
    right: 0;
    background-color: var(--bg-dark);
    border: 1px solid var(--primary-text);
    border-radius: 8px;
    min-width: 220px;
    max-width: 300px;
    /* Ограничиваем максимальную ширину */
    z-index: 1002;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    padding: 5px 0;
    /* Добавляем отступы */
}

.profile_do li {
    margin: 0;
    list-style: none;
    width: 100%;
}

.profile_do a {
    display: block;
    padding: 12px 20px;
    color: var(--primary-text);
    text-decoration: none;
    transition: all 0.3s ease;
    border-bottom: 1px solid rgba(62, 58, 53, 0.1);
    /* КЛЮЧЕВЫЕ СВОЙСТВА ДЛЯ ПЕРЕНОСА ДЛИННЫХ СТРОК: */
    white-space: normal;
    /* Разрешаем перенос строк */
    word-wrap: break-word;
    /* Перенос длинных слов */
    overflow-wrap: break-word;
    /* Современный аналог word-wrap */
    word-break: break-word;
    /* Принудительный перенос при необходимости */
    hyphens: auto;
    /* Автоматические переносы */
    max-width: 100%;
    /* Не выходим за пределы контейнера */
    box-sizing: border-box;
    /* Учитываем padding в ширине */
}

.profile_do li:last-child a {
    border-bottom: none;
}

.profile_do a:hover {
    background-color: var(--primary-text);
    color: var(--bg-dark);
}

/* ========== МОБИЛЬНАЯ ВЕРСИЯ ВЫПАДАЮЩЕГО МЕНЮ ========== */
/* ========== МОБИЛЬНАЯ ВЕРСИЯ ВЫПАДАЮЩЕГО МЕНЮ (исправленная) ========== */
@media (max-width: 767px) {
    .profile_dropdown {
        position: relative;
    }

    .profile_do {
        display: none;
        position: absolute;
        top: 45px;
        right: -10px;
        background: var(--bg-dark);
        border: 1px solid var(--primary-text);
        border-radius: 8px;
        min-width: 180px;
        max-width: 85vw;
        /* ← ОГРАНИЧИВАЕМ ШИРИНУ */
        z-index: 9999;
        padding: 5px 0;
        box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    }

    .profile_do.active {
        display: block;
    }

    .profile_do li {
        margin: 0;
        list-style: none;
        width: 100%;
    }

    .profile_do a {
        padding: 12px 16px;
        display: block;
        color: var(--primary-text);
        text-decoration: none;
        border-bottom: 1px solid rgba(62, 58, 53, 0.1);
        /* КЛЮЧЕВЫЕ СВОЙСТВА ДЛЯ ПЕРЕНОСА ДЛИННЫХ СТРОК: */
        white-space: normal;
        word-wrap: break-word;
        overflow-wrap: break-word;
        word-break: break-word;
        hyphens: auto;
        max-width: 100%;
        box-sizing: border-box;
        font-size: 14px;
        line-height: 1.4;
    }

    .profile_do a:last-child {
        border-bottom: none;
    }

    .profile_do a:active {
        background: var(--primary-text);
        color: var(--bg-dark);
    }

    /* Для очень маленьких экранов */
    @media (max-width: 480px) {
        .profile_do {
            min-width: 150px;
            max-width: 80vw;
            right: -5px;
        }

        .profile_do a {
            font-size: 13px;
            padding: 10px 14px;
        }
    }

    /* Для самых маленьких экранов */
    @media (max-width: 360px) {
        .profile_do {
            min-width: 130px;
            max-width: 75vw;
            right: 0;
        }

        .profile_do a {
            font-size: 12px;
            padding: 8px 12px;
        }
    }
}



/* ========== ДЕСКТОПНАЯ ВЕРСИЯ (hover) ========== */
@media (min-width: 768px) {
    .profile_dropdown {
        position: relative;
    }

    .profile_do {
        position: absolute;
        top: 100%;
        right: 0;
        display: none;
        background-color: var(--bg-dark);
        border: 1px solid var(--primary-text);
        border-radius: 8px;
        min-width: 220px;
        max-width: 300px;
        /* Ограничение ширины */
        z-index: 1000;
        box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
        padding: 5px 0;
    }

    .profile_dropdown:hover .profile_do {
        display: block;
    }

    .profile_do li {
        margin: 0;
    }

    .profile_do a {
        display: block;
        padding: 12px 20px;
        color: var(--primary-text);
        transition: all 0.3s ease;
        border-bottom: 1px solid rgba(62, 58, 53, 0.1);
        white-space: normal;
        word-wrap: break-word;
        overflow-wrap: break-word;
        word-break: break-word;
        hyphens: auto;
        max-width: 100%;
        box-sizing: border-box;
    }

    .profile_do a:last-child {
        border-bottom: none;
    }

    .profile_do a:hover {
        background-color: var(--primary-text);
        color: var(--bg-dark);
    }
}


/* ========== FOOTER ========== */
.footer {
    display: flex;
    align-items: center;
    margin-bottom: 50px;
    padding-top: 50px;
}


.footer_links {
    display: flex;
    gap: 70px;
}

.footer_nav {
    display: flex;
    gap: 20px;
}

.footer_link {
    font-size: 24px;
    color: var(--primary-text);
}

.footer_link:hover {
    text-decoration: underline;
}

.footer_right {
    margin-top: 20px;
    text-align: center;
    font-size: 18px;
}

.nav_background {
    margin-bottom: 30px;
}

/* ========== WELCOME SECTION ========== */
.welcome {
    margin: 100px 0;
}

.welcome_img {
    height: 500px;
    position: relative;
    pointer-events: none;
}

.welcome_img_back {
    position: absolute;
    top: -100px;
    z-index: 1;
    animation: floatCloudBack 4s ease-in-out infinite alternate;
}

@keyframes floatCloudBack {
    0% {
        transform: translateY(0) translateX(0);
    }

    50% {
        transform: translateY(-15px) translateX(5px);
    }

    100% {
        transform: translateY(10px) translateX(-5px);
    }
}

.welcome_img_statue {
    position: absolute;
    top: -200px;
    left: 90px;
    z-index: 1;
}

.welcome_img_front {
    position: absolute;
    top: -50px;
    z-index: 1;
    animation: floatCloudFront 3.5s ease-in-out infinite alternate;
}

@keyframes floatCloudFront {
    0% {
        transform: translateY(0) translateX(0);
    }

    50% {
        transform: translateY(20px) translateX(8px);
    }

    100% {
        transform: translateY(-15px) translateX(-8px);
    }
}

/* ========== THEMES / CATEGORIES (INDEX PAGE) ========== */
.themes {
    margin-bottom: 75px;
}

.theme_title {
    margin-bottom: 80px;
}

.theme_cards {
    display: flex;
    justify-content: space-evenly;
    margin-bottom: 150px;
    flex-wrap: wrap;
    left: 50%;
}

.theme_card {
    position: relative;
    width: 345px;
    height: 230px;
    background-image: url('/img/index/theme.png');
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    transition: 0.3s ease;
}

.theme_card:hover {
    filter: drop-shadow(2px 4px 6px #AE5E21);
    transform: translateY(-5px);
}

.theme_desc {
    display: block;
    padding: 10px 5px;
    font-size: 22px;
    color: var(--primary-text);
    font-weight: 600;
    word-wrap: break-word;
    overflow-wrap: break-word;
    word-break: break-word;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

/* ========== CATEGORY PAGE (category.php) ========== */


.no-posts {
    text-align: center;
    color: #666;
    padding: 30px;
    font-size: 1.1rem;
}

.theme_cards_category {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    margin: 30px 0;
    padding: 0;
    flex-wrap: wrap;
    list-style: none;
}

.theme_card_category {
    display: flex;
    flex-direction: column;
    text-decoration: none;
    color: inherit;
    width: 205px;
    min-height: 320px;
    box-sizing: border-box;
}

.card-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.theme_card_category img {
    width: 185px;
    height: 257px;
    object-fit: cover;
    border: 20px solid transparent;
    border-image: url('/img/index/border_book.svg') 50 stretch;
}

.theme_card_category p {
    text-align: center;
    color: var(--primary-text);
    width: 205px;
    margin: 0;
}

.name_book_category {
    font-size: 24px;
    margin-bottom: 10px;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    min-height: 62px;
    /* 2 строки * 24px * 1.3 line-height примерно */
}

.author_category {
    font-size: 14px;
    color: #888;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    min-height: 20px;
    /* фиксированная высота для автора */
}

.book-price-display {
    margin-top: auto;
    font-size: 14px;
    color: var(--primary-text);
    font-weight: bold;
    text-align: center;
    padding: 10px 0;
}

.free-book {
    color: #c4ab20;
}

.back-to-categories {
    margin-top: 40px;
    text-align: center;
}





/* ========== CATEGORY FILTERS ========== */
.filters-section {
    margin: 30px 0;
    padding: 20px;
    border: 1px solid var(--primary-text);
    border-radius: 8px;
}

.filters-title {
    font-size: 20px;
    margin-bottom: 15px;
    color: var(--primary-text);
}

.filters-form {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    align-items: flex-end;
}

.filter-group {
    flex: 1;
    min-width: 150px;
}

.filter-group label {
    display: block;
    margin-bottom: 5px;
    color: var(--primary-text);
    font-size: 14px;
}

.filter-select {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid var(--primary-text);
    border-radius: 4px;
    background: transparent;
    color: var(--primary-text);
}

.filter-select option {
    background: var(--primary-secondly);
    color: var(--bg-dark);
}

.filter-checkbox {
    display: flex;
    align-items: center;
    gap: 8px;
}

.filter-checkbox input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--primary-text);
}

.filter-actions {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

.btn-filter {
    border: 1px solid var(--primary-text);
    border-radius: 4px;
    padding: 8px 16px;
    background: transparent;
    color: var(--primary-text);
    cursor: pointer;
    transition: 0.3s ease;
}

.btn-filter:hover {
    background-color: var(--primary-text);
    color: var(--bg-dark);
}

.btn-reset {
    border: 1px solid #666;
    color: #666;
}

.btn-reset:hover {
    background-color: #666;
    color: #000;
}

.active-filters {
    margin: 15px 0;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.filter-tag {
    border: 1px solid var(--primary-text);
    border-radius: 4px;
    padding: 4px 8px;
    font-size: 13px;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.filter-tag a {
    color: #666;
    text-decoration: none;
    margin-left: 5px;
}

.filter-tag a:hover {
    color: var(--primary-text);
}

/* ========== PRICE FILTER ========== */
.price-filter {
    min-width: 250px;
}

.price-inputs {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}

.filter-input {
    width: 80px;
    padding: 8px 8px;
    border: 1px solid var(--primary-text);
    border-radius: 4px;
    background: transparent;
    color: var(--primary-text);
    font-size: 14px;
}

.filter-input::placeholder {
    color: #666;
    font-size: 12px;
}

.filter-input:focus {
    outline: none;
    border-color: var(--primary-text);
    box-shadow: 0 0 3px rgba(196, 171, 32, 0.3);
}

.price-separator {
    color: var(--primary-text);
    font-size: 14px;
}

.price-checkbox {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 5px;
}

.price-checkbox input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: var(--primary-text);
    cursor: pointer;
}

.price-checkbox label {
    color: var(--primary-text);
    font-size: 14px;
    cursor: pointer;
}

/* ========== SEARCH BOX ========== */
.search-box {
    margin-bottom: 20px;
}

.search-form {
    display: flex;
    gap: 10px;
    max-width: 500px;
}

.search-input {
    flex: 1;
    padding: 10px 15px;
    border: 1px solid var(--primary-text);
    border-radius: 4px;
    background: transparent;
    color: var(--primary-text);
}

.search-input::placeholder {
    color: #666;
}

.search-btn {
    padding: 10px 20px;
    border: 1px solid var(--primary-text);
    border-radius: 4px;
    background: transparent;
    color: var(--primary-text);
    cursor: pointer;
}

.search-btn:hover {
    background-color: var(--primary-text);
    color: #000;
}

/* ========== MAIN REGISTER SECTION ========== */
.main_register {
    margin-bottom: 150px;
}

.main_register_zone {
    display: flex;
    justify-content: space-evenly;
    align-items: center;
    padding: 0 100px;
}

.main_register_text {
    text-align: center;
}

.main_register_title {
    font-size: 96px;
    font-weight: 600;
    margin-bottom: 20px;
}

.main_register_desc {
    font-size: 32px;
    margin-bottom: 70px;
}

.main_register_form {
    display: flex;
    flex-direction: column;
    width: 425px;
}

.main_register_form input {
    font-size: 24px;
    border-bottom: 1px solid var(--primary-text);
    margin-bottom: 50px;
    padding-bottom: 5px;
}

input::placeholder {
    color: var(--primary-text);
}

.main_register_btn {
    font-size: 26px;
    border: 2px solid var(--primary-text);
    width: 100%;
    padding: 16px 10px;
    border-radius: 8px;
    text-align: center;
    margin-bottom: 20px;
}

.form_subtext {
    font-size: 18px;
    text-align: center;
}

.form_subtext a {
    color: var(--primary-text);
    text-decoration: underline;
}

.form_subtext a:hover {
    text-decoration: none;
}

.polite{
    text-align: center;
    margin-bottom: 10px;
}

/* ========== BREADCRUMBS ========== */
.breadcrumbs {
    margin: 20px 0;
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}

.back-link {
    display: inline-block;
    color: var(--primary-text);
    text-decoration: none;
    font-weight: bold;
}

.back-link:hover {
    text-decoration: underline;
}

.current-page {
    color: #888;
}

/* ========== POST PAGE (one.php) ========== */
.post-header {
    margin: 30px 0;
    padding-bottom: 20px;
    display: flex;
    gap: 50px;
    align-items: center;
    flex-wrap: wrap;
}

.post-image {
    width: 245px;
    height: 360px;
    object-fit: cover;
    border: 30px solid transparent;
    border-image: url('/img/index/border_book.svg') 50 stretch;
}

.post-text {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-width: 300px;
    max-width: 600px;
}

.post-title {
    font-size: 2.5rem;
    margin-bottom: 10px;
    word-wrap: break-word;
}

.post-meta {
    color: var(--primary-text);
    font-size: 0.9rem;
    margin-bottom: 20px;
}

.price-info {
    margin: 15px 0;
    padding: 12px 15px;
    border: 1px solid var(--primary-text);
    border-radius: 8px;
    max-width: 300px;
}

.price-label {
    font-weight: bold;
    color: var(--primary-text);
    margin-right: 10px;
}

.price-value {
    font-size: 1.4em;
    color: var(--primary-text);
    font-weight: bold;
}

.post_btn {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 20px;
    max-width: 300px;
}

.post_btn .btn {
    width: 100%;
    padding: 12px 20px;
    text-align: center;
    font-size: 16px;
    font-weight: 500;
    border-radius: 8px;
    transition: all 0.3s ease;
    cursor: pointer;
    border: 1px solid var(--primary-secondly);
}

.btn-bookmark {
    border: 1px solid var(--primary-text);
    color: var(--primary-text);
}

.btn-bookmark:hover {
    background-color: var(--primary-text);
    color: var(--bg-dark);
}

.btn-purchase {
    border: 1px solid var(--primary-text) ;
    color: var(--primary-text);
}

.btn-purchase:hover {
    background-color: var(--primary-text);
    color: var(--bg-dark);
}

.btn-download {
    border: 1px solid var(--primary-text);
    color: var(--primary-text);
}

.btn-download:hover {
    background-color: var(--primary-text);
    color: #000;
}

.btn-disabled {
    background: transparent;
    border: 1px solid #666 !important;
    color: #666;
    cursor: not-allowed;
    opacity: 0.6;
}

.btn-disabled:hover {
    background-color: #666;
    color: #000;
}

.book-file-info {
    margin: 15px 0;
    display: flex;
    gap: 15px;
    align-items: center;
    flex-wrap: wrap;
}

.file-type {
    border: 1px solid var(--primary-secondly);
    color: #000;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: bold;
    text-transform: uppercase;
}

.purchase-count {
    color: #888;
    font-size: 14px;
}

.age-restriction-badge {
    margin: 15px 0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.age-badge {
    background: #dc3545;
    color: white;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 14px;
    font-weight: bold;
    display: inline-block;
    width: fit-content;
}

.age-restriction-note {
    margin-top: 10px;
    color: #666;
    font-size: 14px;
}

.age-restriction-note a {
    color: var(--primary-text);
    text-decoration: underline;
}

.file-size {
    color: #666;
    font-size: 14px;
}

/* ========== FORMS (REGISTRATION/AUTHORIZATION) ========== */
.form_container {
    width: 545px;
    margin: 0 auto 150px;
}

.form {
    display: flex;
    gap: 30px;
    align-items: center;
}

.form_title {
    font-size: 48px;
    font-weight: 600;
    margin-bottom: 60px;
    text-align: center;
}

.form_img {
    max-width: 150px;
}

.form_text {
    display: flex;
    flex-direction: column;
    width: 465px;
}

.form_enter {
    border-bottom: 1px solid var(--primary-text);
    margin-bottom: 60px;
    width: 100%;
    font-size: 24px;
    background: transparent;
}

.form_enter:focus {
    outline: none;
    border-color: var(--primary-text);
}

.form_avatar_upload {
    margin-bottom: 30px;
}

.form_avatar_upload label {
    display: block;
    margin-bottom: 10px;
}

.form_avatar_upload input[type="file"] {
    border: none;
    font-size: 16px;
    padding: 10px 0;
    margin-bottom: 5px;
}

.form_btn {
    padding: 13px;
    font-size: 26px;
    margin-bottom: 15px;
}

.form_subtitle {
    text-align: center;
    font-size: 16px;
}

.form_link {
    color: var(--primary-text);
    border-bottom: 1px solid var(--primary-text);
}

.form_link:hover {
    border-bottom: none;
}

/* ========== PROFILE PAGE ========== */
.profile {
    margin-bottom: 150px;
}

.profile_block {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-bottom: 60px;
}

.profile_avatar {
    display: flex;
    gap: 15px;
    align-items: flex-start;
}

.profile_img {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid var(--primary-text);
}

.profile_login {
    font-size: 24px;
    font-weight: 600;
}

.profile_setting {
    height: 45px;
}

.profile_mark_title {
    margin-bottom: 50px;
}

.profile_mark_empty {
    font-size: 24px;
    text-align: center;
    padding: 40px;
    color: #666;
    font-style: italic;
}

/* ========== PROFILE TABS ========== */
.profile-tabs {
    display: flex;
    gap: 20px;
    margin: 30px 0 20px;
    border-bottom: 1px solid var(--primary-text);
    padding-bottom: 10px;
}

.tab-btn {
    padding: 10px 25px;
    border: 1px solid var(--primary-text);
    border-radius: 8px 8px 0 0;
    background: transparent;
    color: var(--primary-text);
    font-size: 18px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-block;
    position: relative;
    bottom: -1px;
}

.tab-btn:hover {
    background-color: var(--primary-secondly);
    color: var(--bg-dark);
}

.tab-btn.active {
    background-color: var(--primary-text);
    color: var(--bg-dark);
    border-bottom-color: transparent;
}

.tab-btn .count {
    margin-left: 8px;
    padding: 2px 8px;
    border: 1px solid var(--primary-secondly);
    border-radius: 20px;
    font-size: 14px;
}

.tab-btn.active .count {
    border: 1px solid var(--bg-dark);
    color: var(--bg-dark);
}

.tab-content {
    display: none;
    animation: fadeIn 0.5s ease;
}

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

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

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ========== BOOKMARKS ========== */

/* ========== BOOKMARKS ========== */
.bookmarks-list {
    margin-top: 20px;
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
}

.bookmark-item {
    width: 260px;
    border: 1px solid var(--primary-text);
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 15px;
    text-align: center;
    display: flex;
    flex-direction: column;
    min-height: 450px;
    /* Изменено с height на min-height */
    background: transparent;
    transition: 0.3s ease;
}

.bookmark-item:hover {
    background-color: rgba(196, 171, 32, 0.05);
}

.bookmark-image {
    width: 100%;
    height: 320px;
    object-fit: cover;
    border-radius: 4px;
    margin-bottom: 10px;
    border: 1px solid var(--primary-text);
    flex-shrink: 0;
    /* Запрещаем сжатие изображения */
}

.bookmark-no-image {
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    color: #666;
    font-size: 14px;
    height: 320px;
    border: 1px dashed var(--primary-text);
    border-radius: 4px;
    flex-shrink: 0;
}

.bookmark-info {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    /* Изменено с flex-end на flex-start */
    padding-bottom: 10px;
}

.bookmark-title {
    margin: 0 0 5px 0;
    font-size: 16px;
    line-height: 1.3;
}

.bookmark-title a {
    text-decoration: none;
    color: var(--primary-text);
    transition: 0.3s ease;
}

.bookmark-title a:hover {
    text-decoration: underline;
}

.bookmark-author {
    margin: 0 0 10px;
    color: #666;
    font-size: 14px;
}

.bookmark-actions {
    margin-top: auto;
    /* Прижимаем кнопку к низу */
    padding-top: 10px;
    /* Добавляем отступ сверху */
    flex-shrink: 0;
    /* Запрещаем сжатие */
}

.btn-remove {
    border: 1px solid #666;
    border-radius: 8px;
    padding: 8px 16px;
    font-size: 14px;
    cursor: pointer;
    width: 100%;
    background: transparent;
    color: #666;
    transition: 0.3s ease;
}

.btn-remove:hover {
    background-color: var(--primary-text);
    color: var(--bg-dark);
}

/* ========== PURCHASES LIST ========== */

/* ========== PURCHASES LIST ========== */
.purchases-list {
    margin-top: 20px;
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
}

.purchase-item {
    width: 200px;
    border: 1px solid var(--primary-text);
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 15px;
    text-align: center;
    display: flex;
    flex-direction: column;
    min-height: 420px;
    /* Изменено с фиксированной высоты */
    background: transparent;
    transition: all 0.3s ease;
    position: relative;
}

.purchase-item:hover {
    background-color: rgba(196, 171, 32, 0.05);
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(196, 171, 32, 0.2);
}

.purchase-image {
    width: 100%;
    height: 250px;
    object-fit: cover;
    border-radius: 4px;
    margin-bottom: 10px;
    border: 1px solid var(--primary-text);
    flex-shrink: 0;
}

.purchase-no-image {
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    color: #666;
    font-size: 14px;
    height: 250px;
    border: 1px dashed var(--primary-text);
    border-radius: 4px;
    margin-bottom: 10px;
    flex-shrink: 0;
}

.purchase-info {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
}

.purchase-title {
    margin: 0 0 5px 0;
    font-size: 16px;
    line-height: 1.3;
}

.purchase-author {
    margin: 0 0 5px;
    color: #888;
    font-size: 14px;
}

.purchase-date {
    font-size: 12px;
    color: #666;
    margin-bottom: 5px;
}

.purchase-price {
    font-size: 14px;
    font-weight: bold;
    color: var(--primary-text);
    margin-bottom: 10px;
}

.purchase-actions {
    margin-top: auto;
    padding-top: 10px;
    flex-shrink: 0;
}

.btn-download-small {
    display: inline-block;
    padding: 8px 15px;
    border: 1px solid var(--primary-text);
    border-radius: 8px;
    color: var(--primary-text);
    text-decoration: none;
    font-size: 14px;
    transition: all 0.3s ease;
    width: 100%;
}

.btn-download-small:hover {
    background-color: var(--primary-text);
    color: #000;
}

.empty-message {
    text-align: center;
    padding: 40px;
    color: #666;
    font-style: italic;
    border: 1px dashed var(--primary-text);
    border-radius: 8px;
    margin: 20px 0;
    width: 100%;
}

.empty-message a {
    color: var(--primary-text);
    text-decoration: none;
    
    margin-left: 5px;
}

.empty-message a:hover {
    border-bottom: 1px solid var(--primary-text);
}

/* ========== PURCHASES PAGE (old) ========== */
.purchases-container {
    max-width: 900px;
    margin: 40px auto;
    padding: 20px;
}

.purchases-title {
    font-size: 28px;
    margin-bottom: 30px;
    color: var(--primary-text);
    text-transform: uppercase;
}

.purchases-container .purchase-item {
    display: flex;
    align-items: center;
    padding: 20px;
    border: 1px solid var(--primary-text);
    border-radius: 8px;
    margin-bottom: 15px;
    background: transparent;
    transition: 0.3s ease;
}

.purchases-container .purchase-item:hover {
    background-color: rgba(196, 171, 32, 0.05);
}

.purchases-container .purchase-item img {
    width: 80px;
    height: auto;
    border-radius: 4px;
    margin-right: 20px;
    border: 1px solid var(--primary-text);
}

.purchases-container .purchase-info {
    flex: 1;
}

.purchases-container .purchase-info h3 {
    font-size: 18px;
    margin-bottom: 5px;
}

.purchases-container .purchase-info h3 a {
    color: var(--primary-text);
    text-decoration: none;
}

.purchases-container .purchase-info h3 a:hover {
    text-decoration: underline;
}

.purchases-container .purchase-meta {
    color: #666;
    font-size: 14px;
    margin-bottom: 3px;
}

.purchases-container .purchase-price {
    font-weight: bold;
    color: var(--primary-text);
    margin-top: 5px;
}

.purchases-container .purchase-actions {
    margin-left: 20px;
}

.no-purchases {
    text-align: center;
    padding: 40px;
    border: 1px dashed var(--primary-text);
    border-radius: 8px;
    margin: 20px 0;
}

.no-purchases p {
    margin-bottom: 20px;
    color: #666;
}

.btn-browse {
    border: 1px solid var(--primary-text);
    border-radius: 8px;
    padding: 10px 20px;
    text-decoration: none;
    background: transparent;
    color: var(--primary-text);
    transition: 0.3s ease;
    display: inline-block;
}

.btn-browse:hover {
    background-color: var(--primary-text);
    color: #000;
}




/* ========== PAYMENT PAGE ========== */


.payment-container {
    max-width: 600px;
    margin: 40px auto;
    padding: 30px;
    background-color: var(--bg-dark);
    border-radius: 12px;
    border: 1px solid var(--primary-secondly);
}

.payment-container .payment-title {
    font-size: 28px;
    font-weight: 600;
    color: var(--primary-text);
    margin-bottom: 30px;
    text-align: center;
    position: relative;
    padding-bottom: 15px;
}

.payment-container .payment-title:after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 3px;
    background: var(--primary-secondly);
    border-radius: 2px;
}

.payment-container .book-info {
    display: flex;
    gap: 20px;
    margin-bottom: 30px;
    padding: 20px;
    background: rgba(196, 171, 32, 0.05);
    border-radius: 10px;
    border: 1px solid rgba(196, 171, 32, 0.2);
}

.payment-container .book-info img {
    width: 100px;
    height: 140px;
    object-fit: cover;
    border-radius: 6px;
}

.payment-container .book-details {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.payment-container .book-details h3 {
    font-size: 20px;
    font-weight: 600;
    color: var(--primary-text);
    margin-bottom: 8px;
}

.payment-container .book-details p {
    font-size: 16px;
    color: var(--primary-text);
    margin-bottom: 5px;
}

.payment-container .book-price {
    font-size: 24px;
    font-weight: 700;
    color: var(--primary-secondly);
    margin-top: 8px;
}

.payment-container .card-icons {
    display: flex;
    gap: 15px;
    margin-bottom: 25px;
    justify-content: center;
}

.payment-container .card-icon {
    padding: 8px 15px;
    background: transparent;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    color: var(--primary-text);
    border: 1px solid var(--primary-secondly);
    transition: all 0.3s ease;
}

.payment-container .card-icon:hover {
    background: var(--primary-secondly);
    color: #000000;
    border-color: var(--primary-secondly);
}

.payment-container .form-group {
    margin-bottom: 20px;
}

.payment-container .form-group label {
    display: block;
    margin-bottom: 8px;
    font-size: 14px;
    font-weight: 600;
    color: var(--primary-text);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.payment-container .form-control {
    width: 100%;
    padding: 12px 15px;
    font-size: 16px;
    border: 2px solid rgba(196, 171, 32, 0.2);
    border-radius: 8px;
    transition: all 0.3s ease;
    background: transparent;
    color: var(--primary-text);
}

.payment-container .form-control:focus {
    outline: none;
    border-color: var(--primary-secondly);
    background: rgba(196, 171, 32, 0.05);
}

.payment-container .form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.payment-container .btn-pay {
    width: 100%;
    padding: 15px;
    font-size: 18px;
    font-weight: 600;
    color: var(--bg-dark);
    background: var(--primary-secondly);
    border: 2px solid var(--primary-secondly);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    margin: 30px 0 20px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.payment-container .btn-pay:hover {
    background: transparent;
    border-color: var(--primary-secondly);
    color: var(--primary-text);
}

.payment-container .btn-back {
    display: inline-block;
    color: var(--primary-text);
    text-decoration: none;
    font-size: 16px;
    font-weight: 500;
    transition: all 0.3s ease;
    border-bottom: 2px solid transparent;
}

.payment-container .btn-back:hover {
    color: var(--primary-secondly);
    border-bottom-color: var(--primary-secondly);
}

.payment-container .error-message {
    background: rgba(255, 0, 0, 0.05);
    color: #d32f2f;
    padding: 12px 15px;
    border-radius: 8px;
    margin-bottom: 20px;
    border-left: 4px solid #d32f2f;
    font-size: 14px;
    line-height: 1.5;
    border: 1px solid rgba(211, 47, 47, 0.2);
}

.payment-container .success-message {
    background: rgba(196, 171, 32, 0.05);
    color: var(--primary-secondly);
    padding: 12px 15px;
    border-radius: 8px;
    margin-bottom: 20px;
    border-left: 4px solid var(--primary-secondly);
    font-size: 14px;
    border: 1px solid rgba(196, 171, 32, 0.2);
}

.payment-container .security-badge {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-top: 20px;
    padding: 10px;
    background: rgba(196, 171, 32, 0.05);
    border-radius: 6px;
    font-size: 14px;
    color: var(--primary-text);
    border: 1px solid rgba(196, 171, 32, 0.2);
}

/* ========== MODAL WINDOW ========== */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    justify-content: center;
    align-items: center;
}

.modal {
    background: #FFFAF0;
    padding: 30px;
    border-radius: 10px;
    width: 90%;
    max-width: 500px;
    position: relative;
    border: 1px solid var(--primary-text);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

.close-modal {
    position: absolute;
    top: 15px;
    right: 15px;
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: var(--primary-text);
}

.close-modal:hover {
    color: #000;
}

.modal .current-avatar {
    text-align: center;
    margin-bottom: 20px;
}

.modal .avatar-preview {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid var(--primary-text);
}

.modal .form-group {
    margin-bottom: 15px;
}

.modal .form-group label {
    display: block;
    margin-bottom: 5px;
    color: var(--primary-text);
    font-weight: bold;
}

.modal .form-group input[type="text"],
.modal .form-group input[type="file"] {
    width: 100%;
    padding: 8px;
    border: 1px solid var(--primary-secondly);
    border-radius: 4px;
    background: transparent;
    color: var(--primary-text);
}

.modal .form-group input[type="text"]:focus {
    outline: none;
    border-color: var(--primary-text);
}

.modal .form-group small {
    display: block;
    margin-top: 5px;
    color: #666;
    font-size: 12px;
}

/* ========== MESSAGES AND ALERTS ========== */
.alert {
    padding: 15px;
    margin-bottom: 20px;
    border: 1px solid transparent;
    border-radius: 4px;
}

.alert-success {
    color: #155724;
    background-color: #d4edda;
    border-color: #c3e6cb;
}

.alert-error {
    color: #721c24;
    background-color: #f8d7da;
    border-color: #f5c6cb;
}

.alert-info {
    color: #0c5460;
    background-color: #d1ecf1;
    border-color: #bee5eb;
}

.error-msg {
    color: #dc3545;
    background: #ffe6e6;
    padding: 10px;
    border-radius: 4px;
    margin-bottom: 15px;
    border-left: 4px solid #dc3545;
}

.success-msg {
    color: #28a745;
    background: #e6ffe6;
    padding: 10px;
    border-radius: 4px;
    margin-bottom: 15px;
    border-left: 4px solid #28a745;
}

.purchase-notice {
    background: #d4edda;
    color: #155724;
    padding: 10px;
    border-radius: 5px;
    margin: 10px 0;
    border: 1px solid #c3e6cb;
}

.purchase-notice.error {
    background: #f8d7da;
    color: #721c24;
    border-color: #f5c6cb;
}


/* ========== КОММЕНТАРИИ ========== */
.comments-section {
    margin-top: 60px;
    padding: 30px;
    border: 1px solid var(--primary-text);
    border-radius: 12px;
    background: transparent;
    position: relative;
}

.comments-title {
    font-size: 28px;
    margin-bottom: 30px;
    padding-bottom: 15px;
    border-bottom: 2px solid var(--primary-text);
    text-transform: uppercase;
    letter-spacing: 2px;
    color: var(--primary-text);
}

/* Форма комментария */
.comment-form-container {
    margin-bottom: 40px;
    padding: 25px;
    border: 1px solid var(--primary-text);
    border-radius: 10px;
    background: transparent;
}

.comment-form {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.comment-textarea {
    width: 100%;
    min-height: 120px;
    padding: 15px;
    border: 1px solid var(--primary-text);
    border-radius: 8px;
    background: transparent;
    color: var(--primary-text);
    font-size: 16px;
    line-height: 1.5;
    resize: vertical;
}

.comment-textarea:focus {
    outline: none;
    border-color: var(--primary-text);
    box-shadow: 0 0 15px rgba(62, 58, 53, 0.2);
}

.btn-submit {
    align-self: flex-end;
    padding: 12px 30px;
    border: 1px solid var(--primary-text);
    border-radius: 8px;
    background: transparent;
    color: var(--primary-text);
    font-size: 16px;
    cursor: pointer;
    transition: 0.3s ease;
}

.btn-submit:hover {
    background: var(--primary-text);
    color: #FFFFFF;
}

/* Панель форматирования */
.comment-format-toolbar {
    display: flex;
    gap: 5px;
    margin-bottom: 10px;
    flex-wrap: wrap;
}

.format-btn {
    padding: 5px 10px;
    background: transparent;
    border: 1px solid var(--primary-text);
    border-radius: 4px;
    color: var(--primary-text);
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s;
}

.format-btn:hover {
    background: var(--primary-text);
    color: #FFFFFF;
}

.format-hint {
    font-size: 12px;
    color: var(--primary-text);
    opacity: 0.7;
    margin: 5px 0 10px;
    padding: 5px 10px;
    border-left: 3px solid var(--primary-text);
    background: transparent;
}

/* Список комментариев */
.comments-list {
    display: flex;
    flex-direction: column;
    gap: 25px;
}

.comment {
    border: 1px solid var(--primary-text);
    border-radius: 10px;
    padding: 20px;
    background: transparent;
}

.comment-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid rgba(62, 58, 53, 0.3);
}

.comment-author {
    display: flex;
    gap: 15px;
    align-items: center;
}

.comment-avatar,
.comment-avatar-placeholder {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--primary-text);
}

.comment-avatar-placeholder {
    background: var(--primary-text);
    color: #FFFFFF;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    font-weight: bold;
}

.comment-author-name {
    font-size: 18px;
    font-weight: 600;
    color: var(--primary-text);
}

.comment-date {
    font-size: 14px;
    color: var(--primary-text);
    opacity: 0.7;
}

.comment-content {
    margin: 15px 0;
    padding: 15px;
    background: transparent;
    border-radius: 8px;
    font-size: 16px;
    line-height: 1.6;
    color: var(--primary-text);
    word-wrap: break-word;
}

.comment-footer {
    display: flex;
    gap: 10px;
    align-items: center;
    margin-top: 10px;
}

.comment-likes {
    display: flex;
    align-items: center;
    gap: 5px;
}

.btn-like {
    background: transparent;
    border: 1px solid var(--primary-text);
    border-radius: 20px;
    padding: 5px 12px;
    cursor: pointer;
    font-size: 14px;
    color: var(--primary-text);
    transition: 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.btn-like:hover {
    background: var(--primary-text);
    color: #FFFFFF;
}

.btn-like.liked {
    background: var(--primary-text);
    color: #FFFFFF;
}

.likes-count {
    font-weight: 600;
}

.btn-reply {
    background: transparent;
    border: 1px solid var(--primary-text);
    border-radius: 20px;
    padding: 5px 15px;
    font-size: 13px;
    color: var(--primary-text);
    cursor: pointer;
    transition: 0.3s ease;
}

.btn-reply:hover {
    background: var(--primary-text);
    color: #FFFFFF;
}

.btn-delete {
    background: transparent;
    border: 1px solid var(--primary-text);
    border-radius: 20px;
    padding: 5px 15px;
    font-size: 13px;
    color: var(--primary-text);
    cursor: pointer;
    transition: 0.3s ease;
}

.btn-delete:hover {
    background: var(--primary-text);
    color: #FFFFFF;
}

/* Форма ответа */
.reply-form-container,
.reply-to-reply-form-container {
    margin-top: 15px;
    padding: 15px;
    background: transparent;
    border: 1px solid var(--primary-text);
    border-radius: 8px;
}

.reply-textarea {
    width: 100%;
    min-height: 80px;
    padding: 12px;
    border: 1px solid var(--primary-text);
    border-radius: 6px;
    background: transparent;
    color: var(--primary-text);
    font-size: 14px;
    line-height: 1.5;
    resize: vertical;
    margin-bottom: 10px;
}

.reply-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

.btn-submit-reply {
    padding: 8px 20px;
    border: 1px solid var(--primary-text);
    border-radius: 6px;
    background: transparent;
    color: var(--primary-text);
    font-size: 14px;
    cursor: pointer;
    transition: 0.3s ease;
}

.btn-submit-reply:hover {
    background: var(--primary-text);
    color: #FFFFFF;
}

.btn-cancel {
    padding: 8px 20px;
    border: 1px solid var(--primary-text);
    border-radius: 6px;
    background: transparent;
    color: var(--primary-text);
    font-size: 14px;
    cursor: pointer;
    transition: 0.3s ease;
}

.btn-cancel:hover {
    background: var(--primary-text);
    color: #FFFFFF;
}

/* Ответы */
.replies-list {
    margin-left: 30px;
    margin-top: 20px;
    padding-left: 20px;
    border-left: 1px solid rgba(62, 58, 53, 0.3);
}

.reply {
    margin-bottom: 15px;
    padding: 15px;
    border: 1px solid rgba(62, 58, 53, 0.2);
    border-radius: 8px;
    background: transparent;
}

.reply-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    padding-bottom: 8px;
    border-bottom: 1px solid rgba(62, 58, 53, 0.2);
}

.reply-author {
    display: flex;
    gap: 10px;
    align-items: center;
}

.reply-avatar,
.reply-avatar-placeholder {
    width: 35px;
    height: 35px;
    border-radius: 50%;
    object-fit: cover;
    border: 1px solid var(--primary-text);
}

.reply-avatar-placeholder {
    background: var(--primary-text);
    color: #FFFFFF;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    font-weight: bold;
}

.reply-author-name {
    font-size: 15px;
    font-weight: 600;
    color: var(--primary-text);
}

.reply-to {
    font-size: 13px;
    color: var(--primary-text);
    opacity: 0.7;
    display: flex;
    align-items: center;
    gap: 5px;
}

.reply-to a {
    color: var(--primary-text);
    text-decoration: none;
}

.reply-to a:hover {
    text-decoration: underline;
}

.reply-date {
    font-size: 12px;
    color: var(--primary-text);
    opacity: 0.6;
}

.reply-content {
    margin: 10px 0;
    padding: 12px;
    background: transparent;
    border-radius: 6px;
    font-size: 14px;
    line-height: 1.5;
    color: var(--primary-text);
}

.reply-footer {
    display: flex;
    gap: 10px;
    align-items: center;
    margin: 8px 0;
}

.reply-likes {
    display: flex;
    align-items: center;
    gap: 5px;
}

/* Сообщения */
.comment-login-prompt {
    text-align: center;
    padding: 30px;
    border: 1px dashed var(--primary-text);
    border-radius: 8px;
    background: transparent;
    margin-bottom: 10px;
}

.comment-login-prompt a {
    color: var(--primary-text);
    text-decoration: underline;
}

.comment-login-prompt a:hover {
    text-decoration: none;
}

.error-messages {
    margin: 10px 0;
    padding: 12px;
    border: 1px solid var(--primary-text);
    border-radius: 6px;
    background: transparent;
    color: var(--primary-text);
}

.no-comments {
    text-align: center;
    padding: 40px;
    color: var(--primary-text);
    opacity: 0.7;
    font-size: 18px;
    border: 1px dashed var(--primary-text);
    border-radius: 8px;
}

/* ========== ПРАВИЛА ФОРУМА ========== */
.rules-page {
    max-width: 900px;
    margin: 50px auto;
    padding: 40px;
    border: 1px solid var(--primary-text);
    border-radius: 12px;
    background: transparent;
}

.rules-page h1 {
    font-size: 36px;
    text-align: center;
    margin-bottom: 30px;
    color: var(--primary-text);
    text-transform: uppercase;
}

.rules-page h2 {
    font-size: 24px;
    margin: 30px 0 15px;
    color: var(--primary-text);
    border-bottom: 1px solid var(--primary-text);
    padding-bottom: 5px;
}

.rules-page p {
    margin-bottom: 15px;
    line-height: 1.6;
    color: var(--primary-text);
}

.rules-page ul {
    margin-bottom: 20px;
    padding-left: 20px;
}

.rules-page li {
    margin-bottom: 8px;
    color: var(--primary-text);
    list-style-type: disc;
}

/* ========== СПОЙЛЕРЫ ========== */
.spoiler {
    background: var(--primary-text);
    cursor: pointer;
    padding: 2px 4px;
    border-radius: 3px;
    transition: 0.2s ease;
    user-select: none;
}

.spoiler:hover {
    background: none;
    color: var(--primary-text);
}

/* ========== ЦИТАТЫ ========== */
blockquote {
    margin: 10px 0;
    padding: 10px 15px;
    border-left: 3px solid var(--primary-text);
    background: rgba(62, 58, 53, 0.05);
    font-style: italic;
    color: var(--primary-text);
}


/* ========== СТИЛИ ДЛЯ ЖАЛОБ ========== */
.btn-report {
    background: transparent;
    border: 1px solid #dc3545;
    border-radius: 20px;
    padding: 5px 15px;
    font-size: 13px;
    color: #dc3545;
    cursor: pointer;
    transition: 0.3s ease;
}

.btn-report:hover {
    background: #dc3545;
    color: var(--bg-dark);
}

.report-form-container {
    margin-top: 15px;
    margin-bottom: 15px;
    padding: 20px;
    border: 1px solid var(--primary-text);
    border-radius: 8px;
    background: rgba(196, 171, 32, 0.05);
}

.report-form-title {
    font-size: 16px;
    font-weight: bold;
    margin-bottom: 10px;
    color: var(--primary-text);
}

.report-comment-preview {
    font-size: 13px;
    color: #666;
    margin-bottom: 15px;
    padding: 8px;
    background: rgba(196, 171, 32, 0.1);
    border-radius: 4px;
}

.report-select {
    width: 100%;
    padding: 10px;
    margin-bottom: 15px;
    border: 1px solid var(--primary-text);
    border-radius: 4px;
    background: transparent;
    color: var(--primary-text);
}

.report-select option {
    background: var(--bg-dark);
}

.report-textarea {
    width: 100%;
    padding: 10px;
    margin-bottom: 15px;
    border: 1px solid var(--primary-text);
    border-radius: 4px;
    background: transparent;
    color: var(--primary-text);
    resize: vertical;
    min-height: 60px;
}

.report-textarea:focus,
.report-select:focus {
    outline: none;
    border-color: var(--primary-text);
    box-shadow: 0 0 5px rgba(196, 171, 32, 0.3);
}

.report-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

.btn-report-submit {
    padding: 8px 20px;
    border: 1px solid #dc3545;
    border-radius: 6px;
    background: transparent;
    color: #dc3545;
    cursor: pointer;
    transition: 0.3s ease;
}

.btn-report-submit:hover {
    background: #dc3545;
    color: var(--bg-dark);
}

.btn-report-cancel {
    padding: 8px 20px;
    border: 1px solid #666;
    border-radius: 6px;
    background: transparent;
    color: #666;
    cursor: pointer;
    transition: 0.3s ease;
}

.btn-report-cancel:hover {
    background: #666;
    color: var(--bg-dark);
}



/* ========== UTILITY CLASSES ========== */
.text-center {
    text-align: center;
}

.mt-20 {
    margin-top: 20px;
}

.mb-20 {
    margin-bottom: 20px;
}

.hidden {
    display: none;
}




/* --- Общие исправления для всех устройств --- */
.container {
    width: 100%;
    max-width: 1440px;
    padding: 0 20px;
    margin: 0 auto;
    box-sizing: border-box;
}

/* Резиновые шрифты через clamp() */
.title {
    font-size: clamp(2.5rem, 8vw, 6rem);
}

h2,
.theme_title {
    font-size: clamp(1.8rem, 5vw, 3rem);
}

.theme_desc {
    font-size: clamp(1rem, 4vw, 1.375rem);
}







/* Увеличенные таргеты для мобильных устройств */
@media (max-width: 768px) {
    .btn,
    .nav_item,
    .profile_btn,
    .theme_card,
    .form_btn,
    .tab-btn,
    .btn-filter,
    .search-btn,
    .btn-clear,
    .pagination-item {
        min-height: 44px;
        min-width: 44px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }

    /* Увеличение области клика для ссылок в навигации */
    .nav_item {
        padding: 12px 16px;
    }
}

/* ========== ПЛАНШЕТ (768px - 1199px) ========== */
@media (min-width: 768px) and (max-width: 1199px) {

    .arrow_up {
            display: none;
    }

    .container {
        padding: 0 30px;
    }

    /* Категории на главной */
    .theme_cards {
        gap: 30px;
        justify-content: center;
    }

    .theme_card {
        width: 280px;
        height: 200px;
        background-size: cover;
        border-radius: 16px;
    }

    /* Сетка книг в категории */
    .theme_cards_category {
        display: flex;
        gap: 25px;
        justify-content: center;
    }

    .theme_card_category {
        width: 200px;
    }

    /* Welcome секция */
    .welcome_img {
        height: 400px;
    }

    .welcome_img_statue {
        width: 300px;
        top: -150px;
        left: 50px;
    }

    /* Формы */
    .form_container {
        width: 90%;
        max-width: 600px;
    }

    .form {
        display: flex;
        gap: 20px;
    }

    /* .form {
        flex-direction: column;
        gap: 20px;
    } */

    .form_text {
        width: 100%;
    }

    /* Главная регистрационная секция */
    .main_register_zone {
        padding: 0 50px;
        gap: 20px;
    }

    .main_register_title {
        font-size: clamp(2.5rem, 6vw, 4rem);
    }

    /* Профиль - закладки и покупки */
    .bookmarks-list,
    .purchases-list {
        gap: 20px;
        justify-content: flex-start;
    }

    .bookmark-item,
    .purchase-item {
        width: calc(33.333% - 14px);
        min-width: 200px;
    }
}

/* ========== МОБИЛЬНЫЕ ТЕЛЕФОНЫ (320px - 767px) ========== */
@media (max-width: 767px) {

    .arrow_up{
        display: none;
    }

    .container {
        padding: 0 15px;
    }

    /* --- БУРГЕР-МЕНЮ ДЛЯ ШАПКИ --- */
    /* Переделываем навигацию под мобильные */
    .header {
        padding-top: 20px;
        position: relative;
    }

    .nav {
        flex-wrap: wrap;
        position: relative;
    }

    /* Скрываем навигационное меню по умолчанию */
    .nav_list {
        display: none;
        width: 100%;
        flex-direction: column;
        gap: 10px;
        order: 3;
        margin-top: 20px;
        padding: 15px 0;
        border-top: 1px solid var(--primary-text);
        text-align: center;
    }

    /* Показываем меню при активном состоянии (через JS) */
    .nav_list.active {
        display: flex;
    }

    /* Стили для бургер-кнопки */
    .burger-menu {
        display: flex;
        flex-direction: column;
        justify-content: space-between;
        width: 30px;
        height: 21px;
        cursor: pointer;
        order: 2;
        margin-left: auto;
    }

    .burger-menu span {
        display: block;
        width: 100%;
        height: 3px;
        background-color: var(--primary-text);
        transition: 0.3s ease;
        border-radius: 2px;
    }

    /* Анимация бургера при открытии */
    .burger-menu.active span:nth-child(1) {
        transform: rotate(45deg) translate(6px, 6px);
    }

    .burger-menu.active span:nth-child(2) {
        opacity: 0;
    }

    .burger-menu.active span:nth-child(3) {
        transform: rotate(-45deg) translate(6px, -6px);
    }

    /* Навигационные ссылки на мобилках */
    .nav_item {
        font-size: 20px;
        padding: 12px;
        display: block;
        width: 100%;
    }

    /* Логотип */
    .logo {
        order: 1;
    }

    /* Кнопка профиля */
    .nav_button {
        order: 2;
    }


    /* --- КАТЕГОРИИ НА ГЛАВНОЙ --- */
    .theme_cards {
        flex-direction: column;
        align-items: center;
        gap: 20px;
        margin-bottom: 50px;
    }

    .theme_card {
        width: 90%;
        max-width: 300px;
        height: 180px;
        background-size: cover;
        background-position: center;
    }

    .theme_desc {
        font-size: 18px;
        padding: 10px;
    }

    /* --- СЕТКА КНИГ (вертикальный список) --- */
    .theme_cards_category {
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 25px;
    }

    .theme_card_category_wrapper {
        width: 100%;
        max-width: 280px;
    }

    .theme_card_category {
        width: 100%;
        min-height: auto;
    }

    .theme_card_category img {
        width: 160px;
        height: 220px;
    }

    .name_book_category {
        font-size: 20px;
        -webkit-line-clamp: 2;
        min-height: 52px;
    }

    /* --- ФИЛЬТРЫ НА СТРАНИЦЕ КАТЕГОРИИ --- */
    .filters-form {
        flex-direction: column;
    }

    .filter-group {
        width: 100%;
    }

    .filter-actions {
        flex-direction: column;
    }

    .btn-filter,
    .btn-reset {
        width: 100%;
        text-align: center;
        padding: 12px;
    }

    .price-inputs {
        justify-content: space-between;
    }

    .filter-input {
        width: calc(50% - 10px);
    }

    .active-filters {
        flex-direction: column;
        align-items: flex-start;
    }

    /* --- СТРАНИЦА КНИГИ (one.php) --- */
    .post-header {
        flex-direction: column;
        align-items: center;
        text-align: center;
        gap: 25px;
    }

    .post-image {
        width: 200px;
        height: 280px;
    }

    .post-text {
        max-width: 100%;
        align-items: center;
    }

    .post-title {
        font-size: 1.8rem;
        text-align: center;
    }

    .price-info {
        width: 100%;
        max-width: 100%;
    }

    .post_btn {
        width: 100%;
        max-width: 100%;
    }

    .post_btn .btn {
        width: 100%;
        padding: 14px 20px;
    }

    .book-file-info {
        justify-content: center;
    }

    /* --- ФОРМЫ РЕГИСТРАЦИИ И АВТОРИЗАЦИИ --- */
    .form_container {
        width: 100%;
        padding: 0 20px;
        margin-bottom: 80px;
    }

    .form_title {
        font-size: 32px;
        margin-bottom: 40px;
    }

          .form {
              display: flex;
              gap: 20px;
          }

    .form_img {
        max-width: 100px;
    }

    .form_text {
        width: 100%;
    }

    .form_enter {
        font-size: 18px;
        margin-bottom: 40px;
        padding: 8px 0;
    }

    .form_btn {
        font-size: 20px;
        padding: 12px;
    }

    /* --- СТРАНИЦА ПРОФИЛЯ --- */
    .profile_block {
        flex-direction: column;
        align-items: center;
        gap: 20px;
    }

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

    .profile_login {
        font-size: 20px;
    }

    .profile-tabs {
        flex-direction: column;
        gap: 10px;
        border-bottom: none;
    }

    .tab-btn {
        width: 100%;
        text-align: center;
        border-radius: 8px;
        display: flex;
        justify-content: space-between;
        align-items: center;
    }

    /* Закладки и покупки на мобилках */
    .bookmarks-list,
    .purchases-list {
        flex-direction: column;
        align-items: center;
    }

    .bookmark-item,
    .purchase-item {
        width: 100%;
        max-width: 320px;
        min-height: auto;
    }

    .bookmark-image,
    .purchase-image {
        height: 280px;
    }

    /* --- ГЛАВНАЯ РЕГИСТРАЦИОННАЯ СЕКЦИЯ --- */
    .main_register {
        margin-bottom: 80px;
    }

    .main_register_zone {
        flex-direction: column;
        padding: 0 20px;
        gap: 30px;
    }

    .main_register_column {
        display: none;
    }

    .main_register_title {
        font-size: 48px;
    }

    .main_register_desc {
        font-size: 24px;
        margin-bottom: 40px;
    }

    .main_register_btn {
        font-size: 20px;
        padding: 14px;
        width: 100%;
        max-width: 300px;
        margin: 0 auto;
    }

    /* --- WELCOME СЕКЦИЯ --- */
    .welcome {
        margin: 50px 0;
    }

    .welcome_img {
        height: 300px;
    }

    .welcome_img_back {
        width: 100%;
        top: -50px;
    }

    .welcome_img_statue {
        width: 200px;
        top: -100px;
        left: 50%;
        transform: translateX(-50%);
    }

    .welcome_img_front {
        width: 100%;
        top: -20px;
    }

    /* --- КОММЕНТАРИИ --- */
    .comments-section {
        padding: 20px 15px;
    }

    .comments-title {
        font-size: 24px;
    }

    .comment-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .comment-author {
        flex-wrap: wrap;
    }

    .comment-footer {
        flex-wrap: wrap;
    }

    .btn-like,
    .btn-reply,
    .btn-delete {
        padding: 8px 16px;
        min-height: 40px;
    }

    .replies-list {
        margin-left: 10px;
        padding-left: 10px;
    }

    .reply {
        padding: 12px;
    }

    .reply-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    .reply-footer {
    flex-wrap: wrap;
    }

    /* --- ХЛЕБНЫЕ КРОШКИ --- */
    .breadcrumbs {
        font-size: 14px;
        flex-wrap: wrap;
        gap: 5px;
    }

    /* --- ПАГИНАЦИЯ --- */
    .pagination {
        gap: 5px;
    }

    .pagination-item {
        min-width: 36px;
        height: 36px;
        font-size: 14px;
    }

    /* --- ФУТЕР --- */
    .footer {
        padding-top: 30px;
        margin-bottom: 30px;
    }

    

    .footer_links {
        flex-direction: column;
        align-items: center;
        gap: 15px;
    }

    .footer_link {
        font-size: 18px;
    }

    .footer_right {
        font-size: 14px;
        text-align: center;
    }

    /* --- МОДАЛЬНОЕ ОКНО --- */
    .modal {
        width: 95%;
        padding: 20px;
        margin: 20px;
    }

    .modal .form-group input[type="text"],
    .modal .form-group input[type="file"] {
        font-size: 16px;
        padding: 12px;
    }
}

/* ========== ОЧЕНЬ МАЛЕНЬКИЕ ТЕЛЕФОНЫ (320px - 480px) ========== */
@media (max-width: 480px) {
    .container {
        padding: 0 12px;
    }

    .title {
        font-size: 2rem;
        margin-bottom: 30px;
    }

    .theme_title {
        font-size: 28px;
        margin-bottom: 40px;
        text-align: center;
    }

    .theme_card {
        width: 100%;
        max-width: 260px;
        height: 160px;
        border-radius: 8px;
    }

    .theme_desc {
        font-size: 16px;
    }

    /* Увеличенные отступы для кнопок */
    .btn,
    .form_btn,
    .tab-btn,
    .btn-filter {
        padding: 12px 16px;
    }

    /* Компактные формы */
    .form_enter {
        font-size: 16px;
        margin-bottom: 30px;
    }

    .form_title {
        font-size: 28px;
    }

    /* Пост страница */
    .post-title {
        font-size: 1.5rem;
    }

    .post-image {
        width: 180px;
        height: 250px;
    }

    /* Комментарии */
    .comment-content {
        font-size: 14px;
        padding: 10px;
    }

    .reply-content {
        font-size: 13px;
    }

    /* Пагинация */
    .pagination-info {
        font-size: 12px;
    }

    /* Бургер-меню */
    .burger-menu {
        width: 26px;
        height: 18px;
    }

    .nav_item {
        font-size: 18px;
        padding: 10px;
    }
}


/* ========== ДОРАБОТКА ВЫПАДАЮЩЕГО МЕНЮ ПРОФИЛЯ ========== */

/* Десктопная версия (hover) */
@media (min-width: 768px) {
    .profile_dropdown {
        position: relative;
    }

    .profile_do {
        position: absolute;
        top: 100%;
        right: 0;
        display: none;
        background-color: var(--bg-dark);
        border: 1px solid var(--primary-text);
        border-radius: 8px;
        min-width: 220px;
        z-index: 1000;
        box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    }

    .profile_dropdown:hover .profile_do {
        display: block;
    }

    .profile_do li {
        margin: 0;
    }

    .profile_do a {
        display: block;
        padding: 12px 20px;
        color: var(--primary-text);
        transition: all 0.3s ease;
        border-bottom: 1px solid rgba(62, 58, 53, 0.1);
    }

    .profile_do a:last-child {
        border-bottom: none;
    }

    .profile_do a:hover {
        background-color: var(--primary-text);
        color: var(--bg-dark);
    }
}

/* Мобильная версия (клик) - ИСПРАВЛЕННАЯ ВЕРСИЯ */
/* Простое рабочее решение - замените все стили profile_do на эти */



/* ============================================ */
/* ========== ДОРАБОТКА БУРГЕР-МЕНЮ ========== */
/* ============================================ */

/* Стили для бургер-кнопки */
.burger-menu {
    display: none;
    flex-direction: column;
    justify-content: space-between;
    width: 30px;
    height: 21px;
    cursor: pointer;
    z-index: 1001;
    position: relative;
}

.burger-menu span {
    display: block;
    width: 100%;
    height: 3px;
    background-color: var(--primary-text);
    transition: 0.3s ease;
    border-radius: 2px;
}

/* Анимация бургера при открытии */
.burger-menu.active span:nth-child(1) {
    transform: rotate(45deg) translate(6px, 6px);
}

.burger-menu.active span:nth-child(2) {
    opacity: 0;
    transform: scale(0.8);
}

.burger-menu.active span:nth-child(3) {
    transform: rotate(-45deg) translate(6px, -6px);
}

/* Мобильное меню */
@media (max-width: 767px) {
    .nav {
        display: flex;
        justify-content: space-between;
        align-items: center;
    }

    .burger-menu {
        display: flex;
        margin-left: auto;
    }

    .nav_list {
        order: 3;
        width: 100%;
    }
}




/* ========== ДОПОЛНИТЕЛЬНЫЕ УЛУЧШЕНИЯ ========== */

/* Убираем скролл при открытом меню */
body.menu-open {
    overflow: hidden;
}

/* Плавные переходы для всех интерактивных элементов */
.profile_btn,
.burger-menu,
.nav_item,
.profile_do a {
    transition: all 0.3s ease;
}

/* Улучшенная область клика для мобильных */
@media (max-width: 767px) {
    .profile_btn {
        width: 100px;
        padding: 10px 16px;
        min-height: 44px;
        display: inline-flex;
        align-items: center;
    }

    .nav_button .btn_nav {
        font-size: 16px;
    }
}

@media (min-width: 768px) {
    .profile_do {
        display: none;
    }
}

/* ========== БУРГЕР-МЕНЮ ========== */
@media (max-width: 767px) {
    .burger-menu {
        display: flex;
        flex-direction: column;
        justify-content: space-between;
        width: 30px;
        height: 21px;
        cursor: pointer;
        z-index: 1001;
        margin-left: auto;
        margin-right: 15px;
    }

    .burger-menu span {
        display: block;
        width: 100%;
        height: 3px;
        background-color: var(--primary-text);
        transition: 0.3s ease;
        border-radius: 2px;
    }

    .burger-menu.active span:nth-child(1) {
        transform: rotate(45deg) translate(6px, 6px);
    }

    .burger-menu.active span:nth-child(2) {
        opacity: 0;
    }

    .burger-menu.active span:nth-child(3) {
        transform: rotate(-45deg) translate(6px, -6px);
    }

    .nav_list {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100vh;
        background-color: var(--bg-dark);
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 20px;
        z-index: 1000;
        margin: 0;
        padding: 80px 20px 40px;
    }

    .nav_list.active {
        display: flex;
        animation: fadeInMenu 0.3s ease;
    }

    @keyframes fadeInMenu {
        from {
            opacity: 0;
            transform: translateX(100%);
        }

        to {
            opacity: 1;
            transform: translateX(0);
        }
    }

    .nav_item {
        font-size: 24px;
        padding: 15px 20px;
        width: 100%;
        text-align: center;
        border-bottom: 1px solid rgba(62, 58, 53, 0.1);
    }

    .nav_button {
        position: relative;
        z-index: 1002;
    }


}