/* Header Component Styles */

/* ============================================
   Main Header Container
   ============================================ */

/* Override MudAppBar positioning for docs site */
::deep .dhcs-header.mud-appbar,
::deep .mud-appbar.dhcs-header {
  position: relative !important;
  top: auto !important;
  left: auto !important;
  right: auto !important;
  width: 100% !important;
  border: none !important;
  border-bottom: none !important;
}

/* Ensure MudAppBar toolbar has no border */
::deep .dhcs-header .mud-toolbar,
::deep .dhcs-header.mud-appbar .mud-toolbar {
  border: none !important;
  border-bottom: none !important;
}

::deep .dhcs-header .mud-toolbar-gutters {
  padding-left: var(--dhcs-spacing-sm) !important;
  padding-right: var(--dhcs-spacing-sm) !important;
  min-height: 60px !important;
  height: 60px !important;
}

/* ============================================
   Logo
   ============================================ */

.dhcs-header-logo-container {
  display: inline-flex;
  align-items: center;
  margin-left: var(--dhcs-spacing-sm);
  flex-shrink: 0;
}

.dhcs-header-logo-link {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
  height: 24px;
  min-height: 24px;
}

.dhcs-header-logo-link:focus-visible {
  outline: 2px solid var(--mud-palette-primary);
  outline-offset: 2px;
  border-radius: 4px;
}

.dhcs-header-logo {
  height: 24px;
  width: auto;
  max-height: 24px;
}

/* ============================================
   Application Name and Divider
   ============================================ */

.dhcs-header-divider {
  width: 1px;
  height: 40px;
  background-color: var(--dhcs-color-orange);
  margin-left: 8px;
  margin-right: 8px;
  align-self: center;
  flex-shrink: 0;
}

.dhcs-header-app-name {
  font-family: var(--dhcs-font-title-h4-medium-family);
  font-size: var(--dhcs-font-title-h4-medium-size);
  font-style: var(--dhcs-font-title-h4-medium-style);
  font-weight: var(--dhcs-font-title-h4-medium-weight);
  line-height: var(--dhcs-font-title-h4-medium-line-height);
  color: var(--dhcs-color-primary);
  max-width: 160px;
  word-wrap: break-word;
  white-space: normal;
}

/* ============================================
   Navigation Tabs
   ============================================ */

.dhcs-header-tabs {
  display: inline-flex;
  align-items: center;
  gap: var(--dhcs-spacing-sm);
  margin-left: 24px;
  height: 100%;
}

.dhcs-header-tab {
  display: inline-flex;
  align-items: center;
  padding: var(--dhcs-spacing-sm) var(--dhcs-spacing-md);
  min-width: 160px;
  max-width: 160px;
  height: 100%;
  border-bottom-width: 3px;
  border-bottom-style: solid;
  border-bottom-color: transparent;
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--mud-palette-text-primary);
  transition:
    border-color 0.2s ease-in-out,
    background-color 0.2s ease-in-out;
  justify-content: center;
}

.dhcs-header-tab:hover {
  background-color: rgba(0, 0, 0, 0.04);
}

.dhcs-header-tab:focus-visible {
  outline: 2px solid var(--mud-palette-primary);
  outline-offset: -2px;
}

.dhcs-header-tab.active {
  border-bottom-color: var(--mud-palette-primary);
  color: var(--mud-palette-primary);
}

/* ============================================
   Actions Container
   ============================================ */

.dhcs-header-actions {
  display: inline-flex;
  align-items: center;
  gap: var(--dhcs-spacing-sm);
}

/* Ensure all icon buttons meet minimum touch target */
::deep .dhcs-header-menu-button,
::deep .dhcs-header-help-button,
::deep .dhcs-header-notification-button,
::deep .dhcs-header-appmenu-button {
  width: 48px !important;
  height: 48px !important;
}

::deep .dhcs-header-menu-button .mud-icon-button-label,
::deep .dhcs-header-help-button .mud-icon-button-label,
::deep .dhcs-header-notification-button .mud-icon-button-label,
::deep .dhcs-header-appmenu-button .mud-icon-button-label {
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ============================================
   Avatar
   ============================================ */

.dhcs-header-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-left: var(--dhcs-spacing-sm);
  width: 48px;
  height: 48px;
}

.dhcs-header-avatar ::deep .dhcs-avatar-wrapper {
  width: 48px;
  height: 48px;
}

.dhcs-header-avatar ::deep .mud-avatar {
  width: 48px !important;
  height: 48px !important;
  overflow: inherit !important;
}

.dhcs-header-avatar
  ::deep
  .dhcs-header-avatar-signed-in.dhcs-avatar-wrapper
  .mud-avatar {
  font-weight: 700 !important;
}

.dhcs-header-avatar
  ::deep
  .dhcs-header-avatar-signed-out.dhcs-avatar-wrapper
  .mud-avatar {
  background-color: var(--mud-palette-grey-default) !important;
  color: var(--mud-palette-text-primary) !important;
  border: 2px solid var(--mud-palette-grey-darker) !important;
}

/* Focus styles for avatar */
.dhcs-header-avatar ::deep .dhcs-avatar-wrapper:focus-visible {
  outline: 2px solid var(--mud-palette-primary);
  outline-offset: 2px;
  border-radius: 50%;
}

/* ============================================
   Responsive Design
   ============================================ */

/* Mobile - hide tabs, compact layout */
@media (max-width: 960px) {
  .dhcs-header-tabs {
    display: none;
  }

  ::deep .dhcs-header .mud-toolbar-gutters {
    padding-left: 4px !important;
    padding-right: 4px !important;
  }

  .dhcs-header-logo-container {
    margin-left: 4px;
  }
  
  .dhcs-header-app-name {
    font-size: 1rem;
    color: var(--dhcs-color-primary);
    width: 147px;
  }

  .dhcs-header-divider {
    width: 1px;
    height: 24px;
    background-color: var(--dhcs-color-orange);
    margin-left: 12px;
    margin-right: 12px;
  }

  .dhcs-header-actions {
    gap: 4px;
  }
}
