/* ══════════════════════════════════════════════════════════
   BLUE PEARL — theme-toggle.css
   Premium Theme Toggle Button + Light/Dark overrides
   ══════════════════════════════════════════════════════════ */

/* ── Theme Toggle Button ──────────────────────────────────── */
.theme-toggle {
  position: relative;
  cursor: pointer;
  background: var(--bg-card);
  border: 1.5px solid var(--border-default);
  border-radius: var(--radius-full);
  padding: 0;
  width: 60px;
  height: 32px;
  transition: border-color 0.3s ease, box-shadow 0.3s ease, background 0.35s ease;
  flex-shrink: 0;
  outline: none;
  overflow: hidden;
}

.theme-toggle:hover {
  border-color: var(--brand-blue-light);
  box-shadow: 0 0 0 3px rgba(26, 61, 166, 0.12);
}

.theme-toggle:focus-visible {
  outline: 2px solid var(--brand-blue);
  outline-offset: 2px;
}

/* Track */
.theme-toggle__track {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 7px;
}

.theme-toggle__icon {
  font-size: 0.72rem;
  line-height: 1;
  transition: color 0.3s ease, opacity 0.3s ease, transform 0.3s ease;
  z-index: 1;
}

.theme-toggle__icon--sun {
  color: var(--brand-blue);
  opacity: 1;
  transform: scale(1) rotate(0deg);
}

.theme-toggle__icon--moon {
  color: var(--text-muted);
  opacity: 0.45;
  transform: scale(0.8) rotate(-20deg);
}

[data-theme="dark"] .theme-toggle__icon--sun {
  color: var(--text-muted);
  opacity: 0.45;
  transform: scale(0.8) rotate(20deg);
}

[data-theme="dark"] .theme-toggle__icon--moon {
  color: #6B9BFF;
  opacity: 1;
  transform: scale(1) rotate(0deg);
}

/* Sliding Pill */
.theme-toggle__pill {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--grad-blue);
  box-shadow: 0 2px 6px rgba(26, 61, 166, 0.45);
  transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1),
              background 0.35s ease,
              box-shadow 0.35s ease;
  z-index: 2;
  pointer-events: none;
}

[data-theme="dark"] .theme-toggle__pill {
  transform: translateX(28px);
  background: linear-gradient(135deg, #1A3DA6, #4A7FFF);
  box-shadow: 0 2px 6px rgba(74, 127, 255, 0.5);
}

/* Tooltip */
.theme-toggle[title]:hover::before {
  content: attr(title);
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  background: var(--bg-elevated);
  border: 1px solid var(--border-default);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 0.7rem;
  font-weight: 500;
  padding: 0.25rem 0.55rem;
  border-radius: var(--radius-md);
  white-space: nowrap;
  pointer-events: none;
  box-shadow: var(--shadow-sm);
  z-index: 999;
}

/* ── Smooth Global Theme Transition ───────────────────────── */
html {
  transition: background-color 0.4s ease;
}

/* ── Light Theme — Navbar always shown ────────────────────── */
:root .navbar {
  background: var(--navbar-bg);
  border-bottom: 1px solid var(--navbar-border);
  box-shadow: 0 1px 12px rgba(26, 61, 166, 0.07);
}

[data-theme="dark"] .navbar {
  background: transparent;
  border-bottom: none;
  box-shadow: none;
}

/* ── Light Theme — Hero overrides ────────────────────────── */
:root .hero,
:root .hero__slide {
  background-color: #080B12 !important;
}

:root .hero__bg-img {
  opacity: 0.7;
  filter: saturate(1.1) brightness(0.65) contrast(1.05) !important;
}

:root .hero {
  background: var(--bg-secondary) !important;
}

:root .hero__bg-img {
  display: none !important;
}

:root .hero__bg-overlay {
  background:
    radial-gradient(circle at 70% 30%, rgba(26, 61, 166, 0.03) 0%, transparent 60%),
    linear-gradient(to bottom, transparent 0%, var(--bg-primary) 100%) !important;
}

:root .hero__grid-lines {
  background-image:
    linear-gradient(rgba(26, 61, 166, 0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(26, 61, 166, 0.06) 1px, transparent 1px) !important;
  opacity: 0.8;
}

:root .hero__title {
  color: #0F172A !important;
}

:root .hero__subtitle {
  color: #475569 !important;
}

:root .hero__subtitle-tags {
  color: #334155 !important;
  text-shadow: none !important;
}

:root .prequal-badge {
  color: var(--brand-blue) !important;
  background: linear-gradient(135deg, rgba(26, 61, 166, 0.08), rgba(46, 204, 64, 0.04)) !important;
  border-color: rgba(26, 61, 166, 0.15) !important;
}

:root .hero__scroll-indicator {
  color: #475569 !important;
}

:root .hero__control-btn {
  border-color: rgba(15, 23, 42, 0.25) !important;
}

:root .hero__control-btn.active {
  background: var(--brand-blue) !important;
  border-color: var(--brand-blue) !important;
}

:root .hero .btn--ghost {
  color: var(--text-primary) !important;
  border-color: rgba(15, 23, 42, 0.2) !important;
  background: rgba(15, 23, 42, 0.03) !important;
}

:root .hero .btn--ghost:hover {
  background: rgba(15, 23, 42, 0.08) !important;
  border-color: var(--brand-blue) !important;
  color: var(--brand-blue) !important;
}

[data-theme="dark"] .hero {
  background: var(--bg-secondary) !important;
}

[data-theme="dark"] .hero__bg-img {
  display: none !important;
}

[data-theme="dark"] .hero__bg-overlay {
  background:
    radial-gradient(circle at 70% 30%, rgba(26, 61, 166, 0.15) 0%, transparent 60%),
    linear-gradient(to bottom, transparent 0%, var(--bg-primary) 100%) !important;
}

[data-theme="dark"] .hero__grid-lines {
  background-image:
    linear-gradient(rgba(43, 86, 212, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(43, 86, 212, 0.04) 1px, transparent 1px) !important;
  opacity: 0.6;
}

/* ── Light Theme — Section BG ─────────────────────────────── */
:root .bg-alt { background: var(--bg-secondary); }
:root .section--dark { background: var(--bg-secondary); }

/* ── Light Theme — Logo ───────────────────────────────────── */
.navbar__logo img { filter: var(--logo-filter); }

/* ── Light Theme — Page Loader ────────────────────────────── */
:root .page-loader { background: #F5F8FF; }

/* ── Light Theme — Mobile Nav ─────────────────────────────── */
.navbar__mobile { background: var(--mobile-nav-bg); }

/* ── Light Theme — Prequal Badge ─────────────────────────── */
:root .prequal-badge {
  background: linear-gradient(135deg, rgba(26, 61, 166, 0.07), rgba(34, 160, 48, 0.04));
  border-color: rgba(26, 61, 166, 0.18);
}

/* ── Light Theme — FABs ───────────────────────────────────── */
:root .fab--email {
  background: var(--bg-card);
  border: 1.5px solid var(--border-default);
  color: var(--text-secondary);
  box-shadow: var(--shadow-md);
}

/* ── Light Theme — Back to Top ────────────────────────────── */
:root .back-to-top {
  background: var(--bg-card);
  border-color: var(--border-default);
  box-shadow: var(--shadow-md);
}
