/* css/data_safety.css */

.sync-status {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 0 11px;
  border: 1px solid var(--border-color);
  border-radius: 999px;
  background: var(--bg-surface);
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
  cursor: default;
  transition: border-color 0.2s ease, color 0.2s ease, background 0.2s ease;
}

.sync-status::before {
  content: "";
  width: 8px;
  height: 8px;
  flex: 0 0 8px;
  border-radius: 50%;
  background: #94a3b8;
}

.sync-status--pending,
.sync-status--offline,
.sync-status--error {
  cursor: pointer;
}

.sync-status--pending::before,
.sync-status--syncing::before {
  background: #f59e0b;
}

.sync-status--syncing::before {
  animation: sync-status-pulse 1s ease-in-out infinite;
}

.sync-status--synced {
  border-color: rgba(16, 185, 129, 0.35);
  color: #047857;
  background: rgba(16, 185, 129, 0.08);
}

.sync-status--synced::before {
  background: #10b981;
}

.sync-status--offline {
  color: #b45309;
  background: rgba(245, 158, 11, 0.08);
}

.sync-status--error {
  color: #dc2626;
  border-color: rgba(239, 68, 68, 0.35);
  background: rgba(239, 68, 68, 0.08);
}

.sync-status--error::before {
  background: #ef4444;
}

body.dark-theme .sync-status--synced {
  color: #6ee7b7;
}

body.dark-theme .sync-status--offline {
  color: #fcd34d;
}

body.dark-theme .sync-status--error {
  color: #fca5a5;
}

@keyframes sync-status-pulse {
  0%,
  100% {
    opacity: 0.4;
    transform: scale(0.85);
  }
  50% {
    opacity: 1;
    transform: scale(1);
  }
}

@media (max-width: 768px) {
  .sync-status {
    width: 44px;
    min-width: 44px;
    height: 44px;
    min-height: 44px;
    padding: 0;
    justify-content: center;
    flex: 0 0 44px;
  }

  .sync-status-text {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
  }
}

@media (prefers-reduced-motion: reduce) {
  .sync-status--syncing::before {
    animation: none;
  }
}
