/* ═══════════════════════════════════════════════════════════════════
   FLOW AI 🌊 - Modern Enhancements v226.68
   Additional animations, effects, and polish
   ═══════════════════════════════════════════════════════════════════ */

/* ═══════════════════════════════════════════════════════════════════
   ANTI-FLICKER CSS v2 - Comprehensive flickering prevention
   NOTE: All animations disabled to prevent UI flickering
   ═══════════════════════════════════════════════════════════════════ */

/* GPU acceleration for smooth rendering */
*, *::before, *::after {
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
  -webkit-font-smoothing: antialiased;
}

/* Stabilize all interactive elements */
button, .btn, .tab, .carrier-item, .list-item, input, select, textarea {
  transform: translateZ(0);
  will-change: auto !important;
  contain: layout style;
}

/* Prevent layout shifts */
.tab-content, .tab-panel, .section, .card {
  min-height: 0;
  contain: content;
}

/* AGGRESSIVE: Disable ALL animations globally to fix flicker */
*, *::before, *::after {
  animation: none !important;
  transition: none !important;
}

/* Re-enable minimal transitions for essential UI feedback */
button:active, .btn:active {
  transition: transform 0.1s ease !important;
}

/* Reduce animation intensity - prevent rapid visual changes */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* Animations */
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.7; }
}

@keyframes bounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-5px); }
}

@keyframes slideIn {
  from { opacity: 0; transform: translateX(-20px); }
  to { opacity: 1; transform: translateX(0); }
}

@keyframes slideUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

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

@keyframes glow {
  0%, 100% { box-shadow: 0 0 5px rgba(255, 107, 53, 0.5); }
  50% { box-shadow: 0 0 20px rgba(255, 107, 53, 0.8), 0 0 30px rgba(255, 107, 53, 0.4); }
}

@keyframes shimmer {
  0% { background-position: -200% center; }
  100% { background-position: 200% center; }
}

/* Pulse animation for status indicators */
.pulse, .status-active, .sending {
  animation: pulse 2s ease-in-out infinite;
}

/* Bounce animation for notifications */
.bounce, .new-notification {
  animation: bounce 0.5s ease;
}

/* Slide animations */
.slide-in {
  animation: slideIn 0.3s ease;
}

.slide-up {
  animation: slideUp 0.3s ease;
}

/* Loading spinner */
.spinner, .loading {
  animation: spin 1s linear infinite;
}

/* Glow effect for active elements */
.glow, .active-glow {
  animation: glow 2s ease-in-out infinite;
}

/* Shimmer loading effect */
.shimmer {
  background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
}

/* Card hover effects */
.card:hover, .section:hover {
  transform: translateY(-2px);
  box-shadow: 0 15px 35px rgba(0,0,0,0.2);
}

/* Enhanced button effects */
button::before, .btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
  transition: left 0.5s ease;
}

button:hover::before, .btn:hover::before {
  left: 100%;
}

button, .btn {
  position: relative;
  overflow: hidden;
}

/* Tab transition effects */
.tab-content, .tab-panel {
  transition: opacity 0.3s ease, transform 0.3s ease;
}

/* Input focus glow */
input:focus, textarea:focus, select:focus {
  animation: none;
  box-shadow: 0 0 0 3px rgba(255, 107, 53, 0.2), 0 0 15px rgba(255, 107, 53, 0.1);
}

/* Carrier item hover slide */
.carrier-item, .list-item {
  transition: all 0.25s ease;
}

.carrier-item:hover, .list-item:hover {
  transform: translateX(8px);
  box-shadow: -4px 0 0 var(--primary-orange, #ff6b35);
}

/* Status badge pulse */
.badge-success.active, .status-active {
  position: relative;
}

.badge-success.active::after {
  content: '';
  position: absolute;
  top: 50%;
  right: 8px;
  width: 8px;
  height: 8px;
  background: currentColor;
  border-radius: 50%;
  transform: translateY(-50%);
  animation: pulse 1.5s ease-in-out infinite;
}

/* Countdown pulse effect */
.countdown-number {
  animation: pulse 1s ease-in-out infinite;
}

/* Progress bar animation */
.progress-fill {
  position: relative;
  overflow: hidden;
}

.progress-fill::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
  animation: shimmer 2s infinite;
}

/* Notification slide in */
.notification, .alert {
  animation: slideIn 0.3s ease;
}

/* Floating elements */
.floating {
  animation: bounce 3s ease-in-out infinite;
}

/* Header gradient animation */
.header, h1 {
  background-size: 200% 200%;
  animation: gradientShift 5s ease infinite;
}

@keyframes gradientShift {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}

/* Tooltip styles */
.tooltip {
  position: relative;
}

.tooltip::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%) translateY(-5px);
  padding: 8px 12px;
  background: #2d3748;
  color: white;
  font-size: 12px;
  border-radius: 6px;
  white-space: nowrap;
  opacity: 0;
  visibility: hidden;
  transition: all 0.2s ease;
  z-index: 1000;
}

.tooltip:hover::after {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(-10px);
}

/* Focus visible outlines */
button:focus-visible, 
input:focus-visible, 
select:focus-visible,
textarea:focus-visible,
.tab-btn:focus-visible {
  outline: 2px solid var(--primary-orange, #ff6b35);
  outline-offset: 2px;
}

/* Ripple effect */
.ripple {
  position: relative;
  overflow: hidden;
}

.ripple::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  background: rgba(255,255,255,0.3);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  transition: width 0.6s ease, height 0.6s ease;
}

.ripple:active::after {
  width: 200px;
  height: 200px;
}

/* Mode box transitions */
.mode-box {
  transition: all 0.4s ease;
}

/* Enhanced shadows on scroll */
.card.elevated {
  box-shadow: 0 20px 50px rgba(0,0,0,0.25);
}

/* Text gradient effect */
.gradient-text {
  background: var(--primary-gradient, linear-gradient(135deg, #ff6b35, #ffb347));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* Skeleton loading */
.skeleton {
  background: linear-gradient(90deg, #f0f0f0 25%, #e8e8e8 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: 4px;
}

.skeleton-text {
  height: 14px;
  margin-bottom: 8px;
  border-radius: 4px;
}

.skeleton-title {
  height: 20px;
  width: 60%;
  margin-bottom: 12px;
}

.skeleton-button {
  height: 40px;
  width: 120px;
  border-radius: 8px;
}

/* Success checkmark animation */
@keyframes checkmark {
  0% { stroke-dashoffset: 100; }
  100% { stroke-dashoffset: 0; }
}

.success-checkmark {
  stroke-dasharray: 100;
  stroke-dashoffset: 100;
  animation: checkmark 0.5s ease forwards;
}

/* Error shake animation */
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-5px); }
  75% { transform: translateX(5px); }
}

.shake, .error-shake {
  animation: shake 0.4s ease;
}

/* Notification badge bounce */
.notification-badge {
  position: absolute;
  top: -5px;
  right: -5px;
  min-width: 18px;
  height: 18px;
  background: #f56565;
  color: white;
  font-size: 11px;
  font-weight: 600;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: bounce 0.5s ease;
}

/* Smooth scrolling */
.smooth-scroll {
  scroll-behavior: smooth;
}

/* Active state press effect */
button:active, .btn:active {
  transform: scale(0.98);
}

/* Enhanced select dropdown */
select {
  transition: all 0.2s ease;
}

select:hover {
  border-color: var(--primary-orange, #ff6b35);
}

/* Card entry animation stagger */
.card:nth-child(1) { animation-delay: 0.05s; }
.card:nth-child(2) { animation-delay: 0.1s; }
.card:nth-child(3) { animation-delay: 0.15s; }
.card:nth-child(4) { animation-delay: 0.2s; }
.card:nth-child(5) { animation-delay: 0.25s; }

/* Live mode warning pulse */
.live-mode, .mode-box.live {
  position: relative;
}

.live-mode::before, .mode-box.live::before {
  content: '';
  position: absolute;
  top: -2px;
  left: -2px;
  right: -2px;
  bottom: -2px;
  background: linear-gradient(45deg, #f56565, #ed8936, #f56565);
  border-radius: inherit;
  z-index: -1;
  animation: none !important;
  opacity: 0.5;
}

/* ═══════════════════════════════════════════════════════════════════
   FINAL ANTI-FLICKER OVERRIDE v3 - MUST BE LAST IN FILE
   This section overrides ALL animations to prevent UI glitching
   ═══════════════════════════════════════════════════════════════════ */

/* Nuclear option: Kill ALL animations and transitions */
*, *::before, *::after,
.pulse, .bounce, .slide-in, .slide-up, .spinner, .loading, .glow, .shimmer,
.status-active, .sending, .new-notification, .active-glow,
.card, .section, .btn, button, .tab-btn, .tab-pane {
  animation: none !important;
  animation-delay: 0s !important;
  animation-duration: 0s !important;
  transition: none !important;
  transition-delay: 0s !important;
  transition-duration: 0s !important;
}

/* Remove problematic backface-visibility that causes flickering */
*, *::before, *::after {
  backface-visibility: visible !important;
  -webkit-backface-visibility: visible !important;
}

/* Disable all transforms on hover - causes flickering */
.card:hover, .section:hover, button:hover, .btn:hover {
  transform: none !important;
}

/* Disable pseudo-element animations */
button::before, .btn::before,
.live-mode::before, .mode-box::before {
  animation: none !important;
  transition: none !important;
  display: none !important;
}

/* Stable rendering */
html, body {
  overflow-anchor: none;
  scroll-behavior: auto !important;
}
