/* Preloader Styles */
.preloader {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  min-height: 100vh;
  min-height: -webkit-fill-available;
  background-color: #ffffff;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  z-index: 9999;
  transition: opacity 0.5s ease-out, visibility 0.5s ease-out;
  overflow: hidden;
}

.preloader.hidden {
  opacity: 0;
  visibility: hidden;
}

.preloader__content {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 20px;
}

.preloader__logo {
  width: clamp(40px, 6vw, 55px);
  height: clamp(40px, 6vw, 55px);
  object-fit: cover;
  border-radius: 50%;
  animation: logoFadeScale 1.5s ease-in-out infinite;
  z-index: 2;
  background: transparent;
  mix-blend-mode: multiply;
}

@keyframes logoFadeScale {
  0%, 100% {
    opacity: 0.8;
    transform: scale(1);
  }
  50% {
    opacity: 1;
    transform: scale(1.08);
  }
}

.preloader__spinner {
  position: absolute;
  width: clamp(60px, 9vw, 75px);
  height: clamp(60px, 9vw, 75px);
  border: clamp(2px, 0.25vw, 2.5px) solid rgba(0, 0, 0, 0.08);
  border-top-color: #3a9c40;
  border-radius: 50%;
  animation: spin 1.2s linear infinite;
  z-index: 1;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* Disable scroll when preloader is active */
body.preloader-active {
  overflow: hidden;
  position: fixed;
  width: 100%;
  height: 100%;
}

/* Extra Small Devices (phones, 320px to 480px) */
@media (max-width: 480px) {
  .preloader__logo {
    width: 35px;
    height: 35px;
  }
  
  .preloader__spinner {
    width: 55px;
    height: 55px;
    border-width: 2px;
  }
}

/* Small Devices (tablets, 481px to 768px) */
@media (min-width: 481px) and (max-width: 768px) {
  .preloader__logo {
    width: 42px;
    height: 42px;
  }
  
  .preloader__spinner {
    width: 62px;
    height: 62px;
    border-width: 2px;
  }
}

/* Medium Devices (small laptops, 769px to 1024px) */
@media (min-width: 769px) and (max-width: 1024px) {
  .preloader__logo {
    width: 48px;
    height: 48px;
  }
  
  .preloader__spinner {
    width: 68px;
    height: 68px;
    border-width: 2.5px;
  }
}

/* Large Devices (desktops, 1025px to 1440px) */
@media (min-width: 1025px) and (max-width: 1440px) {
  .preloader__logo {
    width: 52px;
    height: 52px;
  }
  
  .preloader__spinner {
    width: 72px;
    height: 72px;
    border-width: 2.5px;
  }
}

/* Extra Large Devices (large desktops, 1441px and up) */
@media (min-width: 1441px) {
  .preloader__logo {
    width: 55px;
    height: 55px;
  }
  
  .preloader__spinner {
    width: 75px;
    height: 75px;
    border-width: 2.5px;
  }
}

/* Landscape orientation for mobile devices */
@media (max-height: 500px) and (orientation: landscape) {
  .preloader__logo {
    width: 32px;
    height: 32px;
  }
  
  .preloader__spinner {
    width: 50px;
    height: 50px;
    border-width: 2px;
  }
}

/* High DPI / Retina Displays */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
  .preloader__spinner {
    border-width: 2.5px;
  }
}
