/* =====================================================================
 * sync-status.css — backend load/save/sync indicators
 * ===================================================================== */

.rtg-sync-status {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 0.75rem;
    color: #94a3b8;
    opacity: 0.85;
    transition: opacity 0.18s ease-out, color 0.18s ease-out;
    user-select: none;
    max-width: 220px;
}

.rtg-sync-status.is-active { opacity: 1; }

.rtg-sync-status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
    background: #64748b;
}

.rtg-sync-status-text {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.rtg-sync-status--bootstrap .rtg-sync-status-dot,
.rtg-sync-status--loading .rtg-sync-status-dot {
    background: #38bdf8;
    box-shadow: 0 0 0 0 rgba(56, 189, 248, 0.45);
    animation: rtg-sync-pulse 1.2s ease-out infinite;
}

.rtg-sync-status--saving .rtg-sync-status-dot {
    background: #fbbf24;
    animation: rtg-sync-spin 0.8s linear infinite;
}

.rtg-sync-status--synced .rtg-sync-status-dot {
    background: #22c55e;
    animation: rtg-save-pulse 1s ease-out;
}

.rtg-sync-status--error .rtg-sync-status-dot {
    background: #ef4444;
}

.rtg-sync-status--local .rtg-sync-status-dot {
    background: #a78bfa;
}

.rtg-sync-status--idle-up .rtg-sync-status-dot {
    background: #22c55e;
}

.rtg-sync-status--idle-down .rtg-sync-status-dot {
    background: #ef4444;
}

.rtg-sync-status--idle-checking .rtg-sync-status-dot {
    background: #38bdf8;
    box-shadow: 0 0 0 0 rgba(56, 189, 248, 0.45);
    animation: rtg-sync-pulse 1.2s ease-out infinite;
}

.rtg-sync-status--idle-up .rtg-sync-status-text {
    color: #86efac;
}

.rtg-sync-status--idle-down .rtg-sync-status-text {
    color: #fca5a5;
}

.rtg-sync-status--idle-checking .rtg-sync-status-text {
    color: #7dd3fc;
}

.rtg-sync-status--bootstrap .rtg-sync-status-text,
.rtg-sync-status--loading .rtg-sync-status-text {
    color: #7dd3fc;
}

.rtg-sync-status--saving .rtg-sync-status-text {
    color: #fcd34d;
}

.rtg-sync-status--synced .rtg-sync-status-text {
    color: #86efac;
}

.rtg-sync-status--error .rtg-sync-status-text {
    color: #fca5a5;
}

@keyframes rtg-sync-pulse {
    0%   { box-shadow: 0 0 0 0 rgba(56, 189, 248, 0.45); }
    70%  { box-shadow: 0 0 0 6px rgba(56, 189, 248, 0); }
    100% { box-shadow: 0 0 0 0 rgba(56, 189, 248, 0); }
}

@keyframes rtg-sync-spin {
    to { transform: rotate(360deg); }
}

@keyframes rtg-save-pulse {
    0%   { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.45); }
    100% { box-shadow: 0 0 0 8px rgba(34, 197, 94, 0); }
}

/* Login bootstrap panel */
.login-sync-panel {
    margin-top: 16px;
    padding: 16px;
    border-radius: 8px;
    border: 1px solid #334155;
    background: rgba(15, 23, 42, 0.85);
    text-align: center;
}

.login-sync-panel[hidden] { display: none !important; }

.login-sync-spinner {
    width: 28px;
    height: 28px;
    margin: 0 auto 12px;
    border: 3px solid #334155;
    border-top-color: #38bdf8;
    border-radius: 50%;
    animation: rtg-sync-spin 0.75s linear infinite;
}

.login-sync-title {
    margin: 0 0 6px;
    font-size: 0.95rem;
    font-weight: 600;
    color: #e2e8f0;
}

.login-sync-step {
    margin: 0;
    font-size: 0.82rem;
    color: #94a3b8;
}

@media (prefers-reduced-motion: reduce) {
    .rtg-sync-status--bootstrap .rtg-sync-status-dot,
    .rtg-sync-status--loading .rtg-sync-status-dot,
    .rtg-sync-status--saving .rtg-sync-status-dot,
    .rtg-sync-status--idle-checking .rtg-sync-status-dot,
    .login-sync-spinner {
        animation: none;
    }
}
