/* Shared scope-change status component (see js/scope-status.js).
   States are driven by data-state on the mount: idle | pending | error. */

.scope-status {
    margin-bottom: 12px;
    padding: 8px 14px;
    border-radius: 10px;
    font-size: 0.8rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}
.scope-status[data-state="idle"] { display: none; }
.scope-status[data-state="pending"] {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    color: #475569;
}
.scope-status[data-state="pending"] .scope-status-row--error,
.scope-status[data-state="error"] .scope-status-row--pending { display: none; }
.scope-status[data-state="error"] {
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #b91c1c;
}
.scope-status-row {
    display: flex;
    align-items: center;
    gap: 8px;
}
.scope-status-message { flex: 1; }
.scope-status-icon { flex: 0 0 auto; }
.scope-spinner {
    flex: 0 0 auto;
    width: 14px;
    height: 14px;
    border: 2px solid #cbd5e1;
    border-top-color: #64748b;
    border-radius: 50%;
    animation: scope-spin 0.7s linear infinite;
}
@keyframes scope-spin { to { transform: rotate(360deg); } }
.scope-status-btn {
    flex: 0 0 auto;
    padding: 3px 10px;
    border: 1px solid #b91c1c;
    background: white;
    color: #b91c1c;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
}
.scope-status-btn:hover { background: #b91c1c; color: white; }
.scope-status-close {
    flex: 0 0 auto;
    width: 22px;
    height: 22px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: none;
    background: transparent;
    color: #b91c1c;
    font-size: 1.1rem;
    line-height: 1;
    cursor: pointer;
    border-radius: 6px;
}
.scope-status-close:hover { background: rgba(185,28,28,0.1); }

/* Any element marked busy dims while a scope change is in flight. */
.scope-busy { opacity: 0.55; transition: opacity 0.15s; }

@media (prefers-reduced-motion: reduce) {
    .scope-spinner { animation: none; }
    .scope-busy { transition: none; }
}
