/* Global Header — Dark, zone-aware, shared across all zones */

.global-header {
  background: var(--bg-dark);
  border-bottom: 2px solid var(--zone-accent);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow-md);
}

.global-header__inner {
  max-width: var(--container-max-width);
  margin: 0 auto;
  padding: 0 var(--space-xl);
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 64px;
}

/* Logo */
.global-header__logo {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  text-decoration: none;
  flex-shrink: 0;
}

.global-header__logo:hover {
  text-decoration: none;
}

.global-header__logo-img {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
}

.global-header__logo-text {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.global-header__logo-name {
  font-size: 1.25rem;
  font-weight: 700;
  color: #ffffff;
  line-height: 1.2;
  letter-spacing: -0.01em;
}

/* Zone Badge */
.global-header__zone-badge {
  display: inline-block;
  padding: 0.125rem 0.5rem;
  border-radius: var(--radius-sm);
  font-size: 0.625rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  line-height: 1.4;
  width: fit-content;
}

.global-header__zone-badge--intelligence {
  background: var(--zone-accent-intelligence);
  color: #ffffff;
}

.global-header__zone-badge--wire {
  background: var(--zone-accent-wire);
  color: #ffffff;
}

.global-header__zone-badge--admin {
  background: var(--zone-accent-admin);
  color: #ffffff;
}

.global-header__zone-badge--my {
  background: var(--zone-accent);
  color: #ffffff;
}

/* Desktop Navigation */
.global-header__nav {
  display: flex;
  align-items: center;
  gap: var(--space-lg);
}

.global-header__nav-link {
  color: var(--text-tertiary);
  font-size: 0.875rem;
  font-weight: 500;
  text-decoration: none;
  transition: color var(--transition-base);
  position: relative;
  padding: var(--space-xs) 0;
}

.global-header__nav-link:hover {
  color: #ffffff;
}

.global-header__nav-link--active {
  color: #ffffff;
}

.global-header__nav-link--active::after {
  content: '';
  position: absolute;
  bottom: -20px;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--zone-accent);
}

/* Search Icon */
.global-header__search-icon {
  display: flex;
  align-items: center;
  padding: var(--space-xs);
}

.global-header__search-icon svg {
  color: var(--text-tertiary);
  transition: color var(--transition-base);
}

.global-header__search-icon:hover svg {
  color: #ffffff;
}

/* Sign In */
.global-header__sign-in {
  border: 1px solid rgba(255, 255, 255, 0.2);
  padding: var(--space-xs) var(--space-md) !important;
  border-radius: var(--radius-sm);
  font-size: 0.8125rem !important;
}

.global-header__sign-in:hover {
  border-color: rgba(255, 255, 255, 0.4);
  background: rgba(255, 255, 255, 0.05);
}

/* User Avatar + Dropdown (logged in) */
.global-header__user {
  display: flex;
  align-items: center;
  position: relative;
}

.global-header__user-btn {
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.global-header__user-initial {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--zone-accent);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  pointer-events: none;
}

/* Account Dropdown */
.global-header__dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  width: 260px;
  background: var(--bg-dark-secondary, #1a1a2e);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-md);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
  z-index: 200;
  overflow: hidden;
}

.global-header__dropdown.open {
  display: block;
}

.global-header__dropdown-section {
  padding: var(--space-sm) 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
}

.global-header__dropdown-section:last-child {
  border-bottom: none;
}

.global-header__dropdown-section--profile {
  padding: var(--space-md);
}

.global-header__dropdown-identity {
  display: flex;
  flex-direction: column;
  margin-bottom: var(--space-sm);
}

.global-header__dropdown-name {
  font-size: 0.9375rem;
  font-weight: 600;
  color: #ffffff;
  line-height: 1.3;
}

.global-header__dropdown-email {
  font-size: 0.75rem;
  color: var(--text-tertiary);
  margin-top: 2px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.global-header__dropdown-section-label {
  display: block;
  font-size: 0.6875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-tertiary);
  padding: var(--space-xs) var(--space-md) var(--space-xs);
}

.global-header__dropdown-link {
  display: block;
  padding: var(--space-sm) var(--space-md);
  font-size: 0.875rem;
  color: rgba(255, 255, 255, 0.8);
  text-decoration: none;
  transition: background var(--transition-base), color var(--transition-base);
}

.global-header__dropdown-link:hover {
  background: rgba(255, 255, 255, 0.06);
  color: #ffffff;
}

.global-header__dropdown-link--active {
  color: var(--zone-accent);
}

.global-header__dropdown-footer {
  padding: var(--space-sm) var(--space-md);
}

.global-header__dropdown-signout {
  background: none;
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: rgba(255, 255, 255, 0.6);
  font-size: 0.8125rem;
  padding: var(--space-xs) var(--space-sm);
  border-radius: var(--radius-sm);
  cursor: pointer;
  width: 100%;
  transition: all var(--transition-base);
}

.global-header__dropdown-signout:hover {
  border-color: rgba(255, 255, 255, 0.3);
  color: #ffffff;
}

/* Mobile Menu Button */
.global-header__mobile-btn {
  display: none;
  flex-direction: column;
  background: none;
  border: none;
  cursor: pointer;
  padding: var(--space-sm);
  gap: 5px;
  z-index: 150;
}

.global-header__mobile-btn span {
  width: 22px;
  height: 2px;
  background-color: #ffffff;
  border-radius: 1px;
  transition: all 0.3s ease;
}

.global-header__mobile-btn.active span:nth-child(1) {
  transform: rotate(45deg) translate(5px, 5px);
}

.global-header__mobile-btn.active span:nth-child(2) {
  opacity: 0;
}

.global-header__mobile-btn.active span:nth-child(3) {
  transform: rotate(-45deg) translate(5px, -5px);
}

/* Mobile Drawer */
.global-header__drawer {
  position: fixed;
  top: 0;
  right: -320px;
  width: 320px;
  height: 100vh;
  background: var(--bg-dark);
  z-index: 120;
  transition: right 0.3s ease;
  box-shadow: -4px 0 24px rgba(0, 0, 0, 0.3);
}

.global-header__drawer.open {
  right: 0;
}

.global-header__drawer-content {
  padding: var(--space-xl);
  height: 100%;
  display: flex;
  flex-direction: column;
}

.global-header__drawer-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--space-xl);
  padding-bottom: var(--space-md);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.global-header__drawer-title {
  font-size: 1.125rem;
  font-weight: 600;
  color: #ffffff;
}

.global-header__drawer-close {
  background: none;
  border: none;
  font-size: 1.75rem;
  cursor: pointer;
  color: var(--text-tertiary);
  line-height: 1;
  padding: 0;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.global-header__drawer-close:hover {
  color: #ffffff;
}

.global-header__drawer-nav {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.global-header__drawer-nav a {
  color: rgba(255, 255, 255, 0.8);
  font-size: 1rem;
  font-weight: 500;
  text-decoration: none;
  padding: var(--space-md) 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  transition: color var(--transition-base);
}

.global-header__drawer-nav a:hover {
  color: #ffffff;
}

.global-header__drawer-divider {
  height: 1px;
  background: rgba(255, 255, 255, 0.15);
  margin: var(--space-md) 0;
}

.global-header__drawer-email {
  color: var(--text-tertiary);
  font-size: 0.8125rem;
  padding: var(--space-sm) 0;
  display: block;
}

.global-header__drawer-section-label {
  display: block;
  font-size: 0.6875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-tertiary);
  padding: var(--space-sm) 0 var(--space-xs);
  margin-top: var(--space-xs);
}

.global-header__drawer-signout {
  background: none;
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: rgba(255, 255, 255, 0.7);
  padding: var(--space-sm) var(--space-md);
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  cursor: pointer;
  margin-top: var(--space-sm);
  transition: all var(--transition-base);
  width: fit-content;
}

.global-header__drawer-signout:hover {
  border-color: rgba(255, 255, 255, 0.4);
  color: #ffffff;
}

/* Mobile Overlay */
.global-header__overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.6);
  z-index: 110;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
}

.global-header__overlay.open {
  opacity: 1;
  visibility: visible;
}

/* Prevent scroll when mobile drawer is open */
body.mobile-menu-open {
  overflow: hidden;
}

/* Responsive */
@media (max-width: 800px) {
  .global-header__inner {
    padding: 0 var(--space-md);
    height: 56px;
  }

  .global-header__logo-name {
    font-size: 1.1rem;
  }

  .global-header__nav--desktop {
    display: none;
  }

  .global-header__mobile-btn {
    display: flex;
  }
}

@media (max-width: 480px) {
  .global-header__drawer {
    width: 280px;
    right: -280px;
  }
}
