/* ================================================================
   PDF Embed for The7 — Frontend Viewer Styles
   ================================================================ */

/* ---- Outer container ---- */
.the7-pdf-viewer {
    position: relative;
    width: 100%;
    background: #525659;
    border-radius: 6px;
    overflow-x: auto;
    overflow-y: auto;
    /* Let the viewer grow as tall as its content.
       Pages + padding + 56px controls bar. */
    min-height: 200px;
}

/* ---- Pages area ---- */
.the7-pdf-pages {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
    padding: 20px 20px 74px; /* bottom padding clears the controls bar */
}

.the7-pdf-pages canvas {
    display: block;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.45);
    /* Width is set by PDF.js; we let it overflow if zoomed wide */
}

/* ---- Loading spinner ---- */
.the7-pdf-loading {
    display: none;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 60px 20px;
    color: #ccc;
    font-size: 15px;
}

.the7-pdf-spin {
    color: #aaa;
    animation: the7spin 0.8s linear infinite;
    flex-shrink: 0;
}

@keyframes the7spin {
    to { transform: rotate(360deg); }
}

/* ---- Error message ---- */
.the7-pdf-error-msg {
    padding: 30px;
    text-align: center;
    color: #f5c6c6;
    font-size: 14px;
}

.the7-pdf-error-msg a {
    color: #9ec5f7;
}

/* ---- Zoom controls bar (sticky at bottom of viewer) ---- */
.the7-pdf-controls {
    position: sticky;
    bottom: 0;
    left: 0;
    /* Stretch full width of the scrollable viewport, not just the content */
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    padding: 10px 0;
    background: rgba(30, 30, 30, 0.82);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    z-index: 10;
    border-radius: 0 0 6px 6px;
}

/* ---- Zoom buttons ---- */
.the7-pdf-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    padding: 0;
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.22);
    border-radius: 50%;
    color: #fff;
    cursor: pointer;
    transition: background 0.15s ease, transform 0.1s ease;
    line-height: 1;
}

.the7-pdf-btn svg {
    fill: #fff;
    pointer-events: none;
}

.the7-pdf-btn:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.25);
    transform: scale(1.08);
}

.the7-pdf-btn:active:not(:disabled) {
    transform: scale(0.95);
}

.the7-pdf-btn:disabled {
    opacity: 0.35;
    cursor: default;
}

/* ---- Zoom level label ---- */
.the7-pdf-zoom-level {
    color: #fff;
    font-size: 13px;
    font-weight: 600;
    min-width: 44px;
    text-align: center;
    letter-spacing: 0.02em;
    user-select: none;
}

/* ---- Responsive: on narrow screens let pages fill the width ---- */
@media (max-width: 600px) {
    .the7-pdf-pages {
        padding: 12px 12px 66px;
        gap: 10px;
    }
    .the7-pdf-pages canvas {
        width: 100% !important;
        height: auto !important;
    }
}
