/* Shimmer Skeleton Loader (Route-Aware, RTL + Dark/Light Theme) */
:root {
  --shimmer-base: rgba(120, 108, 92, 0.14);
  --shimmer-highlight: #f6f1ec;
  --hirfa-header-h: 76px;
}

[data-theme="dark"],
[data-bs-theme="dark"],
.dark {
  --shimmer-base: rgba(255, 255, 255, 0.08);
  --shimmer-highlight: #242220;
}

@keyframes hirfa-shimmer {
  0% {
    background-position: 200% 0;
  }
  100% {
    background-position: -200% 0;
  }
}

.hirfa-shimmer {
  display: block;
  background: linear-gradient(
    90deg,
    var(--shimmer-base) 25%,
    var(--shimmer-highlight) 50%,
    var(--shimmer-base) 75%
  );
  background-size: 200% 100%;
  animation: hirfa-shimmer 1.2s ease-in-out infinite;
  border-radius: 8px;
}

/* RTL support: sweep right-to-left */
[dir="rtl"] .hirfa-shimmer {
  animation-direction: reverse;
}

@media (prefers-reduced-motion: reduce) {
  .hirfa-shimmer {
    animation: none;
    background: var(--shimmer-base);
  }
}

@media (max-width: 900px) {
  :root {
    --hirfa-header-h: 64px;
  }
}

/* Image shimmer placeholder until loaded */
.hirfa-img-loading {
  background: linear-gradient(
    90deg,
    var(--shimmer-base) 25%,
    var(--shimmer-highlight) 50%,
    var(--shimmer-base) 75%
  );
  background-size: 200% 100%;
  animation: hirfa-shimmer 1.2s ease-in-out infinite;
}

[dir="rtl"] .hirfa-img-loading {
  animation-direction: reverse;
}

/* Map shimmer overlay while Leaflet tiles load */
.hirfa-map-shimmer {
  position: absolute;
  inset: 0;
  z-index: 350;
  border-radius: inherit;
  background: var(--card, #181818);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 18px;
  pointer-events: none;
  transition: opacity 0.25s ease;
  overflow: hidden;
}

.hirfa-map-shimmer::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    90deg,
    var(--shimmer-base) 25%,
    var(--shimmer-highlight) 50%,
    var(--shimmer-base) 75%
  );
  background-size: 200% 100%;
  animation: hirfa-shimmer 1.25s ease-in-out infinite;
  opacity: 0.75;
}

[dir="rtl"] .hirfa-map-shimmer::before {
  animation-direction: reverse;
}

.hirfa-map-shimmer.is-hidden {
  opacity: 0;
  visibility: hidden;
}

.hirfa-map-shimmer-grid {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 10px;
}

/* Reusable shimmer cards & rows */
.hirfa-sk-card {
  background: var(--card, rgba(255, 255, 255, 0.03));
  border: 1px solid var(--line, var(--border, rgba(128, 128, 128, 0.16)));
  border-radius: 16px;
  padding: 16px;
}

.hirfa-sk-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
}

.hirfa-sk-row + .hirfa-sk-row {
  border-top: 1px solid var(--line, var(--border, rgba(128, 128, 128, 0.1)));
}

/* Admin navigation shimmer inside .wassel-main (keeps sidebar + topbar crisp) */
.wassel-main.is-navigating > :not(.top):not(#wasselAdminShimmer) {
  display: none !important;
}

#wasselAdminShimmer {
  padding: 6px 0 28px;
  width: 100%;
}

/* Frontend navigation shimmer below fixed/sticky header */
#wasselFrontendShimmer {
  position: fixed;
  top: var(--hirfa-header-h, 76px);
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 35;
  background: var(--bg, #E8E0D2);
  overflow-y: auto;
  padding-bottom: 48px;
}

.hirfa-fe-wrap-1200 {
  max-width: 1200px;
  margin: 0 auto;
  padding: 36px 24px;
}

.hirfa-fe-wrap-1160 {
  max-width: 1160px;
  margin: 0 auto;
  padding: 40px 24px;
}

.hirfa-fe-wrap-820 {
  max-width: 820px;
  margin: 0 auto;
  padding: 32px 24px;
}

.hirfa-fe-grid-3 {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 24px;
}

.hirfa-fe-grid-2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 24px;
}

@media (max-width: 960px) {
  .hirfa-fe-grid-3 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .hirfa-fe-grid-2 {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 620px) {
  .hirfa-fe-grid-3 {
    grid-template-columns: 1fr;
  }
  .hirfa-fe-wrap-1200,
  .hirfa-fe-wrap-1160,
  .hirfa-fe-wrap-820 {
    padding: 24px 16px;
  }
}

/* Search popup shimmer */
.hirfa-gs-sk {
  padding: 8px 6px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.hirfa-gs-sk-item {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 8px 10px;
  border-radius: 12px;
  border: 1px solid var(--line, rgba(128, 128, 128, 0.14));
}

/* Screen-reader only fallback */
.hirfa-sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
