/* ========================================================
   COMPONENTS — Navbar, Loader, Cursor, FloatingCTA
   ======================================================== */

/* ── Loader ── */
#loader {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: #080810;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  transition: opacity 0.6s ease, visibility 0.6s ease;
}
#loader.hidden { opacity: 0; visibility: hidden; pointer-events: none; }
.loader-logo-img {
  width: 140px;
  height: auto;
  margin-bottom: 40px;
  filter: drop-shadow(0 10px 30px rgba(79,142,247,0.3));
  animation: float-slow 4s ease-in-out infinite;
}
[data-theme="light"] #loader {
  background: var(--bg-primary);
}
.loader-bar-wrap {
  width: 220px;
  height: 2px;
  background: rgba(255,255,255,0.08);
  border-radius: 99px;
  overflow: hidden;
}
.loader-bar {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #4F8EF7, #C9A84C);
  border-radius: 99px;
  animation: loader-progress 1.8s cubic-bezier(0.16,1,0.3,1) forwards;
}
.loader-text {
  margin-top: 20px;
  font-size: 0.75rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.3);
}

/* ── Custom Cursor ── */
#cursor-glow {
  position: fixed;
  width: 320px;
  height: 320px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(79,142,247,0.12) 0%, transparent 70%);
  pointer-events: none;
  z-index: 1;
  transform: translate(-50%, -50%);
  transition: transform 0.1s linear;
  will-change: transform;
}
#cursor-dot {
  position: fixed;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #4F8EF7;
  pointer-events: none;
  z-index: 9998;
  transform: translate(-50%, -50%);
  transition: transform 0.08s linear, width 0.2s ease, height 0.2s ease, opacity 0.2s ease;
  mix-blend-mode: normal;
}
#cursor-dot.hovering { width: 32px; height: 32px; background: rgba(79,142,247,0.3); border: 1px solid #4F8EF7; }
@media (max-width: 768px) { #cursor-glow, #cursor-dot { display: none; } }

/* ── Navbar ── */
#navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  padding: 20px 0;
  transition: all 0.4s cubic-bezier(0.16,1,0.3,1);
}
#navbar.scrolled {
  background: rgba(8,8,16,0.85);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border-bottom: 1px solid rgba(255,255,255,0.06);
  padding: 14px 0;
  box-shadow: 0 4px 32px rgba(0,0,0,0.4);
}
[data-theme="light"] #navbar.scrolled {
  background: rgba(248,248,252,0.88);
  border-bottom: 1px solid rgba(0,0,0,0.06);
}
.nav-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 40px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.nav-logo {
  font-family: 'Outfit', sans-serif;
  font-size: 1.6rem;
  font-weight: 800;
  color: #F2F2F5;
  letter-spacing: -0.03em;
  transition: all 0.3s var(--ease-out);
  text-shadow: 0 0 20px rgba(79,142,247,0.1);
}
[data-theme="light"] .nav-logo { color: #0D0D15; }
.nav-logo span {
  background: linear-gradient(135deg, #4F8EF7, #C9A84C);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.nav-logo:hover { opacity: 0.8; }

.nav-links {
  display: flex;
  align-items: center;
  gap: 6px;
}
.nav-link {
  font-size: 0.875rem;
  font-weight: 500;
  color: rgba(242,242,245,0.7);
  padding: 8px 14px;
  border-radius: 99px;
  transition: all 0.25s ease;
  position: relative;
}
[data-theme="light"] .nav-link { color: rgba(13,13,21,0.65); }
.nav-link:hover, .nav-link.active { color: #F2F2F5; background: rgba(255,255,255,0.07); }
[data-theme="light"] .nav-link:hover, [data-theme="light"] .nav-link.active { color: #0D0D15; background: rgba(0,0,0,0.06); }

.nav-actions { display: flex; align-items: center; gap: 12px; }

.theme-toggle {
  width: 38px; height: 38px;
  border-radius: 50%;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.08);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  transition: all 0.25s ease;
  color: rgba(242,242,245,0.7);
  font-size: 1rem;
}
[data-theme="light"] .theme-toggle { background: rgba(0,0,0,0.04); border-color: rgba(0,0,0,0.08); color: rgba(13,13,21,0.65); }
.theme-toggle:hover { background: rgba(79,142,247,0.12); border-color: rgba(79,142,247,0.3); color: #4F8EF7; transform: scale(1.08); }

.nav-cta {
  padding: 10px 22px;
  background: #4F8EF7;
  color: #fff;
  border-radius: 99px;
  font-size: 0.875rem;
  font-weight: 600;
  transition: all 0.25s ease;
  box-shadow: 0 4px 16px rgba(79,142,247,0.3);
}
.nav-cta:hover { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(79,142,247,0.45); }

.hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
  padding: 8px;
}
.hamburger span {
  display: block; width: 22px; height: 2px;
  background: #F2F2F5;
  border-radius: 2px;
  transition: all 0.3s ease;
}
[data-theme="light"] .hamburger span { background: #0D0D15; }
.hamburger.open span:nth-child(1) { transform: rotate(45deg) translate(5px, 5px); }
.hamburger.open span:nth-child(2) { opacity: 0; transform: scaleX(0); }
.hamburger.open span:nth-child(3) { transform: rotate(-45deg) translate(5px, -5px); }

/* Mobile Nav */
.nav-drawer {
  position: fixed;
  top: 0; right: -100%;
  width: min(320px, 80vw);
  height: 100dvh;
  background: rgba(8,8,16,0.96);
  backdrop-filter: blur(30px);
  border-left: 1px solid rgba(255,255,255,0.07);
  z-index: 99;
  padding: 100px 32px 40px;
  transition: right 0.4s cubic-bezier(0.16,1,0.3,1);
  display: flex; flex-direction: column; gap: 8px;
}
[data-theme="light"] .nav-drawer { background: rgba(248,248,252,0.97); border-left-color: rgba(0,0,0,0.07); }
.nav-drawer.open { right: 0; }
.nav-drawer .nav-link {
  font-size: 1.1rem;
  padding: 14px 16px;
  width: 100%;
  border-radius: 12px;
}
.nav-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.6);
  z-index: 98;
  opacity: 0; visibility: hidden;
  transition: all 0.3s ease;
}
.nav-overlay.open { opacity: 1; visibility: visible; }

/* ── Floating CTA Bar ── */
#floating-cta {
  position: fixed;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  z-index: 90;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 20px;
  background: rgba(8,8,16,0.9);
  border: 1px solid rgba(79,142,247,0.2);
  border-radius: 99px;
  backdrop-filter: blur(24px);
  box-shadow: 0 8px 40px rgba(0,0,0,0.5);
  transition: transform 0.5s cubic-bezier(0.16,1,0.3,1);
}
#floating-cta.visible { transform: translateX(-50%) translateY(0); }
[data-theme="light"] #floating-cta { background: rgba(255,255,255,0.92); border-color: rgba(79,142,247,0.2); }
.floating-cta-text { font-size: 0.82rem; color: rgba(242,242,245,0.7); white-space: nowrap; }
[data-theme="light"] .floating-cta-text { color: rgba(13,13,21,0.6); }
.floating-cta-btn {
  padding: 8px 18px;
  background: #4F8EF7;
  color: #fff;
  border-radius: 99px;
  font-size: 0.8rem;
  font-weight: 600;
  transition: all 0.2s ease;
  text-decoration: none;
}
.floating-cta-btn:hover { background: #2563eb; transform: scale(1.04); }

/* ── WhatsApp Float Button ── */
#whatsapp-btn {
  position: fixed;
  bottom: 28px;
  right: 28px;
  width: 54px; height: 54px;
  background: #25D366;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 4px 24px rgba(37,211,102,0.4);
  z-index: 91;
  transition: all 0.25s ease;
  text-decoration: none;
}
#whatsapp-btn:hover { transform: scale(1.12); box-shadow: 0 8px 32px rgba(37,211,102,0.55); }
#whatsapp-btn svg { width: 26px; height: 26px; fill: #fff; }

@media (max-width: 768px) {
  .nav-links, .nav-actions .nav-cta { display: none; }
  .hamburger { display: flex; }
  #floating-cta { bottom: 90px; }
  #whatsapp-btn { bottom: 28px; }
}
