/* =====================================================
   PDF FlipBook Livre — Estilos
   ===================================================== */

.pfl-wrapper {
    position: relative;
    width: 100%;
    border-radius: 6px;
    overflow: hidden;
    box-shadow: 0 4px 24px rgba(0,0,0,0.4);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    box-sizing: border-box;
    padding-bottom: 52px; /* espaço para os controles */
}

/* ── Flipbook container ──────────────────────────── */
.pfl-flipbook-container {
    position: relative;
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
}

/* ── Páginas individuais ─────────────────────────── */
.pfl-page {
    position: relative;
    background: #fff;
    box-shadow: inset -2px 0 6px rgba(0,0,0,0.08);
    overflow: hidden;
    user-select: none;
    -webkit-user-select: none;
}

.pfl-page-canvas {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
}

/* ── Camada de links (sobreposta ao canvas) ──────── */
.pfl-link-layer {
    position: absolute;
    top: 0;
    left: 0;
    pointer-events: none; /* a camada em si não bloqueia, só os <a> */
    z-index: 5;
}

/* Link individual renderizado a partir do PDF */
.pfl-link-annotation {
    position: absolute;
    display: block;
    pointer-events: all;
    cursor: pointer;
    /* Highlight sutil para indicar que é clicável */
    background: rgba(255, 220, 0, 0.12);
    border: 1px solid rgba(255, 200, 0, 0.25);
    border-radius: 2px;
    transition: background 0.15s ease;
    text-decoration: none;
    color: inherit;
    box-sizing: border-box;
}

.pfl-link-annotation:hover {
    background: rgba(255, 220, 0, 0.35);
    border-color: rgba(200, 160, 0, 0.6);
}

/* ── Loading ─────────────────────────────────────── */
.pfl-loading {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 50;
    background: inherit;
}

.pfl-loading-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    color: #ddd;
    font-size: 14px;
}

.pfl-loading-inner img {
    width: 48px;
    height: 48px;
    opacity: 0.8;
}

/* ── Erro ─────────────────────────────────────────── */
.pfl-error-msg {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    color: #ffb3b3;
    font-size: 14px;
    text-align: center;
    background: rgba(0,0,0,0.5);
    z-index: 50;
}

/* ── Controles de navegação ─────────────────────── */
.pfl-controls {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 0 12px;
    background: rgba(0,0,0,0.55);
    backdrop-filter: blur(4px);
    z-index: 20;
    box-sizing: border-box;
}

.pfl-btn {
    background: rgba(255,255,255,0.12);
    color: #fff;
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: 4px;
    padding: 5px 10px;
    cursor: pointer;
    font-size: 14px;
    line-height: 1;
    transition: background 0.15s ease, border-color 0.15s ease;
    min-width: 30px;
    text-align: center;
}

.pfl-btn:hover {
    background: rgba(255,255,255,0.25);
    border-color: rgba(255,255,255,0.45);
}

.pfl-btn:active {
    background: rgba(255,255,255,0.35);
}

.pfl-page-info {
    color: rgba(255,255,255,0.85);
    font-size: 13px;
    min-width: 100px;
    text-align: center;
}

/* ── Fullscreen ──────────────────────────────────── */
.pfl-wrapper:fullscreen {
    border-radius: 0;
    box-shadow: none;
}

.pfl-wrapper:-webkit-full-screen {
    border-radius: 0;
    box-shadow: none;
}

/* ── Erro inline no shortcode ─────────────────────── */
p.pfl-error {
    background: #fff3cd;
    border: 1px solid #ffc107;
    border-radius: 4px;
    padding: 12px 16px;
    font-size: 13px;
    color: #856404;
}

/* ── Responsivo ──────────────────────────────────── */
@media (max-width: 600px) {
    .pfl-btn {
        padding: 4px 7px;
        font-size: 13px;
    }
    .pfl-page-info {
        font-size: 12px;
        min-width: 80px;
    }
}
