/* ===========================
   ADMIN PAGES (Список сторінок)
=========================== */
.admin-pages {
    padding: 60px 0;
    background: #f4f4f4;
}
.admin-pages-container {
    max-width: 700px;
    margin: auto;
    background: #fff;
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 6px 15px rgba(0,0,0,0.08);
}
.admin-pages-title {
    text-align: center;
    font-size: 28px;
    color: #0b3c6d;
    margin-bottom: 30px;
}
.admin-pages-message {
    background: #e7f7e7;
    color: #155724;
    padding: 12px;
    border-radius: 6px;
    margin-bottom: 20px;
    text-align: center;
}
.admin-pages-form .admin-form-group {
    margin-bottom: 20px;
}
.admin-pages-form label {
    display: block;
    font-weight: bold;
    margin-bottom: 6px;
    color: #333;
}
.admin-pages-form input,
.admin-pages-form textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 6px;
    font-size: 14px;
}
.admin-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 20px;
    background: #f9b233;
    color: #000;
    border-radius: 6px;
    font-weight: bold;
    text-decoration: none;
    cursor: pointer;
    margin-right: 10px;
}
.admin-btn-back {
    background: #ccc;
    color: #000;
}

/* ===========================
   ADMIN EDIT PAGE
=========================== */
.admin-editpage {
    padding: 60px 0;
    background: #f4f4f4;
}
.admin-editpage-container {
    max-width: 700px;
    margin: auto;
    background: #fff;
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 6px 15px rgba(0,0,0,0.08);
}
.admin-editpage-title {
    text-align: center;
    font-size: 28px;
    color: #0b3c6d;
    margin-bottom: 30px;
}
.admin-editpage-message {
    background: #f55555;
    color: #fff;
    padding: 12px;
    border-radius: 6px;
    margin-bottom: 20px;
    text-align: center;
}
.admin-editpage-group {
    margin-bottom: 20px;
}
.admin-editpage-group label {
    display: block;
    font-weight: bold;
    margin-bottom: 6px;
    color: #333;
}
.admin-editpage-group input,
.admin-editpage-group textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 6px;
    font-size: 14px;
}
.admin-editpage-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 18px;
    background: #f9b233;
    color: #000;
    border-radius: 6px;
    font-weight: bold;
    text-decoration: none;
    cursor: pointer;
    margin-right: 10px;
}
.admin-editpage-btn-back {
    background: #ccc;
    color: #000;
}

/* ===========================
   PAGE VIEW
=========================== */
.page-view {
    padding: 60px 0;
    background: #f4f4f4;
}
.page-view-container {
    max-width: 900px;
    margin: auto;
    background: #fff;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 6px 15px rgba(0,0,0,0.08);
}
.page-view-title {
    font-size: 32px;
    margin-bottom: 25px;
    color: #0b3c6d;
}
.page-view-content {
    background: #fff;
    padding: 25px;
    border-radius: 10px;
    margin-bottom: 30px;
    line-height: 1.7;
    text-align: justify;
}
.page-view-admin {
    margin-bottom: 30px;
}
.page-view-btn,
.page-view-btn-back {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 18px;
    border-radius: 6px;
    font-weight: bold;
    text-decoration: none;
    margin-right: 10px;
}
.page-view-btn {
    background: #f9b233;
    color: #000;
}
.page-view-btn-back {
    margin-top:30px;
    background: #ccc;
    color: #000;
}

/* ===== МЕДІА ===== */
.page-view-media {
    margin: 40px 0;
}
/* Фото */
.photo-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: flex-start;
}
.photo-grid img {
    width: auto;
    height: auto;
    max-width: 100%;
    max-height: 220px;
    object-fit: contain;
    border-radius: 10px;
    display: block;
}
/* Відео */
.video-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
}
.video-grid video {
    width: 100%;
    border-radius: 10px;
}

/* PDF */
.pdf-grid {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.pdf-grid .media-item1 {
    position: relative; /* щоб кнопка delete була всередині блока */
    display: flex;
    align-items: center;
    justify-content: space-between; /* кнопка справа, текст зліва */
    padding: 8px 12px;
    background: #e0e0e0;
    border-radius: 8px;
}
.pdf-grid a {
    text-decoration: none;
    color: #0b3c6d;
    font-weight: 500;
    flex-grow: 1; /* текст займає весь простір, кнопка не перекриває */
}
.pdf-grid a:hover {
    background: transparent; /* фон ховер для тексту вимкнений */
}

.pdf-grid .media-item1 {
    padding-right: 50px; /* місце під кнопку */
}

.empty-media {
    color: #777;
    font-style: italic;
}

/* Попап фото */
.image-popup {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.85);
    z-index: 999999;
    justify-content: center;
    align-items: center;
}
.image-popup.active {
    display: flex;
}
.image-popup img {
    max-width: 95vw !important;
    max-height: 95vh !important;
    width: auto !important;
    height: auto !important;
    object-fit: contain !important;
    display: block !important;
}
.image-popup-close {
    position: fixed;
    top: 20px;
    right: 25px;
    font-size: 90px;
    color: #fff;
    cursor: pointer;
    z-index: 1000000;
}

/* Кнопки видалення медіа */
.media-item1 {
    position: relative;
    display: inline-block;
}
.icon-btn {
    position: absolute;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    font-size: 18px;
    color: #fff;
    box-shadow: 0 2px 6px rgba(0,0,0,0.3);
    z-index: 20;
    transition: 0.2s ease;
}
/* РЕДАГУВАТИ */
.icon-btn.edit {
    top: 8px;
    right: 52px; /* ?? зміщення вліво */
    background:#f9b233;
}
.icon-btn.delete {
    top: 8px;
    right: 8px;
    background: #f44336;
}
.icon-btn.delete:hover,
.icon-btn.delete1:hover {
    background: #d32f2f;
    transform: scale(1.1);
}

/* ===========================
   АДАПТИВНІСТЬ
=========================== */
@media (max-width: 768px) {
    .admin-pages,
    .admin-editpage,
    .page-view {
        padding: 25px 10px;
    }
    .admin-pages-container,
    .admin-editpage-container,
    .page-view-container {
        padding: 20px;
        border-radius: 8px;
    }
    .page-view-title,
    .admin-pages-title,
    .admin-editpage-title {
        font-size: 26px;
    }
    .page-view-content {
        padding: 15px;
        font-size: 18px;
    }
    .page-view-admin,
    .photo-grid,
    .video-grid,
    .pdf-grid {
        text-align: center;
        justify-content: center;
    }
    .photo-grid img {
        width: 100%;
        max-width: 280px;
    }
    .video-grid video {
        width: 100%;
        max-width: 100%;
    }
}
