/* ============================================================
   components.css  |  Loading Screen · Navbar · Back to Top
   ============================================================ */

/* ════════════════════════════════════════════════
   LOADING SCREEN
════════════════════════════════════════════════ */
#loading-screen {
  position: fixed;
  inset: 0;
  background: #ffffff;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  transition: opacity 0.5s ease, visibility 0.5s ease;
}
#loading-screen.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.loader-monogram {
  font-family: var(--font-sans);
  font-size: 42px;
  font-weight: 700;
  letter-spacing: -1px;
  background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 28px;
  animation: loader-pulse 1.2s ease-in-out infinite;
}
@keyframes loader-pulse {
  0%,100% { opacity: 1; transform: scale(1); }
  50%      { opacity: 0.7; transform: scale(0.95); }
}

.loader-bar-track {
  width: 160px;
  height: 3px;
  background: var(--bg-tertiary);
  border-radius: var(--radius-full);
  overflow: hidden;
}
.loader-bar-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--accent-primary), var(--accent-secondary));
  border-radius: var(--radius-full);
  animation: loader-fill 1.6s cubic-bezier(0.4,0,0.2,1) forwards;
}
@keyframes loader-fill {
  0%   { width: 0%; }
  60%  { width: 80%; }
  100% { width: 100%; }
}

.loader-text {
  margin-top: 16px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--text-subtle);
}

/* ════════════════════════════════════════════════
   NAVBAR
════════════════════════════════════════════════ */
#navbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--nav-height);
  z-index: 1000;
  background: transparent;
  border-bottom: 1px solid transparent;
  transition: background var(--transition), box-shadow var(--transition), border-color var(--transition);
}
#navbar.scrolled {
  background: rgba(255,255,255,0.9);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom-color: var(--border-light);
  box-shadow: 0 1px 24px rgba(79,70,229,0.07);
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--space-xl);
}

/* Logo */
.nav-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  flex-shrink: 0;
}
.nav-logo-mark {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 700;
  color: #fff;
  letter-spacing: -0.5px;
  flex-shrink: 0;
  transition: transform var(--transition), box-shadow var(--transition);
}
.nav-logo:hover .nav-logo-mark {
  transform: scale(1.05) rotate(-3deg);
  box-shadow: 0 4px 16px rgba(79,70,229,0.3);
}
.nav-logo-name {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
  letter-spacing: -0.3px;
  transition: color var(--transition);
}
.nav-logo:hover .nav-logo-name { color: var(--accent-primary); }

/* Desktop links */
.nav-links {
  display: flex;
  align-items: center;
  gap: 4px;
}
.nav-link {
  position: relative;
  padding: 7px 13px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary);
  text-decoration: none;
  border-radius: var(--radius-sm);
  transition: color var(--transition), background var(--transition);
}
.nav-link::after {
  content: '';
  position: absolute;
  bottom: 3px;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--accent-primary), var(--accent-secondary));
  border-radius: var(--radius-full);
  transition: width var(--transition);
}
.nav-link:hover { color: var(--accent-primary); background: var(--accent-light); }
.nav-link:hover::after,
.nav-link.active::after { width: 60%; }
.nav-link.active { color: var(--accent-primary); font-weight: 600; }

/* Available badge */
.nav-available {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 500;
  color: #166534;
  background: #f0fdf4;
  border: 1px solid rgba(22,101,52,0.2);
  padding: 4px 11px;
  border-radius: var(--radius-full);
  margin-right: var(--space-sm);
}
.nav-available-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #22c55e;
  animation: availability-pulse 2s ease-in-out infinite;
}
@keyframes availability-pulse {
  0%,100% { box-shadow: 0 0 0 0 rgba(34,197,94,0.5); }
  50%      { box-shadow: 0 0 0 5px rgba(34,197,94,0); }
}

/* Hamburger */
.nav-hamburger {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 40px;
  height: 40px;
  padding: 8px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background var(--transition);
}
.nav-hamburger:hover { background: var(--accent-light); }
.nav-hamburger span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--text-secondary);
  border-radius: var(--radius-full);
  transition: transform 0.3s ease, opacity 0.3s ease, width 0.3s ease;
  transform-origin: center;
}
.nav-hamburger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-hamburger.open span:nth-child(2) { opacity: 0; width: 0; }
.nav-hamburger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* Mobile drawer */
#mobile-menu {
  display: none;
  position: fixed;
  top: var(--nav-height);
  left: 0; right: 0;
  background: rgba(255,255,255,0.97);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border-light);
  padding: var(--space-md) var(--space-lg);
  z-index: 999;
  transform: translateY(-10px);
  opacity: 0;
  transition: transform 0.3s ease, opacity 0.3s ease;
  pointer-events: none;
}
#mobile-menu.open {
  display: block;
  transform: translateY(0);
  opacity: 1;
  pointer-events: auto;
}
.mobile-nav-links { display: flex; flex-direction: column; gap: 2px; margin-bottom: var(--space-md); }
.mobile-nav-link {
  display: block;
  padding: 11px 14px;
  font-size: 15px;
  font-weight: 500;
  color: var(--text-secondary);
  border-radius: var(--radius-md);
  text-decoration: none;
  transition: background var(--transition), color var(--transition);
}
.mobile-nav-link:hover,
.mobile-nav-link.active { background: var(--accent-light); color: var(--accent-primary); }
.mobile-nav-cta { display: flex; gap: var(--space-sm); }
.mobile-nav-cta .btn { flex: 1; justify-content: center; }

/* ════════════════════════════════════════════════
   BACK TO TOP
════════════════════════════════════════════════ */
#back-to-top {
  position: fixed;
  bottom: 28px;
  right: 28px;
  width: 46px;
  height: 46px;
  border-radius: var(--radius-full);
  background: var(--accent-primary);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 900;
  box-shadow: 0 4px 20px rgba(79,70,229,0.35);
  border: none;
  opacity: 0;
  visibility: hidden;
  transform: translateY(12px);
  transition: opacity var(--transition), visibility var(--transition),
              transform var(--transition), background var(--transition);
}
#back-to-top.visible { opacity: 1; visibility: visible; transform: translateY(0); }
#back-to-top:hover {
  background: var(--accent-secondary);
  transform: translateY(-3px);
  box-shadow: 0 8px 24px rgba(79,70,229,0.4);
}
#back-to-top svg {
  width: 18px; height: 18px;
  stroke: currentColor; stroke-width: 2.5;
  fill: none; stroke-linecap: round; stroke-linejoin: round;
}

/* ── Responsive ── */
@media (max-width: 900px) {
  .nav-links, .nav-available, .nav-cta { display: none; }
  .nav-hamburger { display: flex; }
}
@media (max-width: 767px) {
  .nav-inner { padding: 0 var(--space-md); }
  #back-to-top { bottom: 20px; right: 20px; width: 42px; height: 42px; }
}