/* Flipbook Styles */
.flipbook-modal .modal-dialog {
    width: 95%;
    max-width: 1600px;
    height: 95vh;
    margin: 2.5vh auto;
}

.flipbook-modal .modal-content {
    height: 100%;
    display: flex;
    flex-direction: column;
}

.flipbook-modal .modal-body {
    flex: 1;
    overflow: hidden;
    padding: 20px;
    background-color: #333;
}

.flipbook-container {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

#flipbook {
    width: 1400px !important;
    height: 900px !important;
    margin: 0 auto;
}

#flipbook .page {
    width: 700px !important;
    height: 900px !important;
    background-color: white;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.2);
}

#flipbook .page img {
    width: 100% !important;
    height: 100% !important;
    object-fit: contain;
}

/* Page number display */
.flipbook-page-number {
    text-align: center;
    color: #fff;
    margin-top: 0px;
    font-size: 14px;
}

/* Navigation buttons */
.flipbook-controls {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1000;
    display: flex;
    gap: 10px;
}

.flipbook-controls button {
    background-color: rgba(255, 255, 255, 0.9);
    border: none;
    padding: 10px 20px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s ease;
}

.flipbook-controls button:hover {
    background-color: #fff;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

.flipbook-controls button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.flipbook-controls button i {
    margin: 0 5px;
}

/* Loading spinner */
.flipbook-loading {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    color: #fff;
}

.flipbook-loading .spinner {
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-top: 4px solid #fff;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 0 auto 10px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Responsive adjustments */
@media (max-width: 1600px) {
    #flipbook {
        width: 1200px;
        height: 800px;
    }
    
    #flipbook .page {
        width: 600px;
        height: 800px;
    }
}

@media (max-width: 1200px) {
    .flipbook-modal .modal-dialog {
        width: 95%;
    }
    
    #flipbook {
        width: 1000px;
        height: 700px;
    }
    
    #flipbook .page {
        width: 500px;
        height: 700px;
    }
}

@media (max-width: 992px) {
    .flipbook-modal .modal-dialog {
        width: 95%;
    }
    
    #flipbook {
        width: 800px;
        height: 600px;
    }
    
    #flipbook .page {
        width: 400px;
        height: 600px;
    }
}

@media (max-width: 768px) {
    #flipbook {
        width: 600px;
        height: 450px;
    }
    
    #flipbook .page {
        width: 300px;
        height: 450px;
    }
    
    .flipbook-controls button {
        padding: 8px 15px;
        font-size: 12px;
    }
}

@media (max-width: 480px) {
    #flipbook {
        width: 400px;
        height: 300px;
    }
    
    #flipbook .page {
        width: 200px;
        height: 300px;
    }
}

/* Turn.js specific styles */
.turn-page {
    background-color: white;
}

.turn-page-wrapper {
    perspective: 2000px;
}
