/**
 * GLIZ Booking Engine - Sync Styles
 * 
 * Base synchronization styles for frontend integration
 */

/* Sync status indicator */
.gbe-sync-status {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 1000;
  background: #f0f9ff;
  border: 1px solid #0ea5e9;
  color: #0369a1;
  padding: 8px 16px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 500;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  opacity: 0;
  transform: translateX(100%);
  transition: all 0.3s ease;
}

.gbe-sync-status.show {
  opacity: 1;
  transform: translateX(0);
}

.gbe-sync-status.active {
  background: #f0fdf4;
  border-color: #22c55e;
  color: #15803d;
}

.gbe-sync-status.loading {
  background: #fffbeb;
  border-color: #f59e0b;
  color: #d97706;
}

.gbe-sync-status.error {
  background: #fef2f2;
  border-color: #ef4444;
  color: #dc2626;
}

/* Loading animation for sync operations */
.gbe-sync-loading {
  display: inline-block;
  width: 12px;
  height: 12px;
  border: 2px solid #e5e7eb;
  border-radius: 50%;
  border-top-color: #3b82f6;
  animation: gbe-spin 1s ease-in-out infinite;
  margin-right: 8px;
}

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

/* Enhanced form elements for sync */
.gbe-sync-enhanced {
  position: relative;
}

.gbe-sync-enhanced::after {
  content: "⚡";
  position: absolute;
  top: -4px;
  right: -4px;
  background: #10b981;
  color: white;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 8px;
  z-index: 10;
}

/* Sync update notification */
.gbe-sync-notification {
  position: fixed;
  bottom: 20px;
  right: 20px;
  background: #1f2937;
  color: white;
  padding: 12px 20px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
  transform: translateY(100px);
  opacity: 0;
  transition: all 0.3s ease;
  max-width: 300px;
  z-index: 1001;
}

.gbe-sync-notification.show {
  transform: translateY(0);
  opacity: 1;
}

.gbe-sync-notification.success {
  background: #059669;
}

.gbe-sync-notification.warning {
  background: #d97706;
}

.gbe-sync-notification.error {
  background: #dc2626;
}

/* Debug mode styles */
body.gbe-debug-mode .gbe-sync-status {
  display: block !important;
}

body.gbe-debug-mode .gbe-sync-enhanced::after {
  display: block !important;
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .gbe-sync-status {
    top: 10px;
    right: 10px;
    font-size: 11px;
    padding: 6px 12px;
  }

  .gbe-sync-notification {
    bottom: 10px;
    right: 10px;
    left: 10px;
    max-width: none;
    font-size: 13px;
  }
}

/* Hide sync indicators by default unless in debug mode */
.gbe-sync-status,
.gbe-sync-enhanced::after {
  display: none;
}

/* Show only when explicitly enabled or in debug mode */
.gbe-sync-debug .gbe-sync-status,
.gbe-sync-debug .gbe-sync-enhanced::after,
body[data-gbe-debug="true"] .gbe-sync-status,
body[data-gbe-debug="true"] .gbe-sync-enhanced::after {
  display: block;
}

/* Accessibility improvements */
.gbe-sync-status:focus,
.gbe-sync-notification:focus {
  outline: 2px solid #3b82f6;
  outline-offset: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
  .gbe-sync-status {
    border-width: 2px;
    font-weight: 600;
  }

  .gbe-sync-notification {
    border: 2px solid rgba(255, 255, 255, 0.3);
  }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
  .gbe-sync-status,
  .gbe-sync-notification {
    transition: none;
  }

  .gbe-sync-loading {
    animation: none;
    border-top-color: #6b7280;
  }
}
