/* ============================================================
   CoThou-style conversation header for CoThou
   Isolated — all selectors are prefixed a0-header-*
   No existing styles are modified here.
   ============================================================ */

:root {
  --a0-header-logo-size: 20px;
  --a0-header-icon-button-size: 28px;
  --a0-header-icon-button-radius: 6px;
  --a0-header-icon-color-dark: #a1a1a1;
  --a0-header-icon-color-dark-hover: rgba(250, 250, 250, 0.9);
  --a0-header-icon-hover-bg-dark: rgba(250, 250, 250, 0.1);
  --a0-header-icon-color-light: #333333;
  --a0-header-icon-color-light-hover: #333333;
  --a0-header-icon-hover-bg-light: var(--color-background-hover, rgba(0, 0, 0, 0.06));
  --a0-header-icon-glyph-size: 16px;
  --a0-header-icon-fill: 0;
  --a0-header-icon-weight: 400;
  --a0-header-icon-grade: 0;
  --a0-header-icon-optical-size: 24;
}

.light-mode {
  --a0-header-icon-color-light: var(--color-text-light, #333333);
  --a0-header-icon-color-light-hover: var(--color-text-light, #333333);
}

/* Outer sticky wrapper — sits at the top of #right-panel */
.a0-header-wrapper {
  position: sticky;
  top: 0;
  z-index: 100;
  padding: 8px 8px 0 8px;
  flex-shrink: 0;
  background: var(--color-chat-background);
}

/* The pill */
.a0-header-pill {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 54px;
  border-radius: 16px;
  border: 1px solid #3a3a3a;
  background: var(--color-panel);
  padding: 0 16px 0 16px;
  gap: 12px;
  /* NOTE: overflow must NOT be hidden — the notification badge and project
     dropdown are absolutely positioned and extend outside the pill bounds. */
  overflow: visible;
}

/* ---------- Left section: logo + dynamic title ---------- */
.a0-header-left {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  min-width: 0;
  overflow: hidden;
}

.a0-header-logo {
  width: var(--a0-header-logo-size);
  height: var(--a0-header-logo-size);
  border-radius: 5px;
  overflow: hidden;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.a0-header-logo img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
}

.a0-header-title {
  color: var(--color-text);
  font-size: 0.9375rem;   /* ~15px */
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  letter-spacing: 0.01em;
  opacity: 0.9;
}

/* ---------- Right section: existing widgets ---------- */
.a0-header-right {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
  margin-left: auto;
  min-height: var(--a0-header-icon-button-size);
}

.a0-header-right > * {
  flex-shrink: 0;
}

.a0-header-right .a0-theme-toggle,
.a0-header-right .notification-toggle,
.a0-header-right .status-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: var(--a0-header-icon-button-size);
  height: var(--a0-header-icon-button-size);
  border-radius: var(--a0-header-icon-button-radius);
  box-sizing: border-box;
  vertical-align: middle;
}

.a0-header-right .status-icon svg {
  width: var(--a0-header-icon-glyph-size);
  height: var(--a0-header-icon-glyph-size);
  display: block;
}

.a0-header-right .material-symbols-outlined {
  font-size: var(--a0-header-icon-glyph-size);
  font-weight: normal;
  font-variation-settings:
    'FILL' var(--a0-header-icon-fill),
    'wght' var(--a0-header-icon-weight),
    'GRAD' var(--a0-header-icon-grade),
    'opsz' var(--a0-header-icon-optical-size);
}

/* Light-mode border adjustment */
.light-mode .a0-header-pill {
  border-color: #d4d4d4;
  background: var(--color-panel);
}
