/* ============================================
   SIMPLE BIKE WHEEL LOADING ANIMATION
   ============================================ */

.loading-screen {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, #2da6b4 0%, #1a636e 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  transition: opacity 0.8s ease-out, visibility 0.8s ease-out;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  /* Enhanced centering for better cross-browser compatibility */
  place-items: center;
  place-content: center;
}

.loading-screen.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.loading-content {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 20px;
  padding: 20px;
  max-width: 90%;
}

/* ===== CENTERED BIKE WHEEL ===== */
.bike-wheel {
  position: relative;
  width: 100px;
  height: 100px;
  border: 6px solid rgba(255, 255, 255, 0.2);
  border-top-color: rgba(255, 255, 255, 0.9);
  border-radius: 50%;
  animation: wheelSpin 1s linear infinite;
  box-shadow: 0 0 20px rgba(255, 255, 255, 0.2), 
              0 0 40px rgba(255, 255, 255, 0.1);
  will-change: transform;
  /* Ensure perfect centering */
  margin: 0 auto;
}

/* Wheel spokes - simplified for mobile */
.wheel-spoke {
  position: absolute;
  width: 2px;
  height: 100%;
  background: linear-gradient(to bottom, 
    rgba(255, 255, 255, 0.7) 0%, 
    rgba(255, 255, 255, 0.2) 50%, 
    rgba(255, 255, 255, 0.7) 100%);
  left: 50%;
  top: 0;
  transform-origin: center;
  border-radius: 1px;
}

.wheel-spoke:nth-child(1) {
  transform: translateX(-50%) rotate(0deg);
}

.wheel-spoke:nth-child(2) {
  transform: translateX(-50%) rotate(45deg);
}

.wheel-spoke:nth-child(3) {
  transform: translateX(-50%) rotate(90deg);
}

.wheel-spoke:nth-child(4) {
  transform: translateX(-50%) rotate(135deg);
}

.wheel-spoke:nth-child(5) {
  transform: translateX(-50%) rotate(180deg);
}

.wheel-spoke:nth-child(6) {
  transform: translateX(-50%) rotate(225deg);
}

.wheel-spoke:nth-child(7) {
  transform: translateX(-50%) rotate(270deg);
}

.wheel-spoke:nth-child(8) {
  transform: translateX(-50%) rotate(315deg);
}

/* Wheel hub */
.bike-wheel::before {
  content: '';
  position: absolute;
  width: 20px;
  height: 20px;
  background: radial-gradient(circle, 
    rgba(255, 255, 255, 1) 0%,
    rgba(240, 240, 240, 0.95) 50%,
    rgba(220, 220, 220, 0.9) 100%);
  border-radius: 50%;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}

@keyframes wheelSpin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

/* ===== BEAUTIFUL LOADING TEXT ===== */
.loading-text {
  color: rgba(255, 255, 255, 0.95);
  font-size: 1.2rem;
  font-weight: 600;
  letter-spacing: 0.5px;
  margin: 0;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
  animation: textFade 2s ease-in-out infinite;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

@keyframes textFade {
  0%, 100% {
    opacity: 0.7;
  }
  50% {
    opacity: 1;
  }
}

/* Loading dots animation */
.loading-text::after {
  content: '';
  animation: loadingDots 1.5s steps(4, end) infinite;
}

@keyframes loadingDots {
  0% {
    content: '';
  }
  25% {
    content: '.';
  }
  50% {
    content: '..';
  }
  75% {
    content: '...';
  }
  100% {
    content: '';
  }
}

/* ===== LOADING BAR ===== */
.loading-bar {
  width: 80%;
  max-width: 300px;
  height: 4px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 10px;
  overflow: hidden;
}

.loading-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, 
    rgba(255, 255, 255, 0.7) 0%,
    rgba(255, 255, 255, 1) 50%,
    rgba(255, 255, 255, 0.7) 100%);
  background-size: 200% 100%;
  border-radius: 10px;
  animation: loadingBarFill 1.5s ease-in-out infinite;
  will-change: width;
}

@keyframes loadingBarFill {
  0% {
    width: 0%;
    background-position: 0% 0%;
  }
  50% {
    width: 70%;
    background-position: 100% 0%;
  }
  100% {
    width: 100%;
    background-position: 200% 0%;
  }
}

/* Responsive adjustments for tablets */
@media (min-width: 481px) and (max-width: 768px) {
  .bike-wheel {
    width: 90px;
    height: 90px;
    border-width: 5px;
  }
  
  .loading-text {
    font-size: 1.15rem;
  }
  
  .loading-bar {
    width: 70%;
    max-width: 250px;
  }
}

/* Responsive adjustments for mobile */
@media (max-width: 480px) {
  .loading-content {
    gap: 15px;
  }
  
  .bike-wheel {
    width: 70px;
    height: 70px;
    border-width: 5px;
  }
  
  .bike-wheel::before {
    width: 16px;
    height: 16px;
  }
  
  .wheel-spoke {
    width: 1.5px;
  }
  
  .loading-text {
    font-size: 1rem;
    letter-spacing: 0.3px;
  }
  
  .loading-bar {
    width: 85%;
    max-width: 200px;
    height: 3px;
  }
}

/* Extra small devices */
@media (max-width: 360px) {
  .bike-wheel {
    width: 60px;
    height: 60px;
    border-width: 4px;
  }
  
  .bike-wheel::before {
    width: 14px;
    height: 14px;
  }
  
  .loading-text {
    font-size: 0.9rem;
  }
  
  .loading-bar {
    width: 90%;
    max-width: 180px;
  }
}

/* Reduce motion for accessibility */
@media (prefers-reduced-motion: reduce) {
  .bike-wheel {
    animation: wheelSpinSlow 2s linear infinite;
  }
  
  .loading-text {
    animation: none;
    opacity: 1;
  }
  
  .loading-bar-fill {
    animation: loadingBarFillSlow 2s ease-in-out infinite;
  }
  
  @keyframes wheelSpinSlow {
    0% {
      transform: rotate(0deg);
    }
    100% {
      transform: rotate(360deg);
    }
  }
  
  @keyframes loadingBarFillSlow {
    0% {
      width: 0%;
    }
    100% {
      width: 100%;
    }
  }
}
