/* Shared creative UI — Copilot inline cards + Prompt Designer (scoped hosts) */

/* Copilot + PD: horizontal style tray (must have bounded width for overflow-x to scroll) */
#pixerrCopilotMessages .pixerr-creative-card-panel,
.pixerr-copilot-drawer .pixerr-creative-card-panel {
    min-width: 0;
    max-width: 100%;
}

#pixerrCopilotMessages .pixerr-creative-style-scroll-host,
.pixerr-copilot-drawer .pixerr-creative-style-scroll-host {
    min-width: 0;
    max-width: 100%;
    margin-bottom: 0.15rem;
}

#pixerrCopilotMessages .pixerr-creative-style-strip,
.pixerr-copilot-drawer .pixerr-creative-style-strip,
.prompt-designer-style-strip {
    display: flex;
    flex-wrap: nowrap;
    gap: 0.5rem;
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
    overflow-y: hidden;
    overscroll-behavior-x: contain;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 0.35rem;
    scroll-snap-type: x proximity;
    scrollbar-width: thin;
    scrollbar-color: rgba(148, 163, 184, 0.55) transparent;
}

#pixerrCopilotMessages .pixerr-creative-style-strip::-webkit-scrollbar,
.pixerr-copilot-drawer .pixerr-creative-style-strip::-webkit-scrollbar {
    height: 6px;
}

#pixerrCopilotMessages .pixerr-creative-style-strip::-webkit-scrollbar-thumb,
.pixerr-copilot-drawer .pixerr-creative-style-strip::-webkit-scrollbar-thumb {
    background: rgba(148, 163, 184, 0.45);
    border-radius: 999px;
}

#pixerrCopilotMessages .pixerr-creative-style-card,
.pixerr-copilot-drawer .pixerr-creative-style-card,
.pixerr-creative-style-grid .pixerr-creative-style-card {
    flex: 0 0 auto;
    scroll-snap-align: start;
    border: 2px solid transparent;
    border-radius: 0.5rem;
    background: transparent;
    padding: 0.25rem;
    width: 5.5rem;
    text-align: center;
    cursor: pointer;
    color: inherit;
}

#pixerrCopilotMessages .pixerr-creative-style-card.is-selected,
.pixerr-copilot-drawer .pixerr-creative-style-card.is-selected,
.pixerr-creative-style-grid .pixerr-creative-style-card.is-selected {
    border-color: var(--bs-primary, #0d6efd);
}

.pixerr-creative-style-thumb {
    width: 4.5rem;
    height: 4.5rem;
    object-fit: cover;
    border-radius: 0.35rem;
    display: block;
    margin: 0 auto;
}

.pixerr-creative-style-card-caption {
    display: block;
    font-size: 0.65rem;
    line-height: 1.2;
    margin-top: 0.25rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

#pixerrCopilotMessages .pixerr-creative-style-grid-host,
.pixerr-copilot-drawer .pixerr-creative-style-grid-host {
    min-width: 0;
    max-width: 100%;
}

#pixerrCopilotMessages .pixerr-creative-style-grid,
.pixerr-copilot-drawer .pixerr-creative-style-grid,
.pixerr-creative-style-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(5.5rem, 1fr));
    gap: 0.5rem;
    max-height: 14rem;
    overflow-x: hidden;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.pixerr-creative-concept-chip {
    margin: 0.15rem;
}

/* Copilot dark panel: inherit readable theme tokens (no hardcoded #212529 on dark chrome) */
#pixerrCopilotMessages .pixerr-creative-card-panel,
.pixerr-copilot-drawer .pixerr-creative-card-panel {
    color: inherit;
}

#pixerrCopilotMessages .pixerr-creative-card-title,
.pixerr-copilot-drawer .pixerr-creative-card-title {
    color: inherit;
}

#pixerrCopilotMessages .pixerr-creative-card-secondary,
.pixerr-copilot-drawer .pixerr-creative-card-secondary {
    color: var(--pixerr-text-dim, #94a3b8);
    font-size: 0.875rem;
}

#pixerrCopilotMessages .pixerr-creative-style-card-visual,
.pixerr-copilot-drawer .pixerr-creative-style-card-visual {
    display: block;
    width: 100%;
    height: 4.5rem;
    overflow: hidden;
    border-radius: 0.35rem;
    background: rgba(0, 0, 0, 0.2);
}

#pixerrCopilotMessages .pixerr-creative-style-card-visual .pixerr-creative-style-thumb,
.pixerr-copilot-drawer .pixerr-creative-style-card-visual .pixerr-creative-style-thumb {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    margin: 0;
}

#pixerrCopilotMessages .pixerr-creative-style-card-caption,
.pixerr-copilot-drawer .pixerr-creative-style-card-caption {
    color: inherit;
}

#pixerrCopilotMessages .pixerr-creative-concept-chip,
.pixerr-copilot-drawer .pixerr-creative-concept-chip {
    border-color: var(--pixerr-border-strong, rgba(148, 163, 184, 0.45));
    color: inherit;
}

.pixerr-creative-results-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(7rem, 1fr));
    gap: 0.5rem;
}

.pixerr-creative-result-card {
    border-radius: 0.5rem;
    border: 1px solid rgba(59, 130, 246, 0.35);
    background: linear-gradient(165deg, rgba(37, 99, 235, 0.22) 0%, rgba(15, 23, 42, 0.55) 100%);
    overflow: hidden;
    color: inherit;
}

.pixerr-creative-result-card.is-pending {
    border-color: rgba(59, 130, 246, 0.2);
    background: linear-gradient(165deg, rgba(37, 99, 235, 0.12) 0%, rgba(15, 23, 42, 0.4) 100%);
}

.pixerr-creative-result-card.is-ready {
    border-color: rgba(56, 189, 248, 0.45);
    box-shadow: 0 0 0 1px rgba(37, 99, 235, 0.15);
}

.pixerr-creative-result-card__visual {
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(15, 23, 42, 0.35);
}

.pixerr-creative-result-card__img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.pixerr-creative-result-card__placeholder {
    font-size: 1.25rem;
    color: var(--pixerr-accent, #3b82f6);
    opacity: 0.75;
    animation: pixerr-creative-pulse 1.2s ease-in-out infinite;
}

@keyframes pixerr-creative-pulse {
    0%, 100% { opacity: 0.45; }
    50% { opacity: 0.9; }
}

.pixerr-creative-result-card__body {
    padding: 0.35rem 0.45rem;
    font-size: 0.7rem;
    line-height: 1.25;
    color: var(--pixerr-text-dim, #94a3b8);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

#pixerrCopilotMessages .pixerr-creative-collection-actions,
.pixerr-copilot-drawer .pixerr-creative-collection-actions {
    padding-top: 0.15rem;
}

.pixerr-creative-progress-bar {
    height: 0.35rem;
}

.pixerr-creative-progress-bar .progress-bar {
    background: var(--pixerr-btn-gradient, linear-gradient(100deg, #2563eb 0%, #0ea5e9 48%, #38bdf8 100%));
}

#pixerrCopilotMessages .pixerr-creative-count-segments,
.pixerr-copilot-drawer .pixerr-creative-count-segments {
    gap: 0.35rem;
}

#pixerrCopilotMessages .pixerr-creative-count-seg,
.pixerr-copilot-drawer .pixerr-creative-count-seg {
    min-width: 2.25rem;
    border: 1px solid rgba(59, 130, 246, 0.4);
    background: rgba(37, 99, 235, 0.12);
    color: inherit;
    font-weight: 600;
}

#pixerrCopilotMessages .pixerr-creative-count-seg.is-selected,
.pixerr-copilot-drawer .pixerr-creative-count-seg.is-selected {
    border-color: var(--pixerr-accent, #3b82f6);
    background: linear-gradient(165deg, rgba(37, 99, 235, 0.35) 0%, rgba(14, 165, 233, 0.2) 100%);
    box-shadow: 0 0 0 1px rgba(56, 189, 248, 0.25);
}

#pixerrCopilotMessages .pixerr-creative-count-seg:hover,
.pixerr-copilot-drawer .pixerr-creative-count-seg:hover {
    border-color: rgba(56, 189, 248, 0.55);
}
