/**
 * Visual Search — camera trigger, upload modal, results page.
 * Follows the conventions in components/auth-modal.css (#1a1a1a text,
 * #666 secondary, 12px radius, blurred dark backdrop).
 */

/* ------------------------------------------------ trigger (search overlay) */

.vs-trigger {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.5rem;
    height: 2.5rem;
    flex: 0 0 auto;
    margin-inline-start: 0.5rem;
    padding: 0;
    background: none;
    border: 1px solid rgba(26, 26, 26, 0.25);
    border-radius: 50%;
    color: #1a1a1a;
    cursor: pointer;
    transition: all 0.2s;
}

.vs-trigger:hover,
.vs-trigger:focus-visible {
    border-color: #1a1a1a;
    background: #f5f5f5;
}

.vs-trigger:active { transform: scale(0.94); }

/* ------------------------------------------------------------------ modal */

.vs-modal {
    position: fixed;
    inset: 0;
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.vs-modal[hidden] { display: none; }

.vs-modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
}

.vs-modal__panel {
    position: relative;
    width: 100%;
    max-width: 26rem;
    background: #fff;
    border-radius: 12px;
    padding: 2rem 1.75rem 1.75rem;
    text-align: center;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.25);
}

.vs-modal__close {
    position: absolute;
    top: 0.75rem;
    inset-inline-end: 0.75rem;
    width: 2rem;
    height: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    line-height: 1;
    background: none;
    border: none;
    border-radius: 50%;
    color: #666;
    cursor: pointer;
    transition: all 0.2s;
}

.vs-modal__close:hover { background: #f5f5f5; color: #1a1a1a; }

.vs-modal__title {
    font-family: 'Canela Text', Georgia, serif;
    font-size: 1.5rem;
    font-weight: 400;
    color: #1a1a1a;
    margin: 0 0 0.5rem;
}

.vs-modal__hint {
    font-size: 0.875rem;
    line-height: 1.5;
    color: #666;
    margin: 0 0 1.5rem;
}

.vs-modal__actions {
    display: flex;
    flex-direction: column;
    gap: 0.625rem;
}

.vs-modal__action {
    display: block;
    padding: 0.875rem 1rem;
    background: #1a1a1a;
    color: #fff;
    border-radius: 8px;
    font-size: 0.9375rem;
    cursor: pointer;
    transition: all 0.2s;
}

.vs-modal__action:hover { background: #333; }

.vs-modal__action--secondary {
    background: #fff;
    color: #1a1a1a;
    border: 1px solid #ebebeb;
}

.vs-modal__action--secondary:hover { background: #f5f5f5; }

/* ------------------------------------------------------- working / scanning */

.vs-modal__preview {
    position: relative;
    width: 100%;
    max-height: 16rem;
    overflow: hidden;
    border-radius: 8px;
    background: #f5f5f5;
}

.vs-modal__preview img {
    display: block;
    width: 100%;
    max-height: 16rem;
    object-fit: contain;
}

.vs-modal__scan {
    position: absolute;
    inset-inline: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, #1a1a1a, transparent);
    animation: vsScan 1.8s ease-in-out infinite;
}

@keyframes vsScan {
    0%   { top: 0; opacity: 0; }
    12%  { opacity: 1; }
    88%  { opacity: 1; }
    100% { top: 100%; opacity: 0; }
}

@media (prefers-reduced-motion: reduce) {
    .vs-modal__scan { animation: none; top: 50%; opacity: 0.5; }
}

.vs-modal__status {
    margin: 1rem 0 0;
    font-size: 0.875rem;
    color: #666;
}

.vs-modal__error {
    margin: 1rem 0 0;
    font-size: 0.875rem;
    line-height: 1.5;
    color: #e53935;
}
