/* PDF Viewer Pro - Style CSS */

.pdf-viewer-container {
    max-width: 100%;
    margin: 0 auto;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

.pdf-viewer-wrapper {
    background: #ffffff;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.pdf-viewer-wrapper:hover {
    box-shadow: 0 15px 50px rgba(0, 0, 0, 0.15);
}

/* Header */
.pdf-viewer-header {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 24px 28px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.theme-blue .pdf-viewer-header {
    background: linear-gradient(135deg, #4A90E2 0%, #2E5C8A 100%);
}

.theme-dark .pdf-viewer-header {
    background: linear-gradient(135deg, #2c3e50 0%, #34495e 100%);
}

.theme-yellow .pdf-viewer-header {
    background: linear-gradient(135deg, #f39c12 0%, #e67e22 100%);
}

.theme-green .pdf-viewer-header {
    background: linear-gradient(135deg, #27ae60 0%, #229954 100%);
}

.pdf-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 60px;
    height: 60px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    backdrop-filter: blur(10px);
}

.pdf-icon svg {
    width: 32px;
    height: 32px;
    stroke: white;
}

.pdf-info {
    flex: 1;
}

.pdf-title {
    margin: 0 0 4px 0;
    font-size: 20px;
    font-weight: 700;
    color: white;
    line-height: 1.3;
}

.pdf-subtitle {
    margin: 0;
    font-size: 14px;
    color: rgba(255, 255, 255, 0.85);
    font-weight: 400;
}

/* Canvas Container */
.pdf-canvas-container {
    position: relative;
    background: #f8f9fa;
    min-height: 600px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: auto;
    padding: 20px;
}

.pdf-canvas {
    max-width: 100%;
    height: auto;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    background: white;
    display: none;
    cursor: pointer; /* <--- AJOUTER CETTE LIGNE */
}

.pdf-canvas.loaded {
    display: block;
}

/* Loading */
.pdf-loading {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    color: #666;
}

.pdf-loading.hidden {
    display: none;
}

.spinner {
    width: 50px;
    height: 50px;
    margin: 0 auto 16px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.theme-blue .spinner {
    border-top-color: #4A90E2;
}

.theme-dark .spinner {
    border-top-color: #34495e;
}

.theme-yellow .spinner {
    border-top-color: #f39c12;
}

.theme-green .spinner {
    border-top-color: #27ae60;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Controls */
.pdf-controls {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 24px;
    background: #ffffff;
    border-top: 1px solid #e9ecef;
    gap: 16px;
}

.controls-left,
.controls-center,
.controls-right {
    display: flex;
    align-items: center;
    gap: 8px;
}

.controls-center {
    flex: 1;
    justify-content: center;
}

.pdf-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border: none;
    background: #f8f9fa;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    color: #495057;
    text-decoration: none;
}

.pdf-btn:hover {
    background: #667eea;
    color: white;
    transform: translateY(-2px);
}

.theme-blue .pdf-btn:hover {
    background: #4A90E2;
}

.theme-dark .pdf-btn:hover {
    background: #34495e;
}

.theme-yellow .pdf-btn:hover {
    background: #f39c12;
}

.theme-green .pdf-btn:hover {
    background: #27ae60;
}

.pdf-btn:active {
    transform: translateY(0);
}

.pdf-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

.pdf-btn svg {
    width: 20px;
    height: 20px;
}

.page-info {
    font-size: 14px;
    font-weight: 600;
    color: #495057;
    background: #f8f9fa;
    padding: 8px 16px;
    border-radius: 20px;
    white-space: nowrap;
}

.current-page {
    color: #667eea;
    font-weight: 700;
}

.theme-blue .current-page {
    color: #4A90E2;
}

.theme-dark .current-page {
    color: #34495e;
}

.theme-yellow .current-page {
    color: #f39c12;
}

.theme-green .current-page {
    color: #27ae60;
}

/* Fullscreen Mode */
.pdf-viewer-container.fullscreen {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 9999;
    max-width: 100%;
    margin: 0;
}

.pdf-viewer-container.fullscreen .pdf-viewer-wrapper {
    height: 100vh;
    border-radius: 0;
    display: flex;
    flex-direction: column;
}

.pdf-viewer-container.fullscreen .pdf-canvas-container {
    flex: 1;
    min-height: auto;
}

/* Responsive Design */
@media (max-width: 768px) {
    .pdf-viewer-header {
        padding: 20px;
        gap: 16px;
    }
    
    .pdf-icon {
        width: 50px;
        height: 50px;
    }
    
    .pdf-icon svg {
        width: 26px;
        height: 26px;
    }
    
    .pdf-title {
        font-size: 18px;
    }
    
    .pdf-subtitle {
        font-size: 13px;
    }
    
    .pdf-canvas-container {
        min-height: 400px;
        padding: 12px;
    }
    
    .pdf-controls {
        flex-wrap: wrap;
        padding: 12px 16px;
        gap: 12px;
    }
    
    .controls-left,
    .controls-right {
        gap: 6px;
    }
    
    .pdf-btn {
        width: 36px;
        height: 36px;
    }
    
    .pdf-btn svg {
        width: 18px;
        height: 18px;
    }
    
    .page-info {
        font-size: 13px;
        padding: 6px 12px;
    }
}

@media (max-width: 480px) {
    .pdf-viewer-header {
        flex-direction: column;
        text-align: center;
        padding: 16px;
    }
    
    .pdf-controls {
        justify-content: center;
    }
    
    .controls-center {
        order: -1;
        width: 100%;
    }
}

/* Animation d'entrée */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.pdf-viewer-wrapper {
    animation: fadeInUp 0.5s ease;
}

/* Scrollbar personnalisée */
.pdf-canvas-container::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

.pdf-canvas-container::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.pdf-canvas-container::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 5px;
}

.pdf-canvas-container::-webkit-scrollbar-thumb:hover {
    background: #555;
}