/* IRC web chat (/irc) — dark-first, EventTrader palette only */

.irc-page {
    max-width: 1100px;
    margin: 0 auto;
    padding: 1.5rem 1rem 2rem;
}

.irc-apps-link {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    color: var(--accent, #00cfff);
    text-decoration: none;
    font-size: 0.85rem;
    margin: 0 0 0.5rem;
}

.irc-apps-link:hover {
    text-decoration: underline;
}

[dir="rtl"] .irc-apps-link-arrow {
    transform: scaleX(-1);
}

.irc-page-head h1 {
    color: var(--text-heading, #ffffff);
    font-size: 1.6rem;
    margin: 0 0 0.25rem;
}

.irc-subtitle {
    color: var(--text-secondary, #7b8794);
    margin: 0 0 1.25rem;
    font-size: 0.95rem;
}

.irc-layout {
    display: grid;
    grid-template-columns: 230px 1fr;
    gap: 1rem;
    align-items: start;
}

/* ── Channel pane ─────────────────────────────────────────────── */

.irc-channels-pane {
    background: rgba(17, 24, 39, 0.6);
    border: 1px solid rgba(0, 150, 255, 0.15);
    border-radius: 6px;
    padding: 0.75rem;
}

.irc-channels-title {
    color: var(--text-secondary, #7b8794);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 0.5rem;
}

.irc-channel-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.irc-channel-btn {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.1rem;
    background: transparent;
    border: 1px solid transparent;
    border-radius: 6px;
    padding: 0.45rem 0.6rem;
    cursor: pointer;
    text-align: left;
}

.irc-channel-btn:hover {
    border-color: rgba(0, 150, 255, 0.3);
}

.irc-channel-btn.active {
    background: rgba(0, 207, 255, 0.08);
    border-color: rgba(0, 207, 255, 0.4);
}

.irc-channel-name {
    color: #00cfff;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.85rem;
}

.irc-channel-net {
    color: var(--text-secondary, #7b8794);
    font-size: 0.7rem;
}

/* ── Chat pane ────────────────────────────────────────────────── */

.irc-chat-pane {
    background: rgba(17, 24, 39, 0.6);
    border: 1px solid rgba(0, 150, 255, 0.15);
    border-radius: 6px;
    display: flex;
    flex-direction: column;
    min-height: 60vh;
}

.irc-chat-topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.6rem 0.9rem;
    border-bottom: 1px solid rgba(0, 150, 255, 0.15);
}

.irc-active-channel {
    color: #00cfff;
    font-family: 'JetBrains Mono', monospace;
    font-weight: 600;
}

.irc-status {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.75rem;
    color: var(--text-secondary, #7b8794);
}

.irc-status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #ff4444;
}

.irc-status[data-state="live"] .irc-status-dot {
    background: #00ff88;
    box-shadow: 0 0 6px rgba(0, 255, 136, 0.6);
}

.irc-status[data-state="live"] {
    color: #00ff88;
}

.irc-load-older {
    margin: 0.5rem auto 0;
    background: transparent;
    border: 1px solid rgba(0, 150, 255, 0.3);
    border-radius: 6px;
    color: #00cfff;
    font-size: 0.75rem;
    padding: 0.3rem 0.9rem;
    cursor: pointer;
}

.irc-load-older:hover {
    background: rgba(0, 207, 255, 0.08);
}

.irc-messages {
    list-style: none;
    margin: 0;
    padding: 0.75rem 0.9rem;
    flex: 1;
    overflow-y: auto;
    max-height: 58vh;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.83rem;
    line-height: 1.5;
}

.irc-empty {
    color: var(--text-secondary, #7b8794);
    text-align: center;
    padding: 2rem 0;
}

.irc-msg {
    padding: 0.12rem 0;
    word-break: break-word;
}

.irc-msg-time {
    color: var(--text-secondary, #7b8794);
    font-size: 0.7rem;
    margin-right: 0.5rem;
}

.irc-msg-nick {
    font-weight: 600;
    margin-right: 0.5rem;
}

.irc-msg-nick::after {
    content: ':';
    color: var(--text-secondary, #7b8794);
}

.irc-msg-action .irc-msg-nick::after {
    content: '';
}

.irc-msg-action .irc-msg-text {
    font-style: italic;
}

/* Nick colors — approved palette family only (cyan/green/blue/red tints) */
.irc-nick-0 { color: #00cfff; }
.irc-nick-1 { color: #00ff88; }
.irc-nick-2 { color: #3b82f6; }
.irc-nick-3 { color: #66dfff; }
.irc-nick-4 { color: #66ffb8; }
.irc-nick-5 { color: #7ba6f6; }

.irc-msg-text {
    color: var(--text-primary, #ffffff);
}

.irc-msg-web .irc-msg-text {
    color: #ccffe9;
}

.irc-msg-badge {
    display: inline-block;
    background: rgba(0, 255, 136, 0.12);
    border: 1px solid rgba(0, 255, 136, 0.35);
    border-radius: 4px;
    color: #00ff88;
    font-size: 0.6rem;
    padding: 0 0.3rem;
    margin-right: 0.5rem;
    vertical-align: middle;
}

.irc-msg-pending {
    opacity: 0.55;
}

.irc-msg-failed {
    opacity: 0.55;
    border-left: 2px solid #ff4444;
    padding-left: 0.4rem;
}

/* ── Composer ─────────────────────────────────────────────────── */

.irc-composer-area {
    border-top: 1px solid rgba(0, 150, 255, 0.15);
    padding: 0.6rem 0.9rem 0.8rem;
}

.irc-disclaimer {
    color: var(--text-secondary, #7b8794);
    font-size: 0.68rem;
    margin: 0 0 0.5rem;
}

.irc-login-prompt {
    text-align: center;
    color: var(--text-secondary, #7b8794);
    font-size: 0.85rem;
    padding: 0.5rem 0;
}

.irc-composer {
    display: flex;
    gap: 0.5rem;
}

.irc-input {
    flex: 1;
    background: rgba(10, 14, 23, 0.8);
    border: 1px solid rgba(0, 150, 255, 0.25);
    border-radius: 6px;
    color: var(--text-primary, #ffffff);
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.85rem;
    padding: 0.55rem 0.75rem;
}

.irc-input:focus {
    outline: none;
    border-color: #00cfff;
}

.irc-send-btn {
    background: rgba(0, 207, 255, 0.12);
    border: 1px solid rgba(0, 207, 255, 0.5);
    border-radius: 6px;
    color: #00cfff;
    font-weight: 600;
    font-size: 0.85rem;
    padding: 0.55rem 1.2rem;
    cursor: pointer;
}

.irc-send-btn:hover {
    background: rgba(0, 207, 255, 0.22);
}

.irc-composer-error {
    color: #ff4444;
    font-size: 0.75rem;
    margin: 0.4rem 0 0;
}

/* ── Light theme ──────────────────────────────────────────────── */

[data-theme="light"] .irc-channels-pane,
[data-theme="light"] .irc-chat-pane {
    background: rgba(255, 255, 255, 0.85);
    border-color: rgba(0, 80, 160, 0.15);
}

[data-theme="light"] .irc-msg-text {
    color: #0f172a;
}

[data-theme="light"] .irc-msg-web .irc-msg-text {
    color: #065f46;
}

[data-theme="light"] .irc-input {
    background: #ffffff;
    color: #0f172a;
    border-color: rgba(0, 80, 160, 0.25);
}

/* ── Mobile ───────────────────────────────────────────────────── */

@media (max-width: 760px) {
    .irc-layout {
        grid-template-columns: 1fr;
    }

    .irc-channels-pane {
        overflow-x: auto;
    }

    .irc-channel-list {
        flex-direction: row;
        flex-wrap: nowrap;
    }

    .irc-channel-btn {
        white-space: nowrap;
    }

    .irc-messages {
        max-height: 48vh;
    }
}

/* RTL */
[dir="rtl"] .irc-msg-time,
[dir="rtl"] .irc-msg-nick,
[dir="rtl"] .irc-msg-badge {
    margin-right: 0;
    margin-left: 0.5rem;
}

/* ── System events (JOIN/PART/QUIT/KICK/TOPIC/NOTICE/NICK) ───────── */

.irc-msg-system {
    opacity: 0.6;
    font-size: 0.78rem;
}

.irc-msg-system .irc-msg-text {
    color: #3b82f6;
}

.irc-msg-system.irc-msg-kick .irc-msg-text {
    color: #ff4444;
}

.irc-msg-system.irc-msg-topic .irc-msg-text {
    color: #00cfff;
}

.irc-msg-system.irc-msg-notice .irc-msg-text {
    color: #00ff88;
}

.irc-toggle-system {
    background: transparent;
    border: 1px solid rgba(0, 150, 255, 0.2);
    border-radius: 4px;
    color: rgba(0, 207, 255, 0.45);
    font-size: 0.7rem;
    padding: 0.15rem 0.55rem;
    cursor: pointer;
    margin-left: auto;
    margin-right: 0.5rem;
}

.irc-toggle-system[aria-pressed="true"] {
    border-color: rgba(0, 207, 255, 0.45);
    color: #00cfff;
}

[dir="rtl"] .irc-toggle-system {
    margin-left: 0.5rem;
    margin-right: auto;
}
