/* ===================================
   COMPOSANT D'UPLOAD DE PHOTOS DEVIS
   =================================== */

.photo-upload-container {
    margin: 1.5rem 0;
    padding: 0;
}

.photo-upload-label {
    font-family: 'Montserrat', 'Segoe UI', sans-serif;
    font-weight: 500;
    font-size: 0.95rem;
    color: #374151;
    margin-bottom: 0.75rem;
    display: block;
}

.photo-upload-label i {
    margin-right: 0.5rem;
    color: #6b7280;
}

.photo-upload-zone {
    position: relative;
    border: 2px dashed #cbd5e0;
    border-radius: 12px;
    padding: 2rem;
    text-align: center;
    background: linear-gradient(135deg, #f9fafb 0%, #f3f4f6 100%);
    transition: all 0.3s ease;
    cursor: pointer;
    overflow: hidden;
}

.photo-upload-zone:hover {
    border-color: #3b82f6;
    background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.15);
}

.photo-upload-zone.dragover {
    border-color: #10b981;
    background: linear-gradient(135deg, #ecfdf5 0%, #d1fae5 100%);
    transform: scale(1.02);
}

.photo-upload-input {
    position: absolute;
    top: 0;
    left: 0;
    width: 0;
    height: 0;
    opacity: 0;
    pointer-events: none;
}

.photo-upload-icon {
    font-size: 3rem;
    color: #9ca3af;
    margin-bottom: 1rem;
    display: block;
    transition: all 0.3s ease;
}

.photo-upload-zone:hover .photo-upload-icon {
    color: #3b82f6;
    transform: scale(1.1);
}

.photo-upload-text {
    font-family: 'Montserrat', sans-serif;
    font-weight: 700;
    color: #FF6B35;
    font-size: 1rem;
    margin-bottom: 0.5rem;
    text-transform: uppercase;
}

.photo-upload-hint {
    font-family: 'Montserrat', sans-serif;
    font-size: 0.85rem;
    color: #6b7280;
    margin-top: 0.5rem;
}

.photo-upload-hint strong {
    color: #374151;
    font-weight: 600;
}

/* Prévisualisation de l'image */
.photo-preview-container {
    position: relative;
    margin-top: 1rem;
    display: none;
    animation: fadeInScale 0.4s ease;
}

.photo-preview-container.active {
    display: block;
}

@keyframes fadeInScale {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.photo-preview-wrapper {
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    background: #fff;
}

.photo-preview-image {
    width: 100%;
    max-height: 300px;
    object-fit: contain;
    display: block;
    background: #f9fafb;
}

.photo-preview-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(to bottom, rgba(0,0,0,0.5) 0%, rgba(0,0,0,0) 50%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.photo-preview-wrapper:hover .photo-preview-overlay {
    opacity: 1;
}

.photo-preview-actions {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    display: flex;
    gap: 0.5rem;
    z-index: 10;
}

.photo-preview-btn {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    border: none;
    background: rgba(255, 255, 255, 0.95);
    color: #374151;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    transition: all 0.2s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.photo-preview-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.photo-preview-btn.delete {
    background: rgba(239, 68, 68, 0.95);
    color: #fff;
}

.photo-preview-btn.delete:hover {
    background: #dc2626;
}

.photo-preview-info {
    padding: 0.75rem 1rem;
    background: #f9fafb;
    border-top: 1px solid #e5e7eb;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-family: 'Montserrat', sans-serif;
    font-size: 0.85rem;
    color: #6b7280;
}

.photo-preview-filename {
    font-weight: 500;
    color: #374151;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 70%;
}

.photo-preview-size {
    font-weight: 400;
    color: #9ca3af;
}

/* Badge optionnel */
.photo-optional-badge {
    display: inline-block;
    margin-left: 0.5rem;
    padding: 0.15rem 0.5rem;
    background: #e0f2fe;
    color: #0369a1;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

/* États de chargement */
.photo-upload-loading {
    position: relative;
}

.photo-upload-loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 40px;
    height: 40px;
    border: 4px solid #e5e7eb;
    border-top-color: #3b82f6;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: translate(-50%, -50%) rotate(360deg); }
}

/* Message d'erreur */
.photo-upload-error {
    margin-top: 0.75rem;
    padding: 0.75rem 1rem;
    background: #fef2f2;
    border-left: 4px solid #ef4444;
    border-radius: 6px;
    color: #991b1b;
    font-size: 0.875rem;
    font-family: 'Montserrat', sans-serif;
    display: none;
}

.photo-upload-error.active {
    display: block;
    animation: shake 0.4s ease;
}

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

.photo-upload-error i {
    margin-right: 0.5rem;
}

/* Boutons mobile : Galerie / Caméra */
.photo-mobile-btns {
    display: none;
    gap: 0.75rem;
    justify-content: center;
    flex-wrap: wrap;
    margin: 0.5rem 0 0.25rem;
}

.photo-mobile-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.65rem 1.2rem;
    border-radius: 25px;
    border: 2px solid;
    font-family: 'Montserrat', sans-serif;
    font-size: 0.88rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
    -webkit-tap-highlight-color: transparent;
    user-select: none;
}

.photo-btn-gallery {
    background: #eff6ff;
    border-color: #3b82f6;
    color: #1d4ed8;
}

.photo-btn-gallery:hover,
.photo-btn-gallery:active {
    background: #3b82f6;
    color: #fff;
}

.photo-btn-camera {
    background: #f0fdf4;
    border-color: #22c55e;
    color: #15803d;
}

.photo-btn-camera:hover,
.photo-btn-camera:active {
    background: #22c55e;
    color: #fff;
}

/* Responsive */
@media (max-width: 768px) {
    .photo-upload-zone {
        padding: 1.5rem 1rem;
    }
    
    .photo-upload-icon {
        font-size: 2.5rem;
    }
    
    .photo-upload-text {
        font-size: 0.9rem;
    }
    
    .photo-upload-hint {
        font-size: 0.8rem;
    }
    
    .photo-preview-image {
        max-height: 200px;
    }
    
    .photo-preview-btn {
        width: 32px;
        height: 32px;
        font-size: 0.9rem;
    }
}

/* Animation de succès */
@keyframes successPulse {
    0% {
        box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
    }
    70% {
        box-shadow: 0 0 0 10px rgba(16, 185, 129, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(16, 185, 129, 0);
    }
}

.photo-upload-zone.success {
    border-color: #10b981;
    background: linear-gradient(135deg, #ecfdf5 0%, #d1fae5 100%);
    animation: successPulse 0.6s ease;
}

/* Affichage de la photo dans le modal de visualisation */
.photo-display-container {
    margin-top: 1rem;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.photo-display-image {
    width: 100%;
    max-height: 400px;
    object-fit: contain;
    display: block;
    background: #f9fafb;
    cursor: pointer;
    transition: transform 0.3s ease;
}

.photo-display-image:hover {
    transform: scale(1.02);
}

.photo-lightbox {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.95);
    z-index: 10000;
    display: none;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    animation: fadeIn 0.3s ease;
}

.photo-lightbox.active {
    display: flex;
}

.photo-lightbox-image {
    max-width: 90%;
    max-height: 90%;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.photo-lightbox-close {
    position: absolute;
    top: 2rem;
    right: 2rem;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.9);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: #374151;
    transition: all 0.2s ease;
}

.photo-lightbox-close:hover {
    background: #fff;
    transform: scale(1.1);
}

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

/* Indicateur de compression */
.compression-indicator {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(59, 130, 246, 0.95);
    color: #fff;
    padding: 0.75rem 1.25rem;
    border-radius: 8px;
    font-family: 'Montserrat', sans-serif;
    font-size: 0.9rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    z-index: 100;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.compression-indicator i {
    font-size: 1rem;
}

/* Message de succès de compression */
.compression-success {
    position: absolute;
    bottom: 1rem;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(16, 185, 129, 0.95);
    color: #fff;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    font-family: 'Montserrat', sans-serif;
    font-size: 0.85rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    z-index: 100;
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.3);
    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

.compression-success i {
    font-size: 1rem;
}
