/* Загрузочный экран */
.loader-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, #1a1b4b 0%, #182848 100%);
  background-size: 400% 400%;
  animation: gradientBG 15s ease infinite;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  transition: opacity 0.5s ease-out;
}

.loader-container.hide {
  opacity: 0;
  pointer-events: none;
}

@keyframes gradientBG {
  0% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
  100% {
    background-position: 0% 50%;
  }
}

.loader-content {
  text-align: center;
  color: white;
  padding: 40px;
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 20px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

.loader-logo {
  width: 80px;
  height: 80px;
  margin: 0 auto 24px;
  background: linear-gradient(135deg, #4f46e5 0%, #3b82f6 100%);
  border-radius: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 20px rgba(79, 70, 229, 0.3);
  animation: loaderPulse 2s infinite;
}

@keyframes loaderPulse {
  0% {
    transform: scale(1);
    box-shadow: 0 4px 20px rgba(79, 70, 229, 0.3);
  }
  50% {
    transform: scale(1.05);
    box-shadow: 0 8px 30px rgba(79, 70, 229, 0.5);
  }
  100% {
    transform: scale(1);
    box-shadow: 0 4px 20px rgba(79, 70, 229, 0.3);
  }
}

.loader-logo svg {
  width: 50px;
  height: 50px;
  fill: white;
}

.loader-title {
  font-size: 28px;
  font-weight: 600;
  margin-bottom: 16px;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.loader-subtitle {
  font-size: 18px;
  margin-bottom: 32px;
  opacity: 0.9;
}

/* Прогресс бар */
.loader-progress {
  width: 300px;
  height: 4px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 4px;
  overflow: hidden;
  margin: 0 auto 24px;
}

.loader-progress-bar {
  height: 100%;
  background: linear-gradient(90deg, #4f46e5 0%, #3b82f6 100%);
  border-radius: 4px;
  width: 0%;
  animation: progressAnimation 2s ease-in-out forwards;
  position: relative;
  overflow: hidden;
}

.loader-progress-bar::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: linear-gradient(
    45deg,
    transparent 45%,
    rgba(255, 255, 255, 0.3) 50%,
    transparent 55%
  );
  animation: shimmer 1s infinite;
}

@keyframes shimmer {
  0% {
    transform: translateX(-100%) rotate(45deg);
  }
  100% {
    transform: translateX(100%) rotate(45deg);
  }
}

@keyframes progressAnimation {
  0% {
    width: 0%;
  }
  30% {
    width: 40%;
  }
  60% {
    width: 75%;
  }
  80% {
    width: 90%;
  }
  100% {
    width: 100%;
  }
}

.loader-status {
  font-size: 14px;
  color: rgba(255, 255, 255, 0.8);
  margin-top: 16px;
}

.loading-dots {
  display: inline-block;
  width: 20px;
  text-align: left;
}

.loading-dots::after {
  content: '.';
  animation: dots 1.5s steps(5, end) infinite;
}

@keyframes dots {
  0%, 20% {
    content: '.';
  }
  40% {
    content: '..';
  }
  60% {
    content: '...';
  }
  80%, 100% {
    content: '';
  }
}

/* Адаптивность для мобильных устройств */
@media (max-width: 768px) {
  .loader-content {
    padding: 30px 20px;
    margin: 20px;
  }

  .loader-logo {
    width: 60px;
    height: 60px;
  }

  .loader-logo svg {
    width: 40px;
    height: 40px;
  }

  .loader-title {
    font-size: 24px;
  }

  .loader-subtitle {
    font-size: 16px;
  }

  .loader-progress {
    width: 100%;
    max-width: 250px;
  }
}

/* Спиннер для кнопок */
.button-spinner {
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  border-top-color: white;
  animation: spin 1s linear infinite;
  margin-right: 8px;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* Эффект появления контента */
.fade-in {
  animation: fadeIn 0.6s ease-out;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
