/* Sync-Status UI für Azubi-App */

/* Sync-Badge im Header */
.sync-badge {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 24px;
  height: 24px;
  padding: 0 6px;
  background: #ef4444;
  color: white;
  font-size: 12px;
  font-weight: 600;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.3s;
  margin-left: 8px;
}

.sync-badge:hover {
  background: #dc2626;
  transform: scale(1.1);
}

.sync-badge.pulse {
  animation: badge-pulse 2s infinite;
}

@keyframes badge-pulse {
  0%, 100% {
    opacity: 1;
    transform: scale(1);
  }
  50% {
    opacity: 0.8;
    transform: scale(1.05);
  }
}

/* Sync-Status-Modal */
.sync-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: modal-fade-in 0.2s ease-out;
}

.sync-modal {
  background: white;
  border-radius: 12px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  max-width: 600px;
  width: 100%;
  max-height: 80vh;
  display: flex;
  flex-direction: column;
  animation: modal-slide-in 0.3s ease-out;
}

@keyframes modal-fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes modal-slide-in {
  from {
    opacity: 0;
    transform: translateY(-20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Modal-Header */
.sync-modal-header {
  padding: 24px;
  border-bottom: 1px solid #e5e7eb;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.sync-modal-title {
  font-size: 20px;
  font-weight: 600;
  color: #14161B;
  display: flex;
  align-items: center;
  gap: 12px;
}

.sync-modal-close {
  width: 32px;
  height: 32px;
  border: none;
  background: transparent;
  color: #6b7280;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  transition: all 0.2s;
  font-size: 24px;
  line-height: 1;
}

.sync-modal-close:hover {
  background: #f3f4f6;
  color: #14161B;
}

/* Modal-Body */
.sync-modal-body {
  padding: 24px;
  overflow-y: auto;
  flex: 1;
}

/* Statistik-Karten */
.sync-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px;
  margin-bottom: 24px;
}

.sync-stat-card {
  background: #f9fafb;
  border-radius: 8px;
  padding: 16px;
  text-align: center;
}

.sync-stat-value {
  font-size: 32px;
  font-weight: 700;
  color: #14161B;
  line-height: 1;
  margin-bottom: 8px;
}

.sync-stat-card.pending .sync-stat-value {
  color: #f59e0b;
}

.sync-stat-card.success .sync-stat-value {
  color: #22c55e;
}

.sync-stat-card.failed .sync-stat-value {
  color: #ef4444;
}

.sync-stat-label {
  font-size: 13px;
  color: #6b7280;
  font-weight: 500;
}

/* Queue-Liste */
.sync-queue-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.sync-queue-empty {
  text-align: center;
  padding: 40px 20px;
  color: #6b7280;
}

.sync-queue-empty-icon {
  font-size: 48px;
  margin-bottom: 12px;
  opacity: 0.5;
}

.sync-queue-item {
  background: #f9fafb;
  border-radius: 8px;
  padding: 16px;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  border-left: 4px solid #e5e7eb;
  transition: all 0.2s;
}

.sync-queue-item:hover {
  background: #f3f4f6;
}

.sync-queue-item.pending {
  border-left-color: #f59e0b;
}

.sync-queue-item.success {
  border-left-color: #22c55e;
}

.sync-queue-item.failed {
  border-left-color: #ef4444;
}

.sync-queue-icon {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  font-weight: 600;
}

.sync-queue-item.pending .sync-queue-icon {
  background: #fef3c7;
  color: #d97706;
}

.sync-queue-item.success .sync-queue-icon {
  background: #dcfce7;
  color: #16a34a;
}

.sync-queue-item.failed .sync-queue-icon {
  background: #fee2e2;
  color: #dc2626;
}

.sync-queue-content {
  flex: 1;
  min-width: 0;
}

.sync-queue-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 4px;
}

.sync-queue-type {
  font-size: 14px;
  font-weight: 600;
  color: #14161B;
}

.sync-queue-status {
  font-size: 12px;
  font-weight: 500;
  padding: 2px 8px;
  border-radius: 4px;
}

.sync-queue-item.pending .sync-queue-status {
  background: #fef3c7;
  color: #d97706;
}

.sync-queue-item.success .sync-queue-status {
  background: #dcfce7;
  color: #16a34a;
}

.sync-queue-item.failed .sync-queue-status {
  background: #fee2e2;
  color: #dc2626;
}

.sync-queue-details {
  font-size: 13px;
  color: #6b7280;
  margin-bottom: 4px;
}

.sync-queue-timestamp {
  font-size: 12px;
  color: #9ca3af;
}

.sync-queue-actions {
  flex-shrink: 0;
  display: flex;
  gap: 8px;
}

.sync-queue-action-btn {
  width: 32px;
  height: 32px;
  border: none;
  background: transparent;
  color: #6b7280;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  transition: all 0.2s;
  font-size: 16px;
}

.sync-queue-action-btn:hover {
  background: white;
  color: #14161B;
}

.sync-queue-action-btn.delete:hover {
  background: #fee2e2;
  color: #dc2626;
}

/* Modal-Footer */
.sync-modal-footer {
  padding: 16px 24px;
  border-top: 1px solid #e5e7eb;
  display: flex;
  gap: 12px;
  justify-content: flex-end;
}

.sync-modal-btn {
  padding: 10px 20px;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.sync-modal-btn.secondary {
  background: #f3f4f6;
  color: #14161B;
}

.sync-modal-btn.secondary:hover {
  background: #e5e7eb;
}

.sync-modal-btn.primary {
  background: #BC9E81;
  color: white;
}

.sync-modal-btn.primary:hover {
  background: #a88a6f;
}

.sync-modal-btn.danger {
  background: #ef4444;
  color: white;
}

.sync-modal-btn.danger:hover {
  background: #dc2626;
}

.sync-modal-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Loading-Spinner */
.sync-loading {
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

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

/* Mobile Anpassungen */
@media (max-width: 768px) {
  .sync-modal {
    max-height: 90vh;
  }

  .sync-modal-header {
    padding: 20px;
  }

  .sync-modal-body {
    padding: 20px;
  }

  .sync-stats {
    grid-template-columns: repeat(2, 1fr);
  }

  .sync-queue-item {
    flex-direction: column;
  }

  .sync-queue-actions {
    width: 100%;
    justify-content: flex-end;
  }

  .sync-modal-footer {
    flex-direction: column;
  }

  .sync-modal-btn {
    width: 100%;
    justify-content: center;
  }
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
  .sync-modal {
    background: #1f2937;
  }

  .sync-modal-header {
    border-bottom-color: #374151;
  }

  .sync-modal-title {
    color: #f9fafb;
  }

  .sync-modal-close {
    color: #9ca3af;
  }

  .sync-modal-close:hover {
    background: #374151;
    color: #f9fafb;
  }

  .sync-stat-card {
    background: #374151;
  }

  .sync-stat-value {
    color: #f9fafb;
  }

  .sync-queue-item {
    background: #374151;
    border-left-color: #4b5563;
  }

  .sync-queue-type {
    color: #f9fafb;
  }

  .sync-queue-action-btn:hover {
    background: #4b5563;
    color: #f9fafb;
  }

  .sync-modal-footer {
    border-top-color: #374151;
  }

  .sync-modal-btn.secondary {
    background: #374151;
    color: #f9fafb;
  }

  .sync-modal-btn.secondary:hover {
    background: #4b5563;
  }
}
