/* =====================================================
   OnePen: Sync-Status UI Styles
   In style.css einfügen oder als sync_queue_styles.css einbinden
   ===================================================== */

/* ========== Sync Status Badge (Header) ========== */
.sync-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  font-size: 12px;
  border-radius: 50%;
  flex-shrink: 0;
  cursor: help;
  transition: all 0.3s ease;
  user-select: none;
  position: relative;
}

.sync-dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

.sync-badge.sync-ok {
  animation: syncPulseGreen 2s ease-in-out;
}

.sync-badge.sync-pending {
  animation: syncPulseYellow 1.5s ease-in-out infinite;
}

.sync-badge.sync-offline,
.sync-badge.sync-error {
  animation: syncPulseRed 2s ease-in-out infinite;
}

@keyframes syncPulseGreen {
  0%   { transform: scale(1); }
  50%  { transform: scale(1.2); }
  100% { transform: scale(1); }
}

@keyframes syncPulseYellow {
  0%, 100% { opacity: 1; }
  50%      { opacity: 0.5; }
}

@keyframes syncPulseRed {
  0%, 100% { transform: scale(1); }
  50%      { transform: scale(1.15); }
}

@media (max-width: 480px) {
  .sync-badge {
    width: 20px;
    height: 20px;
    font-size: 10px;
  }
}

/* ========== Sync Conflict Dialog ========== */
.sync-conflict-dialog {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 10002;
  background: var(--bg-secondary);
  border: 2px solid var(--warning);
  border-radius: var(--radius-xl);
  padding: 0;
  width: min(92vw, 380px);
  box-shadow: 0 8px 32px rgba(245, 158, 11, 0.2);
  overflow: hidden;
}

.sync-conflict-header {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-lg);
  background: var(--warning-subtle);
  border-bottom: 1px solid var(--warning);
}

.sync-conflict-icon {
  font-size: 1.5rem;
  flex-shrink: 0;
}

.sync-conflict-header h3 {
  font-size: var(--text-base);
  font-weight: 700;
  margin: 0;
  color: var(--text-primary);
}

.sync-conflict-body {
  padding: var(--space-lg);
}

.sync-conflict-body p {
  font-size: var(--text-sm);
  color: var(--text-secondary);
  margin: 0 0 var(--space-md);
  line-height: 1.5;
}

.sync-conflict-info {
  background: var(--bg-tertiary);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: var(--space-md);
  font-size: var(--text-sm);
  margin-bottom: var(--space-md);
}

.sync-conflict-info div {
  margin-bottom: var(--space-xs);
}

.sync-conflict-info div:last-child {
  margin-bottom: 0;
}

.sync-conflict-actions {
  padding: 0 var(--space-lg) var(--space-lg);
  display: flex;
  justify-content: flex-end;
}

/* ========== Extended Autosave Badge ========== */
/* Sync-Status Text im bestehenden Badge */
.badge.sync-active {
  background: var(--accent-primary);
}

.badge.sync-error-badge {
  background: var(--danger);
}

/* ========== Debug: Sync-Queue Panel (optional) ========== */
/* Kann mit SyncQueue.getStats() angezeigt werden */
.sync-debug-panel {
  position: fixed;
  bottom: 60px;
  right: var(--space-lg);
  background: var(--bg-secondary);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-md);
  padding: var(--space-md);
  font-size: var(--text-xs);
  font-family: var(--font-mono);
  box-shadow: var(--shadow-md);
  z-index: 998;
  min-width: 200px;
}

.sync-debug-panel dt {
  color: var(--text-muted);
  font-weight: 600;
}

.sync-debug-panel dd {
  margin: 0 0 var(--space-xs);
  color: var(--text-primary);
}
