/**
 * Sync Warning Banner Styles
 * 
 * Styles for the sync unavailable warning banner
 * Requirements: 9.1, 9.6 - Graceful degradation
 */

/* Banner container */
.sync-warning-banner {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 9999;
  background: var(--status-warning-bg, #fff3cd);
  color: var(--status-warning-text, #856404);
  border-bottom: 2px solid var(--status-warning, #ffc107);
  padding: 12px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  animation: slideDown 0.3s ease-out;
}

/* Slide down animation */
@keyframes slideDown {
  from {
    transform: translateY(-100%);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

/* Banner content */
.sync-warning-content {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
}

/* Warning icon */
.sync-warning-icon {
  font-size: 20px;
  flex-shrink: 0;
}

/* Warning text */
.sync-warning-text {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.sync-warning-title {
  font-weight: 600;
  font-size: 14px;
  line-height: 1.4;
}

.sync-warning-subtitle {
  font-size: 12px;
  opacity: 0.9;
  line-height: 1.4;
}

/* Last sync timestamp */
.sync-warning-timestamp {
  font-weight: 500;
  white-space: nowrap;
}

/* Banner actions */
.sync-warning-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

/* Reconnect button */
.sync-warning-reconnect-btn {
  background: var(--accent-primary, #4a90e2);
  color: white;
  border: none;
  border-radius: 6px;
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.sync-warning-reconnect-btn:hover {
  background: var(--accent-primary-hover, #357abd);
  transform: translateY(-1px);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.sync-warning-reconnect-btn:active {
  transform: translateY(0);
  box-shadow: none;
}

.sync-warning-reconnect-btn:focus {
  outline: 2px solid var(--accent-primary, #4a90e2);
  outline-offset: 2px;
}

/* Dismiss button */
.sync-warning-dismiss-btn {
  background: transparent;
  color: var(--status-warning-text, #856404);
  border: 1px solid currentColor;
  border-radius: 6px;
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.sync-warning-dismiss-btn:hover {
  background: rgba(0, 0, 0, 0.05);
}

.sync-warning-dismiss-btn:active {
  background: rgba(0, 0, 0, 0.1);
}

.sync-warning-dismiss-btn:focus {
  outline: 2px solid var(--status-warning, #ffc107);
  outline-offset: 2px;
}

/* Close icon button */
.sync-warning-close-btn {
  background: transparent;
  border: none;
  color: var(--status-warning-text, #856404);
  font-size: 20px;
  cursor: pointer;
  padding: 4px;
  line-height: 1;
  opacity: 0.7;
  transition: opacity 0.2s ease;
  flex-shrink: 0;
}

.sync-warning-close-btn:hover {
  opacity: 1;
}

.sync-warning-close-btn:focus {
  outline: 2px solid var(--status-warning, #ffc107);
  outline-offset: 2px;
  border-radius: 4px;
}

/* Banner variants */
.sync-warning-banner.error {
  background: var(--status-error-bg, #f8d7da);
  color: var(--status-error-text, #721c24);
  border-bottom-color: var(--status-error, #dc3545);
}

.sync-warning-banner.info {
  background: var(--status-info-bg, #d1ecf1);
  color: var(--status-info-text, #0c5460);
  border-bottom-color: var(--status-info, #17a2b8);
}

/* Hidden state */
.sync-warning-banner.hidden {
  display: none;
}

/* Mobile responsive adjustments */
@media (max-width: 768px) {
  .sync-warning-banner {
    padding: 10px 16px;
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
  }

  .sync-warning-content {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }

  .sync-warning-icon {
    font-size: 18px;
  }

  .sync-warning-title {
    font-size: 13px;
  }

  .sync-warning-subtitle {
    font-size: 11px;
  }

  .sync-warning-actions {
    width: 100%;
    justify-content: stretch;
  }

  .sync-warning-reconnect-btn,
  .sync-warning-dismiss-btn {
    flex: 1;
    padding: 10px 12px;
    font-size: 12px;
  }

  .sync-warning-close-btn {
    position: absolute;
    top: 10px;
    right: 10px;
  }
}

/* Dark mode support */
[data-theme="dark"] .sync-warning-banner {
  background: rgba(255, 193, 7, 0.15);
  color: #ffc107;
  border-bottom-color: #ffc107;
}

[data-theme="dark"] .sync-warning-banner.error {
  background: rgba(220, 53, 69, 0.15);
  color: #ff6b6b;
  border-bottom-color: #ff6b6b;
}

[data-theme="dark"] .sync-warning-banner.info {
  background: rgba(23, 162, 184, 0.15);
  color: #17a2b8;
  border-bottom-color: #17a2b8;
}

  .sync-warning-dismiss-btn:hover {
    background: rgba(255, 255, 255, 0.1);
  }

  .sync-warning-dismiss-btn:active {
    background: rgba(255, 255, 255, 0.15);
  }
}

/* Accessibility: Reduced motion */
@media (prefers-reduced-motion: reduce) {
  .sync-warning-banner {
    animation: none;
  }

  .sync-warning-reconnect-btn:hover,
  .sync-warning-reconnect-btn:active {
    transform: none;
  }
}

/* Adjust page content when banner is visible */
body.sync-warning-visible {
  padding-top: 60px;
}

@media (max-width: 768px) {
  body.sync-warning-visible {
    padding-top: 100px;
  }
}
