/* Shareide - Header & Navigation (Ultra Premium V6) */

/* ========== HEADER BASE ========== */
.header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  padding: 0 0;
  height: 72px;
  transition: all 0.4s var(--ease-out-expo);
}

.header .container {
  height: 100%;
  display: flex;
  align-items: center;
}

.header.scrolled {
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border-bottom: 1px solid rgba(0,0,0,0.04);
  box-shadow: 0 1px 3px rgba(0,0,0,0.04), 0 4px 12px rgba(0,0,0,0.03);
}

/* ========== HEADER INNER ========== */
.header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  width: 100%;
  height: 100%;
}

/* ========== LOGO ========== */
.header__logo {
  position: relative;
  z-index: 5;
  flex-shrink: 0;
}

.header__logo-img {
  height: 36px;
  width: auto;
  transition: all 0.3s var(--ease-out);
}

.header.scrolled .header__logo-img {
  height: 34px;
}

/* Default: show dark logo (light theme) */
.header__logo-dark { display: block; }
.header__logo-light { display: none; }

/* Scrolled: show dark logo (light glass background) */
.header.scrolled .header__logo-dark { display: block; }
.header.scrolled .header__logo-light { display: none; }

/* Homepage transparent (light hero): show dark logo */
.header:not(.header--inner):not(.scrolled) .header__logo-dark { display: block; }
.header:not(.header--inner):not(.scrolled) .header__logo-light { display: none; }

/* Inner pages: show dark logo */
.header--inner .header__logo-dark { display: block; }
.header--inner .header__logo-light { display: none; }

.header--inner.scrolled .header__logo-dark { display: block; }
.header--inner.scrolled .header__logo-light { display: none; }

/* ========== NAV ========== */
.header__nav-list {
  display: flex;
  align-items: center;
  gap: 2px;
}

/* ========== NAV LINKS ========== */
.header__nav-link {
  padding: 8px 16px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary);
  border-radius: 10px;
  transition: all 0.25s ease;
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  cursor: pointer;
  background: none;
  border: none;
  font-family: inherit;
  letter-spacing: -0.01em;
}

.header__nav-link:hover {
  color: var(--black);
  background: rgba(0,0,0,0.03);
}

.header__nav-link.active {
  color: var(--gray-900);
  font-weight: 600;
}

.header__nav-link.active::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 18px;
  height: 2px;
  background: var(--primary);
  border-radius: 2px;
}

.header__nav-link--dropdown svg {
  transition: transform 0.3s var(--ease-out);
  opacity: 0.5;
  flex-shrink: 0;
}

.header__dropdown:hover .header__nav-link--dropdown svg,
.header__dropdown.open .header__nav-link--dropdown svg {
  transform: rotate(180deg);
  opacity: 1;
}

/* ========== HEADER COLOR STATES ========== */

/* Homepage: transparent with dark text (light hero) */
.header:not(.header--inner):not(.scrolled) .header__nav-link {
  color: var(--text-secondary);
}
.header:not(.header--inner):not(.scrolled) .header__nav-link:hover {
  color: var(--black);
  background: rgba(0,0,0,0.04);
}
.header:not(.header--inner):not(.scrolled) .header__nav-link.active {
  color: var(--gray-900);
  font-weight: 600;
}
.header:not(.header--inner):not(.scrolled) .header__drive-link {
  color: var(--text-secondary);
}
.header:not(.header--inner):not(.scrolled) .header__drive-link:hover {
  color: var(--black);
}
.header:not(.header--inner):not(.scrolled) .header__hamburger span {
  background: var(--gray-900);
}

/* Inner pages */
.header--inner .header__nav-link {
  color: var(--gray-500);
}
.header--inner .header__nav-link:hover {
  color: var(--gray-900);
  background: rgba(0,0,0,0.03);
}
.header--inner .header__nav-link.active {
  color: var(--gray-900);
  font-weight: 600;
}
.header--inner .header__drive-link {
  color: var(--gray-600);
}
.header--inner .header__hamburger span {
  background: var(--gray-700);
}

/* Scrolled state (light glass - overrides all) */
.header.scrolled .header__nav-link {
  color: var(--gray-500);
}
.header.scrolled .header__nav-link:hover {
  color: var(--gray-900);
  background: rgba(0,0,0,0.03);
}
.header.scrolled .header__nav-link.active {
  color: var(--gray-900);
  font-weight: 600;
}
.header.scrolled .header__drive-link {
  color: var(--gray-600);
}
.header.scrolled .header__drive-link:hover {
  color: var(--gray-900);
}
.header.scrolled .header__hamburger span {
  background: var(--gray-700);
}

/* Scrolled CTA: yellow button always */
.header.scrolled .header__actions .btn {
  background: #F5B800;
  color: #000;
  box-shadow: 0 4px 16px rgba(245,184,0,0.3);
}
.header.scrolled .header__actions .btn:hover {
  background: #E8A500;
  box-shadow: 0 8px 24px rgba(245,184,0,0.4);
}

/* ========== RIGHT ACTIONS ========== */
.header__actions {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-shrink: 0;
}

.header__drive-link {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-secondary);
  transition: color 0.25s var(--ease-out);
  position: relative;
  letter-spacing: -0.01em;
}

.header__drive-link::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 1.5px;
  background: currentColor;
  transition: width 0.3s var(--ease-out-expo);
}

.header__drive-link:hover::after {
  width: 100%;
}

/* CTA Button in Header */
.header__actions .btn {
  font-size: 14px;
  padding: 10px 24px;
  font-weight: 600;
  border-radius: 12px;
  letter-spacing: -0.01em;
}

/* ========== HAMBURGER ========== */
.header__hamburger {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  width: 40px;
  height: 40px;
  cursor: pointer;
  border: none;
  background: none;
  padding: 0;
  border-radius: 10px;
  transition: background 0.2s ease;
}

.header__hamburger:hover {
  background: rgba(0,0,0,0.04);
}

.header__hamburger span {
  display: block;
  width: 22px;
  height: 1.5px;
  background: var(--gray-700);
  border-radius: 2px;
  transition: all 0.3s var(--ease-out);
  transform-origin: center;
}

.header__hamburger.active span:nth-child(1) {
  transform: translateY(6.5px) rotate(45deg);
}

.header__hamburger.active span:nth-child(2) {
  opacity: 0;
  transform: scaleX(0);
}

.header__hamburger.active span:nth-child(3) {
  transform: translateY(-6.5px) rotate(-45deg);
}

/* ========== CLOSE BUTTON (Mobile) ========== */
.header__close {
  display: none;
}

/* ========== DROPDOWN CONTAINER ========== */
.header__dropdown {
  position: relative;
  padding-bottom: 10px;
  margin-bottom: -10px;
}

/* ========== MEGA DROPDOWN ========== */
.header__mega {
  position: absolute;
  top: calc(100% + 4px);
  left: 50%;
  transform: translateX(-50%) translateY(-8px);
  min-width: 520px;
  background: rgba(255, 255, 255, 0.98);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid rgba(0,0,0,0.06);
  border-radius: 20px;
  padding: 24px;
  margin-top: 8px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.06), 0 24px 48px rgba(0,0,0,0.08);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s var(--ease-out), transform 0.25s var(--ease-out), visibility 0s linear 0.25s;
  z-index: 100;
  pointer-events: none;
}

/* Invisible hover bridge */
.header__mega::before {
  content: '';
  position: absolute;
  top: -20px;
  left: -20px;
  right: -20px;
  height: 25px;
  background: transparent;
}

.header__mega--compact {
  min-width: 300px;
}

.header__mega--compact .header__mega-item {
  width: 100%;
}

/* Show on hover */
.header__dropdown:hover .header__mega {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
  pointer-events: auto;
  transition: opacity 0.2s var(--ease-out), transform 0.2s var(--ease-out), visibility 0s linear 0s;
}

/* Mega grid (2-column) */
.header__mega-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.header__mega-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  color: var(--gray-400);
  padding: 4px 10px 8px;
}

.header__mega-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 18px;
  border-radius: 14px;
  transition: all 0.2s ease;
}

.header__mega-item:hover {
  background: rgba(0,0,0,0.03);
}

.header__mega-icon {
  width: 42px;
  height: 42px;
  min-width: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  font-size: 15px;
  color: var(--primary-dark);
  background: var(--primary-surface);
  transition: all 0.2s var(--ease-out);
}

.header__mega-item:hover .header__mega-icon {
  transform: scale(1.05);
}

/* Icon color variants — all yellow brand */
.header__mega-icon--blue,
.header__mega-icon--green,
.header__mega-icon--purple,
.header__mega-icon--red,
.header__mega-icon--teal,
.header__mega-icon--orange { background: rgba(245,184,0,0.08); color: #D4900A; }

.header__mega-item:hover .header__mega-icon--blue,
.header__mega-item:hover .header__mega-icon--green,
.header__mega-item:hover .header__mega-icon--purple,
.header__mega-item:hover .header__mega-icon--red,
.header__mega-item:hover .header__mega-icon--teal,
.header__mega-item:hover .header__mega-icon--orange { background: rgba(245,184,0,0.12); }

.header__mega-title {
  display: block;
  font-size: 15px;
  font-weight: 600;
  color: var(--gray-900);
  letter-spacing: -0.01em;
  transition: color 0.15s ease;
}

.header__mega-item:hover .header__mega-title {
  color: var(--black);
}

.header__mega-desc {
  display: block;
  font-size: 13px;
  color: var(--gray-500);
  margin-top: 2px;
  line-height: 1.5;
}

/* ========== MOBILE RESPONSIVE ========== */
@media (max-width: 992px) {
  .header__nav {
    position: fixed;
    top: 0;
    right: -100%;
    width: 100%;
    max-width: 420px;
    height: 100dvh;
    background: var(--white);
    border-radius: 0;
    padding: 80px 24px 40px;
    transition: right 0.4s var(--ease-out-expo);
    box-shadow: -15px 0 60px rgba(0,0,0,0.12);
    z-index: 1001;
    overflow-y: auto;
    overscroll-behavior: contain;
    border-left: 1px solid rgba(0,0,0,0.04);
  }

  .header__nav.show {
    right: 0;
    background: #ffffff !important;
    -webkit-backdrop-filter: none !important;
    backdrop-filter: none !important;
  }

  .header__nav-list {
    flex-direction: column;
    gap: 2px;
    align-items: stretch;
  }

  .header__nav-link {
    display: flex;
    justify-content: space-between;
    width: 100%;
    padding: 16px 24px;
    font-size: 16px;
    font-weight: 500;
    color: var(--gray-600) !important;
    border-radius: 12px;
    background: transparent !important;
    border-left: 3px solid transparent;
    transition: all 0.2s ease;
  }

  .header__nav-link:hover {
    color: var(--gray-900) !important;
    background: rgba(0,0,0,0.02) !important;
    border-left-color: var(--primary);
  }

  .header__nav-link.active {
    color: var(--gray-900) !important;
    background: rgba(0,0,0,0.02) !important;
    border-left-color: var(--primary);
  }

  .header__nav-link.active::after { display: none; }

  .header__mega {
    position: static;
    min-width: 100% !important;
    transform: none !important;
    box-shadow: none;
    border: none;
    border-radius: 0;
    background: transparent;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    padding: 0 0 0 8px;
    margin-top: 0;
    max-height: 0;
    overflow: hidden;
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transition: max-height 0.4s var(--ease-out);
  }

  .header__mega::before { display: none; }

  .header__mega-grid {
    grid-template-columns: 1fr;
    gap: 0;
  }

  .header__dropdown.mobile-open .header__mega {
    max-height: 800px;
  }

  .header__dropdown:hover .header__mega {
    opacity: 1;
    visibility: visible;
    max-height: 0;
    pointer-events: auto;
    transform: none;
  }

  .header__dropdown.mobile-open:hover .header__mega {
    max-height: 800px;
  }

  .header__mega-label {
    padding: 10px 10px 6px;
    margin-top: 4px;
  }

  .header__mega-item {
    padding: 12px 10px;
  }

  .header__mega-icon {
    width: 34px;
    height: 34px;
    min-width: 34px;
    font-size: 13px;
    border-radius: 10px;
  }

  .header__dropdown.mobile-open .header__nav-link--dropdown svg {
    transform: rotate(180deg);
    opacity: 1;
  }

  .header__close {
    display: flex;
    align-items: center;
    justify-content: center;
    position: absolute;
    top: 20px;
    right: 20px;
    width: 40px;
    height: 40px;
    color: var(--gray-500);
    cursor: pointer;
    border-radius: 10px;
    background: rgba(0,0,0,0.03);
    border: 1px solid rgba(0,0,0,0.04);
    transition: all 0.2s ease;
  }

  .header__close:hover {
    background: rgba(0,0,0,0.06);
    color: var(--gray-900);
  }

  .header__hamburger {
    display: flex;
  }

  .header__actions .btn,
  .header__drive-link {
    display: none;
  }
}

/* ========== OVERLAY ========== */
.header__overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.3);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  z-index: 999;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s var(--ease-out);
}

.header__overlay.show {
  opacity: 1;
  visibility: visible;
}
