/* /public/loader.css */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* Body base */
body {
  font-family:
    "Tajawal",
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    Roboto,
    sans-serif;
  background: #fafaf9;
}
html.dark body {
  background: #0d0b08;
}

/* ---------- Loader ---------- */
#app-loader {
  position: fixed;
  inset: 0;
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(25px) saturate(180%);
  -webkit-backdrop-filter: blur(25px) saturate(180%);
  background: rgba(250, 250, 249, 0.65);
  transition:
    opacity 0.45s ease,
    visibility 0.45s ease;
  opacity: 1;
  visibility: visible;
}
html.dark #app-loader {
  background: rgba(13, 11, 8, 0.65);
}

/* Loader card */
.loader-card {
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-radius: 36px;
  padding: 42px 40px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 32px;
  box-shadow:
    0 25px 50px -12px rgba(92, 66, 18, 0.12),
    inset 0 0 0 1px rgba(255, 212, 132, 0.25);
  animation: loaderSlideUp 0.5s cubic-bezier(0.22, 0.61, 0.36, 1);
  max-width: calc(100vw - 32px);
}
html.dark .loader-card {
  background: rgba(26, 23, 20, 0.92);
  box-shadow:
    0 25px 50px -12px rgba(0, 0, 0, 0.5),
    inset 0 0 0 1px rgba(255, 212, 132, 0.08);
}

@keyframes loaderSlideUp {
  0% {
    opacity: 0;
    transform: translateY(20px) scale(0.97);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* Logo area - primary gradient */
.loader-icon {
  position: relative;
  width: 112px;
  height: 112px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #fffdf9, #fff5df);
  border-radius: 9999px;
  box-shadow:
    0 10px 15px -3px rgba(255, 212, 132, 0.2),
    0 4px 6px -4px rgba(255, 212, 132, 0.15),
    inset 0 2px 4px rgba(255, 255, 255, 0.6);
  transition: all 0.4s ease;
}
html.dark .loader-icon {
  background: linear-gradient(
    135deg,
    rgba(255, 212, 132, 0.15),
    rgba(245, 196, 106, 0.12)
  );
  box-shadow:
    0 10px 15px -3px rgba(0, 0, 0, 0.3),
    inset 0 2px 4px rgba(255, 212, 132, 0.08);
}

/* Icon */
.loader-icon img {
  width: 80px;
  height: 80px;
  filter: drop-shadow(0 4px 6px rgba(255, 212, 132, 0.35));
  transition: transform 0.4s ease;
}
html.dark .loader-icon img {
  filter: drop-shadow(0 4px 8px rgba(245, 196, 106, 0.4));
}
.loader-icon:hover img {
  transform: scale(1.08);
}

/* Typography */
.loader-app-name {
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -0.3px;
  color: #5c4212;
}
html.dark .loader-app-name {
  color: #ffe8a3;
}

.loader-tagline {
  font-size: 14px;
  font-weight: 500;
  color: #a07624;
  margin-top: 4px;
  text-align: center;
}
html.dark .loader-tagline {
  color: #ffda6e;
}

/* Progress bar */
.progress-wrapper {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}
.progress-track {
  width: 100%;
  height: 3px;
  background: rgba(255, 212, 132, 0.15);
  border-radius: 10px;
  overflow: hidden;
}
html.dark .progress-track {
  background: rgba(255, 218, 110, 0.12);
}
.progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #ffd484, #f5c46a);
  border-radius: 10px;
  transition: width 0.25s ease;
}
.progress-label {
  font-size: 12px;
  font-weight: 500;
  color: #a07624;
}
html.dark .progress-label {
  color: #ffe8a3;
}

/* Hide loader when app mounts */
#app-loader.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

/* Responsive */
@media (max-width: 640px) {
  .loader-card {
    padding: 32px 28px;
    gap: 24px;
    border-radius: 32px;
  }
  .loader-icon {
    width: 72px;
    height: 72px;
  }
  .loader-icon img {
    width: 40px;
    height: 40px;
  }
  .loader-app-name {
    font-size: 24px;
  }
  .loader-tagline {
    font-size: 13px;
  }
}

@media (max-width: 480px) {
  .loader-card {
    padding: 28px 24px;
    gap: 20px;
    border-radius: 28px;
  }
  .loader-icon {
    width: 64px;
    height: 64px;
  }
  .loader-icon img {
    width: 36px;
    height: 36px;
  }
  .loader-app-name {
    font-size: 22px;
  }
}
