.wn-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--wn-space-4) var(--wn-space-5);
  border-bottom: 1px solid var(--wn-overlay-10);
  background-color: var(--wn-zinc-900);
  min-height: 72px;
}

.wn-header-left {
  display: flex;
  align-items: center;
  gap: var(--wn-space-4);
}

.wn-header-brand {
  display: flex;
  align-items: center;
  gap: var(--wn-space-3);
}

.wn-header-title {
  display: flex;
  flex-direction: column;
  gap: var(--wn-space-1);
}

.wn-header-title-row {
  display: flex;
  align-items: center;
  gap: var(--wn-space-3);
}

.wn-header-tagline {
  font-size: var(--wn-font-base);
  color: rgba(255, 255, 255, 0.5);
}

.wn-header-logo-text {
  font-size: var(--wn-font-lg);
  font-weight: 700;
  color: var(--wn-zinc-100);
}

.wn-header-badge {
  font-size: var(--wn-font-xs);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: var(--wn-space-1) var(--wn-space-3);
  border-radius: var(--wn-radius-sm);
  background-color: var(--wn-overlay-10);
  color: rgba(255, 255, 255, 0.5);
}

.wn-toolbar {
  display: flex;
  align-items: center;
  gap: var(--wn-space-3);
  padding: var(--wn-space-1) var(--wn-space-3);
  border-radius: var(--wn-radius-lg);
  border: 1px solid var(--wn-overlay-10);
  background-color: var(--wn-overlay-5);
}

.wn-toolbar-separator {
  width: 1px;
  height: 24px;
  background-color: var(--wn-overlay-10);
  margin: 0 var(--wn-space-2);
}

.wn-toolbar-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: var(--wn-icon-btn-lg);
  height: var(--wn-icon-btn-lg);
  border-radius: var(--wn-radius-md);
  border: none;
  background: transparent;
  color: rgba(255, 255, 255, 0.6);
  cursor: pointer;
  transition: all 0.15s ease;
}

.wn-toolbar-btn:hover {
  background: var(--wn-overlay-10);
  color: #fff;
}

.wn-toolbar-btn--active {
  background: var(--wn-overlay-10);
  color: #fff;
}

.wn-toolbar-btn--disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.wn-toolbar-btn--disabled:hover {
  background: transparent;
  color: rgba(255, 255, 255, 0.6);
}

/* ============================================================================
   CSS TOOLTIPS FOR TOOLBAR
   ============================================================================ */

.wn-toolbar-btn {
  position: relative;
}

.wn-toolbar-btn::after {
  content: attr(aria-label);
  position: absolute;
  top: calc(100% + var(--wn-space-3));
  left: 50%;
  transform: translateX(-50%);
  padding: var(--wn-space-2) var(--wn-space-3);
  background-color: var(--wn-zinc-800);
  border: 1px solid var(--wn-overlay-10);
  border-radius: var(--wn-radius-md);
  font-size: var(--wn-font-xs);
  font-weight: 500;
  white-space: nowrap;
  color: var(--wn-zinc-50);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition:
    opacity var(--wn-transition-fast) ease,
    visibility var(--wn-transition-fast) ease;
  z-index: var(--wn-z-dialog);
  box-shadow: var(--wn-shadow-md);
}

/* Tooltip arrow */
.wn-toolbar-btn::before {
  content: "";
  position: absolute;
  top: calc(100% + 2px);
  left: 50%;
  transform: translateX(-50%);
  border: 6px solid transparent;
  border-bottom-color: var(--wn-zinc-800);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition:
    opacity var(--wn-transition-fast) ease,
    visibility var(--wn-transition-fast) ease;
  z-index: var(--wn-z-tooltip);
}

.wn-toolbar-btn:hover::after,
.wn-toolbar-btn:hover::before {
  opacity: 1;
  visibility: visible;
}

/* Hide tooltip for disabled buttons */
.wn-toolbar-btn--disabled::after,
.wn-toolbar-btn--disabled::before {
  display: none;
}

.wn-placeholder-icon {
  font-size: var(--wn-font-base);
  font-weight: 600;
  font-family: monospace;
}

/* ============================================================================
   THEME SWITCHER
   ============================================================================ */

.wn-theme-switcher {
  position: relative;
}

.wn-theme-dropdown {
  position: absolute;
  top: calc(100% + var(--wn-space-3));
  right: 0;
  display: flex;
  flex-direction: column;
  gap: var(--wn-space-1);
  min-width: 120px;
  padding: var(--wn-space-2);
  border-radius: var(--wn-radius-lg);
  border: 1px solid var(--wn-overlay-10);
  background-color: var(--wn-zinc-800);
  box-shadow: var(--wn-shadow-md);
  z-index: var(--wn-z-dropdown);
}

.wn-theme-option {
  display: flex;
  align-items: center;
  gap: var(--wn-space-3);
  width: 100%;
  padding: var(--wn-space-3) var(--wn-space-4);
  border: none;
  border-radius: var(--wn-radius-md);
  background: transparent;
  color: rgba(255, 255, 255, 0.7);
  font-size: var(--wn-font-sm);
  cursor: pointer;
  transition: all 0.15s ease;
}

.wn-theme-option:hover {
  background: var(--wn-overlay-10);
  color: #fff;
}

.wn-theme-option--selected {
  background: var(--wn-overlay-10);
  color: #fff;
}

/* ============================================================================
   LIGHT MODE OVERRIDES
   ============================================================================ */

.wn-light .wn-header {
  border-bottom-color: var(--wn-overlay-light-10);
  background-color: #fff;
}

.wn-light .wn-header-tagline {
  color: rgba(0, 0, 0, 0.5);
}

.wn-light .wn-header-logo-text {
  color: var(--wn-zinc-900);
}

.wn-light .wn-header-badge {
  background-color: var(--wn-overlay-light-5);
  color: rgba(0, 0, 0, 0.5);
}

.wn-light .wn-toolbar {
  border-color: var(--wn-overlay-light-10);
  background-color: var(--wn-overlay-light-3);
}

.wn-light .wn-toolbar-separator {
  background-color: var(--wn-overlay-light-10);
}

.wn-light .wn-toolbar-btn {
  color: rgba(0, 0, 0, 0.6);
}

.wn-light .wn-toolbar-btn:hover {
  background: var(--wn-overlay-light-10);
  color: var(--wn-zinc-900);
}

.wn-light .wn-toolbar-btn--active {
  background: var(--wn-overlay-light-10);
  color: var(--wn-zinc-900);
}

/* Light mode tooltip */
.wn-light .wn-toolbar-btn::after {
  background-color: #fff;
  border-color: var(--wn-overlay-light-10);
  color: var(--wn-zinc-900);
  box-shadow: var(--wn-shadow-md);
}

.wn-light .wn-toolbar-btn::before {
  border-bottom-color: #fff;
}

.wn-light .wn-theme-dropdown {
  border-color: var(--wn-overlay-light-10);
  background-color: #fff;
  box-shadow: var(--wn-shadow-md);
}

.wn-light .wn-theme-option {
  color: rgba(0, 0, 0, 0.7);
}

.wn-light .wn-theme-option:hover {
  background: var(--wn-overlay-light-5);
  color: var(--wn-zinc-900);
}

.wn-light .wn-theme-option--selected {
  background: var(--wn-overlay-light-5);
  color: var(--wn-zinc-900);
}
