/* Styles pour la modale d'aperçu des produits téléchargeables - ISOLÉS */

#productPreviewModal {
    backdrop-filter: blur(4px);
    animation: product-preview-fadeIn 0.3s ease-out;
}

/* Styles pour les aperçus limités */
.preview-limited {
    position: relative;
    overflow: hidden;
}

.preview-limited::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, transparent 40%, rgba(255,255,255,0.1) 50%, transparent 60%);
    background-size: 20px 20px;
    animation: product-preview-shimmer 2s infinite;
    pointer-events: none;
    z-index: 1;
}

@keyframes product-preview-shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

/* Badge d'aperçu limité */
.preview-badge {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    box-shadow: 0 2px 8px rgba(239, 68, 68, 0.3);
    animation: product-preview-pulse-badge 2s infinite;
}

@keyframes product-preview-pulse-badge {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

/* Overlay d'information */
.preview-overlay {
    background: linear-gradient(135deg, rgba(0,0,0,0.8) 0%, rgba(0,0,0,0.6) 100%);
    backdrop-filter: blur(2px);
    border: 1px solid rgba(255,255,255,0.1);
}

/* Bouton d'achat amélioré */
.buy-button {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
    transition: all 0.3s ease;
}

.buy-button:hover {
    background: linear-gradient(135deg, #059669 0%, #047857 100%);
    box-shadow: 0 6px 20px rgba(16, 185, 129, 0.4);
    transform: translateY(-2px);
}

/* Notification d'information */
.preview-notification {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
    animation: product-preview-slideInRight 0.3s ease-out;
}

@keyframes product-preview-slideInRight {
    from {
        opacity: 0;
        transform: translateX(100%);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

#productPreviewModal .bg-white {
    animation: product-preview-slideIn 0.3s ease-out;
}

@keyframes product-preview-fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes product-preview-slideIn {
    from { 
        opacity: 0;
        transform: scale(0.95) translateY(-20px);
    }
    to { 
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

/* Styles pour les onglets */
#previewTabs .flex button {
    position: relative;
    transition: all 0.2s ease;
}

#previewTabs .flex button:hover {
    background-color: rgba(59, 130, 246, 0.05);
}

#previewTabs .flex button.border-accent {
    background-color: white;
    box-shadow: 0 -2px 0 0 #3b82f6;
}

/* Styles pour le contenu de prévisualisation */
#previewContent {
    min-height: 400px;
}

#previewContent img {
    max-height: 500px;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

#previewContent video {
    max-height: 500px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

#previewContent audio {
    width: 100%;
    max-width: 400px;
}

#previewContent iframe {
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

#previewContent pre {
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    line-height: 1.5;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* Styles pour les icônes de fichiers */
.fa-file-pdf { color: #dc2626; }
.fa-file-word { color: #2563eb; }
.fa-file-text { color: #059669; }
.fa-file-image { color: #7c3aed; }
.fa-file-video { color: #ea580c; }
.fa-file-audio { color: #0891b2; }
.fa-file-archive { color: #ca8a04; }

/* Styles pour le bouton d'aperçu */
.preview-button {
    background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.preview-button:hover {
    background: linear-gradient(135deg, #2563eb 0%, #1e40af 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(59, 130, 246, 0.4);
}

/* Styles pour les messages d'état */
.preview-message {
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

/* Responsive design */
@media (max-width: 640px) {
    #productPreviewModal .bg-white {
        margin: 0.5rem;
        max-height: calc(100vh - 1rem);
        border-radius: 0.75rem;
    }
    
    #previewTabs .flex {
        padding: 0 0.5rem;
        scrollbar-width: none;
        -ms-overflow-style: none;
    }
    
    #previewTabs .flex::-webkit-scrollbar {
        display: none;
    }
    
    #previewTabs .flex button {
        font-size: 0.75rem;
        padding: 0.5rem 0.75rem;
        min-width: auto;
    }
    
    #previewContent {
        padding: 0.75rem;
        min-height: 250px;
    }
    
    #previewContent img,
    #previewContent video {
        max-height: 250px;
    }
    
    /* Améliorer les interactions tactiles */
    #previewTabs .flex button {
        touch-action: manipulation;
        -webkit-tap-highlight-color: transparent;
    }
    
    /* Optimiser les badges et overlays pour mobile */
    .preview-badge {
        font-size: 0.625rem;
        padding: 0.25rem 0.5rem;
    }
    
    .preview-overlay {
        padding: 0.5rem;
    }
    
    .preview-overlay p {
        font-size: 0.625rem;
        line-height: 1.2;
    }
    
    /* Améliorer les boutons sur mobile */
    .buy-button {
        min-height: 44px; /* Taille minimale recommandée pour les touches tactiles */
        touch-action: manipulation;
    }
    
    /* Optimiser les notifications pour mobile */
    .preview-notification {
        font-size: 0.75rem;
        max-width: calc(100vw - 1rem);
        word-wrap: break-word;
    }
}

/* Améliorations pour les écrans moyens */
@media (min-width: 641px) and (max-width: 1024px) {
    #productPreviewModal .bg-white {
        margin: 1rem;
        max-height: calc(100vh - 2rem);
    }
    
    #previewContent {
        padding: 1.5rem;
    }
    
    #previewContent img,
    #previewContent video {
        max-height: 400px;
    }
}

/* Masquer les scrollbars sur mobile */
.scrollbar-hide {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

.scrollbar-hide::-webkit-scrollbar {
    display: none;
}

/* Styles pour les barres de défilement personnalisées */
#previewContent::-webkit-scrollbar {
    width: 6px;
}

#previewContent::-webkit-scrollbar-track {
    background: #f1f5f9;
    border-radius: 3px;
}

#previewContent::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 3px;
}

#previewContent::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* Animation pour le chargement */
.loading-spinner {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* Styles pour les états d'erreur et d'avertissement */
.preview-error {
    background: linear-gradient(135deg, #fef2f2 0%, #fee2e2 100%);
    border: 1px solid #fecaca;
}

.preview-warning {
    background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%);
    border: 1px solid #fed7aa;
}

/* Amélioration de l'accessibilité */
#productPreviewModal button:focus {
    outline: 2px solid #3b82f6;
    outline-offset: 2px;
}

#productPreviewModal button:focus:not(:focus-visible) {
    outline: none;
}

/* Styles pour les transitions fluides */
.preview-transition {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Styles pour les ombres et effets */
.preview-shadow {
    box-shadow: 0 10px 25px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

.preview-shadow-lg {
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}
