.flipbook-modal {
    opacity: 0;
    visibility: hidden;
    justify-content: center;
    align-items: center;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(4px);
    z-index: 9999;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    display: flex;
    padding: 20px;
    box-sizing: border-box;
}

.flipbook-modal.show {
    opacity: 1;
    visibility: visible;
}

.flipbook-modal-content {
    background: #111;
    border-radius: 20px;
    max-width: 95%;
    width: 900px;
    max-height: 90%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    overflow: hidden;
    position: relative;
    box-shadow: 0 30px 80px rgba(0,0,0,0.6);
    animation: popupScaleFade 0.3s ease forwards;
    padding: 20px;
}

.flipbook-modal video,
.flipbook-modal iframe {
    width: 100%;
    height: auto;
    max-height: 80vh;
    object-fit: contain;
    border-radius: 12px;
    background: #000;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
}

.flipbook-close {
    position: absolute;
    top: 16px;
    right: 16px;
    font-size: 32px;
    color: #fff;
    background: rgba(255,255,255,0.1);
    border: none;
    cursor: pointer;
    font-weight: 700;
    padding: 6px 14px;
    border-radius: 12px;
    z-index: 11;
    transition: background 0.2s ease, transform 0.2s ease;
}

.flipbook-close:hover {
    background: rgba(255,255,255,0.3);
    transform: scale(1.1);
}

@keyframes popupScaleFade {
    from { transform: scale(0.95); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

@media (max-width: 768px) {
    .flipbook-modal-content {
        max-width: 100%;
        max-height: 85%;
        border-radius: 16px;
        padding: 15px;
    }

    .flipbook-close {
        font-size: 28px;
        padding: 5px 12px;
    }

    .flipbook-modal video,
    .flipbook-modal iframe {
        max-height: 70vh;
    }
}
