body,
html {
    height: 100%;
    margin: 0;
    padding-bottom: 60px;
    background-color: #f2f2f2;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

.ad-card .card-img-top {
    height: 180px;
    width: 100%;
    object-fit: cover;
}

.card-title {
    font-size: 1.1rem;
    font-weight: 600;
}

.card-text {
    font-size: 0.95rem;
}

.card {
    border-radius: 12px;
    overflow: hidden;
    transition: transform 0.2s ease;
}

.card:hover {
    transform: scale(1.01);
    box-shadow: 0 8px 16px rgb(0 0 0 / 8%);
    text-decoration: none;
}

main.main-content {
    margin-top: 56px;

    /* высота searchBar */
    margin-bottom: 70px;

    /* высота нижней навигации */
}

main {
    /* padding-top: 56px; */
    padding-bottom: 70px;
}

main.with-search-bar {
    padding-top: 58px;

    /* высота search-bar */
}

#search-bar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1030;
}

.bottom-nav {
    position: fixed;
    bottom: 0;
    width: 100%;
    height: 70px;
    background: #f8f9fa;
    border-top: 1px solid #ccc;
    display: flex;
    justify-content: space-around;
    align-items: center;
    z-index: 1000;
}

.bottom-nav .message-input {
    bottom: 70px;
}

.bottom-nav a {
    flex: 1;
    text-align: center;
    padding: 8px 0;
    font-size: 13px;
    color: #555;
    text-decoration: none;
}

.bottom-nav a i {
    display: block;
    font-size: 26px;
}

.bottom-nav a.active {
    color: #007bff;
}

.fragment {
    display: none;
}

.fragment.active {
    display: block;
}

.image-preview {
    max-width: 100px;
    max-height: 100px;
    margin-right: 10px;
}

#container {
    padding-bottom: 80px !important;
}

/* === Разметка для диалогов (чат) === */
#messages-container {
    padding: 70px 16px 80px;
    overflow-y: auto;
    height: calc(100vh - 130px);
}

.message {
    margin-bottom: 10px;
    max-width: 80%;
    padding: 8px 12px;
    border-radius: 15px;
    font-size: 0.95rem;
    line-height: 1.4;
    word-wrap: break-word;
}

.message.sent {
    align-self: flex-end;
    background-color: #DCF8C6;
}

.message.received {
    align-self: flex-start;
    background-color: #FFF;
    border: 1px solid #ddd;
}

/* === Панель ввода сообщения (фиксирована внизу) === */
#message-form {
    position: fixed;
    bottom: 60px;
    left: 0;
    right: 0;
    background-color: white;
    padding: 8px 16px;
    border-top: 1px solid #ccc;
    display: flex;
    align-items: center;
    z-index: 1050;
}

#message-form input[type="text"] {
    flex: 1;
    border: none;
    padding: 10px;
    border-radius: 20px;
    background-color: #f1f1f1;
    margin-right: 8px;
    outline: none;
}

#message-form button {
    background-color: transparent;
    border: none;
    color: #007bff;
    font-size: 18px;
}

/* === Стиль бейджика уведомлений на иконках навигации === */
.nav-badge {
    position: absolute;
    top: 6px;
    right: 14px;
    background: red;
    color: white;
    font-size: 11px;
    padding: 2px 5px;
    border-radius: 10px;
    line-height: 1;
}

#messages {
    overflow-y: auto;
    flex: 1 1 auto;
    padding: 1rem;
    scrollbar-width: none;

    /* Firefox */
    -ms-overflow-style: none;

    /* IE и Edge */
}

#messages::-webkit-scrollbar {
    display: none;

    /* Chrome, Safari */
}

.modal-body {
    max-height: 60vh;
    overflow-y: auto;
    padding-right: 1rem;
}

#my-ads-toggle-btn.active {
    background-color: #ffc107;
    color: black;
    border-color: #ffc107;
}

/* Модальное окно для фильтра */
.modal-dialog {
    max-height: 90vh;
    display: flex;
    flex-direction: column;
}

.modal-content {
    max-height: 90vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.modal-dialog-scrollable .modal-body {
    max-height: 60vh;
    overflow-y: auto;
}

#contextMenu {
    background-color: #ffffff;
    border-radius: 12px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
    padding: 8px;
    min-width: 200px;
    max-width: 90vw;
    font-size: 1rem;
}

#contextMenu a {
    display: block;
    padding: 8px 12px;
    color: #333;
    text-decoration: none;
    border-radius: 6px;
}

#contextMenu a:hover {
    background-color: #f5f5f5;
}

.carousel-item {
    height: 300px;
    background-color: #f1f1f1;
}

.carousel-item img {
    max-height: 100%;
    max-width: 100%;
    object-fit: contain;
}

.carousel-indicators [data-bs-target] {
    background-color: #000;
}

.carousel-control-prev-icon,
.carousel-control-next-icon {
    background-color: rgba(0, 0, 0, 0.5);
    border-radius: 50%;
    padding: 10px;
}

@keyframes spinner-border {
    to {
        transform: rotate(360deg);
    }
}

.spinner-border {
    animation: spinner-border .75s linear infinite !important;
}

@media screen and (max-width: 480px) {
    .column {
        width: 100%;
    }
}

@media screen and (max-width: 1024px) {
    .column {
        width: 90%;
    }
}

@media screen and (max-width: 1080px) {
    .column {
        width: 80%;
    }
}