/**
 * PDF Viewer Widget - Styles CSS
 * Version: 1.0.0
 */

/* Conteneur principal */
.pdf-viewer-widget {
    width: 100%;
    margin: 20px 0;
    position: relative;
}

/* Iframe du visionneur PDF */
.pdf-viewer-iframe {
    border: 1px solid #ddd;
    border-radius: 4px;
    display: block;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    background-color: #f9f9f9;
    transition: box-shadow 0.3s ease;
}

.pdf-viewer-iframe:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* Bouton de téléchargement */
.pdf-download-btn {
    display: inline-block;
    margin-top: 15px;
    padding: 12px 24px;
    background-color: #0073aa;
    color: #ffffff;
    text-decoration: none;
    border-radius: 4px;
    font-weight: 600;
    font-size: 16px;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0, 115, 170, 0.2);
    border: none;
    cursor: pointer;
}

.pdf-download-btn:hover {
    background-color: #005a87;
    color: #ffffff;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 115, 170, 0.3);
}

.pdf-download-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(0, 115, 170, 0.2);
}

.pdf-download-btn:focus {
    outline: 2px solid #0073aa;
    outline-offset: 2px;
}

/* Résumé SEO (details/summary) */
.pdf-summary {
    margin-top: 20px;
    font-size: 0.9em;
    color: #555;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    padding: 10px 15px;
    background-color: #fafafa;
}

.pdf-summary summary {
    cursor: pointer;
    font-weight: bold;
    padding: 5px 0;
    user-select: none;
    color: #333;
    transition: color 0.2s ease;
}

.pdf-summary summary:hover {
    color: #0073aa;
}

.pdf-summary summary:focus {
    outline: 2px solid #0073aa;
    outline-offset: 2px;
    border-radius: 2px;
}

.pdf-summary-content {
    margin-top: 10px;
    line-height: 1.6;
    color: #666;
}

.pdf-summary-content p {
    margin: 10px 0;
}

/* Responsive Design */
@media screen and (max-width: 768px) {
    .pdf-viewer-iframe {
        height: 500px !important;
    }
    
    .pdf-download-btn {
        width: 100%;
        text-align: center;
        padding: 14px 20px;
        font-size: 18px;
    }
    
    .pdf-summary {
        font-size: 0.85em;
    }
}

@media screen and (max-width: 480px) {
    .pdf-viewer-iframe {
        height: 400px !important;
    }
    
    .pdf-download-btn {
        font-size: 16px;
    }
}

/* Accessibilité */
@media (prefers-reduced-motion: reduce) {
    .pdf-viewer-iframe,
    .pdf-download-btn,
    .pdf-summary summary {
        transition: none;
    }
    
    .pdf-download-btn:hover {
        transform: none;
    }
}

/* Mode sombre (si votre thème le supporte) */
@media (prefers-color-scheme: dark) {
    .pdf-viewer-iframe {
        border-color: #444;
        background-color: #2a2a2a;
    }
    
    .pdf-summary {
        background-color: #2a2a2a;
        border-color: #444;
        color: #ccc;
    }
    
    .pdf-summary summary {
        color: #e0e0e0;
    }
    
    .pdf-summary summary:hover {
        color: #4a9eff;
    }
    
    .pdf-summary-content {
        color: #aaa;
    }
}

/* Message d'erreur */
.pdf-viewer-widget p[style*="color: red"] {
    background-color: #ffebee;
    border-left: 4px solid #f44336;
    padding: 12px 16px;
    border-radius: 4px;
    margin: 10px 0;
}

/* Animation de chargement */
.pdf-viewer-iframe::before {
    content: "";
    display: block;
    position: absolute;
    top: 50%;
    left: 50%;
    width: 40px;
    height: 40px;
    margin: -20px 0 0 -20px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #0073aa;
    border-radius: 50%;
    animation: pdf-spinner 1s linear infinite;
    z-index: -1;
}

@keyframes pdf-spinner {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}
