/**
 * styles/flipbook.css
 * Visualizador Interativo Flipbook 3D - Editora UEMASUL
 */

/* === MODAL FULLSCREEN OVERLAY === */
#uemasulFlipbookModal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(10, 15, 29, 0.96);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    z-index: 9999999;
    display: flex;
    flex-direction: column;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    user-select: none;
    -webkit-user-select: none;
}

#uemasulFlipbookModal.is-active {
    opacity: 1;
    visibility: visible;
}

/* === BARRA SUPERIOR (TOOLBAR) === */
.flipbook-toolbar {
    height: 56px;
    background: rgba(15, 23, 42, 0.85);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1.5rem;
    color: #f8fafc;
    z-index: 10;
}

.flipbook-title-area {
    display: flex;
    align-items: center;
    gap: 12px;
    max-width: 45%;
    overflow: hidden;
}

.flipbook-badge {
    background: linear-gradient(135deg, #BB5050 0%, #912e2e 100%);
    color: #ffffff;
    font-size: 0.75rem;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
}

.flipbook-doc-title {
    font-size: 0.95rem;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: #e2e8f0;
}

.flipbook-controls {
    display: flex;
    align-items: center;
    gap: 8px;
}

.flipbook-page-indicator {
    font-size: 0.85rem;
    font-weight: 600;
    color: #cbd5e1;
    background: rgba(255, 255, 255, 0.08);
    padding: 5px 12px;
    border-radius: 20px;
    margin-right: 6px;
}

.flipbook-tool-btn {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: #f1f5f9;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s ease;
}

.flipbook-tool-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.3);
    color: #ffffff;
    transform: translateY(-1px);
}

.flipbook-close-btn {
    background: #BB5050 !important;
    border-color: #912e2e !important;
}

.flipbook-close-btn:hover {
    background: #d46a6a !important;
}

/* === PALCO DO FLIPBOOK (STAGE) === */
.flipbook-stage {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
    padding: 1.5rem;
    perspective: 2400px;
}

.flipbook-container {
    display: flex;
    position: relative;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.65), 0 10px 20px rgba(0, 0, 0, 0.4);
    background: #ffffff;
    border-radius: 6px;
    transition: transform 0.3s ease;
    transform-style: preserve-3d;
}

/* Efeito de lombada central (Book Spine) */
.flipbook-container::after {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 24px;
    height: 100%;
    background: linear-gradient(to right, rgba(0,0,0,0.18) 0%, rgba(0,0,0,0.3) 48%, rgba(0,0,0,0.4) 50%, rgba(0,0,0,0.3) 52%, rgba(0,0,0,0.18) 100%);
    pointer-events: none;
    z-index: 10;
}

.flipbook-page-canvas-wrapper {
    background: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    position: relative;
}

.flipbook-page-canvas-wrapper canvas {
    display: block;
    max-height: 80vh;
    width: auto;
    box-shadow: inset 0 0 10px rgba(0,0,0,0.05);
}

/* === NAVEGAÇÃO FLUTUANTE (ANTERIOR / PRÓXIMA) === */
.flipbook-nav-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 52px;
    height: 52px;
    background: rgba(15, 23, 42, 0.75);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: #ffffff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    cursor: pointer;
    transition: all 0.25s ease;
    z-index: 20;
    backdrop-filter: blur(4px);
}

.flipbook-nav-arrow:hover:not(:disabled) {
    background: #BB5050;
    border-color: #BB5050;
    transform: translateY(-50%) scale(1.1);
    box-shadow: 0 0 20px rgba(187, 80, 80, 0.6);
}

.flipbook-nav-arrow:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.flipbook-nav-prev {
    left: 2rem;
}

.flipbook-nav-next {
    right: 2rem;
}

/* === CARREGADOR / SPINNER === */
.flipbook-loading-overlay {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.85);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    gap: 14px;
    z-index: 30;
    opacity: 1;
    transition: opacity 0.3s ease;
}

.flipbook-loading-overlay.hidden {
    opacity: 0;
    pointer-events: none;
}

.flipbook-spinner {
    width: 48px;
    height: 48px;
    border: 4px solid rgba(255, 255, 255, 0.15);
    border-top-color: #BB5050;
    border-radius: 50%;
    animation: flipbook-spin 0.8s linear infinite;
}

@keyframes flipbook-spin {
    to { transform: rotate(360deg); }
}

/* === BARRA INFERIOR DE SLIDER === */
.flipbook-bottom-bar {
    height: 50px;
    background: rgba(15, 23, 42, 0.85);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    padding: 0 2rem;
    z-index: 10;
}

.flipbook-slider {
    width: 320px;
    accent-color: #BB5050;
    cursor: pointer;
}

/* === RESPONSIVIDADE (MOBILE / TABLET) === */
@media (max-width: 768px) {
    .flipbook-container::after {
        display: none;
    }
    .flipbook-doc-title {
        display: none;
    }
    .flipbook-slider {
        width: 160px;
    }
    .flipbook-nav-arrow {
        width: 42px;
        height: 42px;
        font-size: 1.1rem;
    }
    .flipbook-nav-prev { left: 0.5rem; }
    .flipbook-nav-next { right: 0.5rem; }
}
