/**
 * Bilal Siraj Travels — smart brand loader (site-wide)
 * Emerald #0c4f3e · Gold #c4a35a
 */

html.bst-loading,
html.bst-loading body {
  overflow: hidden !important;
}

.bst-smart-loader {
  position: fixed;
  inset: 0;
  z-index: 2147483000;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding:
    max(24px, env(safe-area-inset-top, 0px))
    24px
    max(28px, env(safe-area-inset-bottom, 0px));
  background:
    radial-gradient(120% 80% at 50% 0%, rgba(196, 163, 90, 0.22) 0%, transparent 55%),
    radial-gradient(90% 60% at 100% 100%, rgba(240, 212, 138, 0.12) 0%, transparent 50%),
    linear-gradient(165deg, #062820 0%, #0c4f3e 48%, #08382d 100%);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.4s ease, visibility 0.4s ease;
  box-sizing: border-box;
}

html.bst-loading .bst-smart-loader,
.bst-smart-loader.is-visible {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.bst-smart-loader.is-hiding {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.bst-smart-loader__panel {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  width: min(100%, 320px);
  text-align: center;
}

.bst-smart-loader__logo-stage {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: min(52vw, 188px);
  height: min(52vw, 188px);
  margin-bottom: 2px;
}

.bst-smart-loader__ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  pointer-events: none;
  box-sizing: border-box;
}

.bst-smart-loader__ring--outer {
  border: 1.5px solid transparent;
  border-top-color: rgba(240, 212, 138, 0.85);
  border-right-color: rgba(196, 163, 90, 0.25);
  animation: bst-smart-spin 2.4s linear infinite;
  filter: drop-shadow(0 0 6px rgba(240, 212, 138, 0.35));
}

.bst-smart-loader__ring--mid {
  inset: 12px;
  border: 1.5px dashed rgba(196, 163, 90, 0.45);
  border-bottom-color: rgba(240, 212, 138, 0.9);
  border-left-color: transparent;
  animation: bst-smart-spin-rev 3.2s linear infinite;
}

.bst-smart-loader__orbit {
  position: absolute;
  inset: 4px;
  border-radius: 50%;
  animation: bst-smart-spin 1.8s linear infinite;
  pointer-events: none;
}

.bst-smart-loader__orbit i {
  position: absolute;
  top: 0;
  left: 50%;
  width: 9px;
  height: 9px;
  margin: -4px 0 0 -4px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #fff8e6 0%, #f0d48a 45%, #c4a35a 100%);
  box-shadow: 0 0 10px rgba(240, 212, 138, 0.85), 0 0 2px #fff;
}

.bst-smart-loader__logo-wrap {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  width: min(42vw, 140px);
  height: min(42vw, 140px);
  padding: 12px;
  border-radius: 26px;
  overflow: hidden;
  background: linear-gradient(180deg, #fffefb 0%, #f7f2e8 100%);
  border: 1px solid rgba(196, 163, 90, 0.55);
  box-shadow:
    0 18px 40px rgba(0, 0, 0, 0.28),
    0 0 0 4px rgba(196, 163, 90, 0.18),
    0 0 28px rgba(196, 163, 90, 0.22);
  box-sizing: border-box;
  animation: bst-smart-logo-pulse 2.2s ease-in-out infinite;
}

.bst-smart-loader__shine {
  position: absolute;
  inset: -20% -40%;
  z-index: 2;
  background: linear-gradient(
    105deg,
    transparent 35%,
    rgba(255, 255, 255, 0.55) 48%,
    rgba(240, 212, 138, 0.28) 52%,
    transparent 65%
  );
  transform: translateX(-60%) rotate(8deg);
  animation: bst-smart-shine 2.6s ease-in-out infinite;
  pointer-events: none;
}

.bst-smart-loader__logo {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 100%;
  max-width: 116px;
  max-height: 116px;
  object-fit: contain;
  border-radius: 14px;
  animation: bst-smart-logo-breathe 2.2s ease-in-out infinite;
}

.bst-smart-loader__logo-wrap--mark {
  width: min(36vw, 112px);
  height: min(36vw, 112px);
  border-radius: 50%;
  padding: 0;
}

.bst-smart-loader__mark {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: clamp(1.85rem, 7vw, 2.35rem);
  font-weight: 800;
  letter-spacing: 0.04em;
  line-height: 1;
  color: #0c4f3e;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.65);
  animation: bst-smart-logo-breathe 2.2s ease-in-out infinite;
}

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

@keyframes bst-smart-spin-rev {
  to {
    transform: rotate(-360deg);
  }
}

@keyframes bst-smart-logo-pulse {
  0%,
  100% {
    box-shadow:
      0 18px 40px rgba(0, 0, 0, 0.28),
      0 0 0 4px rgba(196, 163, 90, 0.16),
      0 0 18px rgba(196, 163, 90, 0.16);
  }
  50% {
    box-shadow:
      0 20px 46px rgba(0, 0, 0, 0.32),
      0 0 0 6px rgba(240, 212, 138, 0.28),
      0 0 36px rgba(240, 212, 138, 0.35);
  }
}

@keyframes bst-smart-logo-breathe {
  0%,
  100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.03);
  }
}

@keyframes bst-smart-shine {
  0%,
  35% {
    transform: translateX(-70%) rotate(8deg);
    opacity: 0;
  }
  45% {
    opacity: 1;
  }
  70%,
  100% {
    transform: translateX(70%) rotate(8deg);
    opacity: 0;
  }
}

.bst-smart-loader__kicker {
  display: none;
}

.bst-smart-loader__rule {
  width: 52px;
  height: 3px;
  border-radius: 999px;
  background: linear-gradient(90deg, #f0d48a 0%, #c4a35a 100%);
}

.bst-smart-loader__title {
  margin: 0;
  font-size: clamp(1.25rem, 5vw, 1.55rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.2;
  color: #fff;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.25);
}

.bst-smart-loader__sub {
  margin: 0;
  font-size: 0.9rem;
  font-weight: 500;
  color: rgba(255, 253, 248, 0.78);
}

.bst-smart-loader__track {
  width: min(100%, 200px);
  height: 3px;
  margin-top: 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.14);
  overflow: hidden;
}

.bst-smart-loader__bar {
  height: 100%;
  width: 8%;
  border-radius: inherit;
  background: linear-gradient(90deg, #c4a35a 0%, #f0d48a 100%);
  transition: width 0.28s ease;
}

.bst-smart-loader__dots {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 8px;
}

.bst-smart-loader__dots span {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #c4a35a;
  opacity: 0.35;
  animation: bst-smart-dot 1.1s ease-in-out infinite;
}

.bst-smart-loader__dots span:nth-child(2) {
  animation-delay: 0.15s;
}

.bst-smart-loader__dots span:nth-child(3) {
  animation-delay: 0.3s;
}

@keyframes bst-smart-dot {
  0%,
  80%,
  100% {
    opacity: 0.3;
    transform: translateY(0) scale(0.9);
  }
  40% {
    opacity: 1;
    transform: translateY(-4px) scale(1.1);
    background: #f0d48a;
  }
}

/* Thin top progress for in-site navigations */
.bst-smart-topbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 2147483001;
  height: 3px;
  pointer-events: none;
  background: transparent;
  overflow: hidden;
}

.bst-smart-topbar[hidden] {
  display: none !important;
}

.bst-smart-topbar__bar {
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, #0c4f3e 0%, #c4a35a 55%, #f0d48a 100%);
  box-shadow: 0 0 10px rgba(196, 163, 90, 0.55);
  transition: width 0.35s ease;
}

.bst-smart-topbar.is-active .bst-smart-topbar__bar {
  width: 78%;
  transition: width 8s cubic-bezier(0.1, 0.5, 0.2, 1);
}

.bst-smart-topbar.is-done .bst-smart-topbar__bar {
  width: 100%;
  transition: width 0.2s ease;
}

@media (max-width: 380px) {
  .bst-smart-loader__logo-stage {
    width: min(56vw, 160px);
    height: min(56vw, 160px);
  }

  .bst-smart-loader__logo-wrap {
    width: min(46vw, 120px);
    height: min(46vw, 120px);
    border-radius: 22px;
  }

  .bst-smart-loader__logo-wrap--mark {
    width: min(40vw, 100px);
    height: min(40vw, 100px);
    border-radius: 50%;
  }

  .bst-smart-loader__ring--mid {
    inset: 10px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .bst-smart-loader,
  .bst-smart-loader__bar,
  .bst-smart-topbar__bar {
    transition: none;
  }

  .bst-smart-loader__dots span,
  .bst-smart-loader__ring,
  .bst-smart-loader__orbit,
  .bst-smart-loader__logo-wrap,
  .bst-smart-loader__logo,
  .bst-smart-loader__shine {
    animation: none;
  }

  .bst-smart-loader__dots span {
    opacity: 0.7;
  }

  .bst-smart-loader__shine {
    display: none;
  }
}

/* FM module shell: skip admin double-splash (iframe has its own) */
body.fm-module .bst-smart-loader {
  display: none !important;
}

body.fm-module.bst-loading,
html.bst-loading:has(body.fm-module) {
  overflow: auto !important;
}
