/* node-embed.css — Universal node embed card */

/* ── Base embed card ─────────────────────────────────── */
.ch-node-embed {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 10px;
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 13px;
    color: var(--text-primary);
    transition: border-color 0.15s, background 0.15s;
    position: relative;
    max-width: 100%;
}
.ch-node-embed:hover {
    border-color: var(--accent);
    background: var(--bg-hover);
}
.ch-node-embed--unresolved {
    opacity: 0.6;
    border-style: dashed;
}

/* ── Icon ────────────────────────────────────────────── */
.ch-node-embed-icon {
    flex-shrink: 0;
    font-size: 16px;
    line-height: 1;
}

/* ── Name ────────────────────────────────────────────── */
.ch-node-embed-name {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-weight: 500;
}
.ch-node-embed-name--unresolved {
    font-style: italic;
    color: var(--text-muted);
}

/* ── Type badge ──────────────────────────────────────── */
.ch-node-embed-badge {
    flex-shrink: 0;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    padding: 2px 6px;
    border-radius: 3px;
    background: color-mix(in srgb, var(--badge-color, var(--accent)) 15%, transparent);
    color: var(--badge-color, var(--accent));
}

/* ── Status dot (for records) ────────────────────────── */
.ch-node-embed-status {
    flex-shrink: 0;
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

/* ── Remove button ───────────────────────────────────── */
.ch-node-embed-remove {
    position: absolute;
    top: -6px;
    right: -6px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--bg-panel);
    border: 1px solid var(--border);
    color: var(--text-muted);
    font-size: 12px;
    line-height: 1;
    cursor: pointer;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 0;
}
.ch-node-embed:hover .ch-node-embed-remove {
    display: flex;
}
.ch-node-embed-remove:hover {
    color: #e55;
    border-color: #e55;
}

/* ── Size: small ─────────────────────────────────────── */
.ch-node-embed--sm {
    padding: 3px 8px;
    gap: 5px;
    font-size: 12px;
    border-radius: 4px;
}
.ch-node-embed--sm .ch-node-embed-icon {
    font-size: 13px;
}

/* ── Size: large (with preview) ──────────────────────── */
.ch-node-embed--lg {
    flex-direction: column;
    align-items: stretch;
    padding: 0;
    gap: 0;
    overflow: hidden;
    width: 100%;
    max-width: 320px;
}
.ch-node-embed--lg .ch-node-embed-body {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
}

/* ── Preview area (lg size) ──────────────────────────── */
.ch-node-embed-preview {
    aspect-ratio: 16 / 10;
    background: var(--bg-base, #1a1a1a);
    border-bottom: 1px solid var(--border);
    overflow: hidden;
    position: relative;
}
.ch-node-embed-iframe {
    width: 200%;
    height: 200%;
    transform: scale(0.5);
    transform-origin: top left;
    border: none;
    pointer-events: none;
}

/* ── Embed list (vertical stack of embeds) ───────────── */
.ch-node-embed-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.ch-node-embed-list-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.3px;
    margin-bottom: 4px;
}
.ch-node-embed-list-add {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 2px;
    border-radius: 3px;
    display: flex;
    align-items: center;
}
.ch-node-embed-list-add:hover {
    color: var(--accent);
    background: var(--bg-hover);
}
