/* ==================== LOADING SCREEN STYLES ==================== */

/* --- Main Loading Screen Container --- */
.loading-screen {
  position: fixed;
  inset: 0;
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--u-loading-bg);
  transition: opacity 0.6s cubic-bezier(0.4, 0, 0.2, 1),
              visibility 0.6s cubic-bezier(0.4, 0, 0.2, 1),
              transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
  overflow: hidden;
}

.loading-screen::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 50% 50%, rgba(207, 39, 39, 0.08) 0%, transparent 60%);
  animation: pulseGlow 3s ease-in-out infinite;
}

@keyframes pulseGlow {
  0%, 100% { opacity: 0.5; transform: scale(1); }
  50% { opacity: 1; transform: scale(1.1); }
}

.loading-screen.fade-out {
  opacity: 0;
  visibility: hidden;
  transform: scale(1.05);
}

.loading-screen.hidden {
  display: none;
}

/* --- Loading Content --- */
.loading-content {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 30px;
}

/* --- Logo Container with Rings --- */
.loading-logo-container {
  position: relative;
  width: 180px;
  height: 180px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* --- Animated Ring Around Logo --- */
.loading-logo-ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  animation: rotateRing 8s linear infinite;
}

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

.loading-ring-segment {
  position: absolute;
  width: 100%;
  height: 100%;
  border-radius: 50%;
}

.loading-ring-segment:nth-child(1) {
  border: 2px solid transparent;
  border-top-color: #ff0033;
  animation: ringPulse1 2s ease-in-out infinite;
}

.loading-ring-segment:nth-child(2) {
  border: 2px solid transparent;
  border-right-color: rgba(207, 39, 39, 0.5);
  animation: ringPulse2 2s ease-in-out infinite 0.3s;
  transform: rotate(120deg);
}

.loading-ring-segment:nth-child(3) {
  border: 2px solid transparent;
  border-bottom-color: rgba(207, 39, 39, 0.3);
  animation: ringPulse3 2s ease-in-out infinite 0.6s;
  transform: rotate(240deg);
}

@keyframes ringPulse1 {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

@keyframes ringPulse2 {
  0%, 100% { opacity: 0.5; }
  50% { opacity: 1; }
}

@keyframes ringPulse3 {
  0%, 100% { opacity: 0.3; }
  50% { opacity: 0.8; }
}

/* --- Progress Ring SVG --- */
.loading-progress-ring {
  position: absolute;
  inset: -10px;
  width: calc(100% + 20px);
  height: calc(100% + 20px);
}

.loading-progress-ring svg {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}

.loading-progress-bg {
  fill: none;
  stroke: rgba(255, 255, 255, 0.05);
  stroke-width: 2;
}

.loading-progress-bar {
  fill: none;
  stroke: #ff0033;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-dasharray: 283;
  stroke-dashoffset: 283;
  transition: stroke-dashoffset 0.3s ease;
  filter: drop-shadow(0 0 8px rgba(207, 39, 39, 0.6));
}

/* --- Logo Center --- */
.loading-logo {
  position: relative;
  width: 100px;
  height: 100px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, rgba(20, 0, 0, 0.9) 0%, rgba(10, 0, 0, 0.95) 100%);
  border-radius: 50%;
  border: 2px solid rgba(207, 39, 39, 0.3);
  box-shadow:
    0 0 40px rgba(207, 39, 39, 0.3),
    inset 0 0 30px rgba(207, 39, 39, 0.1);
  animation: logoPulse 2s ease-in-out infinite;
}

@keyframes logoPulse {
  0%, 100% {
    box-shadow:
      0 0 40px rgba(207, 39, 39, 0.3),
      inset 0 0 30px rgba(207, 39, 39, 0.1);
  }
  50% {
    box-shadow:
      0 0 60px rgba(207, 39, 39, 0.5),
      inset 0 0 40px rgba(207, 39, 39, 0.2);
  }
}

.loading-logo-img {
  max-width: 60px;
  max-height: 60px;
  object-fit: contain;
  filter: brightness(1.1);
}

.loading-logo-icon {
  font-size: 40px;
  color: #ff0033;
  filter: drop-shadow(0 0 10px rgba(207, 39, 39, 0.8));
  animation: iconGlow 2s ease-in-out infinite;
}

@keyframes iconGlow {
  0%, 100% { filter: drop-shadow(0 0 10px rgba(207, 39, 39, 0.8)); }
  50% { filter: drop-shadow(0 0 20px rgba(207, 39, 39, 1)); }
}

/* --- Loading Text --- */
.loading-text {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.loading-store-name {
  font-size: 24px;
  font-weight: 800;
  color: #fff;
  text-transform: uppercase;
  letter-spacing: 4px;
  text-shadow: 0 0 20px rgba(207, 39, 39, 0.5);
}

.loading-status {
  font-size: 12px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.5);
  text-transform: uppercase;
  letter-spacing: 3px;
}

/* --- Loading Dots Animation --- */
.loading-dots {
  display: flex;
  gap: 8px;
}

.loading-dots span {
  width: 8px;
  height: 8px;
  background: #ff0033;
  border-radius: 50%;
  animation: dotBounce 1.4s ease-in-out infinite;
  box-shadow: 0 0 10px rgba(207, 39, 39, 0.5);
}

.loading-dots span:nth-child(1) { animation-delay: 0s; }
.loading-dots span:nth-child(2) { animation-delay: 0.2s; }
.loading-dots span:nth-child(3) { animation-delay: 0.4s; }

@keyframes dotBounce {
  0%, 80%, 100% {
    transform: scale(0.6);
    opacity: 0.5;
  }
  40% {
    transform: scale(1);
    opacity: 1;
  }
}

/* --- Floating Particles Background --- */
.loading-particles {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}

.loading-particles .particle {
  position: absolute;
  width: 4px;
  height: 4px;
  background: #ff0033;
  border-radius: 50%;
  opacity: 0;
  animation: particleFloat 4s ease-in-out infinite;
}

.loading-particles .particle:nth-child(1) {
  left: 10%;
  animation-delay: 0s;
}
.loading-particles .particle:nth-child(2) {
  left: 25%;
  animation-delay: 0.5s;
}
.loading-particles .particle:nth-child(3) {
  left: 40%;
  animation-delay: 1s;
}
.loading-particles .particle:nth-child(4) {
  left: 60%;
  animation-delay: 1.5s;
}
.loading-particles .particle:nth-child(5) {
  left: 75%;
  animation-delay: 2s;
}
.loading-particles .particle:nth-child(6) {
  left: 90%;
  animation-delay: 2.5s;
}

@keyframes particleFloat {
  0% {
    bottom: -10px;
    opacity: 0;
    transform: translateX(0) scale(0);
  }
  10% {
    opacity: 1;
    transform: translateX(0) scale(1);
  }
  90% {
    opacity: 1;
    transform: translateX(20px) scale(1);
  }
  100% {
    bottom: 100%;
    opacity: 0;
    transform: translateX(30px) scale(0);
  }
}

/* --- Mobile Responsive --- */
@media (max-width: 480px) {
  .loading-logo-container {
    width: 140px;
    height: 140px;
  }

  .loading-logo {
    width: 80px;
    height: 80px;
  }

  .loading-logo-img {
    max-width: 45px;
    max-height: 45px;
  }

  .loading-logo-icon {
    font-size: 32px;
  }

  .loading-store-name {
    font-size: 18px;
    letter-spacing: 3px;
  }

  .loading-status {
    font-size: 10px;
    letter-spacing: 2px;
  }

  .loading-dots span {
    width: 6px;
    height: 6px;
  }
}
