/* Preloader container */
.preloader {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, #ffffff 0%, #f5f5f5 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  transition: opacity 0.6s ease-out, visibility 0.6s ease-out;
}

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

.preloader-content {
  text-align: center;
  position: relative;
  z-index: 2;
}

/* Background animated gradient */
.preloader-bg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    45deg,
    rgba(0, 178, 214, 0.05),
    rgba(0, 0, 0, 0.02),
    rgba(0, 178, 214, 0.05)
  );
  animation: gradientShift 8s ease infinite;
  z-index: 1;
}

@keyframes gradientShift {
  0%, 100% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
}

/* Spinner animation */
.spinner-container {
  position: relative;
  width: 120px;
  height: 120px;
  margin: 0 auto;
}

.spinner {
  position: relative;
  width: 100%;
  height: 100%;
}

.spinner-ring {
  position: absolute;
  width: 100%;
  height: 100%;
  border: 4px solid transparent;
  border-radius: 50%;
  border-top-color: #00B2D6;
  border-right-color: #00B2D6;
  animation: spin 1.5s linear infinite;
}

.spinner-ring:nth-child(1) {
  animation-delay: 0s;
  border-top-color: #00B2D6;
  border-right-color: transparent;
}

.spinner-ring:nth-child(2) {
  animation-delay: 0.3s;
  border-top-color: transparent;
  border-right-color: #00A0C0;
  width: 85%;
  height: 85%;
  top: 7.5%;
  left: 7.5%;
}

.spinner-ring:nth-child(3) {
  animation-delay: 0.6s;
  border-top-color: #008EA8;
  border-right-color: transparent;
  width: 70%;
  height: 70%;
  top: 15%;
  left: 15%;
}

.spinner-ring:nth-child(4) {
  animation-delay: 0.9s;
  border-top-color: transparent;
  border-right-color: #007B90;
  width: 55%;
  height: 55%;
  top: 22.5%;
  left: 22.5%;
}

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

/* Brand info */
.preloader-brand h3 {
  color: #000;
  font-size: 1.5rem;
  margin: 0;
  animation: slideInDown 0.8s ease-out 0.2s both;
}

.preloader-brand p {
  animation: slideInUp 0.8s ease-out 0.4s both;
}

@keyframes slideInDown {
  from {
    opacity: 0;
    transform: translateY(-30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

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

/* Progress bar */
.progress-bar-container {
  width: 200px;
  height: 4px;
  background-color: #e0e0e0;
  border-radius: 2px;
  margin: 0 auto;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #00B2D6, #0099b8, #00B2D6);
  background-size: 200% 100%;
  border-radius: 2px;
  animation: progressLoad 2s ease-in-out infinite;
}

@keyframes progressLoad {
  0% {
    width: 0%;
  }
  50% {
    width: 80%;
  }
  100% {
    width: 100%;
  }
}

/* Loading text */
.preloader-text {
  color: #666;
  font-style: italic;
  animation: fadeInOut 2s ease-in-out infinite;
}

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

/* Responsive adjustments */
@media (max-width: 480px) {
  .spinner-container {
    width: 80px;
    height: 80px;
  }

  .preloader-brand h3 {
    font-size: 1.2rem;
  }

  .progress-bar-container {
    width: 150px;
  }
}
