/* =========================================
   RESET
========================================= */

* {

    margin: 0;

    padding: 0;

    box-sizing: border-box;

}


html,
body {

    width: 100%;

    height: 100%;

    overflow: hidden;

    font-family:
        Arial,
        Helvetica,
        sans-serif;

    background: #e5e7eb;

    user-select: none;

    -webkit-user-select: none;

}


/* =========================================
   HEADER
========================================= */

.viewer-header {

    position: fixed;

    top: 0;

    left: 0;

    width: 100%;

    height: 65px;

    z-index: 1000;

    display: flex;

    align-items: center;

    justify-content: space-between;

    padding: 0 20px;

    background:
        linear-gradient(
            135deg,
            #111827,
            #1e3a8a
        );

    color: white;

    box-shadow:
        0 4px 15px
        rgba(0,0,0,.25);

}


.brand {

    font-size: 20px;

    font-weight: 700;

    white-space: nowrap;

}


/* =========================================
   TOOLBAR
========================================= */

.toolbar {

    display: flex;

    align-items: center;

    gap: 7px;

}


.toolbar button {

    width: 38px;

    height: 38px;

    border: none;

    border-radius: 8px;

    background:
        rgba(255,255,255,.15);

    color: white;

    font-size: 18px;

    font-weight: bold;

    cursor: pointer;

    transition: .2s;

}


.toolbar button:hover {

    background:
        rgba(255,255,255,.30);

    transform:
        translateY(-1px);

}


#pageInfo {

    min-width: 70px;

    text-align: center;

    font-size: 14px;

    font-weight: 600;

}


/* =========================================
   VIEWER
========================================= */

#viewerContainer {

    position: fixed;

    top: 65px;

    left: 0;

    right: 0;

    bottom: 0;

    overflow: auto;

    padding: 25px;

    background: #dce2ea;

}


#pdfViewer {

    width: 100%;

    min-height: 100%;

    display: flex;

    justify-content: center;

    align-items: flex-start;

}


#pdfCanvas {

    display: block;

    background: white;

    box-shadow:
        0 8px 30px
        rgba(0,0,0,.25);

}


/* =========================================
   LOADING
========================================= */

#loadingScreen {

    position: fixed;

    top: 65px;

    left: 0;

    right: 0;

    bottom: 0;

    z-index: 500;

    display: flex;

    flex-direction: column;

    align-items: center;

    justify-content: center;

    background: #edf1f7;

    color: #1f2937;

}


.spinner {

    width: 48px;

    height: 48px;

    border: 5px solid #d1d5db;

    border-top-color: #2563eb;

    border-radius: 50%;

    animation:
        spin .8s linear infinite;

}


@keyframes spin {

    to {

        transform:
            rotate(360deg);

    }

}


#loadingScreen h2 {

    margin-top: 18px;

}


#loadingScreen p {

    margin-top: 8px;

    color: #64748b;

}


/* =========================================
   WATERMARK
========================================= */

#watermark {

    position: fixed;

    top: 50%;

    left: 50%;

    transform:
        translate(-50%, -50%)
        rotate(-30deg);

    z-index: 900;

    pointer-events: none;

    color:
        rgba(30,41,59,.12);

    font-size: 45px;

    font-weight: 900;

    letter-spacing: 5px;

    white-space: nowrap;

}


/* =========================================
   PURCHASE POPUP
========================================= */

.purchase-overlay {

    position: fixed;

    inset: 0;

    z-index: 5000;

    display: flex;

    align-items: center;

    justify-content: center;

    padding: 20px;

    background:
        rgba(0,0,0,.68);

    backdrop-filter:
        blur(5px);

}


.purchase-box {

    position: relative;

    width: min(430px, 100%);

    padding: 32px 28px;

    background: white;

    border-radius: 20px;

    text-align: center;

    box-shadow:
        0 25px 70px
        rgba(0,0,0,.4);

    animation:
        popupIn .2s ease;

}


@keyframes popupIn {

    from {

        opacity: 0;

        transform:
            scale(.92);

    }

    to {

        opacity: 1;

        transform:
            scale(1);

    }

}


.close-purchase {

    position: absolute;

    top: 10px;

    right: 14px;

    width: 34px;

    height: 34px;

    border: none;

    background: transparent;

    color: #64748b;

    font-size: 28px;

    line-height: 1;

    cursor: pointer;

}


.purchase-icon {

    font-size: 48px;

    margin-bottom: 12px;

}


.purchase-box h2 {

    color: #111827;

    margin-bottom: 10px;

    font-size: 24px;

}


.purchase-box p {

    color: #64748b;

    line-height: 1.6;

    margin-bottom: 24px;

}


.purchase-now {

    width: 100%;

    padding: 14px 20px;

    border: none;

    border-radius: 10px;

    background:
        linear-gradient(
            135deg,
            #2563eb,
            #1d4ed8
        );

    color: white;

    font-size: 16px;

    font-weight: 700;

    cursor: pointer;

    transition: .2s;

}


.purchase-now:hover {

    transform:
        translateY(-1px);

    box-shadow:
        0 8px 20px
        rgba(37,99,235,.3);

}


/* =========================================
   ERROR
========================================= */

.error-box {

    text-align: center;

    padding: 25px;

}


.error-icon {

    font-size: 45px;

    margin-bottom: 10px;

}


.error-box h2 {

    color: #dc2626;

    margin-bottom: 10px;

}


.error-box p {

    color: #64748b;

}


.back-btn {

    margin-top: 20px;

    padding: 11px 22px;

    border: none;

    border-radius: 8px;

    background: #2563eb;

    color: white;

    cursor: pointer;

    font-weight: 600;

}


/* =========================================
   MOBILE
========================================= */

@media (max-width: 768px) {


    .viewer-header {

        height: 105px;

        flex-direction: column;

        justify-content: center;

        gap: 8px;

        padding: 8px;

    }


    .brand {

        font-size: 16px;

    }


    .toolbar {

        gap: 5px;

    }


    .toolbar button {

        width: 34px;

        height: 34px;

        font-size: 16px;

    }


    #pageInfo {

        min-width: 55px;

        font-size: 12px;

    }


    #viewerContainer {

        top: 105px;

        padding: 10px;

    }


    #loadingScreen {

        top: 105px;

    }


    #watermark {

        font-size: 25px;

        letter-spacing: 3px;

    }


    .purchase-box {

        padding:
            28px 20px;

    }

}
