/*=================================================
  App Preloader (Fanar - Sheikh Abdulla Bin Zaid
  Al Mahmoud Islamic Cultural Center)
  Shown until the inline script in index.html marks
  #app-preloader as "is-hidden" (after the app has
  rendered AND a minimum display time has elapsed).
==================================================*/

#app-preloader {
  position: fixed;
  inset: 0;
  z-index: 2147483647;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: radial-gradient(circle at 50% 20%, rgba(253, 153, 64, .45) 0%, var(--black, #2b2d42) 42%, #12131c 100%);
  transition: opacity .6s ease, visibility .6s ease;
}

/* subtle Islamic geometric tiling in the background */
#app-preloader::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    repeating-conic-gradient(from 0deg, rgba(253, 153, 64, 0.05) 0deg 45deg, transparent 45deg 90deg);
  background-size: 64px 64px;
  opacity: .5;
  animation: preloaderDrift 40s linear infinite;
}

@keyframes preloaderDrift {
  from { background-position: 0 0; }
  to { background-position: 640px 640px; }
}

.preloader-content {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 24px;
}

.preloader-logo {
  width: 420px;
  height: auto;
  margin-bottom: 40px;
  filter: drop-shadow(0 0 28px rgba(253, 153, 64, .4));
  animation: preloaderLogoPulse 2.6s ease-in-out infinite;
}

@keyframes preloaderLogoPulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.06); }
}

.preloader-name-ar {
  font-family: "jannaltbold", arial, sans-serif;
  font-size: 22px;
  line-height: 1.5;
  color: #fff;
  margin: 0 0 6px;
}

.preloader-name-en {
  font-family: arial, sans-serif;
  font-size: 14px;
  letter-spacing: .5px;
  color: #fff;
  margin: 0 0 28px;
  max-width: 340px;
}

.preloader-status {
  display: flex;
  align-items: center;
  gap: 2px;
  font-family: arial, sans-serif;
  font-size: 13px;
  color: #fff;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 22px;
}

.preloader-status .dots i {
  font-style: normal;
  opacity: .2;
  animation: dotPulse 1.4s infinite;
}

.preloader-status .dots i:nth-child(2) { animation-delay: .2s; }
.preloader-status .dots i:nth-child(3) { animation-delay: .4s; }

@keyframes dotPulse {
  0%, 80%, 100% { opacity: .2; }
  40% { opacity: 1; }
}

.preloader-bar-track {
  position: relative;
  width: 260px;
  height: 8px;
  border-radius: 999px;
  overflow: hidden;
  background: rgba(255, 255, 255, .08);
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, .5);
}

.preloader-bar-fill {
  position: absolute;
  inset: 0;
  width: 45%;
  border-radius: 999px;
  background: linear-gradient(90deg,
    transparent,
    var(--orange, #fd9940) 35%,
    var(--darkorange, #dd7d25) 50%,
    var(--orange, #fd9940) 65%,
    transparent);
  box-shadow: 0 0 14px 1px rgba(253, 153, 64, .65);
  animation: preloaderComet 1.7s ease-in-out infinite;
}

@keyframes preloaderComet {
  0% { transform: translateX(320%); }
  100% { transform: translateX(-120%); }
}

/* hidden once the inline script confirms the app has rendered
   AND the minimum display duration has elapsed */
#app-preloader.is-hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

@media (max-width: 480px) {
  .preloader-logo { width: 260px; }
  .preloader-name-ar { font-size: 18px; }
  .preloader-name-en { font-size: 12px; }
  .preloader-bar-track { width: 200px; }
}
