* {
  box-sizing: border-box;
  padding: 0;
  margin: 0;
}

body {
  overflow: hidden;
  background: var(--initial-loader-bg);
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

#loading-bg {
  position: fixed;
  z-index: 9999;
  display: flex;
  overflow: hidden;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #fff 0%, #f8f9fa 50%, #f0f2f0 100%);
  block-size: 100%;
  inline-size: 100%;
  inset-block-start: 0;
  inset-inline-start: 0;
}

html {
  overflow: hidden scroll;
}

.loading {
  position: relative;
  display: flex;
  box-sizing: border-box;
  align-items: center;
  justify-content: center;
  border: 3px solid transparent;
  border-radius: 50%;
  block-size: 55px;
  gap: 0.5rem;
  inline-size: 55px;
  margin-block-end: 2rem;
}

.effects {
  border-radius: 50%;
  animation: bounce 1.4s ease-in-out infinite both;
  background: linear-gradient(45deg, var(--initial-loader-color), var(--accent-color));
  block-size: 12px;
  box-shadow: 0 0 15px var(--glow-color);
  inline-size: 12px;
}

.loading .effect-1,
.loading .effect-2,
.loading .effect-3 {
  position: absolute;
  box-sizing: border-box;
  border: 3px solid transparent;
  border-radius: 50%;
  block-size: 100%;
  border-inline-start: 3px solid var(--initial-loader-color, #eee);
  inline-size: 100%;
}

.loading .effect-1 {
  animation: rotate 1s ease infinite;
}

.loading .effect-2 {
  animation: rotate-opacity 1s ease infinite 0.1s;
}

.loading .effect-3 {
  animation: rotate-opacity 1s ease infinite 0.2s;
}

.loading .effects {
  transition: all 0.3s ease;
}

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

  100% {
    transform: rotate(1turn);
  }
}

@keyframes rotate-opacity {
  0% {
    opacity: 0.1;
    transform: rotate(0deg);
  }

  100% {
    opacity: 1;
    transform: rotate(1turn);
  }
}

/* Animated background particles */
#loading-bg::before {
  position: absolute;
  animation: backgroundShift 8s ease-in-out infinite;
  background-image:
    radial-gradient(circle at 20% 80%, var(--soft-green) 0%, transparent 50%),
    radial-gradient(circle at 80% 20%, rgba(107, 124, 42, 8%) 0%, transparent 50%),
    radial-gradient(circle at 40% 40%, rgba(143, 160, 72, 6%) 0%, transparent 50%);
  block-size: 100%;
  content: '';
  inline-size: 100%;
  inset-block-start: 0;
  inset-inline-start: 0;
  pointer-events: none;
}

@keyframes background-shift {
  0%, 100% {
    transform: translateX(0) translateY(0);
  }

  25% {
    transform: translateX(-10px) translateY(-10px);
  }

  50% {
    transform: translateX(10px) translateY(10px);
  }

  75% {
    transform: translateX(-5px) translateY(5px);
  }
}

.loading-logo {
  position: relative;
  animation: logoFloat 3s ease-in-out infinite;
  margin-block-end: 3rem;
}

.loading-logo svg {
  animation: logoGlow 2s ease-in-out infinite alternate;
  block-size: 200px;
  filter: drop-shadow(0 0 20px var(--glow-color)) drop-shadow(0 4px 15px var(--shadow-color));
  inline-size: 200px;
}

@keyframes logo-glow {
  from {
    filter: drop-shadow(0 0 20px var(--glow-color)) drop-shadow(0 4px 15px var(--shadow-color));
  }

  to {
    filter: drop-shadow(0 0 30px var(--initial-loader-color)) drop-shadow(0 0 40px var(--glow-color)) drop-shadow(0 6px 20px var(--shadow-color));
  }
}

@keyframes logo-float {
  0%, 100% {
    transform: translateY(0);
  }

  50% {
    transform: translateY(-10px);
  }
}

.app-title {
  animation: titleGlow 2s ease-in-out infinite alternate;
  color: var(--text-color);
  font-size: 2.5rem;
  font-weight: 300;
  letter-spacing: 0.1em;
  margin-block-end: 1rem;
  text-shadow: 0 0 20px var(--glow-color);
  text-transform: uppercase;
}

@keyframes title-glow {
  from {
    text-shadow: 0 0 20px var(--glow-color);
  }

  to {
    text-shadow: 0 0 30px var(--initial-loader-color), 0 0 40px var(--glow-color);
  }
}

.loading-subtitle {
  animation: subtitlePulse 2s ease-in-out infinite;
  color: rgba(69, 80, 24, 70%);
  font-size: 1rem;
  letter-spacing: 0.05em;
  margin-block-end: 3rem;
}

@keyframes subtitle-pulse {
  0%, 100% {
    opacity: 0.7;
  }

  50% {
    opacity: 1;
  }
}

@keyframes bounce {
  0%, 80%, 100% {
    opacity: 0.5;
    transform: scale(0.8);
  }

  40% {
    opacity: 1;
    transform: scale(1.2);
  }
}

.loading-progress {
  position: relative;
  overflow: hidden;
  border-radius: 2px;
  background: rgba(69, 80, 24, 20%);
  block-size: 3px;
  box-shadow: inset 0 1px 3px rgba(69, 80, 24, 10%);
  inline-size: 300px;
  margin-block-end: 1rem;
}

.progress-bar {
  border-radius: 2px;
  animation: progressFill 3s ease-in-out infinite;
  background: linear-gradient(90deg, var(--dark-green), var(--initial-loader-color), var(--accent-color));
  block-size: 100%;
  box-shadow: 0 0 10px var(--glow-color);
  inline-size: 0%;
}

@keyframes progress-fill {
  0% {
    inline-size: 0%;
  }

  50% {
    inline-size: 70%;
  }

  100% {
    inline-size: 100%;
  }
}

.loading-text {
  animation: textFade 2s ease-in-out infinite;
  color: rgba(69, 80, 24, 80%);
  font-size: 0.9rem;
  font-weight: 500;
  letter-spacing: 0.05em;
}

@keyframes text-fade {
  0%, 100% {
    opacity: 0.8;
  }

  50% {
    opacity: 1;
  }
}

/* Responsive design */
@media (max-width: 768px) {
  .loading-logo {
    margin-block-end: 2rem;
  }

  .loading-logo svg {
    block-size: 100px;
    filter: drop-shadow(0 0 15px var(--glow-color)) drop-shadow(0 3px 10px var(--shadow-color));
    inline-size: 100px;
  }

  .app-title {
    font-size: 2rem;
  }

  .loading-progress {
    inline-size: 250px;
  }
}

@media (max-width: 480px) {
  .loading-logo svg {
    block-size: 80px;
    filter: drop-shadow(0 0 10px var(--glow-color)) drop-shadow(0 2px 8px var(--shadow-color));
    inline-size: 80px;
  }

  .app-title {
    font-size: 1.5rem;
  }

  .loading-progress {
    inline-size: 200px;
  }
}
