/* ============================================
   DUAL BRAND HEADER - The Portal Navigation
   "Red Pill / Blue Pill" UX System
   ============================================ */

:root {
  /* Advisor Brand Colors (Personal - Warm/Trustworthy) */
  --advisor-primary: #1a365d;
  --advisor-accent: #38b2ac;
  --advisor-gradient-from: #1a365d;
  --advisor-gradient-to: #2d3748;
  --advisor-glow: rgba(56, 178, 172, 0.3);

  /* Corporate Brand Colors (Business - Prestigious/Secure) */
  --corporate-primary: #1e3a5f;
  --corporate-accent: #d4af37;
  --corporate-gradient-from: #1e3a5f;
  --corporate-gradient-to: #0f2744;
  --corporate-glow: rgba(212, 175, 55, 0.3);

  /* Shared */
  --header-height: 80px;
  --transition-smooth: cubic-bezier(0.4, 0, 0.2, 1);
  --transition-bounce: cubic-bezier(0.68, -0.55, 0.265, 1.55);
  --menu-slide-right: 270px;
  --menu-slide-left: 280px;
}

/* ============================================
   HEADER CONTAINER
   ============================================ */

.dual-brand-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  background: linear-gradient(135deg, rgba(26, 54, 93, 0.98) 0%, rgba(30, 58, 95, 0.98) 100%);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.3);
}

.dual-brand-container {
  max-width: 1400px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--header-height);
  padding: 0 40px;
  position: relative;
}

/* ============================================
   BRAND PORTALS - Left and Right Sides
   ============================================ */

.brand-portal {
  display: flex;
  align-items: center;
  position: relative;
  height: 100%;
  flex: 0 0 auto;
}

.brand-portal.advisor {
  justify-content: flex-start;
}

.brand-portal.corporate {
  justify-content: flex-end;
}

/* ============================================
   LOGO BUTTONS
   ============================================ */

.brand-logo-btn {
  background: none;
  border: none;
  cursor: pointer;
  padding: 10px 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
  z-index: 10;
  transition: all 0.4s var(--transition-smooth);
}

.brand-logo-btn:hover {
  transform: scale(1.05);
}

.logo-wrapper {
  display: flex;
  align-items: baseline;
  gap: 4px;
}

.logo-bright {
  font-family: 'Red Hat Display', sans-serif;
  font-size: 1.6rem;
  font-weight: 800;
  color: #ffffff;
  letter-spacing: -0.5px;
}

.logo-name {
  font-family: 'Red Hat Display', sans-serif;
  font-size: 1.6rem;
  font-weight: 800;
  letter-spacing: -0.5px;
  transition: all 0.3s var(--transition-smooth);
}

.logo-name.advisor-name {
  color: var(--advisor-accent);
}

.logo-name.corporate-name {
  color: var(--corporate-accent);
}

.logo-name sup {
  font-size: 0.5em;
  margin-left: 2px;
}

.logo-tagline {
  font-family: 'Inter', sans-serif;
  font-size: 0.7rem;
  color: rgba(255, 255, 255, 0.7);
  text-transform: uppercase;
  letter-spacing: 2px;
  margin-top: 2px;
}

/* Inactive state - dimmed */
.brand-portal:not(.active) .brand-logo-btn {
  opacity: 0.5;
}

.brand-portal:not(.active):hover .brand-logo-btn {
  opacity: 0.8;
}

/* Active state - highlighted with glow and underline */
.brand-portal.active .brand-logo-btn {
  filter: drop-shadow(0 0 15px var(--advisor-glow));
}

.brand-portal.active .brand-logo-btn::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 80%;
  height: 3px;
  background: var(--advisor-accent);
  border-radius: 2px;
  box-shadow: 0 0 10px var(--advisor-accent);
}

.brand-portal.corporate.active .brand-logo-btn {
  filter: drop-shadow(0 0 15px var(--corporate-glow));
}

.brand-portal.corporate.active .brand-logo-btn::after {
  background: var(--corporate-accent);
  box-shadow: 0 0 10px var(--corporate-accent);
}

/* ============================================
   REVEAL MENU - Click to Expand
   ============================================ */

.reveal-menu {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  overflow: hidden;
  pointer-events: none;
  opacity: 0;
  transition: all 0.4s var(--transition-smooth);
  z-index: 100;
}

/* Advisor menu - reveals to the right of the logo */
.advisor-menu {
  left: 100%;
  margin-left: 15px;
  transform-origin: left center;
}

/* Corporate menu - reveals to the left of the logo */
.corporate-menu {
  right: 100%;
  margin-right: 15px;
  transform-origin: right center;
}

.menu-mask {
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(10px);
  border-radius: 30px;
  padding: 6px 12px;
  transform: scaleX(0);
  transform-origin: inherit;
  transition: transform 0.4s var(--transition-smooth);
}

/* EXPANDED STATE - Click reveals the menu */
.brand-portal.expanded .reveal-menu {
  opacity: 1;
  pointer-events: auto;
  overflow: visible;
}

.brand-portal.expanded .menu-mask {
  transform: scaleX(1);
}

.menu-items {
  display: flex;
  gap: 5px;
  list-style: none;
  margin: 0;
  padding: 0;
  white-space: nowrap;
}

.menu-items li {
  opacity: 0;
  transform: translateX(-10px);
  transition: all 0.3s var(--transition-smooth);
}

.brand-portal.corporate .menu-items li {
  transform: translateX(10px);
}

/* Staggered animation for menu items when expanded */
.brand-portal.expanded .menu-items li {
  opacity: 1;
  transform: translateX(0);
}

.brand-portal.expanded .menu-items li:nth-child(1) { transition-delay: 0.05s; }
.brand-portal.expanded .menu-items li:nth-child(2) { transition-delay: 0.1s; }
.brand-portal.expanded .menu-items li:nth-child(3) { transition-delay: 0.15s; }
.brand-portal.expanded .menu-items li:nth-child(4) { transition-delay: 0.2s; }
.brand-portal.expanded .menu-items li:nth-child(5) { transition-delay: 0.25s; }
.brand-portal.expanded .menu-items li:nth-child(6) { transition-delay: 0.3s; }

.menu-items a {
  display: block;
  padding: 8px 12px;
  color: rgba(255, 255, 255, 0.85);
  text-decoration: none;
  font-family: 'Inter', sans-serif;
  font-size: 0.8rem;
  font-weight: 500;
  border-radius: 20px;
  transition: all 0.3s var(--transition-smooth);
}

.menu-items a:hover {
  background: rgba(255, 255, 255, 0.15);
  color: #ffffff;
}

.brand-portal.advisor .menu-items a:hover {
  background: var(--advisor-accent);
  color: #ffffff;
}

.brand-portal.corporate .menu-items a:hover {
  background: var(--corporate-accent);
  color: #1a1a1a;
}

/* ============================================
   CENTER DIVIDER - Slides Left/Right
   ============================================ */

.brand-divider {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 60px;
  gap: 0;
  padding: 0 30px;
  transition: transform 0.4s var(--transition-smooth);
  z-index: 150;
}

/* Slide RIGHT when advisor menu is expanded */
.brand-divider.slide-right {
  transform: translate(calc(-50% + var(--menu-slide-right)), -50%);
}

/* Slide LEFT when corporate menu is expanded */
.brand-divider.slide-left {
  transform: translate(calc(-50% - var(--menu-slide-left)), -50%);
}

/* When dragging, disable transition and bring to front */
.brand-divider.dragging {
  transition: none;
  z-index: 200;
}

.divider-line {
  width: 1px;
  height: 15px;
  background: linear-gradient(to bottom, transparent, rgba(255, 255, 255, 0.3), transparent);
}

.divider-orb {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--advisor-accent) 0%, var(--corporate-accent) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  animation: orbPulse 3s ease-in-out infinite;
  border: none;
  cursor: grab;
  padding: 0;
}

.divider-orb:active {
  cursor: grabbing;
}

.orb-inner {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: #ffffff;
}

@keyframes orbPulse {
  0%, 100% {
    box-shadow: 0 0 10px var(--advisor-glow), 0 0 20px var(--corporate-glow);
    transform: scale(1);
  }
  50% {
    box-shadow: 0 0 20px var(--advisor-glow), 0 0 40px var(--corporate-glow);
    transform: scale(1.1);
  }
}

/* ============================================
   BRAND INDICATOR BAR
   ============================================ */

.brand-indicator {
  height: 3px;
  background: rgba(0, 0, 0, 0.2);
  position: relative;
  overflow: hidden;
}

.indicator-fill {
  position: absolute;
  top: 0;
  height: 100%;
  width: 50%;
  transition: all 0.5s var(--transition-smooth);
}

.brand-indicator.advisor .indicator-fill {
  left: 0;
  background: linear-gradient(90deg, var(--advisor-accent), transparent);
}

.brand-indicator.corporate .indicator-fill {
  left: 50%;
  background: linear-gradient(90deg, transparent, var(--corporate-accent));
}

.brand-indicator.transitioning .indicator-fill {
  opacity: 0.5;
}

/* ============================================
   MOBILE MENU
   ============================================ */

.mobile-brand-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 10px;
}

.mobile-brand-toggle span {
  width: 25px;
  height: 2px;
  background: #ffffff;
  transition: all 0.3s var(--transition-smooth);
}

.mobile-brand-toggle.open span:nth-child(1) {
  transform: rotate(45deg) translate(5px, 5px);
}

.mobile-brand-toggle.open span:nth-child(2) {
  opacity: 0;
}

.mobile-brand-toggle.open span:nth-child(3) {
  transform: rotate(-45deg) translate(5px, -5px);
}

/* Mobile Menu Panel */
.mobile-menu-panel {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: linear-gradient(135deg, rgba(26, 54, 93, 0.98) 0%, rgba(30, 58, 95, 0.98) 100%);
  backdrop-filter: blur(20px);
  padding: 20px;
  max-height: 80vh;
  overflow-y: auto;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
  z-index: 500;
}

.mobile-menu-section {
  margin-bottom: 20px;
}

.mobile-menu-title {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 10px;
  padding-bottom: 8px;
  border-bottom: 2px solid;
}

.mobile-menu-title.advisor-title {
  color: var(--advisor-accent);
  border-color: var(--advisor-accent);
}

.mobile-menu-title.corporate-title {
  color: var(--corporate-accent);
  border-color: var(--corporate-accent);
}

.mobile-menu-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.mobile-menu-list li {
  margin-bottom: 8px;
}

.mobile-menu-list a {
  color: rgba(255, 255, 255, 0.9);
  text-decoration: none;
  font-size: 0.95rem;
  display: block;
  padding: 8px 12px;
  border-radius: 6px;
  transition: background 0.2s ease;
}

.mobile-menu-list a:hover {
  background: rgba(255, 255, 255, 0.1);
}

/* ============================================
   COMPACT HEADER (Scrolled State)
   ============================================ */

.dual-brand-header.compact {
  height: 60px;
}

.dual-brand-header.compact .dual-brand-container {
  height: 60px;
}

.compact-container {
  max-width: 1400px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
  padding: 0 40px;
}

.compact-logo {
  display: flex;
  align-items: baseline;
  gap: 4px;
  text-decoration: none;
}

.compact-nav {
  display: flex;
  gap: 30px;
}

.compact-nav a {
  color: rgba(255, 255, 255, 0.85);
  text-decoration: none;
  font-family: 'Inter', sans-serif;
  font-size: 0.9rem;
  font-weight: 500;
  transition: color 0.3s ease;
}

.compact-nav a:hover {
  color: #ffffff;
}

.brand-switch-btn {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #ffffff;
  padding: 8px 16px;
  border-radius: 20px;
  font-family: 'Inter', sans-serif;
  font-size: 0.8rem;
  cursor: pointer;
  transition: all 0.3s var(--transition-smooth);
}

.brand-switch-btn:hover {
  background: rgba(255, 255, 255, 0.2);
  border-color: rgba(255, 255, 255, 0.4);
}

/* ============================================
   BODY PADDING FOR FIXED HEADER
   ============================================ */

body.has-dual-header {
  padding-top: calc(var(--header-height) + 3px);
}

/* ============================================
   RESPONSIVE DESIGN
   ============================================ */

@media (max-width: 1400px) {
  :root {
    --menu-slide-right: 220px;
    --menu-slide-left: 280px;
  }
}

@media (max-width: 1100px) {
  :root {
    --menu-slide-right: 150px;
    --menu-slide-left: 150px;
  }

  .reveal-menu {
    display: none;
  }

  .brand-divider {
    padding: 0 15px;
  }

  .brand-divider,
  .brand-divider.slide-left,
  .brand-divider.slide-right {
    transform: translate(-50%, -50%);
  }
}

@media (max-width: 768px) {
  .dual-brand-container {
    padding: 0 15px;
    justify-content: space-between;
  }

  .brand-portal {
    flex: 0 0 auto;
  }

  .brand-portal.corporate {
    order: 3;
  }

  .brand-logo-btn {
    padding: 8px 10px;
  }

  .logo-bright,
  .logo-name {
    font-size: 1rem;
  }

  .logo-tagline {
    display: none;
  }

  .brand-divider {
    display: none;
  }

  .reveal-menu {
    display: none;
  }

  .mobile-brand-toggle {
    display: flex;
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    z-index: 200;
  }

  .compact-nav {
    display: none;
  }
}

/* ============================================
   CONTENT TRANSITION EFFECTS
   ============================================ */

.brand-content-wrapper {
  transition: opacity 0.3s var(--transition-smooth);
}

.brand-content-wrapper.transitioning {
  opacity: 0;
}

/* Advisor content theme */
.brand-advisor-theme {
  --theme-primary: var(--advisor-primary);
  --theme-accent: var(--advisor-accent);
}

/* Corporate content theme */
.brand-corporate-theme {
  --theme-primary: var(--corporate-primary);
  --theme-accent: var(--corporate-accent);
}

/* ============================================
   CORPORATE DROPDOWN NAVIGATION
   ============================================ */

/* Main corporate nav - always visible when on corporate pages */
.corporate-main-nav {
  position: absolute;
  right: 200px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 100;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(10px);
  border-radius: 30px;
  padding: 6px 12px;
}

.corporate-nav-list {
  display: flex;
  gap: 5px;
  list-style: none;
  margin: 0;
  padding: 0;
  white-space: nowrap;
  align-items: center;
}

.corporate-nav-list .nav-link {
  padding: 8px 12px;
  font-size: 0.8rem;
  border-radius: 20px;
}

.corporate-nav-list .nav-link:hover {
  background: var(--corporate-accent);
  color: #1a1a1a;
}

.corporate-nav-list .dropdown-arrow {
  width: 8px;
  height: 5px;
}

.corporate-nav-items {
  display: flex;
  gap: 5px;
  list-style: none;
  margin: 0;
  padding: 0;
  white-space: nowrap;
}

.dropdown-container {
  position: relative;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 8px 12px;
  color: rgba(255, 255, 255, 0.85);
  text-decoration: none;
  font-family: 'Inter', sans-serif;
  font-size: 0.8rem;
  font-weight: 500;
  border-radius: 20px;
  transition: all 0.3s var(--transition-smooth);
  background: none;
  border: none;
  cursor: pointer;
}

.nav-link:hover,
.nav-link.active {
  background: rgba(255, 255, 255, 0.15);
  color: #ffffff;
}

.dropdown-trigger {
  display: flex;
  align-items: center;
  gap: 6px;
}

.dropdown-arrow {
  transition: transform 0.3s var(--transition-smooth);
  opacity: 0.7;
}

.dropdown-arrow.rotated {
  transform: rotate(180deg);
}

/* Dropdown Menu Container */
.dropdown-menu {
  position: absolute;
  top: calc(100% + 10px);
  left: 0;
  z-index: 1000;
  min-width: 200px;
}

.corporate-nav-list .dropdown-menu {
  left: auto;
  right: 0;
}

.corporate-dropdown {
  background: linear-gradient(135deg, rgba(30, 58, 95, 0.98) 0%, rgba(15, 39, 68, 0.98) 100%);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-radius: 12px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4), 0 0 1px rgba(212, 175, 55, 0.3);
  border: 1px solid rgba(212, 175, 55, 0.2);
  padding: 12px 0;
  animation: dropdownFadeIn 0.2s ease-out;
}

@keyframes dropdownFadeIn {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Standard Dropdown List */
.dropdown-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.dropdown-list li a {
  display: block;
  padding: 10px 20px;
  color: rgba(255, 255, 255, 0.85);
  text-decoration: none;
  font-family: 'Inter', sans-serif;
  font-size: 0.85rem;
  font-weight: 500;
  transition: all 0.2s var(--transition-smooth);
  white-space: nowrap;
}

.dropdown-list li a:hover {
  background: rgba(212, 175, 55, 0.15);
  color: var(--corporate-accent);
  padding-left: 25px;
}

/* ============================================
   MEGA MENU - Solutions Dropdown
   ============================================ */

.mega-menu {
  padding: 16px 20px;
  min-width: 480px;
  max-width: 90vw;
}

.mega-menu-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  align-items: start;
}

.mega-menu-column {
  min-width: 130px;
  max-width: 160px;
  overflow: hidden;
}

.mega-menu-header {
  display: block;
  color: var(--corporate-accent);
  font-family: 'Inter', sans-serif;
  font-size: 0.75rem;
  font-weight: 700;
  text-decoration: none;
  padding-bottom: 8px;
  margin-bottom: 8px;
  border-bottom: 1px solid rgba(212, 175, 55, 0.3);
  transition: all 0.2s var(--transition-smooth);
}

.mega-menu-header:hover {
  color: #ffffff;
}

.mega-menu-items {
  list-style: none;
  margin: 0;
  padding: 0;
}

.mega-menu-items li a {
  display: block;
  padding: 4px 0;
  color: rgba(255, 255, 255, 0.75);
  text-decoration: none;
  font-family: 'Inter', sans-serif;
  font-size: 0.7rem;
  font-weight: 400;
  transition: all 0.2s var(--transition-smooth);
  white-space: normal;
  word-wrap: break-word;
  line-height: 1.3;
}

.mega-menu-items li a:hover {
  color: var(--corporate-accent);
  padding-left: 5px;
}

.mega-menu-column.active .mega-menu-header {
  color: #ffffff;
}

/* ============================================
   RESPONSIVE DROPDOWNS
   ============================================ */

@media (max-width: 1200px) {
  .mega-menu {
    min-width: 600px;
  }

  .mega-menu-grid {
    grid-template-columns: repeat(3, 1fr);
    align-items: start;
  }
}

@media (max-width: 900px) {
  .mega-menu {
    min-width: 400px;
  }

  .mega-menu-grid {
    grid-template-columns: repeat(2, 1fr);
    align-items: start;
  }
}

@media (max-width: 1100px) {
  .corporate-main-nav {
    display: none;
  }
}

@media (max-width: 768px) {
  .dropdown-menu {
    position: fixed;
    top: var(--header-height);
    left: 0;
    right: 0;
    transform: none;
    margin-top: 0;
    border-radius: 0;
    max-height: calc(100vh - var(--header-height));
    overflow-y: auto;
  }

  .mega-menu {
    min-width: 100%;
  }

  .mega-menu-grid {
    grid-template-columns: 1fr;
    gap: 15px;
  }

  .mega-menu-column {
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding-bottom: 15px;
  }

  .mega-menu-column:last-child {
    border-bottom: none;
  }
}
