/* Styles pour l'upload de photos */

.photo-upload-container {
    border: 2px dashed #ddd;
    border-radius: 8px;
    padding: 20px;
    background-color: #f9f9f9;
}

.photo-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    border-bottom: 1px solid #ddd;
}

.photo-tab {
    background: none;
    border: none;
    padding: 10px 15px;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    transition: all 0.3s ease;
    font-size: 14px;
}

.photo-tab:hover {
    background-color: #f0f0f0;
}

.photo-tab.active {
    border-bottom-color: #3498db;
    background-color: #e8f4f8;
    color: #3498db;
}

.photo-tab-content {
    display: none;
}

.photo-tab-content.active {
    display: block;
}

/* Zone d'upload de fichier */
.file-upload-area {
    text-align: center;
}

.file-upload-box {
    border: 2px dashed #3498db;
    border-radius: 8px;
    padding: 40px 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    background-color: white;
}

.file-upload-box:hover {
    border-color: #2980b9;
    background-color: #f8f9fa;
}

.file-upload-box i {
    font-size: 48px;
    color: #3498db;
    margin-bottom: 15px;
    display: block;
}

.file-upload-box p {
    margin: 10px 0;
    font-size: 16px;
    color: #333;
}

.file-upload-box small {
    color: #666;
    font-size: 12px;
}

.file-preview {
    margin-top: 20px;
    position: relative;
    display: inline-block;
}

.file-preview img {
    max-width: 200px;
    max-height: 200px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

/* Zone webcam */
.webcam-container {
    text-align: center;
}

.webcam-container video {
    max-width: 100%;
    max-height: 300px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.webcam-controls {
    margin: 15px 0;
}

.webcam-controls button {
    margin: 0 5px;
}

.webcam-preview {
    margin-top: 20px;
    position: relative;
    display: inline-block;
}

.webcam-preview img {
    max-width: 200px;
    max-height: 200px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

/* Zone URL */
.url-preview {
    margin-top: 15px;
    text-align: center;
}

.url-preview img {
    max-width: 200px;
    max-height: 200px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

/* Photo actuelle (pour l'édition) */
.current-photo {
    margin-bottom: 20px;
    padding: 15px;
    background-color: #e8f5e8;
    border-radius: 8px;
    border: 1px solid #c3e6c3;
}

.current-photo label {
    font-weight: bold;
    color: #27ae60;
    margin-bottom: 10px;
    display: block;
}

.current-photo-display {
    position: relative;
    display: inline-block;
}

.current-photo-img {
    max-width: 150px;
    max-height: 150px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

/* Bouton de suppression */
.btn-remove {
    position: absolute;
    top: -8px;
    right: -8px;
    background-color: #e74c3c;
    color: white;
    border: none;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    cursor: pointer;
    font-size: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
    transition: all 0.3s ease;
}

.btn-remove:hover {
    background-color: #c0392b;
    transform: scale(1.1);
}

/* Responsive */
@media (max-width: 768px) {
    .photo-tabs {
        flex-direction: column;
        gap: 5px;
    }
    
    .photo-tab {
        text-align: center;
        border-bottom: none;
        border-left: 3px solid transparent;
    }
    
    .photo-tab.active {
        border-left-color: #3498db;
        border-bottom-color: transparent;
    }
    
    .file-upload-box {
        padding: 30px 15px;
    }
    
    .file-upload-box i {
        font-size: 36px;
    }
    
    .webcam-container video {
        max-height: 250px;
    }
}

/* Animation pour les aperçus */
.file-preview, .webcam-preview, .url-preview {
    animation: fadeIn 0.3s ease-in;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Style pour les messages d'erreur */
.photo-error {
    color: #e74c3c;
    font-size: 12px;
    margin-top: 5px;
    display: block;
}

/* Style pour les messages de succès */
.photo-success {
    color: #27ae60;
    font-size: 12px;
    margin-top: 5px;
    display: block;
}

/* Styles pour l'affichage des photos dans les vues */
.animal-photo-section {
    text-align: center;
    margin-bottom: 15px;
}

.animal-photo-img {
    max-width: 200px;
    max-height: 200px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    object-fit: cover;
}

.animal-photo-placeholder {
    width: 200px;
    height: 200px;
    border: 2px dashed #ddd;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #999;
    background-color: #f9f9f9;
    margin: 0 auto;
}

.animal-photo-placeholder i {
    font-size: 48px;
    margin-bottom: 10px;
}

.animal-photo-placeholder span {
    font-size: 14px;
}

/* Photos dans les cartes d'animaux */
.animal-card .animal-photo-section {
    margin-bottom: 0;
    padding: 15px;
    background-color: #f8f9fa;
    border-radius: 8px 8px 0 0;
}

.animal-card-photo {
    width: 100%;
    height: 150px;
    object-fit: cover;
    border-radius: 4px;
}

.animal-card .animal-photo-placeholder {
    width: 100%;
    height: 150px;
    margin: 0;
}

.animal-card .animal-photo-placeholder i {
    font-size: 36px;
}

/* Responsive pour les photos */
@media (max-width: 768px) {
    .animal-photo-img {
        max-width: 150px;
        max-height: 150px;
    }
    
    .animal-photo-placeholder {
        width: 150px;
        height: 150px;
    }
    
    .animal-card-photo {
        height: 120px;
    }
    
    .animal-card .animal-photo-placeholder {
        height: 120px;
    }
}
