/*
 * Banca Julian - public site header ("FutureNav" style: dark glass, cyan/indigo/purple accents).
 * Markup: resources/views/frontend/layouts/common/header.blade.php
 * Everything is scoped to .bj-nav so the Bootstrap pages underneath are not affected.
 */

.bj-nav {
  --bj-primary: #6366f1;
  --bj-secondary: #06b6d4;
  --bj-accent: #a855f7;
  --bj-text: #d1d5db;
  --bj-text-strong: #f3f4f6;
  --bj-muted: #9ca3af;
  /* Near-opaque: the site pages are light, a see-through navy would turn grey */
  --bj-bg: rgba(17, 24, 39, 0.94);
  --bj-bg-solid: rgba(13, 18, 30, 0.97);
  --bj-border: rgba(6, 182, 212, 0.3);
  --bj-height: 72px;

  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1030;
  font-family: "Space Grotesk", system-ui, -apple-system, "Segoe UI", sans-serif;
  background-color: var(--bj-bg);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--bj-border);
  transition: background-color 0.3s ease, box-shadow 0.3s ease;
}

.bj-nav.is-scrolled {
  background-color: var(--bj-bg-solid);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.bj-nav *,
.bj-nav *::before,
.bj-nav *::after {
  box-sizing: border-box;
}

.bj-nav a {
  text-decoration: none;
}

.bj-nav__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  max-width: 1280px;
  height: var(--bj-height);
  margin: 0 auto;
  padding: 0 24px;
}

/* Brand */
.bj-nav__brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
  cursor: pointer;
}

.bj-nav__brand:not([href]) {
  cursor: default;
}

.bj-nav__mark {
  position: relative;
  display: inline-flex;
  width: 40px;
  height: 40px;
  padding: 3px;
  border: 1px solid rgba(129, 140, 248, 0.3);
  border-radius: 8px;
  background: linear-gradient(135deg, #4f46e5, #9333ea);
  box-shadow: 0 0 10px rgba(34, 211, 238, 0.3), 0 6px 16px rgba(55, 48, 163, 0.25);
}

.bj-nav__mark-inner {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  border-radius: 5px;
  background: #111827 linear-gradient(135deg, rgba(49, 46, 129, 0.25), rgba(88, 28, 135, 0.25));
}

.bj-nav__mark-text {
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.02em;
  line-height: 1;
  background-image: linear-gradient(90deg, #22d3ee, #818cf8);
}

.bj-nav__mark-text,
.bj-nav__name {
  background-clip: text;
  -webkit-background-clip: text;
  color: transparent;
}

.bj-nav__name {
  background-image: linear-gradient(90deg, #818cf8, #22d3ee, #c084fc);
  font-size: 20px;
  font-weight: 500;
  line-height: 1;
  white-space: nowrap;
}

/* Menu (desktop: inline; mobile: collapsible panel, see media query) */
.bj-nav__menu {
  display: flex;
  align-items: center;
  gap: 16px;
}

.bj-nav__links {
  display: flex;
  align-items: center;
  gap: 2px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.bj-nav__links > li {
  position: relative;
}

/* .nav-link: markup injected by add-ons */
.bj-nav__link,
.bj-nav__links .nav-link {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--bj-text);
  font: inherit;
  font-size: 15px;
  line-height: 1.4;
  white-space: nowrap;
  cursor: pointer;
  transition: color 0.2s ease, text-shadow 0.2s ease;
}

.bj-nav__link::after,
.bj-nav__links .nav-link::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 50%;
  width: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--bj-secondary), var(--bj-primary));
  transform: translateX(-50%);
  transition: width 0.3s ease;
}

.bj-nav__link:hover,
.bj-nav__link:focus-visible,
.bj-nav__link.is-active,
.bj-nav__links .nav-link:hover {
  color: #22d3ee;
  text-shadow: 0 0 8px rgba(6, 182, 212, 0.3);
}

.bj-nav__link:hover::after,
.bj-nav__link:focus-visible::after,
.bj-nav__link.is-active::after,
.bj-nav__links .nav-link:hover::after {
  width: 80%;
}

.bj-nav__link.is-active {
  color: var(--bj-text-strong);
}

/* Services dropdown */
.bj-nav__chevron {
  transition: transform 0.25s ease;
}

.bj-nav__dropdown.is-open .bj-nav__chevron {
  transform: rotate(180deg);
}

.bj-nav__panel {
  position: absolute;
  top: calc(100% + 14px);
  left: 50%;
  display: grid;
  gap: 4px;
  width: 320px;
  padding: 8px;
  border: 1px solid rgba(99, 102, 241, 0.3);
  border-radius: 12px;
  background: rgba(17, 24, 39, 0.97);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4), 0 0 15px rgba(99, 102, 241, 0.15);
  opacity: 0;
  visibility: hidden;
  transform: translate(-50%, 8px);
  transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s;
}

/* Invisible bridge so the pointer can travel from the button to the panel */
.bj-nav__panel::before {
  content: "";
  position: absolute;
  top: -16px;
  left: 0;
  right: 0;
  height: 16px;
}

.bj-nav__dropdown.is-open .bj-nav__panel {
  opacity: 1;
  visibility: visible;
  transform: translate(-50%, 0);
}

@media (min-width: 992px) and (hover: hover) {
  .bj-nav__dropdown:hover .bj-nav__panel {
    opacity: 1;
    visibility: visible;
    transform: translate(-50%, 0);
  }

  .bj-nav__dropdown:hover .bj-nav__chevron {
    transform: rotate(180deg);
  }
}

.bj-nav__panel-item {
  display: block;
  padding: 10px 12px;
  border-radius: 8px;
  transition: background-color 0.2s ease;
}

.bj-nav__panel-item:hover,
.bj-nav__panel-item:focus-visible,
.bj-nav__panel-item.is-active {
  background-color: rgba(99, 102, 241, 0.12);
}

.bj-nav__panel-title {
  display: block;
  color: var(--bj-text-strong);
  font-size: 15px;
  font-weight: 500;
}

.bj-nav__panel-text {
  display: block;
  margin-top: 2px;
  color: var(--bj-muted);
  font-size: 13px;
  line-height: 1.45;
}

/* Actions: theme switch + account buttons */
.bj-nav__actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.bj-nav__theme {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border: 1px solid rgba(6, 182, 212, 0.3);
  border-radius: 8px;
  background: transparent;
  color: #22d3ee;
  cursor: pointer;
  transition: background-color 0.2s ease, border-color 0.2s ease;
}

.bj-nav__theme:hover {
  border-color: rgba(6, 182, 212, 0.6);
  background-color: rgba(8, 145, 178, 0.12);
}

.bj-nav__theme-sun,
.bj-nav__theme[aria-pressed="true"] .bj-nav__theme-moon {
  display: none;
}

.bj-nav__theme[aria-pressed="true"] .bj-nav__theme-sun {
  display: block;
}

.bj-nav__btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: 8px 18px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  white-space: nowrap;
  transition: transform 0.25s ease, background-color 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
}

.bj-nav__btn--ghost {
  border: 1px solid rgba(6, 182, 212, 0.3);
  color: #22d3ee;
}

.bj-nav__btn--ghost:hover,
.bj-nav__btn--ghost:focus-visible {
  border-color: rgba(6, 182, 212, 0.55);
  background-color: rgba(8, 145, 178, 0.12);
  color: #67e8f9;
}

/* Gradient button with glow and light sweep ("Connect" in the original design) */
.bj-nav__btn--glow {
  isolation: isolate;
  overflow: hidden;
  border: 0;
  background: linear-gradient(90deg, rgba(49, 46, 129, 0.95), rgba(88, 28, 135, 0.95));
  box-shadow: 0 0 0 1px rgba(129, 140, 248, 0.35), 0 0 14px rgba(124, 58, 237, 0.45);
}

.bj-nav__btn--glow span {
  background: linear-gradient(90deg, #67e8f9, #a5b4fc);
  background-clip: text;
  -webkit-background-clip: text;
  color: transparent;
}

.bj-nav__btn--glow::before {
  content: "";
  position: absolute;
  z-index: -1;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: linear-gradient(45deg, transparent 40%, rgba(6, 182, 212, 0.2) 45%, rgba(6, 182, 212, 0.4) 50%, rgba(6, 182, 212, 0.2) 55%, transparent 60%);
  transform: translate(-100%, -100%) rotate(45deg);
  transition: transform 0.5s ease;
}

.bj-nav__btn--glow:hover,
.bj-nav__btn--glow:focus-visible {
  background: linear-gradient(90deg, rgba(55, 48, 163, 0.95), rgba(107, 33, 168, 0.95));
  box-shadow: 0 0 0 1px rgba(129, 140, 248, 0.55), 0 0 20px rgba(124, 58, 237, 0.6);
  transform: translateY(-1px);
}

.bj-nav__btn--glow:hover::before {
  transform: translate(100%, 100%) rotate(45deg);
}

.bj-nav a:focus-visible,
.bj-nav button:focus-visible {
  outline: 2px solid rgba(6, 182, 212, 0.6);
  outline-offset: 2px;
}

/* Hamburger (mobile only) */
.bj-nav__toggle {
  position: relative;
  display: none;
  width: 42px;
  height: 42px;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
}

.bj-nav__toggle-line {
  position: absolute;
  left: 50%;
  width: 22px;
  height: 2px;
  margin-left: -11px;
  border-radius: 2px;
  background-color: #22d3ee;
  transition: transform 0.3s ease, opacity 0.2s ease, top 0.3s ease;
}

.bj-nav__toggle-line:nth-child(1) { top: 14px; }
.bj-nav__toggle-line:nth-child(2) { top: 20px; }
.bj-nav__toggle-line:nth-child(3) { top: 26px; }

.bj-nav__toggle[aria-expanded="true"] .bj-nav__toggle-line:nth-child(1) {
  top: 20px;
  transform: rotate(45deg);
}

.bj-nav__toggle[aria-expanded="true"] .bj-nav__toggle-line:nth-child(2) {
  opacity: 0;
}

.bj-nav__toggle[aria-expanded="true"] .bj-nav__toggle-line:nth-child(3) {
  top: 20px;
  transform: rotate(-45deg);
}

/* Tablet: tighter spacing so the full menu still fits on one line */
@media (max-width: 1199.98px) {
  .bj-nav__inner {
    gap: 16px;
    padding: 0 20px;
  }

  .bj-nav__menu {
    gap: 10px;
  }

  .bj-nav__link,
  .bj-nav__links .nav-link {
    padding: 8px 10px;
    font-size: 14px;
  }

  .bj-nav__btn {
    padding: 8px 14px;
  }
}

/* Mobile and small tablets: hamburger + slide-down panel */
@media (max-width: 991.98px) {
  .bj-nav {
    --bj-height: 64px;
  }

  .bj-nav__inner {
    flex-wrap: wrap;
    gap: 0;
    height: auto;
    min-height: var(--bj-height);
    padding: 0 16px;
  }

  .bj-nav__brand {
    height: var(--bj-height);
  }

  .bj-nav__toggle {
    display: block;
  }

  .bj-nav__menu {
    flex-basis: 100%;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    height: 0;
    overflow: hidden;
    visibility: hidden;
    transition: height 0.3s cubic-bezier(0.4, 0, 0.2, 1), visibility 0.3s;
  }

  .bj-nav__menu.is-open {
    visibility: visible;
  }

  .bj-nav__links {
    flex-direction: column;
    align-items: stretch;
    gap: 2px;
    padding: 4px 0 12px;
    border-top: 1px solid rgba(55, 65, 81, 0.6);
  }

  .bj-nav__link,
  .bj-nav__links .nav-link {
    display: flex;
    width: 100%;
    padding: 11px 14px;
    font-size: 16px;
  }

  .bj-nav__link::after,
  .bj-nav__links .nav-link::after {
    display: none;
  }

  .bj-nav__link:hover,
  .bj-nav__link.is-active {
    background-color: rgba(31, 41, 55, 0.6);
  }

  .bj-nav__dropdown-toggle {
    justify-content: space-between;
  }

  /* Services expand inline instead of floating */
  .bj-nav__panel {
    position: static;
    display: none;
    width: auto;
    margin: 2px 0 6px 14px;
    padding: 4px 0 4px 10px;
    border: 0;
    border-left: 1px solid rgba(99, 102, 241, 0.35);
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    opacity: 1;
    visibility: visible;
    transform: none;
    transition: none;
  }

  .bj-nav__dropdown.is-open .bj-nav__panel {
    display: grid;
    transform: none;
  }

  .bj-nav__actions {
    flex-wrap: wrap;
    padding: 0 0 16px;
  }

  .bj-nav__btn {
    flex: 1 1 0;
    min-height: 44px;
  }

  .bj-nav__theme {
    width: 44px;
    height: 44px;
  }
}

@media (max-width: 359.98px) {
  .bj-nav__name {
    font-size: 18px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .bj-nav,
  .bj-nav * {
    transition: none !important;
  }
}

/* Language switch (moved here from the old footer; shown only with 2+ active languages) */
.bj-nav__lang {
  height: 40px;
  padding: 0 10px;
  border: 1px solid var(--bj-border);
  border-radius: 10px;
  background: transparent;
  color: var(--bj-text-strong);
  font: 600 13px/1 "Space Grotesk", system-ui, sans-serif;
  cursor: pointer;
}

.bj-nav__lang option {
  color: #111827;
}
