/* Основные стили */
body {
    background-color: #f8f9fa;
    font-family: 'Georgia', 'Times New Roman', serif;
    line-height: 1.6;
}

/* Стили для просмотра пароля */
.password-input-group {
    position: relative;
    display: flex;
    align-items: center;
}

.password-toggle-btn {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #666;
    cursor: pointer;
    padding: 5px;
    z-index: 10;
    transition: color 0.2s ease;
}

.password-toggle-btn:hover {
    color: #000;
}

.password-toggle-btn:focus {
    outline: none;
    color: #007bff;
}

.password-input-group .form-control {
    padding-right: 45px;
}

/* Сдвигаем иконку глазика влево при наличии ошибки */
.password-input-group .form-control.is-invalid + .password-toggle-btn {
    right: 35px; /* Сдвигаем влево чтобы не перекрывалось с иконкой ошибки */
}

.password-input-group .form-control.is-invalid {
    padding-right: 70px; /* Увеличиваем padding для двух иконок */
}

/* Адаптивность для мобильных устройств */
@media (max-width: 768px) {
    .password-toggle-btn {
        right: 8px;
        padding: 8px;
        font-size: 16px; /* Увеличиваем размер для лучшего тапа */
    }
    
    .password-input-group .form-control {
        padding-right: 50px; /* Больше места для кнопки на мобильных */
        font-size: 16px; /* Предотвращает зум на iOS */
    }
    
    /* Сдвигаем иконку глазика влево при ошибке на мобильных */
    .password-input-group .form-control.is-invalid + .password-toggle-btn {
        right: 30px;
    }
    
    .password-input-group .form-control.is-invalid {
        padding-right: 75px;
    }
}

@media (max-width: 480px) {
    .password-toggle-btn {
        right: 6px;
        padding: 10px;
        font-size: 18px;
    }
    
    .password-input-group .form-control {
        padding-right: 55px;
    }
    
    /* Сдвигаем иконку глазика влево при ошибке на маленьких мобильных */
    .password-input-group .form-control.is-invalid + .password-toggle-btn {
        right: 25px;
    }
    
    .password-input-group .form-control.is-invalid {
        padding-right: 80px;
    }
}

/* Газетный дизайн */
.newspaper-layout {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
    background: #fff;
    box-shadow: 0 0 20px rgba(0,0,0,0.1);
}

.newspaper-header {
    text-align: center;
    border-bottom: 3px solid #000;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
}

.newspaper-logo-container {
    text-align: center;
    margin-bottom: 1rem;
}

.newspaper-logo {
    height: 120px;
    width: auto;
    max-width: 400px;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.1));
    object-fit: contain;
}

.newspaper-title {
    font-family: 'Times New Roman', serif;
    font-size: 3.5rem;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin: 0;
    color: #000;
}

.newspaper-subtitle {
    font-size: 1.2rem;
    color: #666;
    font-style: italic;
    margin: 0.5rem 0;
}

.newspaper-date {
    font-size: 1rem;
    color: #888;
    border-top: 1px solid #ccc;
    padding-top: 0.5rem;
    margin-top: 0.5rem;
}

/* Колонки для объявлений */
.newspaper-columns {
    column-count: 3;
    column-gap: 2rem;
    column-rule: 1px solid #ddd;
}

@media (max-width: 992px) {
    .newspaper-columns {
        column-count: 2;
    }
}

@media (max-width: 768px) {
    .newspaper-columns {
        column-count: 1;
    }
}

/* Стили объявлений в газетном стиле */
.listing-newspaper {
    break-inside: avoid;
    margin-bottom: 2rem;
    padding: 1.5rem;
    border: 2px solid #000;
    background: #fff;
    position: relative;
    page-break-inside: avoid;
}

.listing-newspaper::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #000, #333);
}

.listing-newspaper:hover {
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
    border-color: #333;
    transition: all 0.3s ease;
}

.listing-newspaper .listing-header {
    border-bottom: 2px solid #000;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
}

.listing-newspaper .listing-title {
    font-family: 'Times New Roman', serif;
    font-size: 1.4rem;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #000;
    margin: 0;
    line-height: 1.2;
}

.listing-newspaper .listing-category {
    display: inline-block;
    background: #000;
    color: #fff;
    padding: 0.25rem 0.75rem;
    font-size: 0.8rem;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-top: 0.5rem;
}

.listing-newspaper .listing-price {
    font-family: 'Georgia', serif;
    font-size: 1.8rem;
    font-weight: bold;
    color: #000;
    margin: 1rem 0;
    text-align: center;
    border: 2px solid #000;
    padding: 0.5rem;
    background: #f8f9fa;
}

.listing-newspaper .listing-description {
    font-family: 'Georgia', serif;
    font-size: 1rem;
    line-height: 1.7;
    color: #333;
    margin: 1rem 0;
    text-align: justify;
    hyphens: auto;
    min-height: auto;
    white-space: pre-line;
}

.listing-newspaper .listing-meta {
    border-top: 1px solid #ccc;
    padding-top: 1rem;
    margin-top: 1rem;
    font-size: 0.9rem;
    color: #666;
}

.listing-newspaper .listing-author {
    font-weight: bold;
    color: #000;
}

.listing-newspaper .listing-date {
    font-style: italic;
}

.listing-newspaper .listing-images {
    margin: 1rem 0;
    text-align: center;
}

.listing-newspaper .listing-image {
    width: 100%;
    height: 200px;
    object-fit: cover;
    object-position: center;
    border: 2px solid #000;
    margin: 0.5rem 0;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.listing-newspaper .negotiable-badge {
    display: inline-block;
    background: #000;
    color: #fff;
    padding: 0.25rem 0.5rem;
    font-size: 0.7rem;
    font-weight: bold;
    text-transform: uppercase;
    margin-left: 0.5rem;
}

/* Стили для детального просмотра объявления */
.listing-detail-newspaper {
    max-width: 800px;
    margin: 0 auto;
    padding: 2rem;
    background: #fff;
    box-shadow: 0 0 20px rgba(0,0,0,0.1);
}

.listing-detail-newspaper .detail-header {
    text-align: center;
    border-bottom: 3px solid #000;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
}

.listing-detail-newspaper .detail-title {
    font-family: 'Times New Roman', serif;
    font-size: 2.5rem;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin: 0;
    color: #000;
    line-height: 1.1;
}

.listing-detail-newspaper .detail-category {
    display: inline-block;
    background: #000;
    color: #fff;
    padding: 0.5rem 1.5rem;
    font-size: 1rem;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin: 1rem 0;
}

.listing-detail-newspaper .detail-price {
    font-family: 'Georgia', serif;
    font-size: 2.5rem;
    font-weight: bold;
    color: #000;
    margin: 1.5rem 0;
    text-align: center;
    border: 3px solid #000;
    padding: 1rem;
    background: #f8f9fa;
}

.listing-detail-newspaper .detail-description {
    font-family: 'Georgia', serif;
    font-size: 1.1rem;
    line-height: 1.8;
    color: #333;
    margin: 2rem 0;
    text-align: justify;
    hyphens: auto;
    min-height: auto;
    white-space: pre-line;
}

@media (max-width: 768px) {
    .listing-detail-newspaper .detail-description {
        column-count: 1;
    }
}

.listing-detail-newspaper .detail-images {
    margin: 2rem 0;
    text-align: center;
}

.listing-detail-newspaper .detail-image {
    width: 100%;
    height: 300px;
    object-fit: cover;
    object-position: center;
    border: 2px solid #000;
    margin: 1rem 0;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
}

.listing-detail-newspaper .detail-meta {
    border-top: 2px solid #000;
    padding-top: 1.5rem;
    margin-top: 2rem;
    font-size: 1rem;
    color: #666;
    text-align: center;
}

.listing-detail-newspaper .detail-author {
    font-weight: bold;
    color: #000;
    font-size: 1.1rem;
}

.listing-detail-newspaper .detail-date {
    font-style: italic;
    margin-top: 0.5rem;
}

/* Классические карточки */
.card {
    transition: transform 0.2s ease-in-out;
    border: none;
    box-shadow: 0 2px 4px rgba(0,0,0,.1);
    height: 400px !important;
    min-height: 400px !important;
    max-height: 400px !important;
    display: flex !important;
    flex-direction: column !important;
}

/* Карточки с фото - фиксированная высота */
.card.has-image {
    height: 400px !important;
    min-height: 400px !important;
    max-height: 400px !important;
}

.card:hover {
    box-shadow: 0 4px 8px rgba(0,0,0,.15);
    border-color: #007bff;
}

.listing-card {
    margin-bottom: 20px;
}

.card-body {
    display: flex !important;
    flex-direction: column !important;
    justify-content: space-between !important;
    flex: 1 !important;
    padding: 1rem;
    height: 100% !important;
    overflow: hidden;
}

.listing-image {
    width: 100% !important;
    height: 200px !important;
    object-fit: cover !important;
    object-position: center !important;
    border-radius: 8px 8px 0 0;
    border: 2px solid #ddd;
    border-bottom: none;
    flex-shrink: 0;
}

.listing-image-placeholder {
    width: 100% !important;
    height: 200px !important;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    display: flex !important;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #6c757d;
    border: 2px solid #dee2e6;
    border-bottom: none;
    border-radius: 8px 8px 0 0;
    flex-shrink: 0;
    font-size: 0.9rem;
}

.listing-image-placeholder i {
    font-size: 2rem;
    margin-bottom: 0.5rem;
    opacity: 0.7;
}

.listing-image-placeholder span {
    font-size: 0.9rem;
    font-weight: 500;
    opacity: 0.8;
}

.listing-price {
    font-size: 1.25rem;
    font-weight: bold;
    color: #28a745;
}

.listing-price-main {
    font-size: 1.4rem;
    font-weight: bold;
    color: #17a2b8;
    text-align: center;
    margin: 0.5rem 0;
    padding: 0.3rem 0;
}

/* Исправления для мобильных устройств */
.listing-title {
    word-wrap: break-word;
    overflow-wrap: break-word;
    hyphens: auto;
    line-height: 1.2;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.card-text {
    word-wrap: break-word;
    overflow-wrap: break-word;
    hyphens: auto;
    line-height: 1.4;
    white-space: pre-line;
    min-height: auto;
}

.listing-meta {
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.listing-meta div {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

/* Мобильные стили для карточек объявлений */
@media (max-width: 768px) {
    .listing-card {
        margin-bottom: 15px;
    }
    
    .listing-image,
    .listing-image-placeholder {
        width: 100% !important;
        height: 140px !important;
        object-fit: cover !important;
        object-position: center !important;
    }
    
    .listing-price {
        font-size: 0.9rem;
        margin-bottom: 0.4rem;
    }
    
    .listing-price-main {
        font-size: 1.1rem;
        margin: 0.4rem 0;
        padding: 0.2rem 0;
    }
    
    .listing-title {
        font-size: 0.85rem;
        margin-bottom: 0.3rem;
        line-height: 1.1;
        /* Обрезка текста после 2 строк */
        overflow: hidden;
        text-overflow: ellipsis;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
    }
    
    .listing-meta {
        font-size: 0.65rem;
        margin-top: 0.4rem;
    }
    
    .listing-meta div {
        margin-bottom: 0.15rem;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    
    .card-text {
        font-size: 0.75rem;
        margin-bottom: 0.4rem;
        line-height: 1.2;
        white-space: pre-line;
        min-height: auto;
    }
    
    /* Динамическая высота карточек для мобильных */
    .card {
        min-height: 200px !important;
        max-height: 350px !important;
    }
    
    /* Карточки с фото - фиксированная высота */
    .card.has-image {
        height: 350px !important;
        min-height: 350px !important;
        max-height: 350px !important;
    }
    
    .card-body {
        display: flex !important;
        flex-direction: column !important;
        justify-content: space-between !important;
        height: 100% !important;
        padding: 0.5rem;
        overflow: hidden;
    }
    
    /* Исправленная сетка для 2 колонок */
    .col-6 {
        flex: 0 0 calc(50% - 0.5rem) !important;
        max-width: calc(50% - 0.5rem) !important;
        margin-bottom: 1rem !important;
    }
    
    /* Правильные отступы для сетки */
    .row {
        margin-left: -0.5rem;
        margin-right: -0.5rem;
        display: flex;
        flex-wrap: wrap;
        gap: 1rem;
    }
    
    .col-6, .col-md-4 {
        padding-left: 0.5rem;
        padding-right: 0.5rem;
    }
}

@media (max-width: 480px) {
    .listing-card {
        margin-bottom: 8px;
    }
    
    .listing-image,
    .listing-image-placeholder {
        width: 100% !important;
        height: 100px !important;
        object-fit: cover !important;
        object-position: center !important;
    }
    
    .listing-price {
        font-size: 0.8rem;
        margin-bottom: 0.3rem;
    }
    
    .listing-price-main {
        font-size: 1rem;
        margin: 0.3rem 0;
        padding: 0.15rem 0;
    }
    
    .listing-title {
        font-size: 0.8rem;
        margin-bottom: 0.3rem;
        line-height: 1.1;
        /* Обрезка текста после 2 строк */
        overflow: hidden;
        text-overflow: ellipsis;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
    }
    
    .listing-meta {
        font-size: 0.6rem;
        margin-top: 0.3rem;
    }
    
    .listing-meta div {
        margin-bottom: 0.1rem;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    
    .card-text {
        font-size: 0.7rem;
        margin-bottom: 0.3rem;
        line-height: 1.2;
        white-space: pre-line;
        min-height: auto;
    }
    
    /* Динамическая высота карточек для маленьких мобильных */
    .card {
        min-height: 150px !important;
        max-height: 300px !important;
    }
    
    /* Карточки с фото - фиксированная высота */
    .card.has-image {
        height: 300px !important;
        min-height: 300px !important;
        max-height: 300px !important;
    }
    
    .card-body {
        padding: 0.4rem;
        display: flex !important;
        flex-direction: column !important;
        justify-content: space-between !important;
        height: 100% !important;
        overflow: hidden;
    }
    
    /* Исправленная сетка для 2 колонок */
    .col-6 {
        flex: 0 0 calc(50% - 0.25rem) !important;
        max-width: calc(50% - 0.25rem) !important;
        margin-bottom: 0.5rem !important;
    }
    
    /* Правильные отступы для сетки */
    .row {
        margin-left: -0.25rem;
        margin-right: -0.25rem;
        display: flex;
        flex-wrap: wrap;
        gap: 0.5rem;
    }
    
    .col-6, .col-md-4 {
        padding-left: 0.25rem;
        padding-right: 0.25rem;
    }
}

/* Стили для пустых состояний и загрузки */
.empty-state {
    text-align: center;
    padding: 3rem 1rem;
    background: #f8f9fa;
    border: 2px dashed #dee2e6;
    border-radius: 0.5rem;
    margin: 2rem 0;
}

.empty-state i {
    font-size: 3rem;
    color: #6c757d;
    margin-bottom: 1rem;
}

.empty-state h4 {
    font-size: 1.5rem;
    color: #343a40;
    margin-bottom: 0.5rem;
}

.empty-state p {
    color: #6c757d;
    font-size: 1rem;
}

.loading {
    text-align: center;
    padding: 2rem 1rem;
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 0.5rem;
    margin: 1rem 0;
}

.loading .spinner-border {
    margin-bottom: 1rem;
}

.loading .text-muted {
    font-size: 1rem;
    font-weight: 500;
}

@media (max-width: 768px) {
    .empty-state {
        padding: 2rem 0.5rem;
        margin: 1rem 0;
    }
    
    .empty-state i {
        font-size: 2.5rem;
    }
    
    .empty-state h4 {
        font-size: 1.25rem;
    }
    
    .empty-state p {
        font-size: 0.9rem;
    }
    
    .loading {
        padding: 1.5rem 0.5rem;
    }
}

@media (max-width: 480px) {
    .empty-state {
        padding: 1.5rem 0.25rem;
    }
    
    .empty-state i {
        font-size: 2rem;
    }
    
    .empty-state h4 {
        font-size: 1.1rem;
    }
    
    .empty-state p {
        font-size: 0.85rem;
    }
    
    .loading {
        padding: 1rem 0.25rem;
    }
}

.listing-title {
    font-size: 1.1rem !important;
    font-weight: 600 !important;
    color: #343a40 !important;
    text-decoration: none;
    margin-bottom: 0.5rem !important;
    line-height: 1.2;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box !important;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    visibility: visible !important;
    opacity: 1 !important;
}

.listing-title:hover {
    color: #007bff;
    text-decoration: none;
}

.listing-meta {
    font-size: 0.8rem;
    color: #6c757d;
    margin-top: auto;
    padding-top: 0.5rem;
}

.listing-meta div {
    margin-bottom: 0.2rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
    line-height: 1.2;
}

.category-card {
    text-align: center;
    padding: 20px;
}

.category-icon {
    font-size: 3rem;
    color: #007bff;
    margin-bottom: 15px;
}

.category-name {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 10px;
}

.category-description {
    font-size: 0.9rem;
    color: #6c757d;
}

.stats-card {
    background: linear-gradient(135deg, #007bff, #6610f2);
    color: white;
    border: none;
}

.stats-number {
    font-size: 2rem;
    font-weight: bold;
}

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

.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
}

.negotiable-badge {
    background-color: #17a2b8;
}

.status-badge {
    font-size: 0.75rem;
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
}

/* Логотип в навигации */
.navbar-logo {
    height: 70px;
    max-width: 250px;
    width: auto;
    transition: transform 0.3s ease;
    object-fit: contain;
}

.navbar-logo:hover {
    transform: scale(1.05);
}

/* Навигация в газетном стиле */
.navbar-newspaper {
    background: linear-gradient(135deg, #2c3e50 0%, #34495e 100%);
    border-bottom: 3px solid #e74c3c;
}

.navbar-newspaper .navbar-brand {
    font-family: 'Times New Roman', serif;
    font-size: 1.8rem;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.navbar-newspaper .nav-link {
    font-family: 'Georgia', serif;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Кнопки в газетном стиле */
.btn-newspaper {
    background: #000;
    color: #fff;
    border: 2px solid #000;
    font-family: 'Georgia', serif;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 0.75rem 1.5rem;
    transition: all 0.3s ease;
}

.btn-newspaper:hover {
    background: #fff;
    color: #000;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
}

.btn-newspaper.btn-outline {
    background: transparent;
    color: #000;
}

.btn-newspaper.btn-outline:hover {
    background: #000;
    color: #fff;
}

/* Формы в газетном стиле */
.form-newspaper .form-control {
    border: 2px solid #000;
    border-radius: 0;
    font-family: 'Georgia', serif;
    padding: 0.75rem;
}

.form-newspaper .form-control:focus {
    border-color: #000;
    box-shadow: 0 0 0 0.2rem rgba(0,0,0,0.25);
}

.form-newspaper .form-label {
    font-family: 'Georgia', serif;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #000;
}

/* Модальные окна в газетном стиле */
.modal-newspaper .modal-content {
    border: 3px solid #000;
    border-radius: 0;
}

.modal-newspaper .modal-header {
    background: #000;
    color: #fff;
    border-bottom: 2px solid #000;
}

.modal-newspaper .modal-title {
    font-family: 'Times New Roman', serif;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.modal-newspaper .modal-footer {
    border-top: 2px solid #000;
}

/* Стили для загрузки изображений */
.image-upload-container {
    border: 2px dashed #ccc;
    border-radius: 8px;
    padding: 1rem;
    background: #f8f9fa;
}

.image-upload-area {
    text-align: center;
    padding: 2rem;
    border: 2px dashed #007bff;
    border-radius: 8px;
    background: #fff;
    cursor: pointer;
    transition: all 0.3s ease;
}

.image-upload-area:hover {
    border-color: #0056b3;
    background: #f8f9fa;
}

.image-upload-area.dragover {
    border-color: #28a745;
    background: #d4edda;
}

.image-preview-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}

.image-preview-item {
    position: relative;
    border: 2px solid #ddd;
    border-radius: 8px;
    overflow: hidden;
    aspect-ratio: 1;
}

.image-preview-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.image-preview-item .image-remove {
    position: absolute;
    top: 5px;
    right: 5px;
    background: rgba(220, 53, 69, 0.9);
    color: white;
    border: none;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    font-size: 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.image-preview-item .image-main-badge {
    position: absolute;
    top: 5px;
    left: 5px;
    background: rgba(40, 167, 69, 0.9);
    color: white;
    border: none;
    border-radius: 4px;
    padding: 2px 6px;
    font-size: 10px;
    font-weight: bold;
}

.image-preview-item .image-order {
    position: absolute;
    bottom: 5px;
    left: 5px;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    border-radius: 4px;
    padding: 2px 6px;
    font-size: 10px;
    font-weight: bold;
}

/* Стили для изображений в объявлениях */
.listing-image {
    width: 100% !important;
    height: 200px !important;
    object-fit: cover !important;
    object-position: center !important;
    border-radius: 8px;
    margin-bottom: 1rem;
    border: 2px solid #ddd;
    display: block;
    flex-shrink: 0;
}

/* Газетные категории */
.newspaper-categories {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin: 2rem 0;
}

.category-section {
    border: 3px solid #000;
    background: #fff;
    padding: 1.5rem;
    position: relative;
    break-inside: avoid;
}

.category-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 6px;
    background: linear-gradient(90deg, #000, #333, #000);
}

.category-header {
    border-bottom: 2px solid #000;
    margin-bottom: 1.5rem;
    padding-bottom: 0.5rem;
    position: relative;
}

.category-title {
    font-family: 'Times New Roman', serif;
    font-size: 1.8rem;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: #000;
    margin: 0;
    text-align: center;
}

.category-icon {
    font-size: 2rem;
    margin-right: 1rem;
    color: #333;
}

.category-subcategories {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.category-item {
    display: flex;
    align-items: center;
    padding: 0.75rem;
    border: 1px solid #ddd;
    background: #f8f9fa;
    text-decoration: none;
    color: #333;
    transition: all 0.3s ease;
    position: relative;
}

.category-item::before {
    content: '◆';
    color: #000;
    margin-right: 0.75rem;
    font-size: 0.8rem;
}

.category-item:hover {
    background: #e9ecef;
    border-color: #000;
    transform: translateX(5px);
    box-shadow: 2px 2px 5px rgba(0,0,0,0.1);
}

.category-item-name {
    font-family: 'Georgia', serif;
    font-weight: 500;
    flex-grow: 1;
}

.category-item-count {
    background: #000;
    color: #fff;
    padding: 0.25rem 0.5rem;
    border-radius: 3px;
    font-size: 0.8rem;
    font-weight: bold;
    min-width: 30px;
    text-align: center;
}

/* Категории на главной странице */
.main-categories {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin: 2rem 0;
    justify-content: center;
}

.main-category-item {
    display: flex;
    align-items: center;
    padding: 1rem 1.5rem;
    border: 2px solid #000;
    background: #fff;
    text-decoration: none;
    color: #333;
    transition: all 0.3s ease;
    position: relative;
    min-width: 150px;
    justify-content: center;
    font-family: 'Times New Roman', serif;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.main-category-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #000, #333);
}

.main-category-item:hover {
    background: #f8f9fa;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.main-category-item.active {
    background: #000;
    color: #fff;
}

.main-category-item.active::before {
    background: linear-gradient(90deg, #fff, #ccc);
}

.main-category-icon {
    font-size: 1.2rem;
    margin-right: 0.5rem;
}

/* Адаптивность для газетных категорий */
@media (max-width: 768px) {
    .newspaper-categories {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .category-section {
        padding: 1rem;
    }
    
    .category-title {
        font-size: 1.5rem;
    }
    
    .main-categories {
        gap: 0.5rem;
    }
    
    .main-category-item {
        padding: 0.75rem 1rem;
        min-width: 120px;
        font-size: 0.9rem;
    }
}

.detail-images {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin: 1rem 0;
}

.detail-image {
    width: 100%;
    height: 250px;
    object-fit: cover;
    object-position: center;
    border-radius: 8px;
    border: 2px solid #ddd;
    cursor: pointer;
    transition: transform 0.3s ease;
}

.detail-image:hover {
    transform: scale(1.05);
}

/* Модальное окно для просмотра изображений */
.image-modal .modal-content {
    background: rgba(0, 0, 0, 0.9);
    border: none;
    border-radius: 0;
}

.image-modal .modal-body {
    padding: 0;
    text-align: center;
}

.image-modal img {
    max-width: 100%;
    max-height: 80vh;
    object-fit: contain;
}

.image-modal .modal-footer {
    background: rgba(0, 0, 0, 0.8);
    border-top: none;
}

.image-modal .btn-close {
    filter: invert(1);
    opacity: 0.8;
}

.image-modal .btn-close:hover {
    opacity: 1;
}

/* Адаптивность */
@media (max-width: 768px) {
    .newspaper-layout {
        padding: 1rem;
    }
    
    .newspaper-title {
        font-size: 2.5rem;
    }
    
    .listing-newspaper {
        padding: 1rem;
    }
    
    .listing-newspaper .listing-title {
        font-size: 1.2rem;
    }
    
    .listing-detail-newspaper {
        padding: 1rem;
    }
    
    .listing-detail-newspaper .detail-title {
        font-size: 2rem;
    }
}

/* Анимации для газетного стиля */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.listing-newspaper {
    animation: fadeInUp 0.6s ease-out;
}

/* Дополнительные стили для газетного дизайна */
.newspaper-divider {
    height: 2px;
    background: linear-gradient(90deg, #000, #333, #000);
    margin: 2rem 0;
}

.newspaper-highlight {
    background: #f8f9fa;
    border-left: 4px solid #000;
    padding: 1rem;
    margin: 1rem 0;
}

.newspaper-quote {
    font-family: 'Georgia', serif;
    font-style: italic;
    font-size: 1.1rem;
    color: #666;
    text-align: center;
    border: 1px solid #ccc;
    padding: 1rem;
    margin: 1rem 0;
    background: #f8f9fa;
}

.newspaper-advertisement {
    border: 2px dashed #000;
    padding: 1rem;
    margin: 1rem 0;
    text-align: center;
    background: #f8f9fa;
    font-style: italic;
}

.newspaper-advertisement::before {
    content: 'РЕКЛАМА';
    display: block;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: #000;
    margin-bottom: 0.5rem;
}

/* Стили для валидации в газетном стиле */
.form-newspaper .form-control.is-invalid {
    border-color: #000 !important;
    box-shadow: 0 0 0 0.2rem rgba(0, 0, 0, 0.25) !important;
}

.form-newspaper .form-control.is-invalid:focus {
    border-color: #000 !important;
    box-shadow: 0 0 0 0.2rem rgba(0, 0, 0, 0.25) !important;
}

.form-newspaper .form-check-input.is-invalid {
    border-color: #000 !important;
}

.form-newspaper .form-check-input.is-invalid:focus {
    border-color: #000 !important;
    box-shadow: 0 0 0 0.2rem rgba(0, 0, 0, 0.25) !important;
}

.form-newspaper .invalid-feedback {
    display: block !important;
    color: #000 !important;
    font-size: 0.875rem !important;
    margin-top: 0.25rem !important;
    font-weight: 500;
}

.password-requirements {
    margin-top: 0.5rem;
    padding: 0.5rem;
    background-color: #f8f9fa;
    border-radius: 0;
    border-left: 3px solid #000;
}

.password-requirements small {
    color: #666;
    line-height: 1.4;
}

/* Анимация для ошибок в газетном стиле */
.form-newspaper .form-control.is-invalid {
    animation: shake 0.5s ease-in-out;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

/* Категории на главной странице в стиле газеты */
.newspaper-categories-container {
    border-top: 2px solid #000;
    border-bottom: 2px solid #000;
    padding: 1.5rem 0;
    background: #f8f9fa;
    margin: 2rem 0;
}

.newspaper-categories-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    max-width: 100%;
}

.main-category-item {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem 1.5rem;
    background: #333;
    color: #fff;
    text-decoration: none;
    font-family: 'Times New Roman', serif;
    font-weight: bold;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border: 2px solid #000;
    transition: all 0.3s ease;
    position: relative;
    text-align: center;
    min-height: 60px;
    word-wrap: break-word;
    hyphens: auto;
}

.main-category-item::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    right: 0;
    height: 2px;
    background: #000;
}

.main-category-item:hover {
    background: #000;
    color: #fff;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}

.main-category-item.active {
    background: #000;
    color: #fff;
    box-shadow: inset 0 0 0 2px #fff;
}

.main-category-icon {
    margin-right: 0.75rem;
    font-size: 1.2rem;
}

/* Адаптивность для категорий */
@media (max-width: 768px) {
    .newspaper-categories-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 0.5rem;
    }
    
    .main-category-item {
        padding: 0.5rem 0.75rem;
        font-size: 0.8rem;
        min-height: 45px;
        text-align: center;
    }
    
    .main-category-icon {
        margin-right: 0.4rem;
        font-size: 0.9rem;
    }
}

@media (max-width: 480px) {
    .newspaper-categories-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 0.4rem;
    }
    
    .main-category-item {
        padding: 0.4rem 0.6rem;
        font-size: 0.75rem;
        min-height: 40px;
    }
    
    .main-category-icon {
        margin-right: 0.3rem;
        font-size: 0.8rem;
    }
}

/* Мобильные устройства */
@media (max-width: 768px) {
    .listing-image,
    .listing-image-placeholder {
        width: 100% !important;
        height: 140px !important;
        object-fit: cover !important;
        object-position: center !important;
    }
    
    .listing-price {
        font-size: 1rem;
        margin-bottom: 0.5rem;
    }
    
    .listing-title {
        font-size: 0.9rem;
        margin-bottom: 0.5rem;
        line-height: 1.2;
    }
    
    .listing-meta {
        font-size: 0.75rem;
        margin-bottom: 0.25rem;
    }
    
    .listing-meta div {
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    
    .card-text {
        font-size: 0.8rem;
        margin-bottom: 0.5rem;
        line-height: 1.3;
        white-space: pre-line;
        min-height: auto;
    }
    
    .card.no-image {
        min-height: 200px;
        max-height: 350px;
    }
    
    .card.has-image {
        height: 350px;
    }
    
    .card.has-image .listing-meta {
        font-size: 0.7rem;
        margin-top: 0.4rem;
    }
    
    .card.has-image .listing-meta div {
        margin-bottom: 0.2rem;
    }
    
    .card.has-image .listing-title {
        font-size: 0.85rem;
        margin-bottom: 0.4rem;
    }
    
    .card.has-image .listing-price {
        font-size: 0.9rem;
        margin-bottom: 0.4rem;
    }
    
    .card.has-image .negotiable-badge {
        font-size: 0.55rem;
        padding: 0.15rem 0.3rem;
        margin-top: 0.15rem;
        display: inline-block;
        background: #000;
        color: #fff;
        font-weight: bold;
        text-transform: uppercase;
    }
    
    .card-body {
        padding: 0.5rem;
    }
    
    .col-6 {
        flex: 0 0 calc(50% - 0.5rem) !important;
        max-width: calc(50% - 0.5rem) !important;
        margin-bottom: 1rem !important;
    }
    
    .row {
        margin-left: -0.5rem;
        margin-right: -0.5rem;
        display: flex;
        flex-wrap: wrap;
        gap: 1rem;
    }
}

/* Стили для карточек с фото */
.card.has-image {
    display: flex;
    flex-direction: column;
}

.card.has-image .card-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.card.has-image .listing-meta {
    font-size: 0.8rem;
    margin-top: 0.5rem;
    flex-grow: 1;
}

.card.has-image .listing-meta div {
    margin-bottom: 0.2rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
    font-size: 0.75rem;
    line-height: 1.2;
}

.card.has-image .listing-title {
    font-size: 1rem !important;
    margin-bottom: 0.5rem !important;
    line-height: 1.2;
    -webkit-line-clamp: 2;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box !important;
    -webkit-box-orient: vertical;
    color: #343a40 !important;
    visibility: visible !important;
    opacity: 1 !important;
}

.card.has-image .listing-price {
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
    font-weight: bold;
    color: #28a745;
}

.card.has-image .negotiable-badge {
    font-size: 0.6rem;
    padding: 0.2rem 0.4rem;
    margin-top: 0.2rem;
    display: inline-block;
    background: #000;
    color: #fff;
    font-weight: bold;
    text-transform: uppercase;
}

/* Десктопные стили для карточек с фото */
@media (min-width: 769px) {
    .card.has-image .listing-meta {
        font-size: 0.85rem;
        margin-top: 0.6rem;
    }
    
    .card.has-image .listing-meta div {
        margin-bottom: 0.25rem;
    }
    
    .card.has-image .listing-title {
        font-size: 1.1rem;
        margin-bottom: 0.6rem;
    }
    
    .card.has-image .listing-price {
        font-size: 1.2rem;
        margin-bottom: 0.6rem;
    }
}

/* Маленькие мобильные устройства */
@media (max-width: 480px) {
    .listing-card {
        margin-bottom: 8px;
    }
    
    .listing-image,
    .listing-image-placeholder {
        width: 100% !important;
        height: 100px !important;
        object-fit: cover !important;
        object-position: center !important;
    }
    
    .listing-price {
        font-size: 0.9rem;
        margin-bottom: 0.4rem;
    }
    
    .listing-title {
        font-size: 0.8rem;
        margin-bottom: 0.4rem;
        line-height: 1.1;
        -webkit-line-clamp: 2;
    }
    
    .listing-meta {
        font-size: 0.7rem;
        margin-bottom: 0.2rem;
    }
    
    .card-text {
        font-size: 0.75rem;
        margin-bottom: 0.4rem;
        line-height: 1.2;
        white-space: pre-line;
        min-height: auto;
    }
    
    .card.no-image {
        min-height: 150px;
        max-height: 300px;
    }
    
    .card.has-image {
        height: 300px;
    }
    
    .card.has-image .listing-meta {
        font-size: 0.65rem;
        margin-top: 0.3rem;
    }
    
    .card.has-image .listing-meta div {
        margin-bottom: 0.15rem;
    }
    
    .card.has-image .listing-title {
        font-size: 0.75rem;
        margin-bottom: 0.3rem;
    }
    
    .card.has-image .listing-price {
        font-size: 0.8rem;
        margin-bottom: 0.3rem;
    }
    
    .card.has-image .negotiable-badge {
        font-size: 0.5rem;
        padding: 0.1rem 0.25rem;
        margin-top: 0.1rem;
        display: inline-block;
        background: #000;
        color: #fff;
        font-weight: bold;
        text-transform: uppercase;
    }
    
    .card-body {
        padding: 0.4rem;
        display: flex !important;
        flex-direction: column !important;
        justify-content: space-between !important;
        height: 100% !important;
        overflow: hidden;
    }
    
    .col-6 {
        flex: 0 0 calc(50% - 0.25rem) !important;
        max-width: calc(50% - 0.25rem) !important;
        margin-bottom: 0.5rem !important;
    }
    
    .row {
        margin-left: -0.25rem;
        margin-right: -0.25rem;
        display: flex;
        flex-wrap: wrap;
        gap: 0.5rem;
    }
}

/* Стили для промокода газеты */
.promo-code-section {
    margin: 2rem 0;
}

.promo-code-box {
    background: linear-gradient(135deg, #2c3e50, #3498db);
    border-radius: 15px;
    padding: 2rem;
    color: white;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
    position: relative;
    overflow: hidden;
}

.promo-code-box::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(45deg, transparent, rgba(255,255,255,0.1), transparent);
    transform: rotate(45deg);
    animation: shimmer 3s infinite;
}

@keyframes shimmer {
    0% { transform: translateX(-100%) translateY(-100%) rotate(45deg); }
    100% { transform: translateX(100%) translateY(100%) rotate(45deg); }
}

.promo-code-title {
    font-family: 'Times New Roman', serif;
    font-size: 1.2rem;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 1rem;
    position: relative;
    z-index: 1;
}

.promo-code-value {
    font-family: 'Courier New', monospace;
    font-size: 2.5rem;
    font-weight: bold;
    background: rgba(255,255,255,0.2);
    padding: 1rem 2rem;
    border-radius: 10px;
    border: 2px dashed rgba(255,255,255,0.5);
    margin: 1rem 0;
    position: relative;
    z-index: 1;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

.promo-code-description {
    font-size: 1.1rem;
    margin-top: 1rem;
    position: relative;
    z-index: 1;
}

/* Стили для инструкций */
.instructions-section {
    margin: 2rem 0;
}

.instructions-title {
    font-family: 'Times New Roman', serif;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #2c3e50;
    margin-bottom: 2rem;
    text-align: center;
}

.instruction-steps {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.step {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    padding: 1.5rem;
    background: #f8f9fa;
    border-radius: 10px;
    border-left: 4px solid #3498db;
    transition: all 0.3s ease;
}

.step:hover {
    background: #e9ecef;
    transform: translateX(5px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.step-number {
    background: #3498db;
    color: white;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 1.2rem;
    flex-shrink: 0;
}

.step-content h5 {
    color: #2c3e50;
    font-weight: bold;
    margin-bottom: 0.5rem;
}

.step-content p {
    color: #6c757d;
    margin-bottom: 0;
}

/* Стили для кнопки перехода на сайт газеты */
.btn-newspaper-promo {
    background: linear-gradient(135deg, #e74c3c, #c0392b);
    border: none;
    color: white;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 1rem 2rem;
    border-radius: 10px;
    transition: all 0.3s ease;
    box-shadow: 0 5px 15px rgba(231, 76, 60, 0.3);
}

.btn-newspaper-promo:hover {
    background: linear-gradient(135deg, #c0392b, #a93226);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(231, 76, 60, 0.4);
    color: white;
}

.btn-newspaper-promo:active {
    transform: translateY(0);
}

/* Адаптивность для мобильных устройств */
@media (max-width: 768px) {
    .promo-code-value {
        font-size: 2rem;
        padding: 0.8rem 1.5rem;
    }
    
    .step {
        flex-direction: column;
        text-align: center;
    }
    
    .step-number {
        align-self: center;
    }
    
    .instruction-steps {
        gap: 1rem;
    }
}

/* Принудительные стили для фиксированной высоты карточек */
.listing-card .card {
    height: 400px !important;
    min-height: 400px !important;
    max-height: 400px !important;
    display: flex !important;
    flex-direction: column !important;
}

.listing-card .card.has-image {
    height: 400px !important;
    min-height: 400px !important;
    max-height: 400px !important;
}

.listing-card .card-body {
    display: flex !important;
    flex-direction: column !important;
    justify-content: space-between !important;
    flex: 1 !important;
    height: 100% !important;
    overflow: hidden !important;
}

/* Мобильные стили */
@media (max-width: 768px) {
    .listing-card .card {
        height: 350px !important;
        min-height: 350px !important;
        max-height: 350px !important;
    }
    
    .listing-card .card.has-image {
        height: 350px !important;
        min-height: 350px !important;
        max-height: 350px !important;
    }
}

@media (max-width: 480px) {
    .listing-card .card {
        height: 300px !important;
        min-height: 300px !important;
        max-height: 300px !important;
    }
    
    .listing-card .card.has-image {
        height: 300px !important;
        min-height: 300px !important;
        max-height: 300px !important;
    }
}

/* Принудительные стили для заголовков объявлений */
.listing-card .listing-title,
.listing-card .card .listing-title,
.listing-card .card-body .listing-title {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    color: #343a40 !important;
    font-size: 1.1rem !important;
    font-weight: 600 !important;
    margin-bottom: 0.5rem !important;
    line-height: 1.2 !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    -webkit-line-clamp: 2 !important;
    -webkit-box-orient: vertical !important;
    position: relative !important;
    z-index: 10 !important;
}

/* Переопределение Bootstrap стилей для заголовков */
.card-body .listing-title,
.card .listing-title,
h5.listing-title,
div.listing-title {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    color: #343a40 !important;
    font-size: 1.1rem !important;
    font-weight: 600 !important;
    margin-bottom: 0.5rem !important;
    line-height: 1.2 !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    -webkit-line-clamp: 2 !important;
    -webkit-box-orient: vertical !important;
    position: relative !important;
    z-index: 10 !important;
}

.listing-card .card.has-image .listing-title,
.listing-card .card.has-image .card-body .listing-title {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    color: #343a40 !important;
    font-size: 1rem !important;
    font-weight: 600 !important;
    margin-bottom: 0.5rem !important;
    position: relative !important;
    z-index: 10 !important;
}

/* Переопределение Bootstrap стилей для заголовков */
.card-body .listing-title,
.card .listing-title,
h5.listing-title,
div.listing-title {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    color: #343a40 !important;
    font-size: 1.1rem !important;
    font-weight: 600 !important;
    margin-bottom: 0.5rem !important;
    line-height: 1.2 !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    -webkit-line-clamp: 2 !important;
    -webkit-box-orient: vertical !important;
    position: relative !important;
    z-index: 10 !important;
}