/* ==========================================================================
   css/components/channel-area.css
   Split from app.html (build 2026.10.08.9-beta), original lines 1794-1987.
   Rules are in their ORIGINAL order; load order is defined in index.html.
   ========================================================================== */
/* ═══════════════════════════════════════
   MAIN AREA
═══════════════════════════════════════ */
.channel-area {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  background: var(--bg-chat, var(--bg-base));
  border-top: 1px solid var(--border-strong);
  /* Divider from the channel list - without it the dark voice-call / stage views
     blend straight into the (also dark) channel sidebar. */
  border-left: 1px solid var(--border-strong);
  position: relative; /* containing block for the docked voice-channel chat panel */
}

.channel-header {
  height: 48px;
  border-bottom: 1px solid rgba(255,255,255,0.1);
  border-left: 1px solid var(--border-strong, rgba(255,255,255,0.12));
  display: flex;
  align-items: center;
  padding: 0 16px;
  gap: 12px;
  flex-shrink: 0;
  background: transparent;
}

.channel-header-icon { font-size: 18px; color: var(--text-muted); }
/* 600, not 700 - the reference's channel header is semibold (`text-md/semibold`). Weight
   only; the size is left alone so nothing reflows. */
.channel-header-name { font-size: 15px; font-weight: 600; color: var(--text-primary); }
.channel-header-sep { width: 1px; height: 20px; background: var(--border-strong); }

.channel-header-topic {
  font-size: 13px;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
}

.channel-header-actions {
  display: flex;
  gap: 4px;
  align-items: center;
  margin-left: auto;
}

.header-btn {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  font-size: 18px;
  cursor: pointer;
  transition: background 0.1s, color 0.1s;
}
.header-btn:hover { background: var(--bg-hover); color: var(--text-primary); }
.header-btn.active { color: var(--text-primary); }

.header-search {
  position: relative;
  height: 24px;
  background: var(--bg-void);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0 8px;
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  min-width: 160px;
  transition: border-color .15s;
}
.header-search:focus-within { border-color: var(--accent); }

.header-search input {
  background: none;
  border: none;
  font-size: 13px;
  color: var(--text-primary);
  width: 100%;
}
.header-search input::placeholder { color: var(--text-muted); }
.header-search input:focus { outline: none; }
/* Kill the browser's native type="search" clear button - it rendered as a chunky
   emoji-looking ✕ whenever there was any text (message OR username search). Escape
   still clears the box. */
.header-search input::-webkit-search-cancel-button,
.header-search input::-webkit-search-decoration { -webkit-appearance: none; appearance: none; display: none; }

/* Search filter tokens */
.search-token {
  display: inline-flex; align-items: center; gap: 3px;
  background: var(--accent); color: #fff;
  border-radius: 4px; padding: 1px 6px; font-size: 11px; font-weight: 600;
  white-space: nowrap; flex-shrink: 0;
}
.search-token-remove { cursor: pointer; opacity: .7; margin-left: 2px; }
.search-token-remove:hover { opacity: 1; }

/* Search filter dropdown */
.search-filter-drop {
  display: none; position: absolute; top: calc(100% + 6px); right: 0;
  background: var(--bg-surface); border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg); padding: 8px 0;
  box-shadow: 0 8px 32px rgba(0,0,0,.5); min-width: 300px; z-index: 9999;
}
.search-filter-drop.open { display: block; animation: menu-in 0.22s var(--ease-out, ease); }
.search-filter-head {
  font-size: 10px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
  color: var(--text-muted); padding: 4px 16px 8px;
}
.search-filter-item {
  display: flex; align-items: center; gap: 12px;
  padding: 8px 16px; cursor: pointer; transition: background .1s;
}
.search-filter-item:hover { background: var(--bg-hover); }
.search-filter-icon {
  width: 32px; height: 32px; border-radius: 50%; background: var(--bg-elevated);
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
  color: var(--text-muted);
}
.search-filter-info { display: flex; flex-direction: column; gap: 1px; }
.search-filter-name { font-size: 13px; font-weight: 600; color: var(--text-primary); }
.search-filter-hint { font-size: 11px; color: var(--text-muted); }

/* Messages */
.messages-area {
  flex: 1;
  min-height: 0;
  min-width: 0;
  overflow-y: auto;
  overflow-x: hidden;
  /* The bottom padding is not decoration: with 0 the last message's box ended exactly on the
     composer's top edge (measured gap: 0px), so text sat right on the input. */
  padding: 16px 0 24px;
  display: flex;
  flex-direction: column;
}
/* A voice/stage call is a full-bleed view - the 16px top padding above would
   otherwise show as a gray bar between the header and the call. Drop it then. */
.messages-area:has(> .voice-channel-view) { padding: 0; }

.channel-welcome { padding: 24px 16px 16px; }

.welcome-icon {
  width: 72px;
  height: 72px;
  background: linear-gradient(135deg, color-mix(in srgb, var(--accent) 22%, var(--bg-surface)), var(--bg-surface) 70%);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 36px;
  margin-bottom: 16px;
}

.welcome-title {
  font-family: var(--font-display, 'Space Grotesk', sans-serif);
  font-size: 28px;
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.welcome-sub {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.6;
}

.messages-divider {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  margin: 8px 0;
}

.divider-line { flex: 1; height: 1px; background: var(--border-strong); }
.divider-date { font-size: 12px; font-weight: 600; color: var(--text-muted); white-space: nowrap; }

.message-group {
  padding: 2px 16px;
  margin-top: var(--a11y-group-gap, 8px);
  display: flex;
  gap: 12px;
  position: relative;
  transition: background 0.1s;
  border-radius: 0;
}
