/* CLHEI PDF Viewer Styles - Orange & Green Branding */

/* Modal Overlay */
.clhei-pdf-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 999999;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.clhei-pdf-modal.active {
    display: block;
    opacity: 1;
}

.clhei-pdf-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.92);
}

/* Container */
.clhei-pdf-container {
    position: relative;
    width: 90%;
    max-width: 1200px;
    height: 90vh;
    margin: 5vh auto;
    background: linear-gradient(135deg, #1a1a1a 0%, #2a2a2a 100%);
    border-radius: 12px;
    box-shadow: 0 10px 50px rgba(245, 128, 32, 0.15), 0 0 30px rgba(52, 155, 86, 0.1);
    border: 1px solid rgba(245, 128, 32, 0.2);
    padding: 60px 20px 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* Close Button */
.clhei-pdf-close {
    position: absolute;
    top: 15px;
    right: 20px;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: #fff;
    font-size: 32px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
}

.clhei-pdf-close:hover {
    background: rgba(245, 128, 32, 0.2);
    transform: rotate(90deg);
    color: #F58020;
}

/* Controls */
.clhei-pdf-controls {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 20px;
    background: linear-gradient(135deg, rgba(245, 128, 32, 0.1) 0%, rgba(52, 155, 86, 0.1) 100%);
    padding: 12px 24px;
    border-radius: 30px;
    border: 1px solid rgba(245, 128, 32, 0.2);
}

/* Navigation Buttons - Orange */
.clhei-pdf-prev,
.clhei-pdf-next {
    background: linear-gradient(135deg, #F58020 0%, #d6660e 100%);
    border: none;
    color: #fff;
    font-size: 24px;
    width: 45px;
    height: 45px;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(245, 128, 32, 0.3);
    padding: 0;
    line-height: 1;
}

.clhei-pdf-prev:hover,
.clhei-pdf-next:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(245, 128, 32, 0.5);
    background: linear-gradient(135deg, #ff8c3a 0%, #e67417 100%);
}

.clhei-pdf-prev:active,
.clhei-pdf-next:active {
    transform: scale(0.95);
}

.clhei-pdf-page-info {
    color: #fff;
    font-size: 16px;
    font-weight: 500;
    min-width: 120px;
    text-align: center;
}

/* Download Button - Green */
.clhei-pdf-download {
    background: linear-gradient(135deg, #349B56 0%, #2a7d45 100%);
    border: none;
    color: #fff;
    width: 45px;
    height: 45px;
    border-radius: 50%;
    cursor: pointer;
    text-decoration: none;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(52, 155, 86, 0.3);
    transition: all 0.3s ease;
    margin-left: 10px;
    padding: 0;
}

.clhei-pdf-download svg {
    pointer-events: none;
}

.clhei-pdf-download:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(52, 155, 86, 0.5);
    background: linear-gradient(135deg, #3aab62 0%, #2f8a4f 100%);
}

.clhei-pdf-download:active {
    transform: scale(0.95);
}

/* Flipbook Container */
.clhei-pdf-flipbook {
    flex: 1;
    width: 100%;
    max-width: 1000px;
    background: #1a1a1a;
    border-radius: 8px;
    overflow: auto;
    position: relative;
    transition: transform 260ms cubic-bezier(.2,.8,.2,1);
    transform-origin: center center;
}

/* Per-page placeholder styling for lazy rendering */
.clhei-pdf-page {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #fff; /* page background */
}

.clhei-page-placeholder {
    color: #fff;
    text-align: center;
}

.clhei-pf-spinner {
    width: 36px;
    height: 36px;
    margin: 0 auto 10px;
    border: 3px solid rgba(255,255,255,0.12);
    border-top: 3px solid #F58020;
    border-radius: 50%;
    animation: spin 0.9s linear infinite;
}


/* Loading Spinner */
.clhei-pdf-loading {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    color: #fff;
    display: none;
}

.clhei-pdf-loading.active {
    display: block;
}

.clhei-pdf-spinner {
    width: 50px;
    height: 50px;
    margin: 0 auto 20px;
    border: 4px solid rgba(255, 255, 255, 0.1);
    border-top: 4px solid #349B56;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

.clhei-pdf-loading p {
    font-size: 18px;
    margin: 0;
}

/* Error styling */
.clhei-pdf-error {
    text-align: center;
    color: #fff;
}

.clhei-pdf-error p {
    margin: 10px 0;
}

/* Responsive */
@media (max-width: 768px) {
    .clhei-pdf-container {
        width: 95%;
        height: 95vh;
        margin: 2.5vh auto;
        padding: 50px 10px 10px;
    }

    .clhei-pdf-controls {
        gap: 10px;
        padding: 8px 16px;
    }

    .clhei-pdf-prev,
    .clhei-pdf-next,
    .clhei-pdf-download {
        width: 38px;
        height: 38px;
        font-size: 20px;
    }

    .clhei-pdf-page-info {
        font-size: 14px;
        min-width: 100px;
    }
}

/* Page Flip Enhancement */
.stf__parent {
    width: 100% !important;
    height: 100% !important;
}

.stf__wrapper {
    box-shadow: 0 0 30px rgba(0, 0, 0, 0.5);
}

.stf__item {
    background: #fff;
}

/* Zoom Buttons - Orange */
.clhei-pdf-zoom-in,
.clhei-pdf-zoom-out {
    background: linear-gradient(135deg, #F58020 0%, #d6660e 100%);
    border: none;
    color: #fff;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(245, 128, 32, 0.3);
    transition: all 0.3s ease;
    margin-left: 5px;
    padding: 0;
}

.clhei-pdf-zoom-in svg,
.clhei-pdf-zoom-out svg {
    pointer-events: none;
}

.clhei-pdf-zoom-in:hover,
.clhei-pdf-zoom-out:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(245, 128, 32, 0.5);
    background: linear-gradient(135deg, #ff8c3a 0%, #e67417 100%);
}

.clhei-pdf-zoom-in:active,
.clhei-pdf-zoom-out:active {
    transform: scale(0.95);
}