/* ============================================
   StickyMenuBar - With Position Fixed Solution
   Works with overflow-x: hidden on body
   ============================================ */

/* Animation keyframes for border lights */
@keyframes borderLightTop {
  0% {
    left: 0%;
    top: 50%;
    opacity: 0;
    width: 0px;
    height: 0px;
  }
  5% {
    left: 0%;
    top: 50%;
    opacity: 1;
    width: 0px;
    height: 0px;
  }
  20% {
    left: 0%;
    top: 0%;
    opacity: 1;
    width: 64px;
    height: 64px;
  }
  60% {
    left: 100%;
    top: 0%;
    opacity: 1;
    width: 64px;
    height: 64px;
  }
  90% {
    left: 100%;
    top: 50%;
    opacity: 1;
    width: 0px;
    height: 0px;
  }
  100% {
    left: 0%;
    top: 50%;
    opacity: 0;
    width: 0px;
    height: 0px;
  }
}

@keyframes borderLightBottom {
  0% {
    right: 0%;
    bottom: 50%;
    opacity: 0;
    width: 0px;
    height: 0px;
  }
  5% {
    right: 0%;
    bottom: 50%;
    opacity: 1;
    width: 0px;
    height: 0px;
  }
  20% {
    right: 0%;
    bottom: 0%;
    opacity: 1;
    width: 64px;
    height: 64px;
  }
  60% {
    right: 100%;
    bottom: 0%;
    opacity: 1;
    width: 64px;
    height: 64px;
  }
  90% {
    right: 100%;
    bottom: 50%;
    opacity: 1;
    width: 0px;
    height: 0px;
  }
  100% {
    right: 0%;
    bottom: 50%;
    opacity: 0;
    width: 0px;
    height: 0px;
  }
}

/* Animation for loading dots */
@keyframes loadingDot {
  0%, 100% {
    opacity: 0.3;
    transform: scale(0.8);
  }
  50% {
    opacity: 1;
    transform: scale(1.2);
  }
}

/* Main sticky container - Default state */
.sticky-menu-bar {
  position: relative;
  width: 100%;
  z-index: 9998;
  transition: all 0.3s ease;
}

/* When sticky - uses position: fixed */
.sticky-menu-bar.is-sticky {
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  width: 100% !important;
  z-index: 9999 !important;
  animation: slideDown 0.3s ease;
}

@keyframes slideDown {
  from {
    transform: translateY(-100%);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

/* Main visual styling with purple gradient */
.sticky-menu-bar.warning-section {
  background: linear-gradient(90deg,
    rgba(50, 50, 120, 0.4) 0%,
    rgba(40, 40, 100, 0.5) 50%,
    rgba(50, 50, 120, 0.4) 100%
  );
  backdrop-filter: blur(12px) saturate(120%);
  -webkit-backdrop-filter: blur(12px) saturate(120%);
  box-shadow: 0 4px 20px rgba(0,0,0,0.3);
  padding: 12px 8px;
  min-height: 70px;
  display: flex;
  align-items: center;
  transition: background 0.3s ease, box-shadow 0.3s ease;
  border-bottom: 1px solid rgba(139, 92, 246, 0.1);
}

/* Enhanced sticky state */
.sticky-menu-bar.warning-section.is-sticky {
  background: linear-gradient(90deg,
    rgba(50, 50, 120, 0.6) 0%,
    rgba(40, 40, 100, 0.7) 50%,
    rgba(50, 50, 120, 0.6) 100%
  );
  box-shadow: 0 8px 32px rgba(0,0,0,0.4);
  border-bottom: 1px solid rgba(139, 92, 246, 0.2);
}

/* Warning text */
.legue-not-checked-warning {
  margin: 0;
  color: #fff;
  font-size: 13px;
}

/* Stepper container */
.stepper-dark-container {
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(10, 10, 20, 0.8);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-radius: 12px;
  padding: 0.25rem 0.4rem;
  min-height: 48px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.3);
  border: 1px solid rgba(139, 92, 246, 0.15);
}

/* Progress steps container */
.progress-steps {
  display: flex;
  align-items: center;
  gap: 4px;
  justify-content: center;
}

/* Step buttons */
.step {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: rgba(255,255,255,0.6);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  padding: 10px 14px;
  border-radius: 6px;
  min-width: 60px;
  background: transparent;
  border: none;
  outline: none;
  position: relative;
  overflow: hidden;
}

/* Step hover state */
.step:hover:not(:disabled) {
  background: rgba(255,255,255,0.1);
  color: rgba(255,255,255,0.9);
  transform: translateY(-1px);
}

/* Active step - Settings should be white with purple glow */
.step.active {
  color: #ffffff !important;
  font-weight: bold;
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.2), rgba(139, 92, 246, 0.1));
  border: 1px solid rgba(139, 92, 246, 0.3);
  box-shadow: 0 0 20px rgba(139, 92, 246, 0.3);
}

/* Settings step icon and text - always white */
.step:first-child {
  color: #ffffff !important;
}

.step:first-child svg {
  fill: #ffffff !important;
}

.step:first-child .step-title {
  color: #ffffff !important;
}

/* Animated border lights for active steps */
.light-point {
  position: absolute;
  width: 64px;
  height: 64px;
  pointer-events: none;
  z-index: 2;
}

.light-point::before {
  content: '';
  position: absolute;
  width: 100%;
  height: 100%;
  background: radial-gradient(circle,
    rgba(139, 92, 246, 0.8) 0%,
    rgba(139, 92, 246, 0.4) 40%,
    transparent 70%
  );
  border-radius: 50%;
  filter: blur(8px);
}

.light-point-top {
  animation: borderLightTop 4s linear infinite;
}

.light-point-bottom {
  animation: borderLightBottom 4s linear infinite;
  animation-delay: 2s;
}

/* Completed step */
.step.completed {
  color: #a4ff00;
}

/* Step content wrapper */
.step-content {
  display: flex;
  align-items: center;
  gap: 8px;
  justify-content: center;
  position: relative;
  z-index: 1;
}

/* Step icons */
.step-content svg {
  width: 16px;
  height: 16px;
  fill: currentColor;
}

/* Step title */
.step-title {
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
  letter-spacing: 0.3px;
}

/* Save button special styling */
.step.step-save-rumble {
  background: linear-gradient(135deg, #dc3545 0%, #c82333 100%);
  color: #ffffff !important;
  border: 1px solid rgba(220, 53, 69, 0.3);
}

.step.step-save-rumble:hover {
  background: linear-gradient(135deg, #ff6b7a 0%, #ff4757 100%);
  box-shadow: 0 0 20px rgba(255, 71, 87, 0.5);
  transform: translateY(-2px);
}

.step.step-save-rumble svg {
  fill: #ffffff !important;
}

/* Cancel step with opacity hover effect */
.step:last-child {
  background: rgba(255,255,255,0.05);
  transition: all 0.3s ease;
}

.step:last-child:hover {
  background: rgba(255,255,255,0.15);
  opacity: 0.8;
}

/* Double spacing between Save and Cancel */
.step.step-save-rumble + .step {
  margin-left: 8px;
}

/* Progress dots between steps with animation */
.progress-dots {
  display: flex;
  align-items: center;
  gap: 3px;
  padding: 0 4px;
}

.progress-dots .dot {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: #8b5cf6;
  opacity: 0.3;
  animation: loadingDot 1.5s ease-in-out infinite;
}

.progress-dots .dot-1 {
  animation-delay: 0s;
}

.progress-dots .dot-2 {
  animation-delay: 0.2s;
}

.progress-dots .dot-3 {
  animation-delay: 0.4s;
}

/* Back/Next buttons */
.next-step-btn {
  background: rgba(255,255,255,0.05);
  border-radius: 8px;
  border: none;
  font-family: "DINRegular", sans-serif;
  font-size: 11px;
  font-weight: 600;
  padding: 8px 16px;
  color: #ffffff;
  height: 44px;
  transition: all 0.2s ease;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.next-step-btn:hover:not(:disabled) {
  background: rgba(255,255,255,0.1);
  transform: translateY(-1px);
}

/* Light effect overlay */
.step-light-effect {
  position: absolute;
  top: -2px;
  left: -2px;
  right: -2px;
  bottom: -2px;
  border-radius: 8px;
  background: linear-gradient(45deg,
    transparent,
    rgba(139, 92, 246, 0.1),
    transparent
  );
  pointer-events: none;
  animation: shimmer 3s infinite;
  z-index: 0;
}

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

/* Mobile specific adjustments */
@media (max-width: 767px) {
  /* More transparent background on mobile */
  .sticky-menu-bar.warning-section {
    background: linear-gradient(90deg,
      rgba(50, 50, 120, 0.45) 0%,
      rgba(40, 40, 100, 0.5) 50%,
      rgba(50, 50, 120, 0.45) 100%
    );
    backdrop-filter: blur(15px) saturate(120%);
    -webkit-backdrop-filter: blur(15px) saturate(120%);
    border-radius: 0 !important;
    margin: 0 !important;
    width: 100% !important;
    padding: 8px 4px;
  }

  /* Enhanced sticky state on mobile */
  .sticky-menu-bar.warning-section.is-sticky {
    background: linear-gradient(90deg,
      rgba(50, 50, 120, 0.6) 0%,
      rgba(40, 40, 100, 0.65) 50%,
      rgba(50, 50, 120, 0.6) 100%
    );
  }

  /* Adjust step padding on mobile */
  .step {
    min-width: auto;
    padding: 8px 18px;
  }

  /* Stepper takes 50% on mobile */
  .stepper-dark-container {
    flex: 0 0 50%;
    height: 44px;
  }

  /* Smaller text on mobile */
  .step-title {
    font-size: 11px;
  }

  /* Hide desktop text, show mobile icon */
  .sticky-menu-desktop-text {
    display: none !important;
  }

  .sticky-menu-mobile-icon {
    display: inline-flex !important;
  }

  /* Smaller light points on mobile */
  .light-point {
    width: 48px;
    height: 48px;
  }
}

/* Desktop specific */
@media (min-width: 768px) {
  /* Hide mobile icon, show desktop text */
  .sticky-menu-mobile-icon {
    display: none !important;
  }

  .sticky-menu-desktop-text {
    display: inline-block !important;
  }

  /* Center stepper on desktop when not sticky */
  .sticky-menu-bar:not(.is-sticky) .stepper-dark-container {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
  }

  /* Keep centered when sticky */
  .sticky-menu-bar.is-sticky .stepper-dark-container {
    position: relative;
    left: auto;
    transform: none;
    margin: 0 auto;
  }
}

/* Variant specific styles */
.sticky-menu-bar.variant-league-stage {
  background: linear-gradient(90deg,
    rgba(60, 50, 140, 0.4) 0%,
    rgba(50, 40, 120, 0.5) 50%,
    rgba(60, 50, 140, 0.4) 100%
  );
}

/* Fix z-index issues */
.sticky-menu-bar * {
  position: relative;
}

/* Ensure smooth transitions */
* {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}