/* ═══════════════════════════════════════════════════════════════
   AVM Visual Matcher — CSS v2.2.2
   Diseño: Buscador visual con título morado, drop zone lavanda,
           botón magenta, card blanco con sombra suave.
   ═══════════════════════════════════════════════════════════════ */

:root {
    --avm-purple: #6d288a;
    /* morado titulos */
    --avm-magenta: #7c2d8e;
    /* botón */
    --avm-magenta-h: #5e1f70;
    --avm-lavender: #f3eef8;
    /* fondo drop zone */
    --avm-lavender-b: #c4a9d8;
    /* borde punteado */
    --avm-card-bg: #ffffff;
    --avm-card-border: #f0e8f5;
    --avm-card-shadow: 0 4px 24px rgba(108, 40, 138, .10);
    --avm-radius: 18px;
    --avm-text-muted: #6b6b7b;
}

/* ── Wrapper externo ─────────────────────────────────────────── */
.avm-search-outer {
    max-width: 780px;
    margin: 0 auto;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* ── Cabecera (fuera del card) ───────────────────────────────── */
.avm-search-header {
    text-align: center;
    margin-bottom: 24px;
}

.avm-search-header h3 {
    font-size: 2.2rem !important;
    font-weight: 800 !important;
    color: var(--avm-purple) !important;
    margin: 0 0 12px !important;
    line-height: 1.2 !important;
}

.avm-search-header p {
    color: var(--avm-text-muted) !important;
    font-size: 1.1rem !important;
    margin: 0 !important;
    line-height: 1.6 !important;
}

/* ── Card blanco ─────────────────────────────────────────────── */
.avm-search-card {
    background: var(--avm-card-bg);
    border: 1px solid var(--avm-card-border);
    border-radius: var(--avm-radius);
    padding: 28px 28px 24px;
    box-shadow: var(--avm-card-shadow);
}

/* ── Drop zone wrapper (posición relativa para el input) ──────── */
.avm-drop-wrap {
    position: relative;
    margin-bottom: 24px;
}

/* Input nativo invisible que cubre todo el drop zone */
.avm-file-input {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
    z-index: 2;
    font-size: 0;
    /* evita que el texto "Seleccionar archivo" sea visible */
}

/* ── Drop zone visual ────────────────────────────────────────── */
.avm-drop-zone {
    background: var(--avm-lavender);
    border: 2.5px dashed var(--avm-lavender-b);
    border-radius: 14px;
    padding: 52px 28px;
    text-align: center;
    transition: border-color .2s, background .2s;
    min-height: 180px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
}

.avm-drop-zone.dragging,
.avm-drop-zone:hover {
    border-color: var(--avm-purple);
    background: #ebe3f5;
}

/* Icono de subida */
.avm-upload-icon {
    font-size: 42px !important;
    width: 42px !important;
    height: 42px !important;
    color: #a08cb8;
    display: block;
}

#avm-upload-text {
    color: var(--avm-text-muted) !important;
    font-size: 1.05rem !important;
    margin: 0 !important;
}

/* Preview de imagen seleccionada */
.avm-preview-img {
    max-width: 200px;
    max-height: 160px;
    border-radius: 10px;
    box-shadow: 0 4px 14px rgba(0, 0, 0, .15);
    object-fit: cover;
}

/* ── Pie del card (botón) ────────────────────────────────────── */
.avm-search-footer {
    display: flex;
    justify-content: center;
}

.avm-btn-search {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    background: var(--avm-magenta);
    color: #fff !important;
    border: none;
    border-radius: 10px;
    padding: 15px 40px;
    font-size: 1.05rem !important;
    font-weight: 700 !important;
    cursor: pointer;
    transition: background .2s, transform .15s, box-shadow .2s;
    box-shadow: 0 4px 16px rgba(124, 45, 142, .35);
    text-decoration: none !important;
    letter-spacing: .01em;
}

.avm-btn-search:hover {
    background: var(--avm-magenta-h);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(124, 45, 142, .45);
}

.avm-btn-search .dashicons {
    font-size: 20px;
    width: 20px;
    height: 20px;
}

/* ── Status / mensaje ────────────────────────────────────────── */
.avm-status-msg {
    text-align: center;
    margin-top: 18px;
    padding: 12px 18px;
    border-radius: 10px;
    font-size: .9rem;
    background: #f3eef8;
    color: var(--avm-purple);
    border: 1px solid var(--avm-lavender-b);
}

/* ── Grid de resultados ──────────────────────────────────────── */
.avm-results-wrap {
    margin-top: 36px;
}

.animal-matches-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 24px;
}

.animal-match-card {
    background: #fff;
    border: 1px solid #ede9f5;
    border-radius: var(--avm-radius);
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(108, 40, 138, .08);
    transition: transform .2s, box-shadow .2s;
    animation: avmFadeUp .4s both;
}

.animal-match-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--avm-card-shadow);
}

.animal-match-card a {
    text-decoration: none;
    color: inherit;
    display: block;
}

.match-thumb img {
    width: 100%;
    height: 180px;
    object-fit: cover;
    display: block;
}

.no-thumb-placeholder {
    width: 100%;
    height: 180px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
    background: var(--avm-lavender);
}

.match-info {
    padding: 14px 16px;
}

.match-title {
    font-weight: 700;
    font-size: .95rem;
    display: block;
    color: #1f1235;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* badges */
.match-badge-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 12px;
    background: var(--avm-lavender);
}

.match-badge {
    font-size: .7rem;
    font-weight: 700;
    padding: 3px 10px;
    border-radius: 20px;
    color: #fff;
    text-transform: uppercase;
    letter-spacing: .04em;
}

.match-badge.match-high {
    background: #16a34a;
}

.match-badge.match-medium {
    background: #d97706;
}

.match-badge.match-low {
    background: #dc2626;
}

.match-percentage {
    font-size: .8rem;
    font-weight: 700;
    color: var(--avm-purple);
}

/* ── Sección de animal singular ──────────────────────────────── */
.animal-matcher-container {
    margin-top: 40px;
    padding-top: 20px;
    border-top: 1px solid #eee;
}

.matcher-title {
    font-size: 1.15rem;
    font-weight: 700;
    margin-bottom: 20px;
    color: var(--avm-purple);
}

.no-matches-msg {
    color: var(--avm-text-muted);
    font-style: italic;
    text-align: center;
    padding: 24px;
}

/* ── Animación ───────────────────────────────────────────────── */
@keyframes avmFadeUp {
    from {
        opacity: 0;
        transform: translateY(14px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ── Legado / compatibilidad ─────────────────────────────────── */
.avm-search-container {
    max-width: 800px;
    margin: 0 auto;
}

.premium-search-wrap {
    max-width: 780px;
    margin: 0 auto;
}