/* =========================================
   Стили для страницы "Новини" (Адмінка)
   ========================================= */

/* Карточка контента */
.content-card {
    border-top: 4px solid #0056b3 !important;
    border-radius: 12px !important;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05) !important;
    background: #fff !important;
    padding: 1.5rem !important;
}

.content-title {
    color: #0056b3 !important;
    font-weight: 600 !important;
}

/* =========================================
   КНОПКИ
   ========================================= */

/* Основная синяя кнопка */
.btn-download {
    background-color: #0056b3 !important;
    color: #fff !important;
    border-radius: 8px !important;
    padding: 10px 20px !important;
    text-decoration: none !important;
    border: 1px solid #0056b3 !important;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: 0.2s;
    font-weight: 500;
}
.btn-download:hover {
    background-color: #004a9f !important;
    color: #fff !important;
}

/* Кнопка "Скасувати" (серая) */
.btn-cancel {
    background-color: #6c757d !important;
    color: #fff !important;
    border: 1px solid #6c757d !important;
    border-radius: 8px !important;
    padding: 10px 20px !important;
    display: inline-flex !important;
    align-items: center !important;
    gap: 6px !important;
    text-decoration: none !important;
    font-weight: 500 !important;
    transition: 0.2s !important;
}
.btn-cancel:hover {
    background-color: #5a6268 !important;
    color: #fff !important;
}

/* Кнопки действий в списке новостей */
.btn-admin-edit,
.btn-admin-delete {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 38px;
    padding: 6px 10px;
    border-radius: 6px;
    text-decoration: none !important;
    transition: 0.2s;
    border: 1px solid transparent;
}

.btn-admin-edit {
    background-color: #0056b3 !important;
    color: #fff !important;
    border-color: #0056b3 !important;
}
.btn-admin-edit i { color: #fff !important; }
.btn-admin-edit:hover { background-color: #004a9f !important; }

.btn-admin-delete {
    background-color: #dc3545 !important;
    color: #fff !important;
    border-color: #dc3545 !important;
}
.btn-admin-delete i { color: #fff !important; }
.btn-admin-delete:hover { background-color: #bb2d3b !important; }

/* =========================================
   СПИСОК НОВОСТЕЙ (INDEX)
   ========================================= */

.news-admin-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.news-admin-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 12px;
    border: 1px solid #e3e9f5;
    border-radius: 10px;
    background: #fff;
    transition: all 0.2s ease;
}
.news-admin-item:hover {
    background-color: #f8faff;
    box-shadow: 0 2px 10px rgba(0, 86, 179, 0.05);
}

.news-admin-img {
    flex-shrink: 0;
    width: 100px;
    height: 70px;
    border-radius: 8px;
    overflow: hidden;
    background: #f1f3f5;
    display: flex;
    align-items: center;
    justify-content: center;
}
.news-admin-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.news-admin-img .no-img {
    font-size: 1.5rem;
    color: #adb5bd;
}

.news-admin-info {
    flex-grow: 1;
    min-width: 0;
}
.news-admin-title {
    font-size: 1.05rem;
    font-weight: 600;
    color: #333;
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.news-admin-meta {
    font-size: 0.85rem;
    color: #6c757d;
    display: flex;
    gap: 16px;
}

.news-admin-actions {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
}

/* =========================================
   ПАГИНАЦИЯ
   ========================================= */

.pagination,
.pagination ul,
.pagination li {
    list-style: none !important;
    list-style-type: none !important;
    margin: 0 !important;
    padding: 0 !important;
}

.pagination li::marker,
.pagination .page-item::marker {
    content: none !important;
    display: none !important;
}

.pagination .page-link::before,
.pagination .page-link::after {
    content: none !important;
    display: none !important;
}

.pagination .page-link i,
.pagination .page-link svg,
.pagination .page-link .bi {
    display: none !important;
}

.pagination {
    display: flex !important;
    justify-content: center !important;
    gap: 6px !important;
    flex-wrap: wrap !important;
}

.pagination .page-item .page-link {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    min-width: 42px !important;
    height: 42px !important;
    padding: 0 12px !important;
    font-size: 1rem !important;
    font-weight: 500 !important;
    color: #0056b3 !important;
    background-color: #fff !important;
    border: 1px solid #dee2e6 !important;
    border-radius: 8px !important;
    text-decoration: none !important;
    box-shadow: none !important;
    transition: all 0.2s ease !important;
    margin: 0 !important;
}

.pagination .page-item.active .page-link {
    background-color: #0056b3 !important;
    border-color: #0056b3 !important;
    color: #fff !important;
}

.pagination .page-item .page-link:hover {
    background-color: #e9f5ff !important;
    border-color: #0056b3 !important;
    color: #0056b3 !important;
}

.pagination .page-item.disabled .page-link {
    color: #adb5bd !important;
    background-color: #f8f9fa !important;
    border-color: #dee2e6 !important;
    pointer-events: none !important;
}

/* =========================================
   СКРЫТИЕ ПЛАВАЮЩИХ КНОПОК
   ========================================= */
body.page-admin-news .floating-actions {
    display: none !important;
}

/* =========================================
   ФОРМА (CREATE / UPDATE)
   ========================================= */

/* Поле загрузки файла */
.news-form input[type="file"].form-control {
    padding: 6px 12px !important;
    background-color: #f8faff !important;
    border: 1px dashed #adb5bd !important;
    border-radius: 8px !important;
    cursor: pointer !important;
    width: 100% !important;
    font-size: 0.9rem !important;
}

.news-form input[type="file"]::file-selector-button {
    background-color: #0056b3 !important;
    color: #fff !important;
    border: none !important;
    border-radius: 6px !important;
    padding: 6px 14px !important;
    margin-right: 12px !important;
    cursor: pointer !important;
    font-weight: 500 !important;
    transition: 0.2s !important;
}
.news-form input[type="file"]::file-selector-button:hover {
    background-color: #004a9f !important;
}

/* Поле даты */
.news-form input[type="datetime-local"] {
    max-width: 250px !important;
    width: 100% !important;
    padding: 8px 12px !important;
    font-size: 0.95rem !important;
    border: 1px solid #ced4da !important;
    border-radius: 8px !important;
}

/* Чекбокс */
.form-check-input:checked {
    background-color: #0056b3 !important;
    border-color: #0056b3 !important;
}
.form-check-label {
    font-weight: 500 !important;
    color: #333 !important;
}

.news-form .form-check.form-switch {
    display: flex !important;
    align-items: center !important;
    gap: 10px !important;
    padding-left: 0 !important;
}
.news-form .form-check.form-switch .form-check-input {
    margin-left: 0 !important;
    margin-top: 0 !important;
    flex-shrink: 0 !important;
    width: 3em !important;
    height: 1.5em !important;
    cursor: pointer !important;
}
.news-form .form-check.form-switch .form-check-label {
    margin-bottom: 0 !important;
    white-space: nowrap !important;
}

/* =========================================
   TINYMCE (НОВЫЙ РЕДАКТОР)
   ========================================= */

/* Контейнер редактора */
.news-form .tox-tinymce {
    border: 1px solid #ced4da !important;
    border-radius: 10px !important;
    overflow: hidden !important;
    width: 100% !important;
}

/* Панель инструментов */
.news-form .tox-toolbar {
    background-color: #f8faff !important;
    border-bottom: 1px solid #e3e9f5 !important;
    padding: 4px !important;
}

/* Иконки редактора */
.news-form .tox-toolbar__group button {
    color: #0056b3 !important;
    border-radius: 4px !important;
    transition: 0.2s !important;
}

.news-form .tox-toolbar__group button:hover {
    background-color: #e9f5ff !important;
}

.news-form .tox-toolbar__group button[aria-pressed="true"] {
    background-color: #0056b3 !important;
    color: #fff !important;
}

/* Поле ввода текста */
.news-form .tox-edit-area {
    min-height: 400px !important;
    font-size: 1rem !important;
    line-height: 1.6 !important;
    padding: 10px 15px !important;
}

/* =========================================
   ПОЛЕ ЗАГРУЗКИ ФАЙЛА — ФИНАЛЬНАЯ СТИЛИЗАЦИЯ
   ========================================= */

/* Контейнер поля загрузки */
.news-form input[type="file"].form-control {
    width: 100% !important;
    max-width: 100% !important;
    padding: 8px 12px !important;
    background-color: #f8faff !important;
    border: 1px dashed #adb5bd !important;
    border-radius: 8px !important;
    font-size: 0.9rem !important;
    cursor: pointer !important;
    color: #6c757d !important;
    transition: all 0.2s ease !important;
}

.news-form input[type="file"].form-control:hover {
    border-color: #0056b3 !important;
    background-color: #e9f5ff !important;
}

/* Кнопка "Выберите файл" */
.news-form input[type="file"]::file-selector-button {
    background-color: #0056b3 !important;
    color: #fff !important;
    border: none !important;
    border-radius: 6px !important;
    padding: 6px 14px !important;
    margin-right: 12px !important;
    cursor: pointer !important;
    font-weight: 500 !important;
    font-size: 0.85rem !important;
    transition: background-color 0.2s ease !important;
}

.news-form input[type="file"]::file-selector-button:hover {
    background-color: #004a9f !important;
}

/* Убираем растягивание поля на всю ширину колонки */
.news-form .field-news-file,
.news-form .field-news-news_attach {
    width: 100% !important;
    max-width: 100% !important;
}

/* Уменьшаем отступы у поля */
.news-form .field-news-file .form-group,
.news-form .field-news-news_attach .form-group {
    margin-bottom: 0 !important;
}

/* =========================================
   ЧЕКБОКС "ЗАКРІПИТИ НА ГОЛОВНІЙ (ТОП)"
   ========================================= */

.news-form .form-check.form-switch {
    display: flex !important;
    align-items: center !important;
    gap: 12px !important;
    padding-left: 0 !important;
    margin-bottom: 0 !important;
    min-height: 40px;
}

.news-form .form-check.form-switch .form-check-input {
    margin-left: 0 !important;
    margin-top: 0 !important;
    flex-shrink: 0 !important;
    width: 3em !important;
    height: 1.5em !important;
    cursor: pointer !important;
    border: 1px solid #ced4da !important;
    background-color: #e9ecef !important;
    transition: all 0.2s ease !important;
}

.news-form .form-check.form-switch .form-check-input:checked {
    background-color: #0056b3 !important;
    border-color: #0056b3 !important;
}

.news-form .form-check.form-switch .form-check-label {
    margin-bottom: 0 !important;
    font-weight: 500 !important;
    color: #333 !important;
    font-size: 0.95rem !important;
    cursor: pointer !important;
    white-space: nowrap !important;
}

/* Выравниваем блок ТОП по нижнему краю с полем даты */
.news-form .col-md-6.d-flex.align-items-center {
    display: flex !important;
    align-items: flex-end !important; /* Выравнивание по нижнему краю */
    padding-bottom: 0 !important;
}

/* Прижимаем чекбокс ТОП к правому краю */
.news-form .col-md-6.justify-content-end {
    display: flex !important;
    align-items: center !important;
    justify-content: flex-end !important;
    padding-right: 0 !important;
}

.news-form .form-check.form-switch {
    display: flex !important;
    align-items: center !important;
    gap: 10px !important;
    padding-left: 0 !important;
    margin-bottom: 0 !important;
}

.news-form .form-check.form-switch .form-check-input {
    margin-left: 0 !important;
    margin-top: 0 !important;
    flex-shrink: 0 !important;
    width: 3em !important;
    height: 1.5em !important;
    cursor: pointer !important;
}

.news-form .form-check.form-switch .form-check-input:checked {
    background-color: #0056b3 !important;
    border-color: #0056b3 !important;
}

.news-form .form-check.form-switch .form-check-label {
    margin-bottom: 0 !important;
    font-weight: 500 !important;
    color: #333 !important;
    white-space: nowrap !important;
    cursor: pointer !important;
}

/* =========================================
   БЕЙДЖ "ТОП" — ЯРКИЙ
   ========================================= */

.badge-top {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background-color: #f0ad4e !important; /* Оранжевый фон */
    color: #ffffff !important;            /* Белый текст */
    padding: 4px 10px !important;
    border-radius: 6px !important;
    font-size: 0.7rem !important;
    font-weight: 700 !important;
    margin-right: 10px !important;
    vertical-align: middle !important;
    text-transform: uppercase !important;
    letter-spacing: 0.5px !important;
    box-shadow: 0 2px 5px rgba(240, 173, 78, 0.4) !important;
    border: 1px solid #e09a3a !important;
}

.badge-top i {
    font-size: 0.8rem !important;
    color: #fff !important;
}

/* =========================================
   ПАГИНАЦИЯ В АДМИНКЕ НОВОСТЕЙ (жёстко)
   ========================================= */

.admin-news-pagination .pagination {
    display: flex !important;
    justify-content: center !important;
    gap: 6px !important;
    list-style: none !important;
    padding: 0 !important;
    margin: 0 !important;
}

.admin-news-pagination .pagination li {
    list-style: none !important;
}

.admin-news-pagination .pagination .page-link {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    min-width: 42px !important;
    height: 42px !important;
    padding: 0 12px !important;
    font-size: 1rem !important;
    font-weight: 500 !important;
    color: #0056b3 !important;
    background-color: #fff !important;
    border: 1px solid #dee2e6 !important;
    border-radius: 8px !important;
    text-decoration: none !important;
    box-shadow: none !important;
    transition: all 0.2s ease !important;
}

.admin-news-pagination .pagination .page-item.active .page-link {
    background-color: #0056b3 !important;
    border-color: #0056b3 !important;
    color: #fff !important;
}

.admin-news-pagination .pagination .page-link:hover {
    background-color: #e9f5ff !important;
    border-color: #0056b3 !important;
    color: #0056b3 !important;
}

.admin-news-pagination .pagination .page-link::before,
.admin-news-pagination .pagination .page-link::after {
    content: none !important;
    display: none !important;
}

.admin-news-pagination .pagination .page-link i,
.admin-news-pagination .pagination .page-link svg,
.admin-news-pagination .pagination .page-link .bi {
    display: none !important;
}

/* Перебиваем snodes.css */
ul.pagination li a,
ul.pagination li span,
ul.pagination .page-item .page-link {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    min-width: 42px !important;
    height: 42px !important;
    padding: 0 12px !important;
    font-size: 1rem !important;
    font-weight: 500 !important;
    color: #0056b3 !important;
    background-color: #fff !important;
    border: 1px solid #dee2e6 !important;
    border-radius: 8px !important;
    text-decoration: none !important;
    float: none !important;
    margin: 0 3px !important;
}

ul.pagination li.active a,
ul.pagination li.active span,
ul.pagination .page-item.active .page-link {
    background-color: #0056b3 !important;
    border-color: #0056b3 !important;
    color: #fff !important;
}

/* Убираем галочки из documents.css у пагинации */
html body.page-admin #blog .content-card .pagination li::before,
html body.page-admin #blog .content-card .pagination .page-item::before {
    content: none !important;
    display: none !important;
}