/* Styles pour le flip-book PDF */

.creactive-flipbook-container {
    position: relative;
    margin: 20px auto;
    box-shadow: 0 10px 20px rgba(0,0,0,0.2);
    background: #f8f8f8;
    border-radius: 5px;
    overflow: hidden;
}

.creactive-flipbook {
    width: 100%;
    height: calc(100% - 50px);
    background-color: #f1f1f1;
    position: relative;
    overflow: auto;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 10px;
    box-sizing: border-box;
}

.creactive-flipbook canvas {
    max-width: 100%;
    max-height: 100%;
    box-shadow: 0 0 10px rgba(0,0,0,0.15);
    image-rendering: auto;
    object-fit: contain;
}

.creactive-flipbook-loader {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    background-color: rgba(255,255,255,0.9);
    z-index: 10;
}

.creactive-flipbook-loader .spinner {
    width: 50px;
    height: 50px;
    border: 5px solid #f3f3f3;
    border-top: 5px solid #3498db;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 10px;
}

.flipbook-error {
    color: #d9534f;
    padding: 15px;
    margin: 10px;
    background-color: #f2dede;
    border: 1px solid #ebccd1;
    border-radius: 4px;
    text-align: center;
}

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

.creactive-flipbook-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 10px;
    background-color: #f1f1f1;
    border-top: 1px solid #ddd;
    height: 50px;
    box-sizing: border-box;
    box-shadow: 0 -2px 10px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
}

.creactive-flipbook-controls button,
.creactive-flipbook-controls .download-pdf {
    background: transparent;
    border: none;
    color: #555;
    cursor: pointer;
    padding: 6px 12px;
    font-size: 16px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    margin: 0 3px;
}

.creactive-flipbook-controls button:hover,
.creactive-flipbook-controls .download-pdf:hover {
    background-color: #e0e0e0;
    color: #000;
    transform: translateY(-2px);
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

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

.creactive-flipbook-controls button:disabled:hover {
    background-color: transparent;
}

.creactive-flipbook-controls .page-info {
    margin: 0 15px;
    font-size: 14px;
    color: #555;
}

.creactive-flipbook-controls .download-pdf {
    text-decoration: none;
    margin-left: auto;
}

/* Mode plein écran */
.creactive-flipbook-fullscreen {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    z-index: 999999 !important;
    background: white !important;
    margin: 0 !important;
    max-width: none !important;
    border-radius: 0 !important;
    padding: 0 !important;
    overflow: hidden !important;
}

.creactive-flipbook-fullscreen .creactive-flipbook {
    height: calc(100% - 60px) !important;
    width: 100% !important;
    max-height: none !important;
}

.creactive-flipbook-fullscreen .creactive-flipbook canvas {
    max-height: 85vh !important;
}

.creactive-flipbook-fullscreen .creactive-flipbook-controls {
    position: fixed !important;
    bottom: 0 !important;
    left: 0 !important;
    width: 100% !important;
    background: #333 !important;
    color: white !important;
    padding: 15px !important;
    height: 60px !important;
    box-sizing: border-box !important;
    z-index: 1000000 !important;
}

.creactive-flipbook-fullscreen .creactive-flipbook-controls button,
.creactive-flipbook-fullscreen .creactive-flipbook-controls .download-pdf {
    color: white;
}

.creactive-flipbook-fullscreen .creactive-flipbook-controls button:hover,
.creactive-flipbook-fullscreen .creactive-flipbook-controls .download-pdf:hover {
    background-color: #555;
}

.creactive-flipbook-fullscreen .creactive-flipbook-controls .page-info {
    color: white;
}

/* Pour les mobiles */
@media (max-width: 768px) {
    .creactive-flipbook-controls {
        flex-wrap: wrap;
        justify-content: center;
        gap: 5px;
        height: auto;
        padding: 8px 5px;
    }
    
    .creactive-flipbook {
        height: calc(100% - 80px);
        padding: 5px;
    }
    
    .creactive-flipbook-controls .download-pdf {
        margin-left: 0;
    }
    
    .creactive-flipbook-controls button,
    .creactive-flipbook-controls .download-pdf {
        padding: 4px 8px;
        font-size: 14px;
    }
    
    .creactive-flipbook-controls .page-info {
        margin: 0 5px;
        font-size: 12px;
        order: -1;
        width: 100%;
        text-align: center;
        margin-bottom: 5px;
    }
}

/* Styles pour le mode livre */
.flipbook-pages-container {
    display: flex;
    flex-wrap: nowrap;
    justify-content: center;
    align-items: center;
    width: 100%;
    height: 100%;
    overflow: hidden;
    padding: 5px;
    box-sizing: border-box;
}

.flipbook-pages-container.double-page-mode {
    background-color: #f8f8f8;
    box-shadow: inset 0 0 10px rgba(0,0,0,0.1);
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 5px;
    background-image: linear-gradient(to right, transparent 49.9%, rgba(0,0,0,0.1) 50%, transparent 50.1%);
    background-size: 100% 100%;
}

.flipbook-pages-container.double-page-mode canvas {
    max-width: 48%;
    max-height: 98%;
    width: auto !important;
    margin: 0 1%;
    box-shadow: 0 0 10px rgba(0,0,0,0.15);
    background-color: white;
    border: 1px solid #ddd;
    transition: transform 0.2s ease;
}

.flipbook-pages-container.double-page-mode canvas:first-child {
    border-radius: 5px 0 0 5px;
    box-shadow: -5px 5px 15px rgba(0,0,0,0.15);
    transform: perspective(1200px) rotateY(1deg);
}

.flipbook-pages-container.double-page-mode canvas:last-child {
    border-radius: 0 5px 5px 0;
    box-shadow: 5px 5px 15px rgba(0,0,0,0.15);
    transform: perspective(1200px) rotateY(-1deg);
}

/* Ajouter un bouton pour changer le mode d'affichage */
.creactive-flipbook-controls .toggle-page-mode {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-left: 10px;
    cursor: pointer;
    background: transparent;
    border: none;
    color: #555;
    padding: 5px 10px;
    font-size: 16px;
    border-radius: 3px;
}

.creactive-flipbook-controls .toggle-page-mode:hover {
    background-color: #ddd;
    color: #333;
}

/* Styles responsives pour le mode livre */
@media (max-width: 768px) {
    .flipbook-pages-container.double-page-mode {
        flex-direction: column;
    }
    
    .flipbook-pages-container.double-page-mode::after {
        display: none;
    }
    
    .flipbook-pages-container.double-page-mode canvas {
        width: 98% !important;
        max-width: 98% !important;
        margin: 5px auto !important;
    }
}

/* Style optimisé pour la première page (couverture) */
.flipbook-pages-container.first-page-mode {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    height: 100%;
    background-color: #f8f8f8;
    padding: 0;
    box-sizing: border-box;
}

.flipbook-pages-container.first-page-mode canvas.first-page {
    max-width: 100%;
    max-height: 100%;
    width: auto !important;
    height: auto !important;
    object-fit: contain;
    display: block;
    margin: 0 auto;
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
    border: 1px solid #ddd;
    background-color: white;
    animation: fadeIn 0.5s ease-out;
}

/* Style amélioré pour la couverture avec animation */
.flipbook-pages-container.first-page-mode canvas.enhanced-cover {
    box-shadow: 0 8px 25px rgba(0,0,0,0.3);
    animation: enhancedFadeIn 0.8s ease-out;
    transform-origin: center;
    image-rendering: -webkit-optimize-contrast;
    image-rendering: crisp-edges;
}

@keyframes enhancedFadeIn {
    0% { opacity: 0; transform: scale(0.95); }
    70% { opacity: 1; transform: scale(1.02); }
    100% { opacity: 1; transform: scale(1); }
}

/* Styles pour le bouton de rafraîchissement */
.creactive-flipbook-controls .refresh-button {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-left: 10px;
    cursor: pointer;
    background: transparent;
    border: none;
    color: #555;
    padding: 5px 10px;
    font-size: 16px;
    border-radius: 3px;
}

.creactive-flipbook-controls .refresh-button:hover {
    background-color: #ddd;
    color: #333;
}

.creactive-flipbook-controls .refresh-button .dashicons {
    font-size: 18px;
    width: 18px;
    height: 18px;
}

.creactive-flipbook-controls .refresh-button:active .dashicons {
    animation: spin 0.5s linear;
}

/* Indicateur de swipe pour mobile */
.swipe-indicator {
    position: absolute;
    bottom: 70px;
    left: 0;
    right: 0;
    text-align: center;
    background-color: rgba(0, 0, 0, 0.6);
    color: white;
    padding: 8px;
    z-index: 100;
    pointer-events: none;
    animation: pulse 2s infinite;
    font-size: 14px;
    border-radius: 4px;
    margin: 0 20px;
}

@keyframes pulse {
    0% { opacity: 0.8; }
    50% { opacity: 1; }
    100% { opacity: 0.8; }
}

/* Animation pour l'apparition fluide de la première page */
@keyframes fadeIn {
    0% { opacity: 0; transform: scale(0.98); }
    100% { opacity: 1; transform: scale(1); }
}

/* Style spécifique pour les boutons de zoom */
.creactive-flipbook-controls .zoom-in,
.creactive-flipbook-controls .zoom-out {
    background-color: #f5f5f5;
    border: 1px solid #ddd;
    padding: 7px 12px;
    position: relative;
    z-index: 10;
}

.creactive-flipbook-controls .zoom-in:hover,
.creactive-flipbook-controls .zoom-out:hover {
    background-color: #e0e0e0;
    transform: translateY(-2px);
}

.creactive-flipbook-controls .zoom-in:active,
.creactive-flipbook-controls .zoom-out:active {
    background-color: #d0d0d0;
    transform: translateY(0px);
}

.creactive-flipbook-controls .zoom-in .dashicons,
.creactive-flipbook-controls .zoom-out .dashicons {
    font-size: 20px;
    width: 20px;
    height: 20px;
} 