/* =========================
   САЙДБАР НОВОСТЕЙ (по аналогии с профилем)
   ========================= */

.news-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: transparent;
    z-index: 9998;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    pointer-events: none !important;
    display: none;
}

.news-modal-overlay.show {
    opacity: 0;
    visibility: hidden;
    pointer-events: none !important;
    display: none;
}

@media (max-width: 768px) {
    .news-modal-overlay {
        background-color: rgba(0, 0, 0, 0.5);
        /* Затемнение фона на мобильных */
        z-index: 10001;
        /* Ниже сайдбара, но выше всего остального */
    }

    .news-modal-overlay.show {
        opacity: 1;
        visibility: visible;
        display: block;
        pointer-events: auto !important;
    }
}

.news-empty p {
    position: relative;
    display: flex;
    flex-direction: column;
    padding: 20px;
    pointer-events: auto !important;
    overflow-y: auto;
    overflow-x: hidden;
    max-height: calc(100vh - 150px);
    -webkit-overflow-scrolling: touch;
    scroll-behavior: smooth;
    overscroll-behavior-y: scroll
}

.news-modal {
    position: absolute;
    /* На десктопе absolute, на мобильных будет переопределено на fixed через JS */
    top: calc(100% + 10px);
    right: 0;
    z-index: 10001 !important;
    left: auto;
    width: 526px;
    max-width: calc(100vw - 40px);
    max-height: calc(100vh - 150px);
    background: #FFFFFF;
    border-bottom-right-radius: 40px;
    border-bottom-left-radius: 40px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: opacity 0.3s ease, visibility 0.3s ease, transform 0.3s ease;
    overflow-y: visible !important;
    overflow-x: hidden;
    pointer-events: none;
    margin: 0 !important;
    display: flex;
    flex-direction: column;
    height: auto;
}

.news-modal.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    pointer-events: auto !important;
    overflow-y: visible !important;
}

/* Для мобильных начальное состояние (без класса show) - скрыто снизу */
@media (max-width: 768px) {
    .news-modal:not(.show) {
        transform: translateY(100%) !important;
        opacity: 1 !important;
        visibility: visible !important;
    }
}

.news-modal__content {
    position: relative;
    display: flex;
    flex-direction: column;
    padding: 20px;
    pointer-events: auto !important;
    overflow-y: visible;
    overflow-x: hidden;
    height: 100%;
    -webkit-overflow-scrolling: touch;
    flex: 1;
    min-height: 0;
}

/* Убеждаемся, что все интерактивные элементы внутри меню кликабельны */
.news-modal.show a,
.news-modal.show button,
.news-modal.show input,
.news-modal.show label,
.news-modal.show [onclick] {
    pointer-events: auto !important;
    cursor: pointer;
    position: relative;
    z-index: 1;
}

.page-title__rubirika__links {
    margin-top: 25px;
    gap: 15px;
}

@media (max-width: 1200px) {
    .page-title__rubirika__links {
        display: flex;
        flex-wrap: nowrap;
        overflow-x: auto;
        overflow-y: hidden;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: thin;
        scrollbar-color: #b0b0b0 #e5e5e5;
        margin-left: -4px;
        margin-right: -4px;
        padding-left: 4px;
        padding-right: 4px;
        padding-bottom: 12px;
        margin-bottom: -4px;
    }
    .page-title__rubirika__links::-webkit-scrollbar {
        height: 4px;
    }
    .page-title__rubirika__links::-webkit-scrollbar-track {
        background: #e5e5e5;
        border-radius: 2px;
        margin-top: 8px;
    }
    .page-title__rubirika__links::-webkit-scrollbar-thumb {
        background: #b0b0b0;
        border-radius: 2px;
    }
    .page-title__rubirika__links::-webkit-scrollbar-thumb:hover {
        background: #999;
    }
    .page-title__rubirika__links button {
        flex-shrink: 0;
    }
}

@media (max-width: 500px) {
    .page-title__rubirika__links button {
        font-size: 13px !important;
    }
}

.page-title__rubirika__links button {
    border: none;
    background: white;
    color: #AAA;
    font-family: Inter;
    font-size: 16px;
    font-style: normal;
    font-weight: 600;
    line-height: normal;
}

.page-title__rubirika {
    /* display: flex;
    justify-content: space-between;
    align-items: center; */
}

.news-modal__close {
    /* position: absolute;
    top: 15px;
    right: 15px; */
    width: 34px;
    height: 34px;
    border: none;
    background: transparent;
    cursor: pointer;
    /* display: flex; */
    /* align-items: center; */
    /* justify-content: center; */
    color: #000000;
    /* transition: all 0.2s ease; */
    /* z-index: 10; */
    /* border-radius: 50%; */
}

.news-modal__close:hover {
    color: #0004E3;
    background: #f8f9fa;
    transform: rotate(90deg);
}

.news-modal__body {
    flex: 1;
    margin-bottom: 20px;
    padding-top: 10px;
    overflow-y: visible;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    max-height: calc(100vh - 200px);
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.news-content {
    display: flex;
    flex-direction: column;
    padding: 0;
    overflow-y: auto;
    overflow-x: hidden;
    flex: 1;
    min-height: 0;
    max-height: 100%;
    -webkit-overflow-scrolling: touch;
    scroll-behavior: smooth;
}

.page-title {
    margin-bottom: 20px;
    padding-bottom: 15px;
}

.page-title h1 {
    color: #000;
    font-family: Inter;
    font-size: 22px;
    font-style: normal;
    font-weight: 700;
    line-height: normal;
}

.news-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
    padding: 0;
}

.news-card {
    position: relative;
    background: #FFFFFF;
    border-radius: 12px;
    overflow: visible;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    transition: box-shadow 0.2s ease;
}

.news-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
}

.news-card__menu-wrap {
    position: absolute;
    top: 8px;
    left: 8px;
    z-index: 10;
}

.news-card__menu-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    padding: 0;
    border: none;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 8px;
    color: #333;
    cursor: pointer;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.1);
    transition: background 0.2s, color 0.2s;
}

.news-card__menu-btn:hover {
    background: #fff;
    color: #000;
}

.news-card__menu-btn[aria-expanded="true"] {
    background: #fff;
}

.news-card__dropdown {
    position: absolute;
    left: 0;
    top: calc(100% + 4px);
    min-width: 160px;
    padding: 6px 0;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
    z-index: 11;
}

.news-card__dropdown[hidden] {
    display: none !important;
}

.news-card__dropdown-item {
    display: block;
    width: 100%;
    padding: 10px 16px;
    border: none;
    background: none;
    font-family: 'Inter', sans-serif;
    font-size: 14px;
    font-weight: 500;
    color: #333;
    text-align: left;
    cursor: pointer;
    transition: background 0.2s;
}

.news-card__dropdown-item:hover {
    background: #f0f0f0;
}

/* Модалка подтверждения удаления новости */
.news-delete-modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    z-index: 10006;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.news-delete-modal-overlay.show {
    opacity: 1;
}

.news-delete-modal {
    display: none;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.95);
    z-index: 10007;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.25s ease, transform 0.25s ease, visibility 0.25s ease;
    width: 90%;
    max-width: 360px;
}

.news-delete-modal.show {
    opacity: 1;
    visibility: visible;
    transform: translate(-50%, -50%) scale(1);
}

.news-delete-modal__content {
    position: relative;
    padding: 44px 24px 24px;
    border-radius: 16px;
    background: #fff;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
}

.news-delete-modal__close {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 36px;
    height: 36px;
    padding: 0;
    border: none;
    background: none;
    cursor: pointer;
    color: #555;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background 0.2s, color 0.2s;
}

.news-delete-modal__close:hover {
    background: rgba(0, 0, 0, 0.06);
    color: #000;
}

.news-delete-modal__title {
    margin: 0 0 30px 0;
    font-size: 18px;
    font-weight: 600;
    color: #333;
    line-height: 1.3;
}

.news-delete-modal__actions {
    display: flex;
    flex-direction: row;
    gap: 12px;
    justify-content: flex-end;
}

.news-delete-modal__btn {
    padding: 10px 20px;
    border-radius: 8px;
    font-family: 'Inter', sans-serif;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
}

.news-delete-modal__btn--cancel {
    border: 1px solid #ccc;
    background: #fff;
    color: #333;
}

.news-delete-modal__btn--cancel:hover {
    background: #f5f5f5;
}

.news-delete-modal__btn--confirm {
    border: none;
    background: linear-gradient(91deg, #036 0.32%, #3CF 100%);
    color: #FFF;
}

.news-delete-modal__btn--confirm:hover {
    opacity: 0.9;
}

@media (max-width: 768px) {
    .news-delete-modal {
        top: auto;
        left: 0;
        right: 0;
        bottom: 0;
        width: 100%;
        max-width: none;
        transform: translateY(100%);
        transition: transform 0.35s cubic-bezier(0.32, 0.72, 0, 1), opacity 0.25s ease, visibility 0.25s ease;
        border-radius: 20px 20px 0 0;
    }
    .news-delete-modal.show {
        transform: translateY(0);
    }
    .news-delete-modal__content {
        border-radius: 20px 20px 0 0;
        padding-bottom: calc(24px + env(safe-area-inset-bottom, 0));
    }
}

.news-card__image-wrapper {
    position: relative;
    width: 100%;
    padding-top: 56.25%;
    /* 16:9 aspect ratio */
    overflow: hidden;
    background: #f0f0f0;
}

.news-card__image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.news-card__image-placeholder {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
}

.news-card__tag {
    position: absolute;
    top: 10px;
    right: 10px;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    font-family: 'Inter', sans-serif;
    color: #FFFFFF;
    background: #FF0000;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    z-index: 2;
}

.news-card__tag--danger {
    background: #FF0000;
}

.news-card__tag--interests {
    background: #0004E3;
}

.news-card__tag--news {
    background: #029100;
}

.news-card__tag--default {
    background: #6E6E6E;
}

.news-card__content {
    padding: 15px;
}

.news-card__title {
    font-size: 15px;
    font-weight: 600;
    line-height: 1.4;
    color: #000000;
    margin: 0 0 8px 0;
    font-family: 'Inter', sans-serif;
}

.news-card__text {
    font-size: 14px;
    line-height: 1.6;
    color: #000000;
    margin: 0 0 15px 0;
    font-family: 'Inter', sans-serif;
}

.news-card__reactions {
    display: flex;
    gap: 15px;
    align-items: center;
    flex-wrap: wrap;
}

.news-reaction {
    display: flex;
    align-items: center;
    gap: 6px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 6px 10px;
    border-radius: 20px;
    transition: background-color 0.2s ease;
    font-family: 'Inter', sans-serif;
    font-size: 14px;
    color: #6E6E6E;
    -webkit-tap-highlight-color: transparent;
}

.news-reaction:hover {
    background: rgba(0, 0, 0, 0.05);
}

.news-reaction:active {
    transform: scale(0.95);
}

.news-reaction__icon {
    font-size: 16px;
    line-height: 1;
}

.news-reaction__count {
    font-weight: 500;
    font-size: 14px;
}

.news-reaction--like.active {
    color: #029100 !important;
    background: rgba(2, 145, 0, 0.1);
}

.news-reaction--dislike.active {
    color: #FF0000;
    background: rgba(255, 0, 0, 0.1);
}

.news-reaction:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

.news-reaction:disabled:hover {
    background: transparent;
    transform: none;
}

.news-show-on-map-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    background: transparent;
    border: 1px solid #003366;
    cursor: pointer;
    padding: 6px 12px;
    border-radius: 20px;
    transition: all 0.2s ease;
    font-family: 'Inter', sans-serif;
    font-size: 14px;
    color: #003366;
    margin-left: auto;
    -webkit-tap-highlight-color: transparent;
}

.news-show-on-map-btn:hover {
    background: rgba(0, 51, 102, 0.1);
    border-color: #003366;
}

.news-show-on-map-btn:active {
    transform: scale(0.95);
}

.news-show-on-map-btn svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

.news-show-on-map-btn span {
    font-weight: 500;
    font-size: 14px;
    white-space: nowrap;
}

@media (max-width: 768px) {
    .news-show-on-map-btn {
        margin-left: 0;
        width: 100%;
        justify-content: center;
    }

    /* Лайк/дизлайк в ряд: в модалке с малым текстом или не раскрытой не переводим в column */
    .news-card__reactions {
        flex-direction: row;
        align-items: center;
    }
}

.news-empty {
    text-align: center;
    color: #6E6E6E;
    font-family: 'Inter', sans-serif;
    font-size: 14px;
}

/* Форма создания новостей */
.news-create-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: #0004E3;
    color: #FFFFFF;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: 'Inter', sans-serif;
    margin-top: 10px;
}

.news-create-btn:hover {
    background: #0003b8;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 4, 227, 0.3);
}

.news-create-btn:active {
    transform: translateY(0);
}

.news-create-form {
    background: #f8f9fa;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
    border: 1px solid #e0e0e0;
}

.news-edit-form {
    background: #f8f9fa;
    border-radius: 12px;
    padding: 20px;
    border: 1px solid #e0e0e0;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.12);
}

.form-field {
    margin-bottom: 15px;
}

.form-field label {
    display: block;
    margin-bottom: 6px;
    font-size: 14px;
    font-weight: 500;
    color: #000000;
    font-family: 'Inter', sans-serif;
}

.form-field input[type="text"],
.form-field textarea,
.form-field select {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    font-size: 14px;
    font-family: 'Inter', sans-serif;
    transition: border-color 0.2s ease;
    box-sizing: border-box;
}

.form-field input[type="text"]:focus,
.form-field textarea:focus,
.form-field select:focus {
    outline: none;
    border-color: #0004E3;
    box-shadow: 0 0 0 3px rgba(0, 4, 227, 0.1);
}

.form-field textarea {
    resize: vertical;
    min-height: 100px;
}

.form-field input[type="file"] {
    width: 100%;
    padding: 8px;
    border: 1px dashed #e0e0e0;
    border-radius: 8px;
    background: #FFFFFF;
    font-size: 14px;
    font-family: 'Inter', sans-serif;
}

.form-field small {
    display: block;
    margin-top: 4px;
    font-size: 12px;
    color: #6E6E6E;
    font-family: 'Inter', sans-serif;
}

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

.news-edit-form .form-actions {
    margin-bottom: 20px;
}

/* Оверлей формы редактирования (мобильный) */
.news-edit-form-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    z-index: 10007;
    opacity: 0;
    transition: opacity 0.3s ease;
}
.news-edit-form-overlay.show {
    opacity: 1;
}

/* Форма редактирования — боттомшит на мобильных */
@media (max-width: 768px) {
    .news-edit-form.news-edit-form--sheet {
        top: auto;
        left: 0;
        right: 0;
        bottom: 0;
        width: 100%;
        max-width: none;
        max-height: 85vh;
        overflow-y: auto;
        border-radius: 20px 20px 0 0;
        padding-bottom: calc(20px + env(safe-area-inset-bottom, 0));
        transform: translateY(100%);
        transition: transform 0.35s cubic-bezier(0.32, 0.72, 0, 1);
        -webkit-overflow-scrolling: touch;
    }
    .news-edit-form.news-edit-form--sheet.news-edit-form--sheet-open {
        transform: translateY(0);
    }
}

.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: 'Inter', sans-serif;
    flex: 1;
}

.btn-primary {
    background: #0004E3;
    color: #FFFFFF;
}

.btn-primary:hover {
    background: #0003b8;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 4, 227, 0.3);
}

.btn-secondary {
    background: #6E6E6E;
    color: #FFFFFF;
}

.btn-secondary:hover {
    background: #5a5a5a;
    transform: translateY(-1px);
}

.form-message {
    margin-top: 15px;
    padding: 12px;
    border-radius: 8px;
    font-size: 14px;
    font-family: 'Inter', sans-serif;
}

.form-message.success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.form-message.error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

@keyframes progressAnimation {
    0% {
        width: 65%;
    }

    100% {
        width: 75%;
    }
}

/* Стили для кнопки новостей в хедере */
.news-btn {
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
    display: inline-block;
    text-decoration: none;
    -webkit-tap-highlight-color: transparent;
    transition: transform 0.2s ease;
    pointer-events: auto !important;
    touch-action: manipulation;
    -webkit-touch-callout: none;
    user-select: none;
}

.news-btn:hover {
    transform: scale(1.1);
}

.news-btn:focus {
    outline: none;
}

.news-btn:focus-visible {
    outline: 2px solid rgba(0, 4, 227, 0.5);
    outline-offset: 2px;
    border-radius: 4px;
}

/* Изображение внутри кнопки должно наследовать стили от .header-profile__settings img */
.news-btn img {
    display: block;
    pointer-events: none;
}

/* SVG и другие дочерние элементы не должны блокировать клики */
.news-btn svg,
.news-btn .bottom-nav-icon {
    pointer-events: none;
}

/* Стили для кнопки в аккордеоне */
.profile-accordion-link {
    display: block;
    padding: 10px 15px;
    font-family: 'Inter', sans-serif;
    font-size: 14px;
    color: #0004E3;
    text-decoration: none;
    border-radius: 8px;
    transition: background-color 0.2s ease;
    border: none;
    background: transparent;
    width: 100%;
    text-align: left;
    cursor: pointer;
}

.profile-accordion-link:hover {
    background-color: #f8f9fa;
    text-decoration: underline;
}

/* Позиционирование относительно кнопки новостей */
.header-map__profile {
    position: relative !important;
    z-index: 1000 !important;
}

/* Убеждаемся, что сайдбар новостей находится внутри контейнера профиля (только для десктопа) */
@media (min-width: 769px) {
    .header-map__profile .news-modal {
        position: absolute !important;
        top: calc(100% + 0px) !important;
        right: -14px !important;
    }
}

/* Фикс: в диапазоне 769–1400px модалка могла "прятаться" из-за absolute-позиционирования/слоёв */
@media (min-width: 769px) and (max-width: 1400px) {
    .news-modal {
        position: fixed !important;
        top: 118px !important;
        /* 20px (отступ) + 88px (header) + 10px (зазор) */
        right: 20px !important;
        left: auto !important;
        z-index: 10002 !important;
    }
}

/* Адаптивные стили */
@media (max-width: 768px) {
    .news-modal {
        position: fixed !important;
        /* На мобильных fixed для правильного позиционирования */
        width: 100% !important;
        /* На всю ширину на мобильных */
        max-width: 100% !important;
        z-index: 10002 !important;
        /* Выше чем bottom-nav (10001) */
        right: 0 !important;
        left: 0 !important;
        bottom: 0 !important;
        /* Снизу экрана */
        top: auto !important;
        max-height: calc(100vh - 80px) !important;
        /* Высота минус bottom-nav */
        border-bottom-right-radius: 0 !important;
        border-bottom-left-radius: 0 !important;
        border-top-left-radius: 20px !important;
        border-top-right-radius: 20px !important;
        /* Анимация появления снизу */
        transform: translateY(100%) !important;
        /* Начальная позиция - полностью снизу */
        transition: opacity 0.3s ease, visibility 0.3s ease, transform 0.3s ease !important;
        opacity: 1 !important;
        /* Видимый на мобильных */
        visibility: visible !important;
        /* Видимый на мобильных */
    }

    /* Анимация появления снизу при открытии */
    .news-modal.show {
        transform: translateY(0) !important;
        /* Поднимаем вверх */
        opacity: 1 !important;
        visibility: visible !important;
        pointer-events: auto !important;
    }

    .news-modal__content {
        padding: 15px;
    }

    .news-modal__close {
        top: 10px;
        right: 10px;
        width: 28px;
        height: 28px;
    }

    .news-card__content {
        padding: 12px;
    }

    .news-card__text {
        font-size: 13px;
        margin-bottom: 12px;
    }

    .news-reaction {
        padding: 5px 8px;
        font-size: 13px;
    }

    .news-reaction__icon {
        font-size: 14px;
    }

    .news-reaction__count {
        font-size: 13px;
    }

    .page-title h1 {
        font-size: 18px;
    }
}

@media (max-width: 480px) {
    .news-modal {
        width: calc(100vw - 20px);
        right: -10px;
    }

    .news-card__content {
        padding: 10px;
    }

    .news-card__text {
        font-size: 12px;
        margin-bottom: 10px;
    }

    .news-card__reactions {
        gap: 10px;
    }

    .news-reaction {
        padding: 4px 6px;
        font-size: 12px;
    }

    .news-reaction__icon {
        font-size: 13px;
    }

    .news-reaction__count {
        font-size: 12px;
    }

    .page-title h1 {
        font-size: 16px;
    }
}

/* Полоса прокрутки */
.news-modal::-webkit-scrollbar,
.news-modal__body::-webkit-scrollbar,
.news-modal__content::-webkit-scrollbar {
    width: 8px;
}

.news-modal::-webkit-scrollbar-track,
.news-modal__body::-webkit-scrollbar-track,
.news-modal__content::-webkit-scrollbar-track {
    background: #f8f9fa;
    border-radius: 10px;
    margin: 4px 0;
}

.news-modal::-webkit-scrollbar-thumb,
.news-modal__body::-webkit-scrollbar-thumb,
.news-modal__content::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, #0004E3 0%, #0003b8 100%);
    border-radius: 10px;
    transition: background 0.3s ease, box-shadow 0.3s ease;
    box-shadow: 0 2px 4px rgba(0, 4, 227, 0.2);
}

.news-modal::-webkit-scrollbar-thumb:hover,
.news-modal__body::-webkit-scrollbar-thumb:hover,
.news-modal__content::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, #0003b8 0%, #0002a0 100%);
    box-shadow: 0 2px 8px rgba(0, 4, 227, 0.4);
}

.news-modal::-webkit-scrollbar-thumb:active,
.news-modal__body::-webkit-scrollbar-thumb:active,
.news-modal__content::-webkit-scrollbar-thumb:active {
    background: linear-gradient(180deg, #0002a0 0%, #000180 100%);
    box-shadow: 0 1px 4px rgba(0, 4, 227, 0.5);
}

/* Firefox scrollbar styling */
.news-modal__content {
    scrollbar-width: thin;
    scrollbar-color: #0004E3 #f8f9fa;
}

/* Красивый скроллбар для .news-content */
.news-content::-webkit-scrollbar {
    width: 10px;
}

.news-content::-webkit-scrollbar-track {
    background: linear-gradient(180deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 12px;
    margin: 8px 0;
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.news-content::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, #0004E3 0%, #0003b8 50%, #0002a0 100%);
    border-radius: 12px;
    border: 2px solid transparent;
    background-clip: padding-box;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow:
        inset 0 1px 2px rgba(255, 255, 255, 0.2),
        0 2px 6px rgba(0, 4, 227, 0.3);
    min-height: 40px;
}

.news-content::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, #0003b8 0%, #0002a0 50%, #000180 100%);
    box-shadow:
        inset 0 1px 2px rgba(255, 255, 255, 0.3),
        0 3px 10px rgba(0, 4, 227, 0.5);
    transform: scaleX(1.1);
}

.news-content::-webkit-scrollbar-thumb:active {
    background: linear-gradient(180deg, #0002a0 0%, #000180 50%, #000060 100%);
    box-shadow:
        inset 0 2px 4px rgba(0, 0, 0, 0.2),
        0 1px 4px rgba(0, 4, 227, 0.6);
}

/* Firefox scrollbar для .news-content */
.news-content {
    scrollbar-width: thin;
    scrollbar-color: #0004E3 #f8f9fa;
}

/* =========================
   МОДАЛЬНОЕ ОКНО ДЛЯ НЕАВТОРИЗОВАННЫХ ПОЛЬЗОВАТЕЛЕЙ
   ========================= */
.news-auth-required-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 10003;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    pointer-events: none;
    display: none;
}

.news-auth-required-modal-overlay.show {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    display: block;
}

.news-auth-required-modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.95);
    width: 496px;
    height: auto;
    background: #FFFFFF;
    border-radius: 16px;
    z-index: 10004;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, transform 0.3s ease, visibility 0.3s ease;
    pointer-events: none;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
}

.news-auth-required-modal.show {
    opacity: 1;
    visibility: visible;
    transform: translate(-50%, -50%) scale(1);
    pointer-events: auto;
}

.news-auth-required-modal__content {
    position: relative;
    width: 100%;
    height: 100%;
    padding: 36px;
    display: flex;
    flex-direction: column;
    align-items: center;
    box-sizing: border-box;
}

.news-auth-required-modal__close {
    position: absolute;
    top: 40px;
    right: 25px;
    width: 36px;
    height: 36px;
    padding: 0;
    border: none;
    background: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    z-index: 10;
}

.news-auth-required-modal__icon {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 24px;
    margin-top: 12px;
}

.news-auth-required-modal__icon img {
    width: 70px;
    height: 60px;
}

.news-auth-required-modal__title {
    font-family: 'Inter', sans-serif;
    font-size: 24px;
    font-weight: bold;
    line-height: 1.3;
    color: #003366;
    text-align: center;
    margin: 0 0 20px 0;
}

.news-auth-required-modal__text {
    font-family: 'Inter', sans-serif;
    font-size: 18px;
    line-height: 1.6;
    color: #000000;
    text-align: center;
    margin: 0 0 24px 0;
}

.news-auth-required-modal__text strong {
    font-weight: 700;
}

.news-auth-required-modal__register-btn {
    width: 100%;
    min-height: 67px;
    padding: 12px 24px;
    background: linear-gradient(91deg, #036 0.32%, #3CF 100%);
    color: #FFFFFF;
    border: none;
    border-radius: 50px;
    font-family: 'Inter', sans-serif;
    font-size: 18px;
    font-weight: 500;
    cursor: pointer;
    transition: opacity 0.2s ease;
    margin-bottom: 16px;
}

.news-auth-required-modal__register-btn:hover {
    opacity: 0.9;
}

.news-auth-required-modal__privacy {
    font-family: 'Inter', sans-serif;
    font-size: 12px;
    line-height: 1.4;
    color: rgba(0, 0, 0, 0.6);
    text-align: center;
    margin: 0 0 16px 0;
    opacity: 0.6;
}

.news-auth-required-modal__login-text {
    font-family: 'Inter', sans-serif;
    font-size: 18px;
    line-height: 1.4;
    color: #000000;
    text-align: center;
    margin: 0;
}

.news-auth-required-modal__login-link {
    color: #0086B3;
    text-decoration: none;
    cursor: pointer;
    font-weight: bold;
}

@media (max-width: 768px) {
    .news-auth-required-modal {
        width: calc(100% - 40px);
        max-width: 496px;
        height: auto;
        min-height: 534px;
        max-height: calc(100vh - 40px);
    }

    .news-auth-required-modal__content {
        padding: 32px 24px;
    }

    .news-auth-required-modal__title {
        font-size: 20px;
    }

    .news-auth-required-modal__text {
        font-size: 13px;
    }
}

@media (max-width: 480px) {
    .news-auth-required-modal {
        width: calc(100% - 20px);
    }

    .news-auth-required-modal__content {
        padding: 28px 20px;
    }

    .news-auth-required-modal__title {
        font-size: 18px;
    }
}

/* =========================
   МОДАЛЬНОЕ ОКНО НАСТРОЕК
   ========================= */

.settings-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    pointer-events: none;
}

.settings-modal-overlay.active {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.settings-modal {
    position: fixed;
    box-shadow: none;
    z-index: 10000;
    background: #FFFFFF;
    border-bottom-left-radius: 40px;
    border-bottom-right-radius: 40px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: opacity 0.3s ease, visibility 0.3s ease, transform 0.3s ease;
    overflow-y: auto;
    overflow-x: hidden;
    pointer-events: none;
    display: flex;
    flex-direction: column;
    height: 798px;
    margin: 0;
    padding: 0;
}

.settings-modal.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    pointer-events: auto;
}

/* Когда settings-modal активен, убираем скругления в нижних углах у header */
body:has(.settings-modal.active) header.header-map {
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
    background-color: #FFFFFF;
}

.settings-modal__content {
    position: relative;
    display: flex;
    flex-direction: column;
    padding: 20px 0;
    height: 100%;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    flex: 1;
    min-height: 0;
    box-sizing: border-box;
    background: #FFFFFF;
}

.settings-modal__close {
    position: absolute;
    top: 15px;
    left: 48%;
    width: 34px;
    height: 34px;
    border: none;
    background: transparent;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #000000;
    transition: all 0.2s ease;
    z-index: 10;
    border-radius: 50%;
}

.settings-modal__close:hover {
    color: #0004E3;
    background: #f8f9fa;
    transform: rotate(90deg);
}

.settings-modal__body {
    flex: 1;
    position: relative;
    top: -40px;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.settings-modal__title {
    color: #000;
    font-family: Inter;
    font-size: 32px;
    font-style: normal;
    font-weight: 700;
    line-height: normal;
    margin: 0 auto;
}

.settings-modal__content-inner {
    flex: 1;
    overflow-y: auto;
    flex-direction: column;
    justify-content: flex-start;
    overflow-x: hidden;
}

/* Убеждаемся, что все интерактивные элементы внутри модального окна кликабельны */
.settings-modal.active a,
.settings-modal.active button,
.settings-modal.active input,
.settings-modal.active label,
.settings-modal.active [onclick] {
    pointer-events: auto !important;
    cursor: pointer;
    position: relative;
    z-index: 1;
}

/* Адаптивные стили для модального окна настроек */
@media (max-width: 768px) {
    .settings-modal {
        border-bottom-left-radius: 30px;
        border-bottom-right-radius: 30px;
    }

    .settings-modal__content {
        padding: 15px;
    }

    .settings-modal__title {
        font-size: 20px;
    }
}

/* Модальное окно «Настройка уведомлений» — боттомшит в адаптиве */
@media (max-width: 768px) {
    #settingsModalNotifications.settings-modal.settings-modal--sheet,
    #settingsModalNotifications.settings-modal {
        top: auto !important;
        left: 0 !important;
        right: 0 !important;
        bottom: 0 !important;
        width: 100% !important;
        max-width: 100% !important;
        height: auto !important;
        max-height: 85vh;
        margin-bottom: 50px;
        border-radius: 20px 20px 0 0;
        border-bottom-left-radius: 0;
        border-bottom-right-radius: 0;
        transform: translateY(100%);
        transition: transform 0.35s ease, opacity 0.35s ease;
    }

    #settingsModalNotifications.settings-modal.active {
        transform: translateY(0);
    }

    #settingsModalNotifications .settings-modal__sheet-handle {
        display: block;
        width: 40px;
        height: 4px;
        background: rgba(0, 0, 0, 0.2);
        border-radius: 2px;
        margin: 0 auto 12px;
        flex-shrink: 0;
    }

    #settingsModalNotifications .settings-modal__content-inner__right__about__myself {
        width: 100%;
        max-width: 100%;
        max-height: none;
        min-height: 0;
        padding: 16px 20px;
    }

    #settingsModalNotifications .settings-modal__content-inner__right__about__myself ul li {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 12px;
        margin-top: 14px;
        flex-wrap: wrap;
    }

    #settingsModalNotifications .settings-modal__content-inner__right__about__myself ul li .profile-toggle-switch {
        flex-shrink: 0;
    }
}

/* Заголовок и блок уведомлений — отступ 20px */
#settingsModalNotifications .settings-modal__body {
    gap: 20px;
}

@media (min-width: 769px) {
    .settings-modal__sheet-handle {
        display: none;
    }
}

@media (max-width: 480px) {
    .settings-modal {
        border-bottom-left-radius: 25px;
        border-bottom-right-radius: 25px;
    }

    .settings-modal__content {
        padding: 12px;
    }

    .settings-modal__title {
        font-size: 18px;
    }

    .settings-modal__close {
        width: 30px;
        height: 30px;
        top: 12px;
        right: 12px;
    }
}

.settings-modal__content-inner h4 {
    color: #000;
    font-family: Inter;
    font-size: 22px;
    font-style: normal;
    font-weight: 700;
    line-height: normal;
}

.settings-modal__content-inner__right div:last-child {
    margin-top: 28px;
}

.settings-modal__content-inner__left div:last-child {
    margin-top: 28px;
}

.settings-modal__content-inner__right__about__myself {
    width: 578px;
    max-height: 240px;
    height: 100%;
    padding: 26px 81px;
    border-radius: 30px;
}

.settings-modal__content-inner__right__about__myself ul li {
    display: flex;
    justify-content: space-between;
    margin-top: 14px;
}

.settings-modal__content-inner__right__about__myself ul {
    list-style: none;
}

.settings-modal__content-inner__right__about__myself {
    background: var(--gray, rgba(233, 239, 243, 0.65));
}

/* Стили для чекбоксов в settings-modal__content - черный фон при активном состоянии */
.settings-modal .settings-modal__content .profile-toggle-switch input:checked+.profile-toggle-slider,
.settings-modal__content .profile-toggle-switch input:checked+.profile-toggle-slider,
.settings-modal__body .profile-toggle-switch input:checked+.profile-toggle-slider {
    background-color: #000000 !important;
}

.settings-modal .settings-modal__content .profile-toggle-switch input:checked+.profile-toggle-slider:before,
.settings-modal__content .profile-toggle-switch input:checked+.profile-toggle-slider:before,
.settings-modal__body .profile-toggle-switch input:checked+.profile-toggle-slider:before {
    transform: translateX(24px) !important;
    background-color: white !important;
}

/* Дополнительные стили для чекбоксов в settings-modal с максимальной специфичностью */
#settingsModal .settings-modal__content .profile-toggle-switch input[type="checkbox"]:checked+.profile-toggle-slider,
#settingsModal .settings-modal__body .profile-toggle-switch input[type="checkbox"]:checked+.profile-toggle-slider,
#settingsModal .settings-modal__content-inner .profile-toggle-switch input[type="checkbox"]:checked+.profile-toggle-slider,
#settingsModal .profile-toggle-switch input[type="checkbox"]:checked+.profile-toggle-slider {
    background-color: #000000 !important;
    border-color: #000000 !important;
}

#settingsModal .settings-modal__content .profile-toggle-switch input[type="checkbox"]:checked+.profile-toggle-slider:before,
#settingsModal .settings-modal__body .profile-toggle-switch input[type="checkbox"]:checked+.profile-toggle-slider:before,
#settingsModal .settings-modal__content-inner .profile-toggle-switch input[type="checkbox"]:checked+.profile-toggle-slider:before,
#settingsModal .profile-toggle-switch input[type="checkbox"]:checked+.profile-toggle-slider:before {
    transform: translateX(24px) !important;
    background-color: #ffffff !important;
}

/* Переопределение стилей из profile-modal.css для settings-modal */
.settings-modal .profile-toggle-switch input:checked+.profile-toggle-slider,
#settingsModal .profile-toggle-switch input:checked+.profile-toggle-slider {
    background-color: #000000 !important;
}

.settings-modal .profile-toggle-switch input:checked+.profile-toggle-slider:before,
#settingsModal .profile-toggle-switch input:checked+.profile-toggle-slider:before {
    transform: translateX(24px) !important;
    background-color: white !important;
}

.settings-modal__content-inner__left__me {
    padding: 18px 42px 18px 27px;
}

.settings-modal__content-inner__left__me__info__chang__photo div img:first-child {
    width: 88px;
    height: 88px;
}

/* Финальное переопределение для чекбоксов в settings-modal - максимальная специфичность */
#settingsModal.settings-modal .profile-toggle-switch input[type="checkbox"]:checked+.profile-toggle-slider,
#settingsModal .settings-modal__content .profile-toggle-switch input[type="checkbox"]:checked+.profile-toggle-slider,
#settingsModal .settings-modal__body .profile-toggle-switch input[type="checkbox"]:checked+.profile-toggle-slider,
#settingsModal .settings-modal__content-inner .profile-toggle-switch input[type="checkbox"]:checked+.profile-toggle-slider {
    background-color: #000000 !important;
    background: #000000 !important;
}

#settingsModal.settings-modal .profile-toggle-switch input[type="checkbox"]:checked+.profile-toggle-slider:before,
#settingsModal .settings-modal__content .profile-toggle-switch input[type="checkbox"]:checked+.profile-toggle-slider:before,
#settingsModal .settings-modal__body .profile-toggle-switch input[type="checkbox"]:checked+.profile-toggle-slider:before,
#settingsModal .settings-modal__content-inner .profile-toggle-switch input[type="checkbox"]:checked+.profile-toggle-slider:before {
    transform: translateX(24px) !important;
    background-color: #ffffff !important;
    background: #ffffff !important;
}

/* Анимации для уведомлений */
@keyframes slideIn {
    from {
        transform: translateY(-20px);
        opacity: 0;
    }

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

@keyframes slideOut {
    from {
        transform: translateY(0);
        opacity: 1;
    }

    to {
        transform: translateY(-20px);
        opacity: 0;
    }
}