/* FCS.Blazor.Irc — IRC client styling.
 *
 * Colours come from the shared --fcs-* tokens (FCS.Blazor.Shared/fcs-theme.css), which the host must
 * link. Nothing here names a colour, so the client follows the host's light/dark toggle; see that
 * sheet for why --rz-base-N00 must not be used and why the surfaces are mixed rather than fixed. */

.fcs-irc {
    display: flex;
    border: 1px solid var(--fcs-border);
    border-radius: var(--fcs-radius);
    overflow: hidden;
    background: var(--fcs-surface);
    color: var(--fcs-fg);
    font: 14px/1.5 var(--fcs-font);
}

/* ── connect form ──────────────────────────────────────────────────────────────────────────────────── */
.irc-connect { flex: 1 1 auto; display: flex; align-items: center; justify-content: center; padding: 24px; }
.irc-connect-card { width: 420px; max-width: 100%; display: flex; flex-direction: column; gap: 12px;
    padding: 22px; border: 1px solid var(--fcs-border); border-radius: var(--fcs-radius); background: var(--fcs-surface-raised); }
.irc-connect-card, .irc-connect-card * { box-sizing: border-box; }
.irc-connect-card h3 { margin: 0 0 4px; font-size: 18px; }
.irc-field { display: flex; align-items: center; gap: 8px; }
.irc-field > label { width: 78px; flex: 0 0 auto; color: var(--fcs-fg-subtle); font-size: 13px; }
.irc-field-inline { gap: 6px; flex-wrap: wrap; }
.irc-field-inline label { width: auto; margin-right: 12px; }
/* Radzen inputs default to display:inline-flex with intrinsic width; let the text box shrink and pin the
   numeric so the row never exceeds the card. */
.irc-grow { flex: 1 1 auto; min-width: 0; width: auto; }
.irc-port { flex: 0 0 92px; width: 92px; min-width: 0; }
.irc-connect-error { margin: 4px 0 0; color: var(--fcs-danger-ink); font-size: 13px; }
/* Host-managed session: the identity is shown, not edited. */
.irc-managed-identity { margin: 0; display: flex; align-items: baseline; gap: 8px; }
.irc-managed-identity > span:first-child { font-weight: 700; }
.irc-managed-host { color: var(--fcs-fg-subtle); font-size: 13px; }

/* ── workspace layout ──────────────────────────────────────────────────────────────────────────────── */
.irc-workspace { flex: 1 1 auto; display: grid; grid-template-columns: 220px minmax(0, 1fr) 200px; min-width: 0; }
/* No member list (server console / direct messages) — reclaim the third column so the transcript, header,
   and composer extend to the right edge. */
.irc-workspace.irc-no-members { grid-template-columns: 220px minmax(0, 1fr); }

.irc-sidebar { display: flex; flex-direction: column; border-right: 1px solid var(--fcs-border); background: var(--fcs-surface-raised); min-height: 0; }
.irc-sidebar-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; padding: 12px 12px 8px; border-bottom: 1px solid var(--fcs-border-subtle); }
.irc-net { font-size: 12px; color: var(--fcs-info-ink); text-transform: uppercase; letter-spacing: 0.04em; }
.irc-self { font-weight: 700; }
.irc-sidebar-foot { margin-top: auto; display: flex; align-items: center; min-height: 56px; padding: 8px 12px; border-top: 1px solid var(--fcs-border-subtle); }

.irc-buffers { flex: 1 1 auto; overflow-y: auto; padding: 8px 6px; }
.irc-buffers-group { margin-bottom: 10px; }
.irc-buffers-label { padding: 4px 8px; color: var(--fcs-fg-faint); font-size: 11px; text-transform: uppercase; letter-spacing: 0.05em; }
.irc-buffer { display: flex; align-items: center; gap: 7px; width: 100%; padding: 6px 8px; border: none; border-radius: var(--fcs-radius-sm);
    background: none; color: var(--fcs-fg-muted); cursor: pointer; text-align: left; font: inherit; }
.irc-buffer:hover { background: var(--fcs-surface-hover); }
.irc-buffer.active { background: var(--fcs-surface-active); color: var(--fcs-fg); }
.irc-buffer.highlight .irc-buffer-name { color: var(--fcs-warning-ink); }
.irc-buffer-icon { width: 16px; text-align: center; color: var(--fcs-fg-faint); flex: 0 0 auto; }
.irc-buffer-name { flex: 1 1 auto; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.irc-buffer-badge { flex: 0 0 auto; min-width: 18px; padding: 0 5px; border-radius: 9px; background: var(--fcs-accent); color: var(--fcs-on-accent);
    font-size: 11px; font-weight: 700; text-align: center; }
.irc-buffer-close { flex: 0 0 auto; color: var(--fcs-fg-faint); opacity: 0; }
.irc-buffer:hover .irc-buffer-close { opacity: 1; }
.irc-buffer-close:hover { color: var(--fcs-danger-ink); }

.irc-main { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.irc-main-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 14px;
    border-bottom: 1px solid var(--fcs-border); background: var(--fcs-surface-raised); }
.irc-main-title { font-weight: 700; font-size: 15px; }
.irc-main-topic { margin-left: 12px; color: var(--fcs-fg-subtle); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.irc-leave { border: 1px solid var(--fcs-border); border-radius: var(--fcs-radius-sm); background: var(--fcs-surface-hover); color: var(--fcs-fg-muted); padding: 4px 10px; cursor: pointer; font: inherit; }
.irc-leave:hover { border-color: var(--fcs-danger); color: var(--fcs-danger-ink); }

/* ── transcript ────────────────────────────────────────────────────────────────────────────────────── */
.irc-log { flex: 1 1 auto; overflow-y: auto; padding: 10px 14px; display: flex; flex-direction: column; gap: 2px;
    background: var(--fcs-surface-sunken);
    font: 13.5px/1.55 var(--fcs-font-mono); }
/* Paging into the server's retained history; only rendered where the server actually has some. */
.irc-load-older { align-self: center; margin: 2px 0 8px; padding: 3px 12px; border: 1px solid var(--fcs-border);
    border-radius: 999px; background: var(--fcs-surface-raised); color: var(--fcs-fg-muted); cursor: pointer;
    font: inherit; font-size: 12px; }
.irc-load-older:hover:not(:disabled) { color: var(--fcs-fg); border-color: var(--fcs-accent); }
.irc-load-older:disabled { opacity: 0.6; cursor: default; }

.irc-line { display: flex; gap: 8px; align-items: baseline; padding: 1px 0; word-break: break-word; }
/* Self-mention: a full-width band (extended into the log's 14px padding) with an amber left accent. */
.irc-line.irc-highlight { background: var(--fcs-warning-wash); border-left: 3px solid var(--fcs-warning);
    margin: 0 -14px; padding: 2px 14px 2px 11px; }
.irc-time { flex: 0 0 auto; color: var(--fcs-fg-faint); font-size: 11.5px; }
.irc-nick { flex: 0 0 auto; font-weight: 700; }
.irc-nick::after { content: ":"; color: var(--fcs-fg-faint); font-weight: 400; }
.irc-text { flex: 1 1 auto; white-space: pre-wrap; }
.irc-mention { font-weight: 600; }
.irc-action { color: var(--fcs-accent-ink); font-style: italic; }
.irc-action span { font-style: normal; font-weight: 700; }
.irc-notice-tag { flex: 0 0 auto; color: var(--fcs-info-ink); font-size: 11px; text-transform: uppercase; }
.irc-line.irc-status .irc-status,
.irc-line.irc-motd .irc-status { color: var(--fcs-fg-subtle); font-style: italic; }
.irc-status-nick { color: var(--fcs-fg-muted); font-style: normal; font-weight: 700; margin-right: 4px; }
.irc-line.irc-error .irc-status { color: var(--fcs-danger-ink); font-style: normal; }
.irc-line.irc-motd { color: var(--fcs-fg-faint); }

/* ── member list ───────────────────────────────────────────────────────────────────────────────────── */
.irc-members { display: flex; flex-direction: column; border-left: 1px solid var(--fcs-border); background: var(--fcs-surface-raised); min-height: 0; }
.irc-members-head { padding: 10px 12px; border-bottom: 1px solid var(--fcs-border-subtle); color: var(--fcs-fg-faint); font-size: 12px; text-transform: uppercase; letter-spacing: 0.04em; }
.irc-members-list { flex: 1 1 auto; overflow-y: auto; padding: 6px; }
.irc-member { display: flex; align-items: baseline; gap: 4px; width: 100%; padding: 4px 8px; border: none; border-radius: var(--fcs-radius-sm);
    background: none; cursor: pointer; text-align: left; font: inherit; }
.irc-member:hover { background: var(--fcs-surface-hover); }
.irc-member-prefix { flex: 0 0 auto; font-weight: 700; width: 10px; }
.irc-member-nick { flex: 1 1 auto; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

@media (max-width: 860px) {
    .irc-workspace { grid-template-columns: 160px minmax(0, 1fr); }
    .irc-members { display: none; }
}
