/* Header Styles - Glassmorphic, Neon Trim */
.hd-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background-color: var(--hd-surface-glass);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--hd-border-glass);
  height: 72px;
  display: flex;
  align-items: center;
  transition: var(--hd-transition-all);
}

.hd-header-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
}

.hd-logo-link {
  font-family: var(--hd-font-display);
  font-size: var(--hd-text-xl);
  font-weight: 800;
  letter-spacing: 0.05em;
  color: var(--hd-text-main);
  display: flex;
  align-items: center;
}

.hd-logo-highlight {
  color: var(--hd-primary);
  text-shadow: 0 0 10px var(--hd-primary-glow);
}

.hd-logo-version {
  font-size: var(--hd-text-xs);
  background: var(--hd-accent);
  color: var(--hd-bg);
  padding: 1px 4px;
  border-radius: var(--hd-radius-xs);
  margin-left: 6px;
  font-weight: 900;
}

/* Nav Menu */
.hd-nav ul {
  display: flex;
  gap: var(--hd-spacing-lg);
}

.hd-nav a {
  font-weight: 500;
  font-size: var(--hd-text-sm);
  color: var(--hd-text-muted);
  transition: var(--hd-transition-all);
  position: relative;
  padding: var(--hd-spacing-xs) 0;
}

.hd-nav a:hover,
.hd-nav li.current-menu-item a {
  color: var(--hd-text-main);
}

.hd-nav a::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--hd-primary);
  transition: var(--hd-transition-all);
}

.hd-nav a:hover::after,
.hd-nav li.current-menu-item a::after {
  width: 100%;
}

/* Header Buttons */
.hd-header-actions {
  display: flex;
  align-items: center;
  gap: var(--hd-spacing-md);
}

.hd-icon-btn {
  color: var(--hd-text-muted);
  padding: var(--hd-spacing-xs);
  border-radius: var(--hd-radius-sm);
  transition: var(--hd-transition-all);
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.hd-icon-btn:hover {
  color: var(--hd-text-main);
  background-color: var(--hd-border-glass);
}

.hd-badge {
  position: absolute;
  top: -2px;
  right: -2px;
  background-color: var(--hd-primary);
  color: var(--hd-text-main);
  font-size: 10px;
  font-weight: 800;
  width: 16px;
  height: 16px;
  border-radius: var(--hd-radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--hd-shadow-sm);
}

/* Search Drawer Overlay */
.hd-search-drawer {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  justify-content: flex-end;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--hd-duration-normal) var(--hd-ease-out);
}

.hd-search-drawer.active {
  opacity: 1;
  pointer-events: all;
}

.hd-search-drawer-overlay {
  position: absolute;
  inset: 0;
  background-color: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(8px);
}

.hd-search-drawer-content {
  position: relative;
  width: 100%;
  max-width: 480px;
  height: 100%;
  background-color: var(--hd-surface);
  border-left: 1px solid var(--hd-border);
  box-shadow: var(--hd-shadow-xl);
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform var(--hd-duration-normal) var(--hd-ease-out);
}

.hd-search-drawer.active .hd-search-drawer-content {
  transform: translateX(0);
}

.hd-search-drawer-header {
  padding: var(--hd-spacing-lg);
  border-bottom: 1px solid var(--hd-border);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.hd-close-btn {
  font-size: 28px;
  color: var(--hd-text-muted);
  transition: var(--hd-transition-all);
}

.hd-close-btn:hover {
  color: var(--hd-primary);
}

.hd-search-drawer-body {
  padding: var(--hd-spacing-lg);
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
}

.hd-search-input-wrapper {
  position: relative;
  background: var(--hd-bg);
  border: 1px solid var(--hd-border);
  border-radius: var(--hd-radius-md);
  overflow: hidden;
  transition: var(--hd-transition-all);
}

.hd-search-input-wrapper:focus-within {
  border-color: var(--hd-primary);
  box-shadow: var(--hd-glow-primary);
}

.hd-search-input {
  width: 100%;
  padding: var(--hd-spacing-md) 48px var(--hd-spacing-md) var(--hd-spacing-md);
  color: var(--hd-text-main);
  font-size: var(--hd-text-sm);
}

/* Style WebKit search cancel button to match design system */
.hd-search-input::-webkit-search-cancel-button {
  -webkit-appearance: none;
  height: 14px;
  width: 14px;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'><line x1='18' y1='6' x2='6' y2='18'></line><line x1='6' y1='6' x2='18' y2='18'></line></svg>");
  background-size: contain;
  background-repeat: no-repeat;
  cursor: pointer;
  transition: opacity 0.2s ease;
}

.hd-search-input::-webkit-search-cancel-button:hover {
  opacity: 0.8;
}

.hd-search-input::-ms-clear,
.hd-search-input::-ms-reveal {
  display: none;
  width: 0;
  height: 0;
}

.hd-search-submit-btn {
  position: absolute;
  right: var(--hd-spacing-md);
  top: 50%;
  transform: translateY(-50%);
  color: var(--hd-text-muted);
}

.hd-search-submit-btn:hover {
  color: var(--hd-primary);
}

.hd-search-results {
  margin-top: var(--hd-spacing-lg);
  flex-grow: 1;
}

/* Live dropdown results in header search drawer */
.hd-live-search-item {
  display: flex;
  gap: var(--hd-spacing-sm);
  padding: var(--hd-spacing-sm);
  border-bottom: 1px solid var(--hd-border);
  transition: var(--hd-transition-all);
  border-radius: var(--hd-radius-sm);
  text-decoration: none;
}

.hd-live-search-item:hover {
  background-color: var(--hd-surface-hover);
}

.hd-live-search-img {
  width: 45px;
  height: 60px;
  object-fit: cover;
  border-radius: var(--hd-radius-xs);
  flex-shrink: 0;
}

.hd-live-search-info {
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.hd-live-search-title {
  font-size: var(--hd-text-sm);
  font-weight: 600;
  margin-bottom: 4px;
  color: var(--hd-text-main);
}

.hd-live-search-meta {
  font-size: 11px;
  color: var(--hd-text-dim);
}

.hd-empty-msg {
  color: var(--hd-text-muted);
  text-align: center;
  padding: var(--hd-spacing-lg) 0;
}

/* Mobile Nav Styles */
.hd-menu-toggle {
  display: none;
}

@media (max-width: 768px) {
  .hd-nav {
    display: none; /* In production a responsive mobile navigation drawer can be toggled */
  }
  .hd-menu-toggle {
    display: flex;
  }
}
