/* Стили для страницы документов PDF */

.documents-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

/* Переключатель разделов */
.section-switcher {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.section-btn {
    background-color: #ea6511;
    color: white;
    padding: 12px 30px;
    border-radius: 5px;
    text-decoration: none;
    font-weight: 500;
    font-family: "Bastion", "Golos Text", Arial, sans-serif;
    transition: all 0.3s ease;
    display: inline-block;
    border: 2px solid transparent;
    font-size: 1.1em;
}

.section-btn:hover {
    background-color: #e7362c;
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

.section-btn.active {
    background-color: #e7362c;
    color: white;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
    cursor: default;
}

/* Стили пагинации */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
    margin: 20px 0;
    flex-wrap: wrap;
}

.pagination-numbers {
    display: flex;
    gap: 8px;
    align-items: center;
}

.prev-btn, .next-btn {
    background-color: #ea6511;
    color: white;
    padding: 10px 20px;
    border-radius: 5px;
    text-decoration: none;
    font-weight: 500;
    font-family: "Bastion", "Golos Text", Arial, sans-serif;
    transition: all 0.3s ease;
    display: inline-block;
    border: 2px solid transparent;
}

.prev-btn:hover, .next-btn:hover {
    background-color: #e7362c;
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

.pagination-number {
    background-color: #ea6511;
    color: white;
    padding: 8px 12px;
    border-radius: 5px;
    text-decoration: none;
    font-weight: 500;
    font-family: "Bastion", "Golos Text", Arial, sans-serif;
    transition: all 0.3s ease;
    display: inline-block;
    min-width: 40px;
    text-align: center;
}

.pagination-number:hover {
    background-color: #e7362c;
    color: white;
    transform: translateY(-2px);
}

.pagination-number.active {
    background-color: #e7362c;
    color: white;
    cursor: default;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

/* PDF контейнер */
.pdf-container {
    width: 100%;
    max-width: 1200px;
    background: white;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    overflow: hidden;
}

.pdf-header {
    background: linear-gradient(135deg, #ea6511, #e7362c);
    color: white;
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

.pdf-header h3 {
    margin: 0;
    font-family: "Bastion", "Golos Text", Arial, sans-serif;
    font-size: 1.2em;
}

.pdf-controls {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.control-btn {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.3);
    padding: 8px 15px;
    border-radius: 5px;
    text-decoration: none;
    font-size: 0.9em;
    transition: all 0.3s ease;
    cursor: pointer;
    font-family: "Bastion", "Golos Text", Arial, sans-serif;
}

.control-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
}

/* PDF просмотрщик с максимальным скрытием элементов управления */
.pdf-viewer {
    width: 100%;
    height: 1000px;
    border: none;
    display: block;
    background: #f5f5f5;
    overflow: auto;
    position: relative;
    pointer-events: auto;
}

/* Максимально агрессивное скрытие всех элементов управления PDF */
.pdf-viewer::-webkit-media-controls,
.pdf-viewer::-webkit-media-controls-enclosure,
.pdf-viewer::-webkit-media-controls-panel,
.pdf-viewer::-webkit-media-controls-play-button,
.pdf-viewer::-webkit-media-controls-volume-slider,
.pdf-viewer::-webkit-media-controls-mute-button,
.pdf-viewer::-webkit-media-controls-timeline,
.pdf-viewer::-webkit-media-controls-current-time-display,
.pdf-viewer::-webkit-media-controls-time-remaining-display,
.pdf-viewer::-webkit-media-controls-fullscreen-button,
.pdf-viewer::-webkit-media-controls-overlay-enclosure,
.pdf-viewer::-webkit-media-controls-overlay-play-button {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
    pointer-events: none !important;
    -webkit-appearance: none !important;
    appearance: none !important;
}

/* Разрешаем прокрутку в PDF */
.pdf-viewer {
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    scrollbar-color: #888 #f1f1f1;
}

/* Убираем блокировку pointer-events для iframe - это мешало прокрутке */
.pdf-container iframe {
    pointer-events: auto !important;
}

/* Убираем псевдоэлемент, который блокировал взаимодействие */
.pdf-container::after {
    display: none;
}

/* Блокировка контекстного меню */
.pdf-viewer {
    -webkit-context-menu: none !important;
    -moz-context-menu: none !important;
    context-menu: none !important;
    pointer-events: auto;
}

/* Скрытие скроллбаров и дополнительных элементов */
.pdf-viewer::-webkit-scrollbar {
    display: none !important;
    width: 0 !important;
}

.pdf-viewer {
    scrollbar-width: none !important;
    -ms-overflow-style: none !important;
}

/* Полное скрытие элементов управления PDF */
.pdf-viewer::-webkit-media-controls,
.pdf-viewer::-webkit-media-controls-enclosure,
.pdf-viewer::-webkit-media-controls-panel,
.pdf-viewer::-webkit-media-controls-play-button,
.pdf-viewer::-webkit-media-controls-volume-slider,
.pdf-viewer::-webkit-media-controls-mute-button,
.pdf-viewer::-webkit-media-controls-timeline,
.pdf-viewer::-webkit-media-controls-current-time-display,
.pdf-viewer::-webkit-media-controls-time-remaining-display,
.pdf-viewer::-webkit-media-controls-fullscreen-button {
    display: none !important;
    -webkit-appearance: none !important;
    opacity: 0 !important;
    visibility: hidden !important;
}

/* Блокировка всех стандартных элементов iframe */
.pdf-container iframe {
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    -webkit-touch-callout: none;
    -webkit-tap-highlight-color: transparent;
    pointer-events: none;
}

/* Восстанавливаем возможность прокрутки PDF */
.pdf-container {
    position: relative;
}

/* Скрытие контекстного меню */
.pdf-viewer {
    -webkit-context-menu: none;
    -moz-context-menu: none;
    context-menu: none;
}

/* Скрываем кнопки управления PDF в браузере */
.pdf-viewer::-webkit-media-controls {
    display: none !important;
}

.pdf-viewer::-webkit-media-controls-enclosure {
    display: none !important;
}

/* Дополнительное скрытие элементов управления */
iframe[src*=".pdf"] {
    -webkit-appearance: none;
    appearance: none;
}

iframe[src*=".pdf"]::-webkit-scrollbar {
    display: none;
}

/* Блокируем контекстное меню */
.pdf-viewer {
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    -webkit-touch-callout: none;
    -webkit-tap-highlight-color: transparent;
}
.pdf-fallback {
    padding: 50px;
    text-align: center;
    background: #f9f9f9;
    color: #666;
}

.pdf-fallback p {
    margin: 10px 0;
    font-family: "Helios", "Golos Text", Arial, sans-serif;
}

.pdf-fallback a {
    color: #ea6511;
    text-decoration: none;
    font-weight: 500;
}

.pdf-fallback a:hover {
    color: #e7362c;
    text-decoration: underline;
}

/* Информация о документе */
.document-info {
    background: #f8f9fa;
    border-left: 4px solid #ea6511;
    padding: 15px 20px;
    border-radius: 5px;
    max-width: 1200px;
    width: 100%;
    margin-top: 20px;
}

.document-info p {
    margin: 0;
    color: #666;
    font-family: "Helios", "Golos Text", Arial, sans-serif;
    line-height: 1.5;
}

.document-info a {
    color: #ea6511;
    text-decoration: none;
    font-weight: 500;
}

.document-info a:hover {
    color: #e7362c;
    text-decoration: underline;
}

/* Контейнер для изображения документа */
.document-image-container {
    width: 100%;
    max-height: 1000px;
    overflow-y: auto;
    background: #f5f5f5;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding: 20px;
}

.document-image {
    max-width: 100%;
    height: auto;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
    border-radius: 5px;
    cursor: zoom-in;
    transition: transform 0.3s ease;
}

.document-image:hover {
    transform: scale(1.02);
}

/* Обновляем fullscreen функциональность для изображения */
.document-image.fullscreen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    object-fit: contain;
    z-index: 9999;
    background: rgba(0,0,0,0.9);
    cursor: zoom-out;
}

/* Адаптивность */
@media (max-width: 768px) {
    .documents-container {
        padding: 15px;
    }

    .pagination {
        flex-direction: column;
        gap: 15px;
    }

    .pagination-numbers {
        order: 2;
        flex-wrap: wrap;
        justify-content: center;
    }

    .prev-btn {
        order: 1;
        width: 100%;
        max-width: 250px;
        text-align: center;
    }

    .next-btn {
        order: 3;
        width: 100%;
        max-width: 250px;
        text-align: center;
    }

    .pdf-header {
        flex-direction: column;
        text-align: center;
        gap: 15px;
    }

    .pdf-controls {
        justify-content: center;
    }

    .pdf-viewer {
        height: 800px;
    }

    .section-switcher {
        flex-wrap: wrap;
        justify-content: center;
    }

    .section-btn {
        flex: 1;
        min-width: 150px;
        text-align: center;
    }
}

@media (max-width: 480px) {
    .pdf-viewer {
        height: 600px;
    }

    .pdf-header h3 {
        font-size: 1em;
    }

    .control-btn {
        padding: 6px 12px;
        font-size: 0.8em;
    }

    .section-btn {
        padding: 10px 20px;
        font-size: 1em;
    }
}

@media (max-width: 600px) {
    .pdf-container {
        width: 100vw !important;
        max-width: 100vw !important;
        padding: 0 !important;
        box-sizing: border-box;
    }
    .pdf-viewer {
        width: 100vw !important;
        max-width: 100vw !important;
        height: 70vh !important;
        min-height: 300px;
    }
    .pdf-container iframe {
        width: 100vw !important;
        height: 70vh !important;
        min-height: 300px;
    }
    .pdf-header {
        flex-direction: column;
        align-items: flex-start;
    }
}
