/* Flipbook Modal Styles */
.flipbook-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(12, 12, 30, 0.95);
    z-index: 99999;
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 12px 20px;
    overflow: hidden;
}
.flipbook-modal-overlay.show {
    display: flex;
}
.flipbook-modal-overlay.loaded {
    overflow: hidden;
}
.flipbook-close-btn {
    width: 45px;
    height: 45px;
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.15);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #fff;
    transition: background 0.3s ease;
    backdrop-filter: blur(10px);
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 100002;
}
.flipbook-close-btn:hover {
    background: rgba(255,255,255,0.2);
}
.flipbook-viewer-container {
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 1;
    width: 100%;
    max-width: 1400px;
    position: relative;
    /* Space for fixed controls bar (40px) + bottom gap (8px) */
    margin-bottom: 48px;
}
.flipbook-nav-btn {
    width: 45px;
    height: 45px;
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.15);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #fff;
    transition: background 0.3s ease;
    backdrop-filter: blur(10px);
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 100;
}
.flipbook-nav-btn.prev { left: -66px; }
.flipbook-nav-btn.next { right: -66px; }
.flipbook-nav-btn:hover:not(:disabled) { background: rgba(255,255,255,0.2); }
.flipbook-nav-btn:disabled { opacity: 0.3; cursor: not-allowed; }
.flipbook-wrapper {
    position: relative;
    perspective: 3000px;
    display: flex;
    justify-content: center;
    align-items: center;
}
#flipbook {
    position: relative;
    margin: 0 auto;
}
#flipbook .page {
    background: white;
    background-size: 100% 100%;
}
#flipbook .page canvas {
    width: 100%;
    height: 100%;
    object-fit: contain;
}
.flipbook-wrapper::after {
    content: '';
    position: absolute;
    bottom: -30px;
    left: 10%;
    right: 10%;
    height: 30px;
    background: radial-gradient(ellipse at center, rgba(0,0,0,0.4) 0%, transparent 70%);
    filter: blur(10px);
}
#flipbook-container {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
}
#flipbook-container.double-view::after {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 1px;
    height: 100%;
    background: rgba(0,0,0,0.2);
    z-index: 9999;
    pointer-events: none;
}
.flipbook-controls {
    position: fixed;
    bottom: 0px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 100001;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 0px 0px;
    background: rgba(30, 30, 50, 0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: 40px;
    border: 1px solid rgba(255,255,255,0.12);
    box-shadow: 0 8px 32px rgba(0,0,0,0.4);
    white-space: nowrap;
}
.flipbook-ctrl-btn {
    width: 40px;
    height: 40px;
    background: transparent;
    border: none;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: rgba(255,255,255,0.85);
    transition: all 0.2s ease;
    flex-shrink: 0;
}
.flipbook-ctrl-btn:hover:not(:disabled) {
    background: rgba(255,255,255,0.15);
    color: #fff;
}
.flipbook-ctrl-btn:disabled { opacity: 0.35; cursor: not-allowed; }
.flipbook-page-indicator {
    display: flex;
    align-items: center;
    gap: 5px;
    color: rgba(255,255,255,0.9);
    font-size: 0.88rem;
    padding: 0 10px;
    font-weight: 500;
    letter-spacing: 0.02em;
}
.flipbook-divider {
    width: 1px;
    height: 22px;
    background: rgba(255,255,255,0.18);
    margin: 0 6px;
    flex-shrink: 0;
}
.flipbook-loading {
    position: fixed;
    inset: 0;
    background: rgba(12, 12, 30, 0.98);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 100000;
}
.flipbook-loading.hidden { display: none; }
#flipbook-container.loading #flipbook {
    visibility: hidden;
    position: absolute;
    overflow: hidden;
}
.flipbook-spinner {
    width: 50px;
    height: 50px;
    min-width: 50px;
    min-height: 50px;
    border-style: solid;
    border-width: 4px;
    border-color: rgba(255,255,255,0.2) rgba(255,255,255,0.2) rgba(255,255,255,0.2) #667eea;
    border-radius: 50%;
    box-sizing: border-box;
    display: inline-block;
    animation: flipbookSpin 1s linear infinite;
}
@keyframes flipbookSpin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}
.flipbook-loading p { color: #fff; margin-top: 20px; font-size: 1rem; }
.flipbook-empty-state {
    width: 450px;
    height: 600px;
    background: rgba(255,255,255,0.05);
    border: 2px dashed rgba(255,255,255,0.2);
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: rgba(255,255,255,0.6);
    text-align: center;
    padding: 40px;
}
.flipbook-empty-state h2 { font-size: 1.5rem; margin-bottom: 10px; color: #fff; }
.flipbook-empty-state p { font-size: 1rem; opacity: 0.8; }
@media (max-width: 1100px) {
    .flipbook-empty-state { width: 350px; height: 470px; }
}
@media (max-width: 800px) {
    .flipbook-empty-state { width: 320px; height: 430px; }
    .flipbook-nav-btn { width: 44px; height: 44px; }
    .flipbook-nav-btn.prev { left: 8px; }
    .flipbook-nav-btn.next { right: 8px; }
    .flipbook-close-btn { width: 44px; height: 44px; top: 15px; right: 15px; }
    .flipbook-controls { gap: 2px; padding: 8px 12px; bottom: 12px; }
    .flipbook-ctrl-btn { width: 34px; height: 34px; }
}
