/* app/static/css/rig-steps.css - shared by every Rig surface (see rig-steps.js). */

/* Rig's steps: one block per answer, under the question. Live rows while
   Rig works ("Searching listings" -> "12 listings found · 0.8s"), folded to
   one line ("Rig worked · 2 steps · 1.9s") once the answer is in.
   Versioned with rig-steps.js, so they never disagree. */
.rig-steps {
    margin: 0 0 12px;
    border: 1px solid #eceef1;
    border-radius: 12px;
    background: #fafbfc;
    font-size: 13px;
    color: #5a6169;
    animation: rigStepsIn 0.25s ease-out;
}

.rig-steps-head {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    padding: 8px 12px;
    border: 0;
    background: none;
    color: inherit;
    font: inherit;
    text-align: left;
    cursor: pointer;
}

.rig-steps.is-running .rig-steps-head {
    cursor: default;
}

.rig-steps-bolt {
    color: var(--theme-orange, #f15a29);
    font-size: 12px;
}

.rig-steps-title {
    flex: 1;
    font-weight: 600;
}

.rig-steps-chevron {
    font-size: 11px;
    transition: transform 0.2s ease;
}

.rig-steps.is-running .rig-steps-chevron {
    display: none;
}

.rig-steps.is-collapsed .rig-steps-chevron {
    transform: rotate(-90deg);
}

.rig-steps-list {
    list-style: none;
    margin: 0;
    padding: 0 12px 10px;
}

.rig-steps.is-collapsed .rig-steps-list {
    display: none;
}

.rig-step {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    padding: 3px 0;
    line-height: 1.4;
}

.rig-step-icon {
    flex: 0 0 auto;
    width: 12px;
    height: 12px;
    margin-top: 3px;
    border-radius: 50%;
}

.rig-step.is-running .rig-step-icon {
    border: 2px solid #d6d9dd;
    border-top-color: var(--theme-orange, #f15a29);
    animation: rigToolSpin 0.7s linear infinite;
}

.rig-step.is-done .rig-step-icon,
.rig-step.is-failed .rig-step-icon {
    margin-top: 1px;
    font-size: 12px;
    line-height: 12px;
    text-align: center;
}

.rig-step.is-done .rig-step-icon::before {
    content: "\2713";
    color: #2e9e5b;
}

.rig-step.is-failed .rig-step-icon::before {
    content: "\26a0";
    color: #b9503f;
}

.rig-step.is-failed {
    opacity: 0.7;
}

.rig-step-summary {
    display: block;
    color: #8a9199;
    font-size: 12px;
}

.rig-step-summary:empty {
    display: none;
}

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

/* Sites a web-search step used, as small links under the step. */
.rig-step-sources {
    display: flex;
    flex-wrap: wrap;
    gap: 2px 8px;
    margin-top: 2px;
    font-size: 12px;
}

.rig-step-sources a {
    color: var(--market-accent-strong, #d94717);
    text-decoration: none;
}

.rig-step-sources a:hover {
    text-decoration: underline;
}

@keyframes rigStepsIn {
    from { opacity: 0; transform: translateY(6px); }
    to { opacity: 1; transform: none; }
}

@media (prefers-reduced-motion: reduce) {
    .rig-steps { animation: none; }
    .rig-step.is-running .rig-step-icon { animation: none; }
}
