/**
 * Styles pour le Lightbox Our PDF Viewer Pro
 * Accessibilité complète et design moderne
 */

/* Conteneur principal du lightbox */
.pdfv-lightbox {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.pdfv-lightbox:not(.pdfv-lightbox-hidden) {
    opacity: 1;
    visibility: visible;
}

/* Overlay de fond */
.pdfv-lightbox-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    cursor: pointer;
}

/* Contenu du lightbox */
.pdfv-lightbox-content {
    position: relative;
    background: #ffffff;
    border-radius: 8px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    max-width: 90vw;
    max-height: 90vh;
    width: 100%;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transform: scale(0.9);
    transition: transform 0.3s ease;
}

.pdfv-lightbox:not(.pdfv-lightbox-hidden) .pdfv-lightbox-content {
    transform: scale(1);
}

/* En-tête du lightbox */
.pdfv-lightbox-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid #e5e7eb;
    background: #f9fafb;
    min-height: 70px;
}

.pdfv-lightbox-title {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: #111827;
    flex: 1;
    padding-right: 20px;
}

/* Bouton de fermeture */
.pdfv-lightbox-close {
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    border-radius: 6px;
    transition: background-color 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    min-height: 40px;
}

.pdfv-lightbox-close:hover {
    background-color: #f3f4f6;
}

.pdfv-lightbox-close:focus {
    outline: 2px solid #3b82f6;
    outline-offset: 2px;
}

.pdfv-lightbox-close-icon {
    font-size: 24px;
    color: #6b7280;
    line-height: 1;
}

/* Corps du lightbox */
.pdfv-lightbox-body {
    flex: 1;
    overflow: hidden;
    position: relative;
    min-height: 400px;
}

.pdfv-lightbox-viewer {
    width: 100%;
    height: 100%;
    position: relative;
}

/* Pied de page du lightbox */
.pdfv-lightbox-footer {
    padding: 16px 24px;
    border-top: 1px solid #e5e7eb;
    background: #f9fafb;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

/* Contrôles de navigation */
.pdfv-lightbox-controls {
    display: flex;
    align-items: center;
    gap: 16px;
}

.pdfv-lightbox-prev,
.pdfv-lightbox-next {
    background: #ffffff;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    padding: 8px 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    min-height: 40px;
}

.pdfv-lightbox-prev:hover,
.pdfv-lightbox-next:hover {
    background-color: #f3f4f6;
    border-color: #9ca3af;
}

.pdfv-lightbox-prev:focus,
.pdfv-lightbox-next:focus {
    outline: 2px solid #3b82f6;
    outline-offset: 2px;
}

.pdfv-lightbox-prev-icon,
.pdfv-lightbox-next-icon {
    font-size: 18px;
    color: #374151;
    line-height: 1;
}

/* Informations de page */
.pdfv-lightbox-page-info {
    font-size: 14px;
    color: #6b7280;
    font-weight: 500;
    min-width: 80px;
    text-align: center;
}

/* Actions du lightbox */
.pdfv-lightbox-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.pdfv-lightbox-zoom-in,
.pdfv-lightbox-zoom-out,
.pdfv-lightbox-fullscreen,
.pdfv-lightbox-download {
    background: #ffffff;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    padding: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    min-height: 36px;
    font-size: 14px;
    color: #374151;
}

.pdfv-lightbox-zoom-in:hover,
.pdfv-lightbox-zoom-out:hover,
.pdfv-lightbox-fullscreen:hover,
.pdfv-lightbox-download:hover {
    background-color: #f3f4f6;
    border-color: #9ca3af;
}

.pdfv-lightbox-zoom-in:focus,
.pdfv-lightbox-zoom-out:focus,
.pdfv-lightbox-fullscreen:focus,
.pdfv-lightbox-download:focus {
    outline: 2px solid #3b82f6;
    outline-offset: 2px;
}

/* Boutons de déclenchement du lightbox */
.pdfv-lightbox-trigger {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    background: #3b82f6;
    color: #ffffff;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.2s ease;
    line-height: 1;
}

.pdfv-lightbox-trigger:hover {
    background: #2563eb;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.pdfv-lightbox-trigger:focus {
    outline: 2px solid #3b82f6;
    outline-offset: 2px;
}

.pdfv-lightbox-trigger:active {
    transform: translateY(0);
}

/* Tailles des boutons */
.pdfv-lightbox-trigger[data-size="small"] {
    padding: 8px 16px;
    font-size: 12px;
}

.pdfv-lightbox-trigger[data-size="large"] {
    padding: 16px 24px;
    font-size: 16px;
}

/* États de chargement et d'erreur */
.pdfv-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: #6b7280;
    font-size: 16px;
}

.pdfv-error {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: #dc2626;
    font-size: 16px;
    text-align: center;
    padding: 20px;
}

/* Viewer d'images */
.pdfv-image-viewer {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.pdfv-image-container {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    background: #f9fafb;
}

.pdfv-page-image {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    border-radius: 4px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.pdfv-image-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    padding: 16px;
    background: #ffffff;
    border-top: 1px solid #e5e7eb;
}

.pdfv-page-prev,
.pdfv-page-next {
    background: #ffffff;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    padding: 8px 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 18px;
    color: #374151;
    min-width: 40px;
    min-height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.pdfv-page-prev:hover,
.pdfv-page-next:hover {
    background-color: #f3f4f6;
    border-color: #9ca3af;
}

.pdfv-page-info {
    font-size: 14px;
    color: #6b7280;
    font-weight: 500;
    min-width: 120px;
    text-align: center;
}

/* Viewer PDF.js */
.pdfv-pdfjs-viewer {
    width: 100%;
    height: 100%;
}

.pdfv-pdfjs-viewer iframe {
    width: 100%;
    height: 100%;
    border: none;
}

/* Verrouillage du scroll */
.pdfv-scroll-locked {
    overflow: hidden;
}

/* Responsive design */
@media (max-width: 768px) {
    .pdfv-lightbox-content {
        max-width: 95vw;
        max-height: 95vh;
        margin: 10px;
    }
    
    .pdfv-lightbox-header {
        padding: 16px 20px;
        min-height: 60px;
    }
    
    .pdfv-lightbox-title {
        font-size: 16px;
    }
    
    .pdfv-lightbox-footer {
        padding: 12px 20px;
        flex-direction: column;
        gap: 12px;
    }
    
    .pdfv-lightbox-controls,
    .pdfv-lightbox-actions {
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .pdfv-lightbox-content {
        max-width: 98vw;
        max-height: 98vh;
        margin: 5px;
    }
    
    .pdfv-lightbox-header {
        padding: 12px 16px;
    }
    
    .pdfv-lightbox-footer {
        padding: 8px 16px;
    }
    
    .pdfv-lightbox-controls {
        gap: 8px;
    }
    
    .pdfv-lightbox-actions {
        gap: 4px;
    }
}

/* Animations */
@keyframes pdfv-fade-in {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes pdfv-slide-up {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Support des préférences de réduction de mouvement */
@media (prefers-reduced-motion: reduce) {
    .pdfv-lightbox,
    .pdfv-lightbox-content {
        transition: none;
    }
    
    .pdfv-lightbox-trigger {
        transition: none;
    }
}

/* Support du mode sombre */
@media (prefers-color-scheme: dark) {
    .pdfv-lightbox-content {
        background: #1f2937;
        color: #f9fafb;
    }
    
    .pdfv-lightbox-header,
    .pdfv-lightbox-footer {
        background: #111827;
        border-color: #374151;
    }
    
    .pdfv-lightbox-title {
        color: #f9fafb;
    }
    
    .pdfv-lightbox-close,
    .pdfv-lightbox-prev,
    .pdfv-lightbox-next,
    .pdfv-lightbox-zoom-in,
    .pdfv-lightbox-zoom-out,
    .pdfv-lightbox-fullscreen,
    .pdfv-lightbox-download {
        background: #374151;
        border-color: #4b5563;
        color: #f9fafb;
    }
    
    .pdfv-lightbox-close:hover,
    .pdfv-lightbox-prev:hover,
    .pdfv-lightbox-next:hover,
    .pdfv-lightbox-zoom-in:hover,
    .pdfv-lightbox-zoom-out:hover,
    .pdfv-lightbox-fullscreen:hover,
    .pdfv-lightbox-download:hover {
        background: #4b5563;
        border-color: #6b7280;
    }
    
    .pdfv-lightbox-page-info {
        color: #9ca3af;
    }
    
    .pdfv-image-container {
        background: #111827;
    }
}
