/* ============================================================
   Animal Visual Matcher — Smart Edition Styles
   Integrado desde Animal Matcher Smart Edition v2.1.1
   ============================================================ */

:root {
    --avm-premium-gradient: linear-gradient(135deg, #6366f1 0%, #a855f7 50%, #ec4899 100%);
    --avm-glass-bg: rgba(255, 255, 255, 0.7);
    --avm-glass-border: rgba(255, 255, 255, 0.3);
    --avm-card-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.07);
    --avm-high-match: #ef4444;
    --avm-medium-match: #f59e0b;
    --avm-low-match: #10b981;
}

/* ── Contenedor principal ── */
.animal-matcher-container {
    margin: 3em 0;
    padding: 2.5em;
    background: var(--avm-glass-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--avm-glass-border);
    border-radius: 24px;
    box-shadow: var(--avm-card-shadow);
}

.matcher-title {
    margin-top: 0;
    color: #111827;
    font-size: 1.8em;
    font-weight: 800;
    margin-bottom: 30px;
    letter-spacing: -0.025em;
}

.no-matches-msg {
    color: #6b7280;
    font-style: italic;
}

/* ── Grid de tarjetas ── */
.animal-matches-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 25px;
}

/* ── Tarjeta individual ── */
.animal-match-card {
    background: #ffffff;
    border-radius: 20px;
    overflow: hidden;
    border: 1px solid rgba(0, 0, 0, 0.04);
    transition: all 0.5s cubic-bezier(0.23, 1, 0.32, 1);
    position: relative;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
    opacity: 0;
    animation: avmPremiumEntrance 0.6s cubic-bezier(0.23, 1, 0.32, 1) forwards;
}

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

.animal-match-card:hover {
    transform: translateY(-10px) scale(1.02);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

/* Animaciones staggered */
@keyframes avmPremiumEntrance {
    from {
        opacity: 0;
        transform: translateY(30px) scale(0.9);
    }

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

.animal-match-card:nth-child(2) {
    animation-delay: 0.1s;
}

.animal-match-card:nth-child(3) {
    animation-delay: 0.2s;
}

.animal-match-card:nth-child(4) {
    animation-delay: 0.3s;
}

.animal-match-card:nth-child(5) {
    animation-delay: 0.4s;
}

.animal-match-card:nth-child(6) {
    animation-delay: 0.5s;
}

/* ── Badges de similitud ── */
.match-badge-container {
    position: absolute;
    top: 12px;
    left: 12px;
    right: 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 20;
}

.match-badge {
    padding: 6px 12px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.match-percentage {
    background: var(--avm-premium-gradient);
    color: white;
    padding: 6px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 800;
    box-shadow: 0 4px 6px rgba(99, 102, 241, 0.3);
}

.match-high {
    background: rgba(239, 68, 68, 0.9);
    color: #fff;
}

.match-medium {
    background: rgba(245, 158, 11, 0.9);
    color: #fff;
}

.match-low {
    background: rgba(16, 185, 129, 0.9);
    color: #fff;
}

/* ── Thumbnail ── */
.match-thumb {
    aspect-ratio: 4/5;
    background: #f3f4f6;
    overflow: hidden;
}

.match-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.8s ease;
}

.animal-match-card:hover .match-thumb img {
    transform: scale(1.15);
}

.no-thumb-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    font-size: 3em;
    color: #d1d5db;
}

/* ── Info de la tarjeta ── */
.match-info {
    padding: 20px;
    background: white;
}

.match-title {
    display: block;
    font-weight: 800;
    font-size: 1.1em;
    color: #1f2937;
    margin-bottom: 8px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.match-locality {
    font-size: 0.9em;
    color: #6b7280;
    font-weight: 500;
}

/* ── Formulario Premium (Guest Reporter) ── */
.guest-report-container.premium-form {
    max-width: 800px;
    margin: 2em auto;
    padding: 40px;
    background: #fff;
    border-radius: 30px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.05);
}

.form-header {
    text-align: center;
    margin-bottom: 40px;
}

.form-header h3 {
    font-size: 2em;
    font-weight: 900;
    background: var(--avm-premium-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 10px;
}

.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 25px;
}

@media (max-width: 600px) {
    .form-grid {
        grid-template-columns: 1fr;
    }
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-group label {
    font-weight: 700;
    color: #374151;
    font-size: 0.9em;
}

.form-group input,
.form-group select {
    padding: 12px 16px;
    border: 2px solid #f3f4f6;
    border-radius: 12px;
    font-size: 1em;
    transition: all 0.3s ease;
}

.form-group input:focus,
.form-group select:focus {
    border-color: #6366f1;
    outline: none;
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.1);
}

/* ── Real-time results ── */
.realtime-matches-preview {
    margin-top: 30px;
    padding: 20px;
    background: #f8fafc;
    border-radius: 20px;
    border: 1px dashed #e2e8f0;
    animation: avmPremiumEntrance 0.4s ease;
}

.realtime-matches-preview h4 {
    margin: 0 0 15px 0;
    color: #1e293b;
    font-size: 1em;
}

.mini-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
}

.mini-card {
    background: white;
    padding: 10px;
    border-radius: 12px;
    text-align: center;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.02);
}

.mini-card img {
    border-radius: 8px;
    margin-bottom: 8px;
    width: 100%;
}

.mini-card span {
    font-size: 11px;
    font-weight: 700;
    display: block;
}

/* ── Footer del formulario ── */
.form-footer {
    margin-top: 40px;
    text-align: center;
}

.submit-premium-btn {
    background: var(--avm-premium-gradient);
    color: white;
    border: none;
    padding: 16px 40px;
    border-radius: 50px;
    font-size: 1.1em;
    font-weight: 800;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 10px 20px rgba(99, 102, 241, 0.3);
}

.submit-premium-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 15px 30px rgba(99, 102, 241, 0.4);
}

/* ── Mensaje de éxito ── */
.avm-alert-success {
    padding: 15px 20px;
    background: #ecfdf5;
    border: 1px solid #6ee7b7;
    border-radius: 12px;
    color: #065f46;
    font-weight: 600;
    margin-bottom: 20px;
    text-align: center;
}

/* ── Logged in message ── */
.logged-in-msg {
    padding: 15px;
    background: #eff6ff;
    border-radius: 12px;
    color: #1e40af;
    font-style: italic;
}

/* ── File Upload (Guest Form) ── */
.file-upload-wrapper {
    position: relative;
    width: 100%;
}

.file-input {
    position: absolute;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
    z-index: 10;
}

.file-upload-preview {
    border: 2px dashed #e2e8f0;
    border-radius: 16px;
    padding: 30px;
    text-align: center;
    background: #f8fafc;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.file-upload-wrapper:hover .file-upload-preview {
    border-color: #6366f1;
    background: #f0f4ff;
}

.file-upload-preview .dashicons {
    font-size: 40px;
    width: 40px;
    height: 40px;
    color: #94a3b8;
}

.file-upload-preview p {
    margin: 0;
    font-size: 0.9em;
    color: #64748b;
}

.form-group.full-width {
    grid-column: 1 / -1;
}

/* ── Status Messages ── */
.avm-status-msg {
    margin: 20px 0;
    padding: 12px 20px;
    background: #eff6ff;
    border-radius: 12px;
    color: #2563eb;
    font-weight: 600;
    text-align: center;
    font-size: 0.9em;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% {
        opacity: 1;
    }

    50% {
        opacity: 0.6;
    }

    100% {
        opacity: 1;
    }
}

/* ── Specific Visual Matches ── */
.visual-matches {
    border-color: #6366f1;
    background: #f5f3ff;
}

.visual-matches h4 {
    color: #4338ca;
}

.mini-card a {
    text-decoration: none;
    color: inherit;
    display: block;
    transition: transform 0.3s ease;
}

.mini-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}