/* static/css/pdf-viewer.css - Version améliorée avec contrôles page par page */

/* Modal PDF */
.pdf-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    z-index: 2000;
    align-items: center;
    justify-content: center;
}

.pdf-modal-content {
    width: 98%;
    height: 98%;
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    position: relative;
    display: flex;
    flex-direction: column;
}

.pdf-modal-header {
    padding: 15px 20px;
    background-color: #f8f9fa;
    border-bottom: 1px solid #dee2e6;
    border-radius: 8px 8px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
}

.pdf-modal-title {
    font-size: 18px;
    font-weight: bold;
    color: #333;
    margin: 0;
    flex-grow: 1;
}

.pdf-page-info {
    display: flex;
    align-items: center;
    gap: 15px;
    color: #666;
    font-size: 14px;
}

.pdf-page-input {
    width: 60px;
    padding: 4px 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    text-align: center;
    font-size: 14px;
}

.pdf-modal-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #666;
    padding: 5px;
    border-radius: 4px;
    transition: all 0.2s;
    margin-left: 15px;
}

.pdf-modal-close:hover {
    background-color: #e9ecef;
    color: #333;
}

.pdf-modal-body {
    flex: 1;
    padding: 0;
    overflow: hidden;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #525659;
}

/* Container pour le canvas PDF */
.pdf-canvas-container {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.pdf-canvas {
    max-width: 100%;
    max-height: 100%;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    background-color: white;
}

/* Boutons de navigation latéraux */
.pdf-nav-button {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 60px;
    height: 60px;
    background-color: rgba(52, 152, 219, 0.8);
    color: white;
    border: none;
    border-radius: 50%;
    font-size: 24px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 20;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.pdf-nav-button:hover {
    background-color: rgba(52, 152, 219, 1);
    transform: translateY(-50%) scale(1.1);
}

.pdf-nav-button:disabled {
    background-color: rgba(108, 117, 125, 0.5);
    cursor: not-allowed;
    opacity: 0.5;
}

.pdf-nav-button:disabled:hover {
    transform: translateY(-50%) scale(1);
}

.pdf-prev-button {
    left: 20px;
}

.pdf-next-button {
    right: 20px;
}

/* Zone de clic pour navigation */
.pdf-click-area {
    position: absolute;
    top: 0;
    width: 30%;
    height: 100%;
    z-index: 15;
    cursor: pointer;
    transition: background-color 0.2s;
}

.pdf-click-area:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

.pdf-click-prev {
    left: 0;
}

.pdf-click-next {
    right: 0;
}

/* Container PDF dans les vignettes */
.pdf-container {
    width: 100%;
    height: 100%;
    position: relative;
    background-color: #f8f9fa;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s;
}

.pdf-container:hover {
    background-color: #e9ecef;
}

.pdf-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    transition: background-color 0.3s;
    position: relative;
}

.pdf-placeholder:hover {
    background-color: rgba(0, 0, 0, 0.1);
}

.pdf-inline-viewer {
    width: 100%;
    height: 100%;
    border: none;
    background-color: white;
}

.pdf-view-button {
    position: absolute;
    width: 50px;
    height: 50px;
    background-color: rgba(52, 152, 219, 0.9);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 20px;
    cursor: pointer;
    z-index: 10;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
    transition: all 0.3s ease;
}

.pdf-container:hover .pdf-view-button {
    transform: scale(1.1);
    background-color: rgba(52, 152, 219, 1);
}

/* Contrôles du PDF */
.pdf-controls {
    display: flex;
    gap: 10px;
    align-items: center;
    justify-content: center;
    padding: 15px;
    background-color: #f8f9fa;
    border-top: 1px solid #dee2e6;
    flex-shrink: 0;
}

.pdf-control-btn {
    padding: 8px 12px;
    background-color: #3498db;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: background-color 0.2s;
    display: flex;
    align-items: center;
    gap: 5px;
}

.pdf-control-btn:hover {
    background-color: #2980b9;
}

.pdf-control-btn:disabled {
    background-color: #bdc3c7;
    cursor: not-allowed;
}

/* Contrôles de navigation en bas */
.pdf-bottom-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    padding: 10px;
    background-color: rgba(248, 249, 250, 0.95);
    backdrop-filter: blur(10px);
}

.pdf-nav-bottom {
    padding: 10px 15px;
    background-color: #3498db;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: bold;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 8px;
}

.pdf-nav-bottom:hover {
    background-color: #2980b9;
    transform: translateY(-1px);
}

.pdf-nav-bottom:disabled {
    background-color: #bdc3c7;
    cursor: not-allowed;
    transform: none;
}

/* Animation de chargement pour PDF */
.pdf-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    background-color: #525659;
    color: white;
}

.pdf-loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-top: 4px solid #3498db;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 15px;
}

.pdf-loading-text {
    color: white;
    font-size: 14px;
}

/* Zoom controls */
.pdf-zoom-controls {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0 10px;
}

.pdf-zoom-btn {
    width: 32px;
    height: 32px;
    border: none;
    background-color: #6c757d;
    color: white;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s;
}

.pdf-zoom-btn:hover {
    background-color: #5a6268;
}

.pdf-zoom-level {
    font-size: 12px;
    color: #666;
    min-width: 45px;
    text-align: center;
}

/* Boutons d'action PDF */
.pdf-action-buttons {
    position: absolute;
    bottom: 10px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 5px;
    opacity: 0;
    transition: opacity 0.3s;
}

.pdf-container:hover .pdf-action-buttons {
    opacity: 1;
}

.pdf-action-btn {
    padding: 6px 12px;
    background-color: rgba(52, 152, 219, 0.9);
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    transition: all 0.2s;
}

.pdf-action-btn:hover {
    background-color: rgba(52, 152, 219, 1);
    transform: scale(1.05);
}

/* Indicateur de page actuelle */
.pdf-page-indicator {
    position: absolute;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    background-color: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 14px;
    z-index: 25;
    backdrop-filter: blur(10px);
}

/* Responsive */
@media (max-width: 768px) {
    .pdf-modal-content {
        width: 100%;
        height: 100%;
        border-radius: 0;
    }

    .pdf-modal-header {
        padding: 10px 15px;
        flex-wrap: wrap;
        gap: 10px;
    }

    .pdf-modal-title {
        font-size: 16px;
    }

    .pdf-nav-button {
        width: 50px;
        height: 50px;
        font-size: 20px;
    }

    .pdf-prev-button {
        left: 10px;
    }

    .pdf-next-button {
        right: 10px;
    }

    .pdf-controls {
        flex-wrap: wrap;
        justify-content: center;
        gap: 8px;
        padding: 10px;
    }

    .pdf-control-btn {
        font-size: 12px;
        padding: 6px 10px;
    }

    .pdf-page-info {
        gap: 10px;
        font-size: 12px;
    }

    .pdf-page-input {
        width: 50px;
        font-size: 12px;
    }

    .pdf-click-area {
        width: 25%;
    }
}

/* Animations */
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.pdf-canvas {
    animation: fadeIn 0.3s ease-in-out;
}

/* Mode plein écran améliorer */
.pdf-fullscreen {
    background-color: #000;
}

.pdf-fullscreen .pdf-modal-content {
    background-color: #000;
    border-radius: 0;
}

.pdf-fullscreen .pdf-modal-header {
    background-color: rgba(0, 0, 0, 0.8);
    color: white;
}

.pdf-fullscreen .pdf-controls {
    background-color: rgba(0, 0, 0, 0.8);
    color: white;
}