/* Original loader styles with modern enhancements */
.loader1 {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(8px);
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 9999;
  opacity: 0;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.loader2 {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(8px);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 9999;
  opacity: 1;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

#loader {
  transition: all 0.3s ease;
}

.loader-content {
  background: white;
  padding: 40px;
  border-radius: 20px;
  text-align: center;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  transform: scale(0.9);
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  position: relative;
  overflow: hidden;
}

.loader2 .loader-content {
  transform: scale(1);
}

.loader-content::before {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 4px;
  background: linear-gradient(90deg, #667eea, #764ba2, #f093fb, #f5576c);
  animation: shimmer 2s linear infinite;
}

@keyframes shimmer {
  0% {
    left: -100%;
  }
  100% {
    left: 100%;
  }
}

/* Modern spinner animation */
.modern-spinner {
  width: 80px;
  height: 80px;
  margin: 0 auto 20px;
  position: relative;
}

.spinner-ring {
  position: absolute;
  width: 80px;
  height: 80px;
  border: 4px solid transparent;
  border-radius: 50%;
  animation: spin 1.5s cubic-bezier(0.68, -0.55, 0.265, 1.55) infinite;
}

.spinner-ring:nth-child(1) {
  border-top: 4px solid #667eea;
  animation-delay: 0s;
}

.spinner-ring:nth-child(2) {
  border-right: 4px solid #764ba2;
  animation-delay: 0.3s;
  animation-direction: reverse;
}

.spinner-ring:nth-child(3) {
  border-bottom: 4px solid #f093fb;
  animation-delay: 0.6s;
}

.spinner-ring:nth-child(4) {
  border-left: 4px solid #f5576c;
  animation-delay: 0.9s;
  animation-direction: reverse;
}

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

.loader-text {
  color: #2c3e50;
  font-size: 18px;
  font-weight: 600;
  margin: 0;
  opacity: 0;
  animation: fadeInUp 0.6s ease-out 0.3s forwards;
}

.loader-subtext {
  color: #7f8c8d;
  font-size: 14px;
  margin: 10px 0 0 0;
  opacity: 0;
  animation: fadeInUp 0.6s ease-out 0.6s forwards;
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Floating dots animation */
.loading-dots {
  display: inline-block;
  margin-left: 5px;
}

.loading-dots::after {
  content: "";
  animation: dots 1.5s steps(4, end) infinite;
}

@keyframes dots {
  0%,
  20% {
    content: "";
  }
  40% {
    content: ".";
  }
  60% {
    content: "..";
  }
  80%,
  100% {
    content: "...";
  }
}


/* Responsive design */
@media (max-width: 768px) {
  .loader-content {
    margin: 20px;
    padding: 30px;
  }

  .modern-spinner {
    width: 60px;
    height: 60px;
  }

  .spinner-ring {
    width: 60px;
    height: 60px;
  }

  .loader-text {
    font-size: 16px;
  }

}

/* Pulse effect for extra visual appeal */
.pulse-ring {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 120px;
  height: 120px;
  border: 2px solid rgba(102, 126, 234, 0.3);
  border-radius: 50%;
  animation: pulse 2s ease-out infinite;
}

.pulse-ring:nth-child(2) {
  animation-delay: 0.5s;
}

.pulse-ring:nth-child(3) {
  animation-delay: 1s;
}

@keyframes pulse {
  0% {
    transform: translate(-50%, -50%) scale(0.8);
    opacity: 1;
  }
  100% {
    transform: translate(-50%, -50%) scale(1.5);
    opacity: 0;
  }
}
