/* ==========================================================================
   AI Discovery Panel – on-demand asset suggestions below the prompt bar
   ========================================================================== */

/* ── Badge row (collapsed state) ── */
.ai-discovery-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 0.625rem;
    justify-content: center;
    padding: 0.625rem 1rem 0.75rem;
}

.ai-discovery-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.4375rem 1.125rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    border: none;
    border-radius: 9999px;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.30);
    white-space: nowrap;
}

.ai-discovery-badge:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 14px rgba(102, 126, 234, 0.42);
}

.ai-discovery-badge:active {
    transform: translateY(0);
    box-shadow: 0 2px 6px rgba(102, 126, 234, 0.25);
}

.ai-discovery-badge-icon {
    font-size: 1rem;
    line-height: 1;
}

/* ── Expanded panel ── */
.ai-discovery-panel--open {
    padding: 0 1rem 0.75rem;
    animation: discoverySlideDown 0.22s ease;
}

@keyframes discoverySlideDown {
    from { opacity: 0; transform: translateY(-8px); }
    to   { opacity: 1; transform: translateY(0); }
}

.ai-discovery-content {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 14px;
    padding: 1rem 1.125rem 1.125rem;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.06);
}

/* ── Panel header ── */
.ai-discovery-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.875rem;
    padding-bottom: 0.625rem;
    border-bottom: 1px solid #f3f4f6;
}

.ai-discovery-header-icon {
    font-size: 1.125rem;
    line-height: 1;
}

.ai-discovery-header-title {
    flex: 1;
    font-size: 0.9375rem;
    font-weight: 600;
    color: #111827;
    margin: 0;
}

.ai-discovery-close {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 1.75rem;
    height: 1.75rem;
    background: none;
    border: none;
    border-radius: 50%;
    color: #9ca3af;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
    flex-shrink: 0;
}

.ai-discovery-close:hover {
    background: #f3f4f6;
    color: #374151;
}

/* ── Loading state ── */
.ai-discovery-loading {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    padding: 1rem 0;
    font-size: 0.875rem;
    color: #6b7280;
}

.ai-discovery-spinner {
    display: inline-block;
    width: 1rem;
    height: 1rem;
    border: 2px solid #e5e7eb;
    border-top-color: #7c3aed;
    border-radius: 50%;
    animation: discoverySpin 0.7s linear infinite;
    flex-shrink: 0;
}

@keyframes discoverySpin {
    to { transform: rotate(360deg); }
}

/* ── Asset grid ── */
.ai-discovery-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.75rem;
}

/* ── Empty state ── */
.ai-discovery-empty {
    text-align: center;
    padding: 1.25rem 0;
    font-size: 0.875rem;
    color: #9ca3af;
    margin: 0;
}

/* ==========================================================================
   AI Suggestion Card
   ========================================================================== */

.ai-suggestion-card {
    position: relative;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
    outline: none;
}

.ai-suggestion-card:hover,
.ai-suggestion-card:focus-visible {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.10);
    border-color: #c4b5fd;
}

.ai-suggestion-card:active {
    transform: translateY(-1px);
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.08);
}

/* ── Card image ── */
.ai-suggestion-image {
    position: relative;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    background: #f3f4f6;
}

.ai-suggestion-img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.ai-suggestion-card:hover .ai-suggestion-img {
    transform: scale(1.04);
}

/* ── Investment model badge (bottom-left of image) ── */
.ai-suggestion-model-badge {
    position: absolute;
    bottom: 0.375rem;
    left: 0.375rem;
    padding: 0.15rem 0.5rem;
    border-radius: 6px;
    font-size: 0.6875rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    text-transform: uppercase;
}

.model-direct { background: #dbeafe; color: #1e40af; }
.model-club   { background: #fef9c3; color: #854d0e; }
.model-token  { background: #ede9fe; color: #5b21b6; }

/* ── Recency/quality badge (top-right of image) ── */
.ai-suggestion-badge {
    position: absolute;
    top: 0.375rem;
    right: 0.375rem;
    padding: 0.2rem 0.5rem;
    border-radius: 9999px;
    font-size: 0.6875rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.badge-new      { background: #2563eb; color: #fff; }
.badge-yield    { background: #7c3aed; color: #fff; }
.badge-hot      { background: #dc2626; color: #fff; }
.badge-featured { background: #0891b2; color: #fff; }

/* ── Card body ── */
.ai-suggestion-content {
    padding: 0.625rem 0.75rem 0.75rem;
}

.ai-suggestion-title {
    font-size: 0.875rem;
    font-weight: 600;
    color: #111827;
    margin: 0 0 0.375rem;
    line-height: 1.35;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ai-suggestion-metrics {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 0.25rem;
}

/* ── Card action buttons ── */
.ai-suggestion-actions {
    display: flex;
    gap: 0.375rem;
    padding: 0 0.625rem 0.625rem;
}

.ai-suggestion-price {
    font-size: 0.9375rem;
    font-weight: 700;
    color: #be123c;
}

.ai-suggestion-yield {
    font-size: 0.8125rem;
    font-weight: 600;
    color: #15803d;
}

/* ==========================================================================
   Responsive
   ========================================================================== */

@media (max-width: 640px) {
    .ai-discovery-grid {
        grid-template-columns: 1fr;
    }

    .ai-discovery-panel--open {
        padding: 0 0.5rem 0.625rem;
    }

    .ai-discovery-badges {
        padding: 0.5rem 0.5rem 0.625rem;
    }
}

@media (min-width: 641px) and (max-width: 900px) {
    .ai-discovery-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}
