/* ==========================================
   Workflow Demo Surface — Styles
   Uses the app's theme variables (--bg, --bg-surface, --text, etc.)
   defined in variables.css for automatic dark/light support.
   ========================================== */

.surface-workflow-demo {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 1.5rem 2rem;
}

/* Topbar */
.demo-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 0;
    border-bottom: 1px solid var(--border);
    margin-bottom: 1rem;
}
.demo-topbar h1 {
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0;
    color: var(--text);
}

/* Subtitle */
.demo-subtitle {
    color: var(--text-2);
    margin: 0 0 1.5rem;
    font-size: 0.9rem;
}

/* Grid */
.demo-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
}
@media (min-width: 768px) {
    .demo-grid {
        grid-template-columns: 1fr 1fr;
    }
}

/* Card */
.demo-card {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    color: var(--text);
}

/* Title row */
.card-title-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.card-title-row h2 {
    font-size: 1.1rem;
    font-weight: 600;
    margin: 0;
    flex: 1;
    color: var(--text);
}
.card-icon {
    font-size: 1.3rem;
}
.card-tier {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: 600;
}
.badge-browser { background: var(--success-dim); color: var(--success-light); }
.badge-starlark { background: var(--accent-dim); color: var(--accent-light); }

/* Description */
.card-desc {
    color: var(--text-2);
    font-size: 0.85rem;
    margin: 0;
    line-height: 1.4;
}

/* Badges */
.card-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
}
.demo-card .badge {
    font-size: 0.7rem;
    padding: 2px 8px;
    border-radius: 10px;
    background: var(--bg-raised);
    color: var(--text-2);
    white-space: nowrap;
}
.demo-card .badge-installed { background: var(--success-dim); color: var(--success-light); }
.demo-card .badge-not-installed { background: var(--warning-dim); color: var(--warning-light); }
.demo-card .badge-needs-publish { background: var(--danger-dim); color: var(--danger-light); }

/* Stage flow diagram */
.stage-flow {
    display: flex;
    align-items: flex-start;
    gap: 0.25rem;
    flex-wrap: wrap;
    padding: 0.75rem;
    background: var(--bg-raised);
    border-radius: 6px;
    overflow-x: auto;
}

.stage-node {
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 0.4rem 0.6rem;
    min-width: 80px;
    text-align: center;
    background: var(--bg-surface);
    font-size: 0.75rem;
    color: var(--text);
}
.stage-node.stage-public {
    border-color: var(--success);
    background: var(--success-dim);
}
.stage-node.stage-system {
    border-color: var(--accent);
    background: var(--accent-dim);
}

.stage-label {
    font-weight: 600;
    font-size: 0.8rem;
}
.stage-meta {
    color: var(--text-3);
    font-size: 0.65rem;
}
.stage-note {
    color: var(--warning-light);
    font-size: 0.6rem;
    font-style: italic;
    margin-top: 2px;
}

.stage-arrow {
    display: flex;
    align-items: center;
    font-size: 1.1rem;
    color: var(--text-3);
    padding: 0 0.15rem;
    align-self: center;
}

/* Collapsible sections */
.card-collapsible {
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 0.8rem;
}
.card-collapsible summary {
    padding: 0.5rem 0.75rem;
    cursor: pointer;
    font-weight: 600;
    user-select: none;
    color: var(--text);
}
.card-collapsible summary:hover {
    background: var(--bg-hover);
}
.collapsible-content {
    padding: 0 0.75rem 0.75rem;
}
.collapsible-content pre {
    background: var(--bg-raised);
    color: var(--text);
    padding: 0.5rem;
    border-radius: 4px;
    overflow-x: auto;
    font-size: 0.72rem;
    line-height: 1.4;
    margin: 0.25rem 0;
    font-family: var(--mono);
}

/* Actions */
.card-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: auto;
    padding-top: 0.5rem;
    border-top: 1px solid var(--border);
}
.demo-card .btn {
    padding: 0.4rem 1rem;
    border: none;
    border-radius: 6px;
    font-size: 0.8rem;
    cursor: pointer;
    font-weight: 500;
}
.demo-card .btn-primary {
    background: var(--accent);
    color: var(--text-on-color);
}
.demo-card .btn-primary:hover {
    background: var(--accent-hover);
}
.demo-card .btn-primary:disabled {
    opacity: 0.5;
    cursor: default;
}

/* Public link row */
.public-link-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.25rem;
}
.public-link-row input {
    flex: 1;
    font-size: 0.7rem;
    padding: 4px 8px;
    background: var(--input-bg);
    border: 1px solid var(--border);
    border-radius: 4px;
    color: var(--text);
    font-family: var(--mono);
}
.public-link-row .btn-copy {
    padding: 4px 10px;
    font-size: 0.7rem;
    background: var(--bg-raised);
    border: 1px solid var(--border);
    border-radius: 4px;
    color: var(--text-2);
    cursor: pointer;
}
.public-link-row .btn-copy:hover {
    background: var(--bg-hover);
}
