/* Loading Screen Styles */
.loader {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, #B0B1B5 0%, #f59e0b 50%, #B0B1B5 100%);
    display: flex;
  justify-content: center;
  align-items: center;
  z-index: 10000;
  transition: all 0.8s ease-in-out;
  overflow: hidden;
}

.loader::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1000 1000"><defs><pattern id="grid" width="50" height="50" patternUnits="userSpaceOnUse"><path d="M 50 0 L 0 0 0 50" fill="none" stroke="rgba(255,255,255,0.1)" stroke-width="1"/></pattern></defs><rect width="100%" height="100%" fill="url(%23grid)"/></svg>');
  animation: backgroundFloat 20s ease-in-out infinite;
  opacity: 0.3;
}

.loader::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: radial-gradient(circle at 20% 80%, rgba(255, 255, 255, 0.1) 0%, transparent 50%),
              radial-gradient(circle at 80% 20%, rgba(255, 255, 255, 0.1) 0%, transparent 50%),
              radial-gradient(circle at 40% 40%, rgba(255, 255, 255, 0.05) 0%, transparent 50%);
  animation: backgroundPulse 8s ease-in-out infinite;
  opacity: 0.6;
}

.loader-container {
  text-align: center;
  color: white;
  position: relative;
  z-index: 2;
  animation: fadeInUp 1.2s ease-out;
}

.loader-logo {
  margin-bottom: 3rem;
  animation: logoFloat 4s ease-in-out infinite;
  position: relative;
}

.loader-img {
  width: 200px;
  height: 200px;
  object-fit: contain;
  border-radius: 25px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
  animation: logoGlow 2.5s ease-in-out infinite;
  transition: all 0.4s ease;
  position: relative;
  z-index: 1;
}

.loader-img:hover {
  transform: scale(1.1);
  box-shadow: 0 15px 40px rgba(0, 0, 0, 0.3);
}

.loader-text h2 {
  font-size: 3rem;
  font-weight: 800;
  margin-bottom: 1rem;
  background: linear-gradient(45deg, #ffffff, #ffffff, #ffffff, #ffffff);
  background-size: 300% 300%;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: gradientShift 3s ease-in-out infinite;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  filter: drop-shadow(0 0 3px rgba(255, 255, 255, 0.1));
  position: relative;
}

.loader-text h2::after {
  content: "";
  position: absolute;
  bottom: -8px;
  left: 50%;
  transform: translateX(-50%);
  width: 120px;
  height: 3px;
  background: linear-gradient(90deg, #ffffff, #ffffff, #ffffff);
  border-radius: 2px;
  animation: lineGlow 2s ease-in-out infinite;
}

.loader-text p {
  font-size: 1.4rem;
  font-weight: 600;
  opacity: 0.95;
  margin-bottom: 3.5rem;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
  animation: textPulse 2.5s ease-in-out infinite;
  filter: drop-shadow(0 0 2px rgba(255, 255, 255, 0.1));
  background: linear-gradient(45deg, #ffffff, #ffffff, #ffffff);
  background-size: 200% 200%;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: gradientShift 3s ease-in-out infinite, textPulse 2.5s ease-in-out infinite;
}

.loader-progress {
  width: 250px;
  height: 6px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 3px;
  margin: 0 auto 2.5rem;
  overflow: hidden;
  position: relative;
  box-shadow: inset 0 0 10px rgba(255, 255, 255, 0.1);
}

.progress-bar {
  height: 100%;
  background: linear-gradient(90deg, #ffffff, #f0f9ff, #e0f2fe);
  border-radius: 3px;
  width: 0%;
  animation: progressLoad 4s ease-in-out infinite;
  position: relative;
  box-shadow: 0 0 10px rgba(255, 255, 255, 0.5);
  transition: width 0.4s ease;
}

.progress-bar::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
  animation: shimmer 1.5s ease-in-out infinite;
}

.loader-dots {
  display: flex;
  justify-content: center;
  gap: 0.8rem;
  margin-top: 1.5rem;
}

.loader-dots span {
  width: 16px;
  height: 16px;
  background: #ffffff;
  border-radius: 50%;
  animation: dotBounce 1.8s ease-in-out infinite both;
  box-shadow: 0 0 10px rgba(255, 255, 255, 0.5);
  position: relative;
}

.loader-dots span:nth-child(1) {
  animation-delay: -0.4s;
}

.loader-dots span:nth-child(2) {
  animation-delay: -0.2s;
}

.loader-dots span:nth-child(3) {
  animation-delay: 0s;
}

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

@keyframes logoGlow {
  0%, 100% {
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
  }
  50% {
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.4), 0 0 30px rgba(255, 255, 255, 0.3);
  }
}

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

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

@keyframes shimmer {
  0% {
    transform: translateX(-100%);
  }
  100% {
    transform: translateX(100%);
  }
}

@keyframes dotBounce {
  0%, 80%, 100% {
    transform: scale(0.8);
    opacity: 0.6;
  }
  40% {
    transform: scale(1.2);
    opacity: 1;
  }
}

@keyframes textPulse {
  0%, 100% {
    transform: scale(1);
    opacity: 0.9;
  }
  50% {
    transform: scale(1.02);
    opacity: 1;
  }
}

@keyframes lineGlow {
  0%, 100% {
    opacity: 0.6;
    transform: translateX(-50%) scaleX(0.8);
  }
  50% {
    opacity: 1;
    transform: translateX(-50%) scaleX(1.2);
  }
}

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

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

@keyframes backgroundFloat {
  0%, 100% {
    transform: translateY(0px) scale(1);
  }
  50% {
    transform: translateY(-10px) scale(1.02);
  }
}

@keyframes backgroundPulse {
  0%, 100% {
    opacity: 0.6;
    transform: scale(1);
  }
  50% {
    opacity: 0.8;
    transform: scale(1.02);
  }
}

/* Hide loader when page is loaded */
.loader.hidden {
  opacity: 0;
  visibility: hidden;
  transform: scale(0.8);
}

/* Body styles when loader is active */
body.loading {
  overflow: hidden;
}

/* Loader Responsive Design */
@media (max-width: 768px) {
  .loader-text h2 {
    font-size: 2.2rem;
  }

  .loader-text p {
    font-size: 1.1rem;
  }

  .loader-img {
    width: 160px;
    height: 160px;
  }

  .loader-progress {
    width: 200px;
    height: 5px;
  }

  .loader-dots span {
    width: 14px;
    height: 14px;
  }

  .loader-logo {
    margin-bottom: 2.5rem;
  }
}

@media (max-width: 480px) {
  .loader-text h2 {
    font-size: 1.8rem;
  }

  .loader-text p {
    font-size: 1rem;
  }

  .loader-img {
    width: 100px;
    height: 100px;
  }

  .loader-progress {
    width: 180px;
    height: 4px;
  }

  .loader-dots span {
    width: 12px;
    height: 12px;
  }

  .loader-logo {
    margin-bottom: 2rem;
  }

  .loader-text h2::after {
    width: 100px;
    height: 2px;
  }
}
