﻿/* ============================================
   NEWS PAGE HERO SECTION
   ============================================ */

/* Hero Section Wrapper с адаптивными отступами */
.news-hero-wrapper {
    width: 100%;
    margin-left: auto;
    margin-right: auto;
    padding-left: 2rem;
    padding-right: 2rem;
}

.news-hero {
    background: linear-gradient(135deg, #0d6efd 0%, #0056b3 100%);
    height: 350px;
    display: flex;
    align-items: center;
    padding: 2rem;
    color: white;
    position: relative;
    overflow: hidden;
    border-radius: 8px;
}

    .news-hero::before {
        content: '';
        position: absolute;
        top: -50%;
        right: -10%;
        width: 400px;
        height: 400px;
        background: rgba(255, 255, 255, 0.05);
        border-radius: 50%;
    }

.hero-content {
    position: relative;
    z-index: 1;
}

.hero-text {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.btn-back {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(255, 255, 255, 0.2);
    color: white;
    padding: 0.6rem 1.2rem;
    border-radius: 6px;
    text-decoration: none;
    font-weight: 500;
    font-size: 0.95rem;
    width: fit-content;
    transition: all 0.3s;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

    .btn-back:hover {
        background: rgba(255, 255, 255, 0.3);
        border-color: rgba(255, 255, 255, 0.5);
        transform: translateX(-4px);
        color: white;
    }

.hero-title {
    font-size: 2.5rem;
    font-weight: 700;
    margin: 0;
    line-height: 1.2;
}

.hero-subtitle {
    font-size: 1.1rem;
    opacity: 0.95;
    margin: 0;
    max-width: 600px;
    line-height: 1.6;
}

/* Отступы для News Hero wrapper на разных экранах */
@media (min-width: 576px) {
    .news-hero-wrapper {
        padding-left: 2.5rem;
        padding-right: 2.5rem;
    }
}

@media (min-width: 768px) {
    .news-hero-wrapper {
        padding-left: 3rem;
        padding-right: 3rem;
    }
}

@media (min-width: 992px) {
    .news-hero-wrapper {
        padding-left: 4rem;
        padding-right: 4rem;
    }
}

@media (min-width: 1200px) {
    .news-hero-wrapper {
        max-width: 1320px;
        padding-left: 5rem;
        padding-right: 5rem;
    }
}

@media (min-width: 1400px) {
    .news-hero-wrapper {
        max-width: 1400px;
        padding-left: 6rem;
        padding-right: 6rem;
    }
}

@media (min-width: 1600px) {
    .news-hero-wrapper {
        max-width: 1500px;
        padding-left: 7rem;
        padding-right: 7rem;
    }
}

@media (max-width: 992px) {
    .news-hero {
        height: 300px;
        border-radius: 6px;
    }
}

@media (max-width: 768px) {
    .news-hero {
        height: 280px;
        border-radius: 6px;
    }

    .hero-title {
        font-size: 1.75rem;
    }

    .hero-subtitle {
        font-size: 1rem;
    }
}

@media (max-width: 576px) {
    .news-hero {
        height: 250px;
        border-radius: 4px;
    }
}

/* ============================================
   NEWS GRID LAYOUT
   ============================================ */

.news-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
}

@media (max-width: 1024px) {
    .news-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1.5rem;
    }
}

@media (max-width: 768px) {
    .news-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
}

/* ============================================
   ФИЛЬТРЫ
   ============================================ */

.filter-panel {
    background: white;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 1.5rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

    .filter-panel .form-label {
        font-weight: 600;
        color: #333;
        font-size: 0.95rem;
        margin-bottom: 0.5rem;
    }

    .filter-panel .form-control,
    .filter-panel .form-select {
        border: 1px solid #ced4da;
        border-radius: 6px;
        padding: 0.6rem 0.75rem;
        font-size: 0.95rem;
        transition: border-color 0.2s, box-shadow 0.2s;
    }

        .filter-panel .form-control:focus,
        .filter-panel .form-select:focus {
            border-color: #0d6efd;
            box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.15);
        }

    .filter-panel .btn {
        padding: 0.6rem 1.25rem;
        font-weight: 500;
        border-radius: 6px;
        transition: all 0.2s;
    }

    .filter-panel .btn-primary {
        background-color: #0d6efd;
        border-color: #0d6efd;
    }

        .filter-panel .btn-primary:hover {
            background-color: #0056b3;
            border-color: #0056b3;
            transform: translateY(-2px);
            box-shadow: 0 4px 8px rgba(0, 86, 179, 0.2);
        }

    .filter-panel .btn-secondary {
        background-color: #6c757d;
        border-color: #6c757d;
        color: white;
    }

        .filter-panel .btn-secondary:hover {
            background-color: #5a6268;
            border-color: #5a6268;
        }

/* ============================================
   NEWS CARDS (GRID VERSION)
   ============================================ */

/* Обертка-ссылка для кликабельной карточки */
.news-card-link {
    text-decoration: none;
    color: inherit;
    display: block;
    height: 100%;
    cursor: pointer;
}

.news-card {
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    overflow: hidden;
    transition: all 0.3s ease;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
    display: flex;
    flex-direction: column;
    height: 100%;
}

.news-card-link:hover .news-card {
    transform: translateY(-8px);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.15);
    border-color: #0d6efd;
}

/* Контейнер изображения */
.news-card-image-container {
    width: 100%;
    height: 220px;
    overflow: hidden;
    background-color: #f8f9fa;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

/* Изображение новости */
.news-card-image {
    width: 100%;
    height: 220px;
    object-fit: contain;
    object-position: center;
    display: block;
    background-color: #f8f9fa;
}

/* Placeholder для отсутствующего изображения */
.news-card-image-placeholder {
    width: 100%;
    height: 220px;
    background: linear-gradient(135deg, #e7f3ff 0%, #f0f8ff 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 4rem;
    color: #0d6efd;
    transition: all 0.3s ease;
}

.news-card:hover .news-card-image-placeholder {
    background: linear-gradient(135deg, #cce5ff 0%, #e0f0ff 100%);
}

/* Контент карточки */
.news-card-content {
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    flex: 1;
}

/* Мета информация (дата, источник) */
.news-meta {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-bottom: 0.75rem;
}

    .news-meta .badge {
        font-size: 0.75rem;
        padding: 0.35rem 0.65rem;
        font-weight: 500;
        white-space: nowrap;
    }

    .news-meta .bg-info {
        background-color: #e7f3ff !important;
        color: #0056b3;
    }

    .news-meta .bg-secondary {
        background-color: #e9ecef !important;
        color: #495057;
    }

/* Заголовок новости */
.news-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: #212529;
    margin: 0 0 0.75rem 0;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    transition: color 0.2s;
}

.news-card-link:hover .news-title {
    color: #0d6efd;
}

/* Описание новости */
.news-description {
    color: #666;
    font-size: 0.9rem;
    line-height: 1.5;
    margin-bottom: 1rem;
    flex-grow: 1;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}


/* ============================================
   ПАГИНАЦИЯ
   ============================================ */

.pagination {
    display: flex;
    gap: 0.25rem;
    justify-content: center;
    flex-wrap: wrap;
}

    .pagination .page-link {
        border: 1px solid #dee2e6;
        border-radius: 6px;
        padding: 0.6rem 0.85rem;
        color: #0d6efd;
        text-decoration: none;
        font-weight: 500;
        transition: all 0.2s;
    }

        .pagination .page-link:hover:not(.disabled.page-link) {
            background-color: #e7f3ff;
            border-color: #0d6efd;
            color: #0056b3;
        }

    .pagination .page-item.active .page-link {
        background-color: #0d6efd;
        border-color: #0d6efd;
        color: white;
    }

    .pagination .page-item.disabled .page-link {
        color: #999;
        border-color: #dee2e6;
        cursor: not-allowed;
    }

/* ============================================
   ALERT (Нет новостей)
   ============================================ */

.alert-info {
    background-color: #e7f3ff;
    border: 1px solid #b3d9ff;
    border-left: 4px solid #0d6efd;
    border-radius: 8px;
    color: #0056b3;
}

    .alert-info .alert-heading {
        color: #0056b3;
        margin-bottom: 0.5rem;
    }

    .alert-info a {
        color: #0d6efd;
        text-decoration: underline;
        font-weight: 500;
    }

        .alert-info a:hover {
            color: #0056b3;
        }

/* ============================================
   АДАПТАЦИЯ ДЛЯ МОБИЛЬНЫХ УСТРОЙСТВ
   ============================================ */

@media (max-width: 768px) {
    .filter-panel {
        padding: 1rem;
    }

        .filter-panel .row {
            row-gap: 1rem;
        }

    .news-title {
        font-size: 1rem;
    }

    .news-description {
        font-size: 0.85rem;
    }

    .pagination {
        font-size: 0.85rem;
    }

        .pagination .page-link {
            padding: 0.4rem 0.6rem;
        }
}

@media (max-width: 576px) {
    .hero-title {
        font-size: 1.5rem;
    }

    .hero-subtitle {
        font-size: 0.95rem;
    }

    .filter-panel {
        padding: 0.75rem;
    }

    .news-card-content {
        padding: 1rem;
    }

    .news-title {
        font-size: 0.95rem;
    }

    .news-meta .badge {
        font-size: 0.7rem;
        padding: 0.3rem 0.5rem;
    }

    .news-card .btn-sm {
        font-size: 0.8rem;
        padding: 0.3rem 0.6rem;
    }
}

/* ============================================
   MODAL ДЛЯ ПРОСМОТРА ДОКУМЕНТОВ
   ============================================ */

#documentViewer {
    border: 1px solid #dee2e6;
    border-radius: 4px;
}

.modal-xl {
    max-width: 90%;
}

@media (max-width: 768px) {
    .modal-xl {
        max-width: 95%;
    }

    #documentViewer {
        height: 400px !important;
    }
}

/* ============================================
   СТРАНИЦА ДЕТАЛЕЙ НОВОСТИ (Details)
   ============================================ */

.page-title {
    font-size: 2rem;
    font-weight: 700;
    color: #0d6efd;
    margin-bottom: 0.5rem;
    border-bottom: 3px solid #0d6efd;
    padding-bottom: 0.5rem;
    display: inline-block;
}

.news-details-image {
    max-height: 500px;
    object-fit: contain;
    background-color: #f8f9fa;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.news-details-meta {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

    .news-details-meta .badge {
        font-size: 0.95rem;
        padding: 0.5rem 1rem;
        font-weight: 500;
    }

.news-details-content {
    font-size: 1.1rem;
    line-height: 1.9;
    color: #333;
    column-count: auto;
    column-width: 500px;
    column-gap: 2rem;
}

    .news-details-content p {
        margin-bottom: 1.5rem;
        text-align: justify;
        text-align-last: justify;
        orphans: 3;
        widows: 3;
        hyphens: auto;
        word-break: break-word;
        overflow-wrap: break-word;
    }

    .news-details-content h2 {
        font-size: 1.8rem;
        font-weight: 700;
        color: #0d6efd;
        margin-top: 2.5rem;
        margin-bottom: 1.5rem;
        border-left: 4px solid #0d6efd;
        padding-left: 1rem;
        column-span: all;
        break-after: avoid;
    }

    .news-details-content h3 {
        font-size: 1.4rem;
        font-weight: 600;
        color: #0056b3;
        margin-top: 2rem;
        margin-bottom: 1rem;
        column-span: all;
        break-after: avoid;
    }

    .news-details-content h4 {
        font-size: 1.2rem;
        font-weight: 600;
        color: #0d6efd;
        margin-top: 1.5rem;
        margin-bottom: 0.75rem;
    }

    .news-details-content a {
        color: #0d6efd;
        text-decoration: underline;
        font-weight: 500;
    }

        .news-details-content a:hover {
            color: #0056b3;
            text-decoration: none;
        }

    /* Автоматически созданные ссылки из текста */
    .news-details-content a.text-link {
        color: #0d6efd;
        text-decoration: underline;
        font-weight: 500;
        word-break: break-all;
        transition: all 0.3s;
    }

        .news-details-content a.text-link:hover {
            color: #0056b3;
            text-decoration: none;
            background-color: rgba(13, 110, 253, 0.1);
        }

        .news-details-content a.text-link:visited {
            color: #6610f2;
        }

    .news-details-content blockquote {
        border-left: 4px solid #0d6efd;
        padding-left: 1.5rem;
        margin: 1.5rem 0;
        color: #666;
        font-style: italic;
        background-color: #f8f9fa;
        padding: 1rem;
        border-radius: 4px;
        column-span: all;
    }

    .news-details-content ul,
    .news-details-content ol {
        margin-left: 2rem;
        margin-bottom: 1.5rem;
    }

    .news-details-content li {
        margin-bottom: 0.5rem;
        line-height: 1.8;
    }

    .news-details-content img {
        max-width: 100%;
        height: auto;
        margin: 1.5rem 0;
        border-radius: 8px;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
        column-span: all;
        display: block;
    }

/* Хлебные крошки */
.breadcrumb {
    background-color: #f8f9fa;
    border-radius: 8px;
    padding: 1rem;
}

    .breadcrumb .breadcrumb-item a {
        color: #0d6efd;
        text-decoration: none;
    }

        .breadcrumb .breadcrumb-item a:hover {
            text-decoration: underline;
        }

/* ============================================
   CAROUSEL (ГАЛЕРЕЯ КАРТИНОК)
   ============================================ */

#newsCarousel {
    background-color: #f8f9fa;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    padding-bottom: 0;
    height: 100% !important;
    width: 100% !important;
    position: relative !important;
    transition: opacity 0.3s ease !important;
}

.carousel-inner {
    border-radius: 8px;
    height: 100% !important;
    width: 100% !important;
    position: relative !important;
    transition: transform 0.6s ease-in-out !important;
}

.carousel-item {
    height: 100% !important;
    width: 100% !important;
    background-color: #f8f9fa;
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
}

    .carousel-item.active,
    .carousel-item-next,
    .carousel-item-prev {
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
    }

    .carousel-item img {
        object-fit: contain;
        height: 100%;
        width: 100%;
        max-height: 100%;
        max-width: 100%;
    }

.carousel-indicators {
    position: absolute;
    bottom: 15px;
    left: 0;
    right: 0;
    z-index: 10;
    justify-content: center;
    margin: 0;
}

    .carousel-indicators [data-bs-target] {
        width: 12px;
        height: 12px;
        border-radius: 50%;
        background-color: rgba(255, 255, 255, 0.6);
        margin: 0 5px;
        border: none;
        box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
        opacity: 1;
        transition: all 0.3s ease;
    }

        .carousel-indicators [data-bs-target]:hover {
            background-color: rgba(255, 255, 255, 0.9);
            transform: scale(1.2);
        }

    .carousel-indicators .active {
        background-color: #ffffff;
        transform: scale(1.3);
    }

/* Стрелки карусели */
.carousel-control-prev,
.carousel-control-next {
    width: 50px !important;
    height: 100% !important;
    opacity: 0.8;
    transition: opacity 0.3s !important;
    position: absolute !important;
    z-index: 1;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 0 !important;
    margin: 0 !important;
    border: none !important;
    background: transparent !important;
    outline: none !important;
    box-shadow: none !important;
    transform: none !important;
}

    .carousel-control-prev:hover,
    .carousel-control-next:hover {
        opacity: 1 !important;
        background: transparent !important;
        border: none !important;
        outline: none !important;
        box-shadow: none !important;
        transform: none !important;
    }

    .carousel-control-prev:focus,
    .carousel-control-next:focus,
    .carousel-control-prev:active,
    .carousel-control-next:active,
    .carousel-control-prev:focus-visible,
    .carousel-control-next:focus-visible {
        outline: none !important;
        box-shadow: none !important;
        opacity: 1 !important;
        background: transparent !important;
        border: none !important;
        transform: none !important;
    }

.carousel-control-prev-icon,
.carousel-control-next-icon {
    filter: invert(1);
    background-size: 100%;
    width: 2rem !important;
    height: 2rem !important;
    display: inline-block;
}

/* Фиксация стрелок внутри hero блока */
.news-details-hero .carousel-control-prev,
.news-details-hero .carousel-control-next {
    top: 0 !important;
    bottom: 0 !important;
    margin: 0 !important;
    transform: none !important;
}

.news-details-hero .carousel-control-prev {
    left: 0 !important;
}

.news-details-hero .carousel-control-next {
    right: 0 !important;
}

/* Дополнительная фиксация для всех состояний */
#newsCarousel .carousel-control-prev,
#newsCarousel .carousel-control-next {
    width: 50px !important;
    height: 100% !important;
    top: 0 !important;
    bottom: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    transform: none !important;
}

#newsCarousel .carousel-control-prev {
    left: 0 !important;
}

#newsCarousel .carousel-control-next {
    right: 0 !important;
}

.carousel-caption {
    background: rgba(0, 0, 0, 0.5);
    padding: 1rem;
    border-radius: 4px;
}

@media (max-width: 768px) {
    .news-details-hero {
        margin-bottom: 1.5rem;
    }

    .carousel-indicators {
        bottom: 10px;
    }

        .carousel-indicators [data-bs-target] {
            width: 10px;
            height: 10px;
            margin: 0 4px;
        }
}

/* ============================================
   MODAL ДЛЯ УВЕЛИЧЕНИЯ КАРТИНОК
   ============================================ */

.news-image-modal-trigger {
    cursor: zoom-in;
    transition: opacity 0.2s;
}

    .news-image-modal-trigger:hover {
        opacity: 0.9;
    }

.modal-content {
    border-radius: 8px;
    border: 1px solid #dee2e6;
}

.modal-header {
    border-bottom: 1px solid #dee2e6;
    background-color: #f8f9fa;
}

.modal-title {
    font-weight: 600;
    color: #0d6efd;
}

.modal-body {
    padding: 2rem;
    background-color: #fff;
}

#imageModalImg {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    border-radius: 4px;
}

@media (max-width: 1024px) {
    .news-details-content {
        column-count: 1;
    }
}

@media (max-width: 768px) {
    .modal-dialog {
        margin: 1rem !important;
    }

    .modal-body {
        padding: 1rem;
    }

    #imageModalImg {
        max-height: 60vh !important;
    }
}


/* ============================================
   NEWS DETAILS PAGE - ПОЛНЫЙ РЕДИЗАЙН
   ============================================ */

.btn-back {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(13, 110, 253, 0.1);
    color: #0d6efd;
    padding: 0.6rem 1.2rem;
    border-radius: 6px;
    text-decoration: none;
    font-weight: 500;
    font-size: 0.95rem;
    width: fit-content;
    transition: all 0.3s;
    border: 1px solid rgba(13, 110, 253, 0.2);
}

    .btn-back:hover {
        background: rgba(13, 110, 253, 0.2);
        border-color: #0d6efd;
        transform: translateX(-4px);
        color: #0d6efd;
    }

/* Контейнер статьи с ограничением ширины */
.news-details-article {
    max-width: 100%;
    width: 100%;
    margin: 0 auto;
}

/* Ограничение ширины контента на очень больших экранах */
@media (min-width: 1600px) {
    .news-details-article {
        max-width: 1400px;
    }
}

@media (min-width: 1400px) and (max-width: 1599px) {
    .news-details-article {
        max-width: 1200px;
    }
}

@media (min-width: 1200px) and (max-width: 1399px) {
    .news-details-article {
        max-width: 1100px;
    }
}

/* Hero Image */
.news-details-hero {
    width: 100%;
    margin-bottom: 2rem;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    aspect-ratio: 32 / 9;
    background-color: #f8f9fa;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

/* Контейнер для одиночной картинки */
.single-image-container {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    height: 100% !important;
    width: 100% !important;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    overflow: hidden;
}

/* Карусель внутри hero - скрываем overflow и фиксируем размеры */
.news-details-hero #newsCarousel {
    border-radius: 12px;
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    height: 100% !important;
    width: 100% !important;
    padding-bottom: 0 !important;
}

.news-details-hero .carousel-inner {
    border-radius: 12px;
    overflow: hidden;
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    height: 100% !important;
    width: 100% !important;
}

.news-details-hero-image {
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center;
    max-width: 100%;
    max-height: 100%;
}

/* Header с метаинформацией */
.news-details-header {
    margin-bottom: 2rem;
}

.news-details-meta-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.news-details-meta-left {
    display: flex;
    gap: 1.5rem;
    flex-wrap: wrap;
    align-items: center;
}

.news-details-meta-right {
    display: flex;
}

.news-meta-item {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.95rem;
    color: #666;
    font-weight: 500;
}

    .news-meta-item i {
        color: #0d6efd;
        font-size: 1rem;
    }

/* Кнопка поделиться */
.btn-share {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: white;
    color: #0d6efd;
    padding: 0.6rem 1.2rem;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    font-weight: 500;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.3s;
    text-decoration: none;
}

    .btn-share:hover {
        background: #e7f3ff;
        border-color: #0d6efd;
        color: #0056b3;
    }

/* Заголовок статьи */
.news-details-title {
    font-size: 2rem;
    font-weight: 700;
    color: #212529;
    margin: 0;
    line-height: 1.3;
}

@media (max-width: 768px) {
    .news-details-title {
        font-size: 1.5rem;
    }

    .news-details-meta-row {
        flex-direction: column;
        align-items: flex-start;
    }
}

/* Галерея */
.news-details-gallery {
    margin: 2rem 0;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.news-gallery-image {
    object-fit: contain;
    background-color: #f8f9fa;
    max-height: 500px;
}

/* Описание */
.news-details-description {
    font-size: 1.1rem;
    line-height: 1.7;
    color: #555;
    margin: 2rem 0;
    padding: 1.5rem;
    background-color: #f8f9fa;
    border-left: 4px solid #0d6efd;
    border-radius: 6px;
}

    .news-details-description p {
        margin: 0;
    }

/* Вложения */
.news-details-attachment {
    display: flex;
    gap: 1.5rem;
    padding: 1.5rem;
    margin: 2rem 0;
    background: linear-gradient(135deg, #e7f3ff 0%, #f0f8ff 100%);
    border: 1px solid #b3d9ff;
    border-radius: 8px;
    align-items: center;
}

.attachment-icon {
    font-size: 2rem;
    color: #0d6efd;
    flex-shrink: 0;
}

.attachment-content {
    flex: 1;
}

    .attachment-content strong {
        display: block;
        margin-bottom: 0.5rem;
        color: #0056b3;
    }

/* Контент статьи */
.news-details-content {
    font-size: 1rem;
    line-height: 1.8;
    color: #333;
    margin: 2rem 0;
}

    .news-details-content p {
        margin-bottom: 1.5rem;
        text-align: justify;
    }

    .news-details-content h2 {
        font-size: 1.5rem;
        font-weight: 700;
        color: #0d6efd;
        margin-top: 2rem;
        margin-bottom: 1rem;
        border-left: 4px solid #0d6efd;
        padding-left: 1rem;
    }

    .news-details-content h3 {
        font-size: 1.3rem;
        font-weight: 600;
        color: #0056b3;
        margin-top: 1.5rem;
        margin-bottom: 0.75rem;
    }

    .news-details-content h4 {
        font-size: 1.1rem;
        font-weight: 600;
        color: #0d6efd;
        margin-top: 1.5rem;
        margin-bottom: 0.75rem;
    }

    .news-details-content ul,
    .news-details-content ol {
        margin-left: 2rem;
        margin-bottom: 1.5rem;
    }

    .news-details-content li {
        margin-bottom: 0.75rem;
        line-height: 1.6;
    }

    .news-details-content a {
        color: #0d6efd;
        text-decoration: none;
        font-weight: 500;
        transition: color 0.3s;
    }

        .news-details-content a:hover {
            color: #0056b3;
            text-decoration: underline;
        }

    /* Автоматически созданные ссылки из текста */
    .news-details-content a.text-link {
        color: #0d6efd;
        text-decoration: underline;
        font-weight: 500;
        word-break: break-all;
        transition: all 0.3s;
    }

        .news-details-content a.text-link:hover {
            color: #0056b3;
            text-decoration: none;
            background-color: rgba(13, 110, 253, 0.1);
        }

        .news-details-content a.text-link:visited {
            color: #6610f2;
        }

    .news-details-content img {
        max-width: 100%;
        height: auto;
        margin: 1.5rem 0;
        border-radius: 8px;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    }

/* Footer */
.news-details-footer {
    display: flex;
    justify-content: center;
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 1px solid #dee2e6;
}

    .news-details-footer .btn {
        padding: 0.75rem 1.5rem;
        font-weight: 500;
        font-size: 1rem;
    }

/* Адаптивность */
@media (max-width: 768px) {
    .news-details-hero {
        margin-bottom: 1.5rem;
        border-radius: 8px;
    }

    .news-details-title {
        font-size: 1.25rem;
    }

    .news-details-content {
        font-size: 0.95rem;
    }

        .news-details-content h2 {
            font-size: 1.25rem;
        }

    .news-details-attachment {
        flex-direction: column;
        text-align: center;
    }

    .attachment-icon {
        font-size: 1.5rem;
    }

    .news-details-meta-left {
        gap: 1rem;
    }

    .news-meta-item {
        font-size: 0.85rem;
    }

    .btn-share {
        padding: 0.5rem 1rem;
        font-size: 0.9rem;
    }
}

@media (max-width: 576px) {
    .news-details-header {
        margin-bottom: 1.5rem;
    }

    .news-details-title {
        font-size: 1.1rem;
        line-height: 1.2;
    }

    .news-details-meta-row {
        flex-direction: column;
        gap: 0.5rem;
    }

    .news-details-meta-left {
        flex-direction: column;
        gap: 0.5rem;
        width: 100%;
    }

    .btn-share {
        width: 100%;
        justify-content: center;
    }

    .news-details-description {
        padding: 1rem;
        margin: 1.5rem 0;
    }

    .news-details-attachment {
        padding: 1rem;
        gap: 1rem;
    }
}

/* ============================================
   NEWS CONTENT CARD (Обводка контента)
   ============================================ */

.news-content-card {
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    padding: 2rem;
    margin: 2rem 0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

/* ============================================
   AI РЕЗЮМЕ НОВОСТЕЙ
   ============================================ */

.ai-summary-panel {
    background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 1.25rem 1.5rem;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
}

.ai-summary-panel:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    border-color: #0d6efd;
}

.ai-summary-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid #e7f3ff;
}

.ai-sparkle-icon {
    color: #0d6efd;
    flex-shrink: 0;
    animation: sparkle 2s ease-in-out infinite;
}

@keyframes sparkle {
    0%, 100% {
        opacity: 1;
        transform: scale(1) rotate(0deg);
    }
    50% {
        opacity: 0.7;
        transform: scale(1.1) rotate(5deg);
    }
}

.ai-summary-title {
    font-size: 0.9rem;
    color: #666;
    font-weight: 500;
}

.ai-summary-buttons {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.btn-ai-summary {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: #ffffff;
    color: #0d6efd;
    padding: 0.5rem 1rem;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    font-weight: 500;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
}

.btn-ai-summary svg {
    flex-shrink: 0;
}

.btn-ai-summary:hover:not(:disabled) {
    background: linear-gradient(135deg, #e7f3ff 0%, #f0f8ff 100%);
    border-color: #0d6efd;
    color: #0056b3;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(13, 110, 253, 0.15);
}

.btn-ai-summary:active:not(:disabled) {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(13, 110, 253, 0.2);
}

.btn-ai-summary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Адаптация для мобильных */
@media (max-width: 768px) {
    .ai-summary-panel {
        padding: 1rem;
    }

    .ai-summary-buttons {
        gap: 0.5rem;
    }

    .btn-ai-summary {
        padding: 0.4rem 0.8rem;
        font-size: 0.8rem;
    }

    .btn-ai-summary svg {
        width: 12px;
        height: 12px;
    }

    .ai-sparkle-icon {
        width: 14px;
        height: 14px;
    }
}

@media (max-width: 576px) {
    .ai-summary-buttons {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
    }

    .btn-ai-summary {
        width: 100%;
        justify-content: center;
    }
}


/* ============================================
   AI РЕЗЮМЕ НОВОСТЕЙ - ОБНОВЛЕНО
   ============================================ */

/* Разделитель между фильтрами и AI резюме */
.filter-divider {
    height: 1px;
    background: linear-gradient(to right, transparent, #dee2e6 20%, #dee2e6 80%, transparent);
    margin: 1.5rem 0;
}

/* Секция AI резюме внутри filter-panel */
.ai-summary-section {
    padding-top: 0.5rem;
}

/* Переопределяем старые стили */
.ai-summary-panel {
    background: none !important;
    border: none !important;
    border-radius: 0 !important;
    padding: 0 !important;
    box-shadow: none !important;
}

.ai-summary-panel:hover {
    box-shadow: none !important;
    border-color: transparent !important;
}

/* Обновленный заголовок без border-bottom */
.ai-summary-header {
    padding-bottom: 0 !important;
    border-bottom: none !important;
}


/* Уменьшаем отступ AI резюме от разделителя */
.ai-summary-section {
    padding-top: 0.25rem !important;
}


/* ============================================
   AI РЕЗЮМЕ - МОДАЛЬНОЕ ОКНО И КОНТЕНТ
   ============================================ */

/* Контент AI резюме */
#aiSummaryContent {
    line-height: 1.7;
    color: #333;
    font-size: 0.95rem;
}

#aiSummaryContent strong {
    color: #0d6efd;
    font-weight: 600;
}

#aiSummaryContent em {
    font-style: italic;
    color: #555;
}

/* Элементы списка с буллетами */
#aiSummaryContent .ai-summary-list-item {
    margin: 0.5rem 0;
    padding-left: 0.5rem;
}

/* Стилизация модального окна AI резюме */
#aiSummaryModal .modal-header {
    background: linear-gradient(135deg, #e7f3ff 0%, #f8f9fa 100%);
    border-bottom: 2px solid #0d6efd;
}

#aiSummaryModal .modal-title {
    color: #0d6efd;
    font-weight: 600;
}

#aiSummaryModal .modal-body {
    padding: 1.5rem;
    max-height: 70vh;
    overflow-y: auto;
}

/* Спиннер загрузки */
#aiSummaryLoading {
    text-align: center;
    padding: 3rem 1rem;
}

#aiSummaryLoading .spinner-border {
    width: 3rem;
    height: 3rem;
    color: #0d6efd;
}
