/* ======== LOADER STYLES ======== */

.page-loader {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-secondary) 100%);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  z-index: 9999;
  opacity: 1;
  visibility: visible;
  transition: opacity 0.5s ease-out, visibility 0.5s ease-out;
}

.page-loader.fade-out {
  opacity: 0;
  visibility: hidden;
}

.loader-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--spacing-lg);
}

.loader-logo {
  width: 80px;
  height: 80px;
  opacity: 0.9;
  animation: logoFloat 2s ease-in-out infinite;
}

.loader-spinner {
  position: relative;
  width: 60px;
  height: 60px;
}

.spinner-ring {
  position: absolute;
  width: 100%;
  height: 100%;
  border: 3px solid transparent;
  border-top: 3px solid var(--color-accent);
  border-radius: 50%;
  animation: spin 1.2s linear infinite;
}

.spinner-ring:nth-child(2) {
  width: 80%;
  height: 80%;
  top: 10%;
  left: 10%;
  border-top-color: var(--color-light);
  animation-duration: 1.8s;
  animation-direction: reverse;
}

.spinner-ring:nth-child(3) {
  width: 60%;
  height: 60%;
  top: 20%;
  left: 20%;
  border-top-color: var(--color-accent);
  animation-duration: 2.4s;
  opacity: 0.7;
}

.loader-text {
  color: var(--color-light);
  font-family: var(--font-accent);
  font-size: var(--font-size-lg);
  font-weight: 600;
  text-align: center;
  letter-spacing: 1px;
  animation: textPulse 2s ease-in-out infinite;
}

.loader-progress {
  width: 200px;
  height: 4px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: var(--radius-full);
  overflow: hidden;
  margin-top: var(--spacing-md);
}

.loader-progress-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--color-accent), var(--color-light));
  border-radius: var(--radius-full);
  width: 0%;
  animation: progressFill 3s ease-out forwards;
}

.loader-steam {
  position: absolute;
  bottom: 20%;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 8px;
}

.steam-particle {
  width: 6px;
  height: 6px;
  background: rgba(245, 245, 220, 0.6);
  border-radius: 50%;
  animation: steamRise 2s ease-in-out infinite;
}

.steam-particle:nth-child(1) {
  animation-delay: 0s;
}

.steam-particle:nth-child(2) {
  animation-delay: 0.3s;
}

.steam-particle:nth-child(3) {
  animation-delay: 0.6s;
}

.steam-particle:nth-child(4) {
  animation-delay: 0.9s;
}

.steam-particle:nth-child(5) {
  animation-delay: 1.2s;
}

/* Анимации */
@keyframes spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

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

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

@keyframes progressFill {
  0% {
    width: 0%;
  }
  100% {
    width: 100%;
  }
}

@keyframes steamRise {
  0% {
    transform: translateY(0px);
    opacity: 0.6;
  }
  50% {
    transform: translateY(-20px);
    opacity: 1;
  }
  100% {
    transform: translateY(-40px);
    opacity: 0;
  }
}

/* Адаптивность */
@media (max-width: 768px) {
  .loader-logo {
    width: 60px;
    height: 60px;
  }
  
  .loader-spinner {
    width: 50px;
    height: 50px;
  }
  
  .loader-text {
    font-size: var(--font-size-md);
  }
  
  .loader-progress {
    width: 150px;
  }
}

/* Скрытие контента во время загрузки */
.loading .main-content {
  opacity: 0;
  visibility: hidden;
}

.main-content {
  opacity: 1;
  visibility: visible;
  transition: opacity 0.5s ease-in, visibility 0.5s ease-in;
}
