/* Couleurs de secours si --primary (style.css) n’est pas chargé sur la page */
.vs-section {
    --vs-accent: var(--primary, #0aa61f);
}

.visual-search {
    padding: 40px 0;
    background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);
}

.upload-zone {
    width: 100%;
    max-width: 600px;
    margin: 0 auto;
    padding: 30px;
    background: #fff;
    border-radius: 15px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.08);
    text-align: center;
}

.vs-title-wrapper {
    position: relative;
    display: inline-block;
    padding: 0 20px;
}

.vs-title {
    font-size: 2rem;
    font-weight: 600;
    color: var(--vs-accent);
    margin: 0;
    padding: 0;
    position: relative;
    z-index: 2;
}

.vs-title i {
    font-size: 1.5rem;
    opacity: 0.8;
}

.vs-title-line {
    position: absolute;
    bottom: 5px;
    left: 0;
    right: 0;
    height: 8px;
    background: var(--vs-accent);
    opacity: 0.1;
    border-radius: 4px;
}

.drop-zone-vs {
    border: 2px dashed #dee2e6;
    border-radius: 1rem;
    padding: 3rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    background: white;
    max-width: 600px;
    margin: 0 auto;
}

.drop-zone-vs:hover,
.drop-zone-vs.dragover {
    border-color: var(--vs-accent);
    background-color: #f8f9fa;
    transform: translateY(-2px);
    box-shadow: 0 .5rem 1rem rgba(0,0,0,.08);
}

.drop-zone-content-vs {
    max-width: 400px;
    margin: 0 auto;
}

#visual-search-form .vs-drop-label {
    display: block;
    width: 100%;
    cursor: pointer;
    margin: 0;
}

.drop-zone-vs i {
    font-size: 3rem;
    color: var(--vs-accent);
    margin-bottom: 15px;
    transition: transform 0.3s ease;
}

.drop-zone-vs:hover i {
    transform: translateY(-5px);
}

.drop-zone-vs p {
    margin: 0;
    color: #666;
}

.preview-container-vs {
    display: none;
    margin-top: 2rem;
}

.preview-container-vs.active {
    display: block;
    animation: fadeIn 0.5s ease;
}

.image-preview-vs {
    max-width: 400px;
    margin: 2rem auto;
    box-shadow: 0 .5rem 1.5rem rgba(0,0,0,.1);
}

.image-preview-vs img {
    width: 100%;
    height: auto;
    display: block;
}

.loading-spinner-vs {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255,255,255,0.9);
    z-index: 1000;
    justify-content: center;
    align-items: center;
}

.loading-spinner-vs.active {
    display: flex;
}

.vs-form-control-vs:focus {
    border-color: var(--vs-accent);
    box-shadow: 0 0 0 0.15rem rgba(10, 166, 31, 0.18);
}

.vs-input-group {
    margin-bottom: 1rem;
}

.vs-input-group-text {
    background-color: var(--vs-accent);
    color: white;
    border: none;
    padding: 0.5rem 0.75rem;
}

.vs-btn {
    padding: 0.6rem 1.5rem;
    font-weight: 500;
    transition: all 0.2s ease;
    border-radius: 0.25rem;
}

.vs-btn-primary {
    background: var(--vs-accent);
    color: #fff;
    border: none;
}

.vs-btn-primary:hover:not(:disabled) {
    opacity: 0.92;
    color: #fff;
}

.vs-btn-primary:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

.vs-btn-primary.vs-needs-file:not(:disabled) {
    opacity: 0.88;
}

.vs-submit-hint {
    font-size: 0.875rem;
    color: #6c757d;
    margin-bottom: 0.75rem;
}

.vs-card {
    background: white;
    border-radius: 0.5rem;
    padding: 1.5rem;
    margin-bottom: 1rem;
    box-shadow: 0 0.25rem 0.5rem rgba(0,0,0,.05);
}

.vs-alert {
    border: none;
    border-radius: 0.5rem;
    padding: 1rem;
    margin-bottom: 1rem;
}

.vs-alert-success {
    background-color: #d4edda;
    color: #155724;
}

.vs-alert-danger {
    background-color: #f8d7da;
    color: #721c24;
}

.vs-alert i {
    font-size: 1.25rem;
    margin-right: 0.5rem;
}

@keyframes slideIn {
    from { 
        opacity: 0;
        transform: translateY(-20px);
    }
    to { 
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    from { 
        opacity: 0;
        transform: translateY(10px);
    }
    to { 
        opacity: 1;
        transform: translateY(0);
    }
}

.similar-products {
    margin-top: 40px;
    display: none;
}

.similar-products.active {
    display: block;
}

.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.product-card {
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 3px 10px rgba(0,0,0,0.1);
    transition: transform 0.3s ease;
}

.product-card:hover {
    transform: translateY(-5px);
}

.product-image {
    width: 100%;
    height: 200px;
    object-fit: cover;
}

.product-info {
    padding: 15px;
}

.product-name {
    font-size: 1rem;
    margin: 0 0 10px;
    color: #333;
}

.product-price {
    font-weight: bold;
    color: var(--burkina-green);
}

.similarity-score {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(52, 199, 89, 0.9);
    color: white;
    padding: 4px 8px;
    border-radius: 20px;
    font-size: 0.8rem;
}

/* Animation pour le chargement */
@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); }
}

.loading .drop-zone i {
    animation: pulse 1.5s infinite;
}
