/* ============================================================
   PORTAL PINTAR - PDF VIEWER
   ============================================================ */

.pdf-viewer {
    width: 100%;
    max-width: 100%;
    position: relative;
    box-sizing: border-box;
}


/* ============================================================
   TOOLBAR
   ============================================================ */

.pdf-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;

    width: 100%;
    box-sizing: border-box;

    padding: 8px 10px;
    margin: 0 0 10px 0;

    gap: 10px;

    border-radius: 8px;

    background: rgba(128, 128, 128, 0.10);

    flex-wrap: wrap;
}

.pdf-toolbar-left,
.pdf-toolbar-center,
.pdf-toolbar-right {
    display: flex;
    align-items: center;
    justify-content: center;

    gap: 5px;
}

.pdf-toolbar-left {
    justify-content: flex-start;
}

.pdf-toolbar-center {
    justify-content: center;
}

.pdf-toolbar-right {
    justify-content: flex-end;
}


/* ============================================================
   PAGE INDICATOR
   ============================================================ */

.pdf-page-info {
    min-width: 60px;

    text-align: center;

    font-weight: 600;

    white-space: nowrap;
}


/* ============================================================
   ZOOM INDICATOR
   ============================================================ */

.pdf-zoom-level {
    min-width: 55px;

    text-align: center;

    font-size: 0.9rem;

    font-weight: 500;

    white-space: nowrap;
}


/* ============================================================
   PDF SCROLL CONTAINER
   ============================================================ */

.pdf-scroll-container {
    position: relative;

    width: 100%;
    height: 800px;

    box-sizing: border-box;

    /*
     * IMPORTANT:
     *
     * Only this element should scroll.
     * The surrounding page must NOT expand when
     * the PDF is zoomed.
     */

    overflow-x: auto;
    overflow-y: auto;

    /*
     * Prevent browser overscroll from affecting
     * the surrounding page.
     */

    overscroll-behavior: contain;

    /*
     * Smooth scrolling on mobile.
     */

    -webkit-overflow-scrolling: touch;

    /*
     * PDF background.
     */

    background: #525659;

    border-radius: 8px;

    padding: 15px;

    /*
     * Don't let child content determine the
     * height of this container.
     */

    min-height: 0;
}


/* ============================================================
   PDF PAGES CONTAINER
   ============================================================ */

.pdf-pages {
    position: relative;

    display: flex;

    flex-direction: column;

    align-items: center;

    /*
     * IMPORTANT:
     *
     * The pages container should be at least as wide
     * as the viewport, but may become wider when zoomed.
     */

    width: 100%;
    min-width: 100%;

    height: auto;

    box-sizing: border-box;

    margin: 0;
    padding: 0;

    gap: 15px;
}


/* ============================================================
   INDIVIDUAL PDF PAGE
   ============================================================ */

.pdf-page {
    position: relative;

    display: flex;

    justify-content: center;
    align-items: flex-start;

    /*
     * The page wrapper follows the canvas size.
     */

    width: 100%;
    height: auto;

    min-height: 0;

    box-sizing: border-box;

    margin: 0;
    padding: 0;

    flex: 0 0 auto;
}


/* ============================================================
   PDF CANVAS
   ============================================================ */

.pdf-canvas {
    display: block;

    position: relative;

    /*
     * IMPORTANT:
     *
     * Never constrain the canvas width with max-width: 100%.
     *
     * When zoomed, it must be allowed to become wider than
     * the PDF container so the container can scroll horizontally.
     */

    width: auto;
    height: auto;

    max-width: none;
    max-height: none;

    min-width: 0;
    min-height: 0;

    box-sizing: content-box;

    margin: 0 auto;
    padding: 0;

    background: #ffffff;

    box-shadow:
        0 2px 8px rgba(0, 0, 0, 0.35);
}


/* ============================================================
   PAGE LOADING PLACEHOLDER
   ============================================================ */

.pdf-page-loading {
    display: flex;

    align-items: center;
    justify-content: center;

    width: 100%;
    min-height: 100px;

    box-sizing: border-box;

    padding: 30px;

    color: #dddddd;

    text-align: center;
}


/* ============================================================
   PAGE ERROR
   ============================================================ */

.pdf-page-error {
    display: flex;

    align-items: center;
    justify-content: center;

    width: 100%;
    min-height: 100px;

    padding: 30px;

    box-sizing: border-box;

    color: #dc3545;

    text-align: center;
}


/* ============================================================
   LOADING
   ============================================================ */

.pdf-loading {
    display: flex;

    flex-direction: column;

    align-items: center;
    justify-content: center;

    min-height: 150px;

    text-align: center;
}


/* ============================================================
   ERROR
   ============================================================ */

.pdf-error {
    margin-top: 10px;
}


/* ============================================================
   MOBILE / TABLET
   ============================================================ */

@media (max-width: 767.98px) {

    .pdf-toolbar {
        justify-content: center;

        padding: 6px;

        gap: 6px;
    }


    .pdf-toolbar-left,
    .pdf-toolbar-center,
    .pdf-toolbar-right {
        width: 100%;

        justify-content: center;
    }


    .pdf-scroll-container {
        height: 70vh;

        min-height: 400px;

        padding: 8px;

        border-radius: 6px;
    }


    .pdf-pages {
        gap: 10px;
    }


    .pdf-page {
        width: 100%;
    }


    .pdf-toolbar .btn {
        min-width: 42px;

        min-height: 36px;
    }


    .pdf-page-info {
        min-width: 55px;
    }


    .pdf-zoom-level {
        min-width: 50px;
    }

}


/* ============================================================
   SMALL PHONE
   ============================================================ */

@media (max-width: 480px) {

    .pdf-scroll-container {
        height: 65vh;

        min-height: 350px;

        padding: 6px;
    }


    .pdf-toolbar {
        padding: 5px;

        gap: 4px;
    }


    .pdf-toolbar .btn {
        min-width: 38px;

        min-height: 34px;

        padding: 4px 8px;
    }


    .pdf-button-text {
        display: none;
    }

}