/* =========================================================
   Divi PDF Module — Frontend Styles
   ========================================================= */

/* ── Placeholder ── */
.dlp_pdf_module__placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 200px;
    border: 2px dashed #ccc;
    border-radius: 6px;
    color: #888;
    font-size: 14px;
    padding: 24px;
    text-align: center;
}

/* ── Standard viewer ── */
/*
 * Padding makes the module's Divi background visible as a frame around the iframe.
 * aspect-ratio applies to the whole wrapper (incl. padding); the iframe fills
 * the inner content area. overflow:hidden clips the iframe to the rounded corners.
 */
.dlp_pdf_module__standard-wrapper {
    width: 100%;
    height: 100%;
    aspect-ratio: 1 / 0.928;
    overflow: hidden;
    border-radius: 4px;
    box-sizing: border-box;
}

.dlp_pdf_module__standard-wrapper iframe {
    display: block;
    border: none;
    width: 100%;
    height: 100%;
}

/* ── Flipbook wrapper ── */
.dlp_pdf_module__flipbook-wrapper {
    position: relative;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 28px 20px 20px;
    border-radius: 8px;
}

/* ── Flipbook container ── */
.dlp_pdf_module__flipbook-container {
    position: relative;
    width: 100%;
    max-width: 100%;
    overflow: visible;
}

/* ── Loading state ── */
.dlp_pdf_module__loading {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    background: rgba(255, 255, 255, 0.85);
    z-index: 10;
}

.dlp_pdf_module__loading p {
    margin: 0;
    font-size: 14px;
    color: #555;
}

.dlp_pdf_module__loading.hidden {
    display: none;
}

/* ── Spinner ── */
@keyframes dlp-pdf-spin {
    to { transform: rotate(360deg); }
}

.dlp_pdf_module__spinner {
    display: inline-block;
    width: 36px;
    height: 36px;
    border: 3px solid rgba(0, 0, 0, 0.08);
    border-top-color: #666;
    border-radius: 50%;
    animation: dlp-pdf-spin 0.75s linear infinite;
}

/* ── Controls ── */
.dlp_pdf_module__flipbook-controls {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    margin-top: 20px;
    padding: 4px;
    background: rgba(15, 15, 15, 0.6);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-radius: 50px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.22), inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.dlp_pdf_module__btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background: transparent;
    color: rgba(255, 255, 255, 0.8);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    line-height: 1;
    transition: background 0.18s ease, color 0.18s ease, transform 0.12s ease;
    user-select: none;
    flex-shrink: 0;
}

.dlp_pdf_module__btn svg {
    display: block;
    pointer-events: none;
}

.dlp_pdf_module__btn:hover {
    background: rgba(255, 255, 255, 0.14);
    color: #fff;
}

.dlp_pdf_module__btn:active {
    transform: scale(0.9);
    background: rgba(255, 255, 255, 0.08);
}

.dlp_pdf_module__btn:disabled {
    opacity: 0.25;
    cursor: default;
    transform: none;
}

.dlp_pdf_module__page-info {
    font-size: 12px;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.7);
    min-width: 56px;
    text-align: center;
    letter-spacing: 0.5px;
    padding: 0 4px;
}

/* ── Modern scrollbar (flipbook wrapper & any overflow areas) ── */
.dlp_pdf_module__flipbook-wrapper,
.dlp_pdf_module__standard-wrapper {
    scrollbar-width: thin;
    scrollbar-color: rgba(0, 0, 0, 0.2) transparent;
}

.dlp_pdf_module__flipbook-wrapper::-webkit-scrollbar,
.dlp_pdf_module__standard-wrapper::-webkit-scrollbar {
    width: 5px;
    height: 5px;
}

.dlp_pdf_module__flipbook-wrapper::-webkit-scrollbar-track,
.dlp_pdf_module__standard-wrapper::-webkit-scrollbar-track {
    background: transparent;
}

.dlp_pdf_module__flipbook-wrapper::-webkit-scrollbar-thumb,
.dlp_pdf_module__standard-wrapper::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.18);
    border-radius: 10px;
}

.dlp_pdf_module__flipbook-wrapper::-webkit-scrollbar-thumb:hover,
.dlp_pdf_module__standard-wrapper::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 0, 0, 0.35);
}
