/* ============================================================
   Scroll Progress Bar
   CNC Website · Dhofar University · 2026
   ============================================================ */

#scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  z-index: 1001; /* above navbar (1000) */
  background: transparent;
  pointer-events: none;
}

#scroll-progress-bar {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg,
    var(--color-primary) 0%,
    var(--color-primary-light) 50%,
    var(--color-green) 100%
  );
  box-shadow: none;
  border-radius: 0 var(--radius-full) var(--radius-full) 0;
  transition: width 0.05s linear;
  will-change: width;
}

/* RTL — mirror from right */
[dir="rtl"] #scroll-progress-bar {
  margin-left: auto;
  border-radius: var(--radius-full) 0 0 var(--radius-full);
}

/* ── Back-to-Top Button ──────────────────────────────────── */
#back-to-top {
  position: fixed;
  bottom: var(--space-8);
  right: var(--space-8);
  width: 48px;
  height: 48px;
  background: var(--color-primary);
  border: none;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transform: translateY(16px);
  transition: all var(--transition-base);
  color: #ffffff;
  font-size: var(--text-lg);
  box-shadow: var(--shadow-lg);
}
#back-to-top.is-visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}
#back-to-top:hover {
  background: var(--color-primary-light);
  box-shadow: var(--shadow-xl);
  transform: translateY(-3px);
}
[dir="rtl"] #back-to-top { right: auto; left: var(--space-8); }

@media (max-width: 767px) {
  #back-to-top { bottom: var(--space-6); right: var(--space-4); }
  [dir="rtl"] #back-to-top { right: auto; left: var(--space-4); }
}
