/* Styles pour le composant ImageUploader */

/* =================
   GALERIE D'IMAGES MODERNE
   ================= */

/* Container principal d'upload */
.image-upload-container {
    border: 3px dashed #ddd;
    border-radius: 12px;
    padding: 40px 20px;
    text-align: center;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    transition: all 0.3s ease;
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.image-upload-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.4), transparent);
    transition: left 0.6s ease;
}

.image-upload-container:hover {
    border-color: #007bff;
    background: linear-gradient(135deg, #e3f2fd 0%, #bbdefb 100%);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0,123,255,0.15);
}

.image-upload-container:hover::before {
    left: 100%;
}

.image-upload-container.dragover {
    border-color: #28a745;
    background: linear-gradient(135deg, #e8f5e8 0%, #c8e6c9 100%);
    transform: scale(1.02);
    box-shadow: 0 12px 35px rgba(40,167,69,0.2);
}

.upload-icon {
    font-size: 4rem;
    color: #6c757d;
    margin-bottom: 1rem;
    transition: all 0.3s ease;
}

.image-upload-container:hover .upload-icon {
    color: #007bff;
    transform: scale(1.1) rotate(5deg);
}

.image-upload-container.dragover .upload-icon {
    color: #28a745;
    animation: bounce 0.6s ease infinite alternate;
}

@keyframes bounce {
    from { transform: translateY(0) scale(1.1); }
    to { transform: translateY(-10px) scale(1.2); }
}

.upload-button {
    background: linear-gradient(135deg, #007bff, #0056b3);
    border: none;
    color: white;
    padding: 12px 24px;
    border-radius: 25px;
    font-weight: 500;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0,123,255,0.3);
}

.upload-button:hover {
    background: linear-gradient(135deg, #0056b3, #004085);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0,123,255,0.4);
}

/* Statistiques d'upload */
.upload-stats {
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.upload-stats .card {
    border: none;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
    border-radius: 12px;
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
}

.upload-stats .progress {
    background-color: #e9ecef;
    border-radius: 10px;
    overflow: hidden;
}

.upload-stats .progress-bar {
    background: linear-gradient(90deg, #007bff, #28a745);
    transition: width 0.3s ease;
}

/* Container de prévisualisation */
.image-preview-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 20px;
    margin-top: 20px;
    padding: 20px 0;
}

/* Items de prévisualisation */
.image-preview-item {
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
    overflow: hidden;
    transition: all 0.3s ease;
    position: relative;
    animation: fadeInScale 0.5s ease;
}

@keyframes fadeInScale {
    from {
        opacity: 0;
        transform: scale(0.8) translateY(20px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.image-preview-item:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 40px rgba(0,0,0,0.15);
}

.image-preview-item.upload-success {
    animation: successPulse 1s ease;
}

@keyframes successPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); box-shadow: 0 15px 45px rgba(40,167,69,0.3); }
}

.image-preview-item.upload-error {
    border: 2px solid #dc3545;
    animation: errorShake 0.5s ease;
}

@keyframes errorShake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

/* Container d'image */
.image-container {
    position: relative;
    width: 100%;
    height: 140px;
    overflow: hidden;
    border-radius: 12px 12px 0 0;
}

.image-preview {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.image-preview-item:hover .image-preview {
    transform: scale(1.1);
}

/* Overlay avec boutons */
.image-overlay {
    position: absolute;
    top: 0;
    right: 0;
    left: 0;
    bottom: 0;
    background: linear-gradient(45deg, transparent 0%, rgba(0,0,0,0.1) 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
    display: flex;
    align-items: flex-start;
    justify-content: flex-end;
    padding: 8px;
}

.image-preview-item:hover .image-overlay {
    opacity: 1;
}

.remove-btn {
    background: rgba(220,53,69,0.9);
    border: none;
    color: white;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.remove-btn:hover {
    background: #dc3545;
    transform: scale(1.1);
    box-shadow: 0 4px 15px rgba(220,53,69,0.4);
}

/* Informations de l'image */
.image-info {
    padding: 12px;
    background: white;
}

.image-name {
    font-weight: 600;
    font-size: 0.85rem;
    color: #333;
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.image-size {
    font-size: 0.75rem;
    color: #6c757d;
}

/* Barre de progression */
.progress-container {
    padding: 8px 12px 12px;
    background: white;
}

.progress {
    height: 6px;
    background-color: #e9ecef;
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 6px;
}

.progress-bar {
    background: linear-gradient(90deg, #007bff, #28a745);
    height: 100%;
    border-radius: 10px;
    transition: width 0.3s ease;
    position: relative;
    overflow: hidden;
}

.progress-bar::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    right: 0;
    background-image: linear-gradient(45deg, 
        rgba(255,255,255,0.2) 25%, 
        transparent 25%, 
        transparent 50%, 
        rgba(255,255,255,0.2) 50%, 
        rgba(255,255,255,0.2) 75%, 
        transparent 75%, 
        transparent);
    background-size: 20px 20px;
    animation: progressStripes 1s linear infinite;
}

@keyframes progressStripes {
    0% { background-position: 0 0; }
    100% { background-position: 20px 0; }
}

.progress-text {
    text-align: center;
    font-size: 0.75rem;
    font-weight: 600;
    color: #007bff;
}

/* Status badges */
.upload-status {
    padding: 0 12px 12px;
    text-align: center;
}

.status-badge {
    font-size: 0.7rem;
    font-weight: 600;
    padding: 4px 8px;
    border-radius: 12px;
    border: none;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    transition: all 0.3s ease;
}

.status-badge.bg-info {
    background: linear-gradient(135deg, #17a2b8, #138496) !important;
}

.status-badge.bg-primary {
    background: linear-gradient(135deg, #007bff, #0056b3) !important;
}

.status-badge.bg-success {
    background: linear-gradient(135deg, #28a745, #1e7e34) !important;
}

.status-badge.bg-danger {
    background: linear-gradient(135deg, #dc3545, #c82333) !important;
}

/* Messages d'erreur */
.error-message {
    margin-top: 10px;
}

.error-message > div {
    background: linear-gradient(135deg, #f8d7da, #f5c6cb);
    color: #721c24;
    padding: 10px 15px;
    border-radius: 8px;
    border-left: 4px solid #dc3545;
    margin-bottom: 8px;
    animation: slideInRight 0.3s ease;
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Champ de fichier caché */
.file-input-hidden,
.hidden-input-field {
    position: absolute;
    left: -9999px;
    opacity: 0;
    pointer-events: none;
}

/* Images existantes */
#existingImagesContainer .position-relative {
    transition: all 0.3s ease;
    border-radius: 12px;
    overflow: hidden;
}

#existingImagesContainer .position-relative:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
}

#existingImagesContainer img {
    border-radius: 12px;
    transition: transform 0.3s ease;
}

#existingImagesContainer .position-relative:hover img {
    transform: scale(1.05);
}

/* Drag & Drop pour réorganisation */
.sortable-ghost {
    opacity: 0.5;
    transform: scale(0.95);
}

.sortable-chosen {
    box-shadow: 0 8px 25px rgba(0,123,255,0.3);
}

.sortable-drag {
    transform: rotate(5deg);
    box-shadow: 0 15px 35px rgba(0,0,0,0.2);
}

/* Responsive */
@media (max-width: 768px) {
    .image-preview-container {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
        gap: 15px;
    }
    
    .image-container {
        height: 120px;
    }
    
    .image-upload-container {
        padding: 30px 15px;
    }
    
    .upload-icon {
        font-size: 3rem;
    }
}

@media (max-width: 576px) {
    .image-preview-container {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
    
    .image-container {
        height: 100px;
    }
    
    .upload-stats .row {
        text-align: center;
    }
    
    .upload-stats .col-auto {
        margin-top: 10px;
    }
}

/* Animations globales */
* {
    box-sizing: border-box;
}

.fade-in {
    animation: fadeIn 0.5s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.slide-up {
    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Mode sombre (optionnel) */
@media (prefers-color-scheme: dark) {
    .image-upload-container {
        background: linear-gradient(135deg, #343a40 0%, #495057 100%);
        border-color: #495057;
        color: #f8f9fa;
    }
    
    .image-upload-container:hover {
        border-color: #adb5bd;
    }
    
    .image-info {
        background: linear-gradient(135deg, #495057 0%, #343a40 100%);
        border-color: #495057;
        color: #adb5bd;
    }
    
    .image-info .file-name {
        color: #f8f9fa;
    }
} 