/* ═══════════════════════════════════════════════════════════════
   HeaderPro — Scoped styles (.hpro-*)
   Floating command bar + pro top bar + mega menus + mobile drawer
   ═══════════════════════════════════════════════════════════════ */

/* ── Variables ─────────────────────────────────────────────── */
:root {
  --hpro-max: 80vw;
  --hpro-bg: rgba(8, 6, 30, 0.75);
  --hpro-bg-solid: rgba(8, 6, 30, 0.95);
  --hpro-border: rgba(255, 255, 255, 0.06);
  --hpro-border-hover: var(--glass-border);
  --hpro-text: rgba(255, 255, 255, 0.72);
  --hpro-text-hover: #fff;
  --hpro-accent: #3b82f6;
  --hpro-accent-glow: rgba(59, 130, 246, 0.35);
  --hpro-radius: 14px;
  --hpro-pill-radius: 999px;
  --hpro-transition: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  --hpro-logo-scale: 1.2;
  --hpro-logo-height-desktop: 48px;
  --hpro-logo-height-tablet: 45px;
  --hpro-logo-height-mobile: 38px;
  --hpro-logo-height-xl: 53px;
}

/* ── Wrapper ───────────────────────────────────────────────── */
.hpro {
  position: sticky;
  top: 0;
  z-index: 1000;
  transition: transform 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.hpro--scrolled {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
}

/* ═══ TOP BAR ══════════════════════════════════════════════ */
.hpro-topbar {
  background: linear-gradient(90deg, rgba(0, 0, 0, 0.97) 0%, rgba(0, 0, 0, 0.93) 100%);
  border-bottom: none;
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  overflow: hidden;
}

.hpro-topbar__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: var(--hpro-max);
  margin: 0 auto;
  padding: 12px 24px; /* Increased height */
  position: relative;
}

.hpro-topbar__left,
.hpro-topbar__right {
  display: flex;
  align-items: center;
  gap: 16px;
}

.hpro-topbar__center {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--hpro-accent);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  pointer-events: none;
}

.hpro-topbar__center svg {
  animation: hpro-pulse 2.5s ease-in-out infinite;
}

@keyframes hpro-pulse {
  0%, 100% { opacity: 0.6; transform: scale(1); }
  50% { opacity: 1; transform: scale(1.15); }
}

.hpro-topbar__link {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: rgba(255, 255, 255, 0.82);
  text-decoration: none;
  font-size: 11.5px;
  font-weight: 500;
  letter-spacing: 0.02em;
  transition: color var(--hpro-transition);
}
.hpro-topbar__link:hover {
  color: #ffffff;
}
.hpro-topbar__link svg {
  flex-shrink: 0;
}

.hpro-topbar__sep {
  width: 1px;
  height: 12px;
  background: var(--glass-bg-hover);
}

.hpro-topbar__time {
  font-size: 10.5px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.82);
  letter-spacing: 0.1em;
  font-variant-numeric: tabular-nums;
}

/* Keep the compact header pinned to the top on mobile/tablet */
@media (max-width: 1199px) {
  .hpro {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
  }

  .hpro-topbar { display: none; }
}

/* ═══ MAIN BAR ═════════════════════════════════════════════ */
.hpro-bar {
  padding: 8px 16px;
  transition: padding var(--hpro-transition), background var(--hpro-transition);
}

.hpro--scrolled .hpro-bar {
  padding: 6px 16px;
}

@media (min-width: 1200px) {
  .hpro-bar {
    min-height: 76px;
    display: flex;
    align-items: center;
    padding: 12px 16px 0;
    margin-bottom: -10px;
  }

  .hpro--scrolled .hpro-bar {
    min-height: 70px;
    padding: 12px 16px 0;
    margin-bottom: 0;
  }
}

.hpro-bar__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  max-width: var(--hpro-max);
  margin: 0 auto;
  background: var(--hpro-bg);
  backdrop-filter: blur(28px) saturate(1.3);
  -webkit-backdrop-filter: blur(28px) saturate(1.3);
  border: 1px solid var(--hpro-border);
  border-radius: var(--hpro-pill-radius);
  padding: 6px 8px 6px 18px;
  box-shadow:
    0 1px 0 0 var(--glass-bg-subtle) inset,
    0 8px 32px rgba(0, 0, 0, 0.35);
  transition: all var(--hpro-transition);
}

.hpro--scrolled .hpro-bar__inner {
  background: var(--hpro-bg-solid);
  box-shadow:
    0 1px 0 0 rgba(255, 255, 255, 0.04) inset,
    0 12px 48px rgba(0, 0, 0, 0.5);
}

/* ── Logo ──────────────────────────────────────────────────── */
.hpro-logo {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
  flex-shrink: 0;
  transition: opacity var(--hpro-transition);
}
.hpro-logo:hover { opacity: 0.85; }

.hpro-logo__img {
  height: calc(var(--hpro-logo-height-desktop) * var(--hpro-logo-scale));
  width: auto;
  max-width: none;
  display: block;
}

.hpro-logo-light { display: block; } /* Show in dark mode */
.hpro-logo-dark { display: none; }

/* ── Desktop nav ───────────────────────────────────────────── */
.hpro-nav {
  display: none;
  align-items: center;
  gap: 2px;
}

@media (min-width: 1200px) {
  .hpro-nav { display: flex; }
}

@media (min-width: 1200px) and (max-width: 1439px) {
  .hpro-nav__link {
    padding: 7px 8px;
  }
}

.hpro-nav__item {
  position: relative;
}

/* Bridge for hover gap between trigger and mega panel */
.hpro-nav__item--has-dropdown::after {
  content: '';
  position: absolute;
  left: -8px;
  right: -8px;
  top: 100%;
  height: 18px;
}

.hpro-nav__link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 7px 12px;
  border-radius: 10px;
  color: var(--hpro-text);
  text-decoration: none;
  font-size: 13.5px;
  font-weight: 550;
  letter-spacing: 0.01em;
  white-space: nowrap;
  border: none;
  background: transparent;
  cursor: pointer;
  transition: color var(--hpro-transition), background var(--hpro-transition);
  position: relative;
}

/* Active underline indicator */
.hpro-nav__item--active > .hpro-nav__link::after {
  content: '';
  position: absolute;
  bottom: 2px;
  left: 12px;
  right: 12px;
  height: 2px;
  border-radius: 2px;
  background: var(--hpro-accent);
  box-shadow: 0 0 8px var(--hpro-accent-glow);
}

.hpro-nav__link:hover {
  color: var(--hpro-text-hover);
  background: var(--glass-bg);
}

.hpro-nav__chevron {
  transition: transform 0.2s ease;
  opacity: 0.5;
}
.hpro-nav__chevron--open {
  transform: rotate(180deg);
  opacity: 0.8;
}

/* ═══ MEGA MENU ════════════════════════════════════════════ */
.hpro-mega {
  position: absolute;
  top: calc(100% + 4px);
  left: 50%;
  transform: translateX(-50%) translateY(-3px);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.08s ease, transform 0.08s ease, visibility 0.08s;
  z-index: 100;
}
.hpro-mega--open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateX(-50%) translateY(0);
}

.hpro-mega__grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2px;
  background: var(--hpro-bg-solid);
  border: 1px solid var(--hpro-border);
  border-radius: var(--hpro-radius);
  padding: 8px;
  min-width: 400px;
  max-width: 520px;
  box-shadow:
    0 24px 64px rgba(0, 0, 0, 0.5),
    0 0 0 0.5px rgba(255, 255, 255, 0.04) inset;
}

/* Small dropdowns (<=3 items like Company) go single column */
.hpro-mega__grid:has(:nth-child(-n+3):last-child) {
  grid-template-columns: 1fr;
  min-width: 260px;
  max-width: 320px;
}

.hpro-mega__link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: 10px;
  color: var(--hpro-text);
  text-decoration: none;
  transition: all var(--hpro-transition);
}
.hpro-mega__link:hover {
  background: var(--glass-bg);
  color: var(--hpro-text-hover);
}
.hpro-mega__link--active {
  color: var(--hpro-text-hover);
  background: rgba(59, 130, 246, 0.08);
}
.hpro-mega__link--active .hpro-mega__icon {
  background: rgba(59, 130, 246, 0.18);
  color: var(--hpro-accent);
  box-shadow: 0 0 12px var(--hpro-accent-glow);
}

.hpro-mega__icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.04);
  color: rgba(255, 255, 255, 0.55);
  flex-shrink: 0;
  transition: all var(--hpro-transition);
}
.hpro-mega__link:hover .hpro-mega__icon {
  background: rgba(59, 130, 246, 0.12);
  color: var(--hpro-accent);
}

.hpro-mega__text {
  font-size: 13px;
  font-weight: 500;
  line-height: 1.35;
}

/* ── Desktop actions ───────────────────────────────────────── */
.hpro-actions {
  display: none;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

@media (min-width: 1200px) {
  .hpro-actions { display: flex; }
}

/* ── CTA Button ────────────────────────────────────────────── */
.hpro-cta {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 20px;
  border-radius: var(--hpro-pill-radius);
  background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
  color: var(--text-primary);
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-decoration: none;
  text-transform: uppercase;
  white-space: nowrap;
  border: none;
  cursor: pointer;
  box-shadow:
    0 0 0 1px rgba(59, 130, 246, 0.3),
    0 4px 16px rgba(59, 130, 246, 0.3);
  transition: all var(--hpro-transition);
  position: relative;
  overflow: hidden;
}

/* Shimmer effect */
.hpro-cta::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, var(--glass-border-strong), transparent);
  transition: left 0.5s ease;
}
.hpro-cta:hover::before {
  left: 100%;
}

.hpro-cta:hover {
  background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
  box-shadow:
    0 0 0 1px rgba(59, 130, 246, 0.5),
    0 8px 28px rgba(59, 130, 246, 0.45);
  transform: translateY(-1px);
}
.hpro-cta:active {
  transform: translateY(0);
}

.hpro-cta--full {
  width: 100%;
  justify-content: center;
  padding: 14px 24px;
  font-size: 14px;
}

/* ── Mobile actions ────────────────────────────────────────── */
.hpro-mobile-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

@media (min-width: 1200px) {
  .hpro-mobile-actions { display: none; }
}

.hpro-burger {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  border: 1px solid var(--hpro-border);
  background: var(--glass-bg-subtle);
  color: var(--hpro-text);
  cursor: pointer;
  transition: all var(--hpro-transition);
  -webkit-tap-highlight-color: transparent;
}
.hpro-burger svg {
  transition: transform var(--hpro-transition), opacity var(--hpro-transition), color var(--hpro-transition);
}
.hpro-burger:hover {
  background: rgba(255, 255, 255, 0.06);
  color: var(--hpro-text-hover);
}
.hpro-burger--open {
  color: var(--hpro-accent);
  border-color: rgba(59, 130, 246, 0.2);
  background: rgba(59, 130, 246, 0.1);
  box-shadow: 0 0 0 1px rgba(59, 130, 246, 0.08), 0 10px 24px rgba(59, 130, 246, 0.16);
}

.hpro-burger__icon--close {
  transform: rotate(90deg) scale(1.04);
}

/* ═══ MOBILE DRAWER ════════════════════════════════════════ */
.hpro-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 998;
  animation: hpro-fadeIn 0.2s ease;
}

@keyframes hpro-fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.hpro-drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(320px, 85vw);
  background: linear-gradient(180deg, rgba(10, 8, 35, 0.98) 0%, rgba(6, 4, 24, 0.99) 100%);
  border-left: 1px solid var(--hpro-border);
  z-index: 999;
  transform: translateX(100%);
  transition: transform 0.3s cubic-bezier(0.32, 0.72, 0, 1);
  box-shadow: -16px 0 48px rgba(0, 0, 0, 0.4);
  overflow: hidden;
}
.hpro-drawer--open {
  transform: translateX(0);
}

.hpro-drawer__close {
  position: absolute;
  top: 16px;
  right: 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  border: 1px solid var(--hpro-border);
  background: rgba(255, 255, 255, 0.04);
  color: var(--hpro-text-hover);
  cursor: pointer;
  z-index: 2;
  -webkit-tap-highlight-color: transparent;
}

.hpro-drawer__scroll {
  height: 100%;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 80px 20px 24px;
  -webkit-overflow-scrolling: touch;
}

.hpro-drawer__group {
  border-bottom: 1px solid var(--hpro-border);
}
.hpro-drawer__group:last-of-type {
  border-bottom: none;
}

.hpro-drawer__link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 15px 4px;
  color: var(--hpro-text);
  text-decoration: none;
  font-size: 15px;
  font-weight: 600;
  background: transparent;
  border: none;
  cursor: pointer;
  transition: color var(--hpro-transition);
  -webkit-tap-highlight-color: transparent;
}
.hpro-drawer__link:hover,
.hpro-drawer__link--active {
  color: var(--hpro-text-hover);
}
.hpro-drawer__link--expanded {
  color: var(--hpro-accent);
}

.hpro-drawer__arrow {
  opacity: 0.3;
  transition: opacity var(--hpro-transition), transform var(--hpro-transition);
}
.hpro-drawer__link:hover .hpro-drawer__arrow {
  opacity: 0.7;
  transform: translateX(3px);
}

.hpro-drawer__chevron {
  transition: transform 0.25s ease;
  opacity: 0.5;
}
.hpro-drawer__chevron--open {
  transform: rotate(180deg);
  opacity: 1;
  color: var(--hpro-accent);
}

/* Accordion sub-items */
.hpro-drawer__sub {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.35s cubic-bezier(0.32, 0.72, 0, 1), padding 0.25s ease;
  padding: 0;
}
.hpro-drawer__sub--open {
  max-height: 600px;
  padding: 4px 0 8px;
}

.hpro-drawer__child {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  margin: 1px 0;
  border-radius: 10px;
  color: rgba(255, 255, 255, 0.6);
  text-decoration: none;
  font-size: 13.5px;
  font-weight: 450;
  transition: all var(--hpro-transition);
}
.hpro-drawer__child:hover,
.hpro-drawer__child--active {
  background: rgba(255, 255, 255, 0.04);
  color: var(--hpro-text-hover);
}
.hpro-drawer__child--active {
  color: var(--hpro-accent);
}
.hpro-drawer__child svg {
  flex-shrink: 0;
  opacity: 0.45;
}
.hpro-drawer__child:hover svg {
  opacity: 0.8;
  color: var(--hpro-accent);
}

/* Mobile CTA */
.hpro-drawer__cta {
  padding: 24px 0 0;
  margin-top: 8px;
  border-top: 1px solid var(--hpro-border);
}

/* ═══ SCROLLED STATE REFINEMENTS ═══════════════════════════ */
.hpro--scrolled .hpro-topbar {
  max-height: 0;
  padding: 0;
  border-bottom: none;
  opacity: 0;
  overflow: hidden;
  transition: max-height 0.3s ease, opacity 0.2s ease, padding 0.3s ease;
}

/* Entry animation when sticky */
.hpro--scrolled .hpro-bar {
  animation: hpro-slideDown 0.35s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
}

@keyframes hpro-slideDown {
  from { transform: translateY(-100%); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

/* ═══ TABLET REFINEMENTS ═══════════════════════════════════ */
@media (min-width: 768px) and (max-width: 1199px) {
  .hpro-bar {
    padding: 0;
  }

  .hpro--scrolled .hpro-bar {
    padding: 0;
  }

  .hpro-bar__inner {
    width: 100%;
    max-width: none;
    border-radius: 0;
    padding: 10px 18px;
  }

  .hpro-logo {
    flex: 1 1 auto;
    min-width: 0;
  }

  .hpro-logo__img {
    height: calc(var(--hpro-logo-height-tablet) * var(--hpro-logo-scale));
  }

  .hpro-drawer {
    width: min(380px, 75vw);
  }

  .hpro-drawer__scroll {
    padding: 88px 28px 32px;
  }

  .hpro-drawer__link {
    font-size: 16px;
    padding: 18px 4px;
  }

  .hpro-drawer__child {
    font-size: 14.5px;
    padding: 12px 14px;
  }
}

/* ═══ SMALL MOBILE ═════════════════════════════════════════ */
@media (max-width: 374px) {
  .hpro-bar {
    padding: 0;
  }

  .hpro-bar__inner {
    width: 100%;
    max-width: none;
    border-radius: 0;
    padding: 8px 10px;
  }

  .hpro-logo__img {
    height: calc(var(--hpro-logo-height-mobile) * 1.5);
  }

  .hpro-burger {
    width: 32px;
    height: 32px;
  }
}

@media (max-width: 767px) {
  .hpro-bar {
    padding: 0;
  }

  .hpro--scrolled .hpro-bar {
    padding: 0;
  }

  .hpro-bar__inner {
    width: 100%;
    max-width: none;
    border-radius: 0;
    padding: 9px 12px;
    gap: 10px;
  }

  .hpro-logo {
    flex: 1 1 auto;
    min-width: 0;
  }

  .hpro-logo__img {
    height: calc(var(--hpro-logo-height-mobile) * 1.35);
  }

  .hpro-mobile-actions {
    gap: 6px;
  }
}

/* ═══ LARGE SCREENS ════════════════════════════════════════ */
@media (min-width: 1440px) {
  .hpro-bar__inner {
    padding: 7px 12px 7px 24px;
  }

  .hpro-nav__link {
    padding: 8px 14px;
    font-size: 14px;
  }

  .hpro-logo__img {
    height: calc(var(--hpro-logo-height-xl) * var(--hpro-logo-scale));
  }

  .hpro-mega__grid {
    min-width: 440px;
    max-width: 560px;
  }
}

/* ═══ REDUCE MOTION ════════════════════════════════════════ */
@media (prefers-reduced-motion: reduce) {
  .hpro,
  .hpro-bar__inner,
  .hpro-nav__link,
  .hpro-mega,
  .hpro-drawer,
  .hpro-cta::before {
    transition-duration: 0.01ms;
    animation-duration: 0.01ms;
  }
}

/* ═══ LIGHT MODE OVERRIDES ═════════════════════════════════ */
.light-mode {
  --hpro-bg: rgba(255, 255, 255, 0.95);
  --hpro-bg-solid: #ffffff;
  --hpro-border: rgba(0, 0, 0, 0.15);
  --hpro-text: #334155;
  --hpro-text-hover: #0f172a;
}

.light-mode .hpro-topbar {
  background: #ffffff;
  border-bottom: none;
}

.light-mode .hpro-topbar__center {
  color: #2563eb;
}

.light-mode .hpro-topbar__link {
  color: #334155;
}

.light-mode .hpro-topbar__link:hover {
  color: #0f172a;
}

.light-mode .hpro-topbar__time {
  color: #475569;
}

.light-mode .hpro-topbar__sep {
  background: rgba(0, 0, 0, 0.15);
}

.light-mode .hpro-mega__grid {
  background: #ffffff;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.1);
  border: 1px solid var(--hpro-border);
}

.light-mode .hpro-mega__icon {
  background: rgba(0, 0, 0, 0.05);
  color: #334155;
}

.light-mode .hpro-burger {
  background: rgba(0, 0, 0, 0.05);
  color: #0f172a;
  border-color: rgba(0, 0, 0, 0.15);
}

.light-mode .hpro-drawer {
  background: #ffffff;
  border-left: 1px solid var(--hpro-border);
}

.light-mode .hpro-drawer__link {
  color: #0f172a;
}

.light-mode .hpro-drawer__child {
  color: #334155;
}

.light-mode .hpro-drawer__child:hover {
  background: rgba(0, 0, 0, 0.05);
  color: #0f172a;
}

/* ═══ LOGO THEME SWITCHING ═══ */
.light-mode .hpro-logo-light { display: none; }
.light-mode .hpro-logo-dark { display: block; } /* Show in light mode */

/* ═══ LANGUAGE SWITCHER LIGHT FIX ═══ */
.light-mode .power-label {
  color: #334155 !important;
}

/* ═══ THEME SWITCHER STYLING ═══ */
.theme-switcher-btn {
  background: rgba(255, 255, 255, 0.08) !important;
  border-radius: 50% !important;
  color: #ffffff !important;
  transition: all 0.3s ease !important;
}
.theme-switcher-btn:hover {
  background: rgba(255, 255, 255, 0.15) !important;
}
.light-mode .theme-switcher-btn {
  background: rgba(0, 0, 0, 0.05) !important;
  color: #3b82f6 !important;
}
.light-mode .theme-switcher-btn:hover {
  background: rgba(0, 0, 0, 0.1) !important;
  color: #2563eb !important;
}

.hpro-nav__item--has-dropdown:hover > .hpro-mega,
.hpro-nav__item--has-dropdown:focus-within > .hpro-mega {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateX(-50%) translateY(0);
}
.hpro-cta, .hpro-cta:visited { color: #fff; }
.power-dropdown[hidden], .hpro-backdrop[hidden] { display: none !important; }
