/* agent-comms.css — Comms Hub styling */

.comms-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.5rem 2rem 1rem;
}

.comms-title {
    font-family: 'Orbitron', monospace, sans-serif;
    font-size: 1.4rem;
    color: #f5c842;
    letter-spacing: 0.1em;
    margin: 0;
}

.comms-new-dm {
    background: transparent;
    border: 1px solid #f5c842;
    color: #f5c842;
    font-family: 'Orbitron', monospace, sans-serif;
    font-size: 0.7rem;
    padding: 0.4rem 1rem;
    cursor: pointer;
    letter-spacing: 0.08em;
    transition: background 0.2s;
}
.comms-new-dm:hover { background: rgba(245, 200, 66, 0.15); }

/* ── Layout ───────────────────────────────────── */

.comms-wrap {
    display: flex;
    height: calc(100vh - 140px);
    border-top: 1px solid rgba(245, 200, 66, 0.15);
}

.comms-sidebar {
    width: 260px;
    min-width: 260px;
    border-right: 1px solid rgba(245, 200, 66, 0.12);
    overflow-y: auto;
    padding: 0.5rem 0;
}

.comms-thread {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

/* ── Channel list ─────────────────────────────── */

.comms-channel-item {
    display: flex;
    align-items: center;
    padding: 0.7rem 1rem;
    cursor: pointer;
    transition: background 0.15s;
    gap: 0.6rem;
}
.comms-channel-item:hover { background: rgba(245, 200, 66, 0.06); }
.comms-channel-item--active {
    background: rgba(245, 200, 66, 0.12);
    border-left: 3px solid #f5c842;
}

.comms-channel-icon {
    font-size: 0.9rem;
    color: #f5c842;
    opacity: 0.7;
}

.comms-channel-label {
    flex: 1;
    font-family: 'Orbitron', monospace, sans-serif;
    font-size: 0.7rem;
    color: rgba(255, 255, 255, 0.85);
    letter-spacing: 0.06em;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.comms-unread-badge {
    background: #e05555;
    color: #fff;
    font-size: 0.6rem;
    font-weight: 700;
    padding: 0.15rem 0.45rem;
    border-radius: 9px;
    min-width: 1.2rem;
    text-align: center;
}

/* ── Thread area ──────────────────────────────── */

.comms-thread-bar {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    padding: 0.7rem 1rem;
    border-bottom: 1px solid rgba(245, 200, 66, 0.12);
}

.comms-back-btn {
    display: none;
    background: transparent;
    border: none;
    color: #f5c842;
    font-family: 'Orbitron', monospace, sans-serif;
    font-size: 0.65rem;
    cursor: pointer;
    letter-spacing: 0.06em;
}

.comms-thread-title {
    font-family: 'Orbitron', monospace, sans-serif;
    font-size: 0.8rem;
    color: #f5c842;
    letter-spacing: 0.08em;
}

.comms-thread-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: rgba(255, 255, 255, 0.3);
    font-family: 'Orbitron', monospace, sans-serif;
    font-size: 0.8rem;
    letter-spacing: 0.1em;
}

.comms-msg-area {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.comms-empty {
    color: rgba(255, 255, 255, 0.3);
    font-family: monospace;
    font-size: 0.8rem;
    text-align: center;
    padding: 3rem 1rem;
}

.comms-load-more {
    background: transparent;
    border: 1px solid rgba(245, 200, 66, 0.2);
    color: rgba(245, 200, 66, 0.6);
    font-family: 'Orbitron', monospace, sans-serif;
    font-size: 0.6rem;
    padding: 0.3rem 1rem;
    margin: 0.5rem auto;
    cursor: pointer;
    letter-spacing: 0.08em;
}
.comms-load-more:hover { background: rgba(245, 200, 66, 0.08); }

/* ── Message bubbles ──────────────────────────── */

.comms-msg {
    max-width: 80%;
    padding: 0.5rem 0.8rem;
    background: rgba(255, 255, 255, 0.04);
    border-radius: 6px;
    border-left: 2px solid rgba(245, 200, 66, 0.2);
}

.comms-msg--mine {
    align-self: flex-end;
    border-left: none;
    border-right: 2px solid #f5c842;
    background: rgba(245, 200, 66, 0.06);
}

.comms-msg-meta {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    margin-bottom: 0.2rem;
}

.comms-msg-codename {
    font-family: 'Orbitron', monospace, sans-serif;
    font-size: 0.6rem;
    letter-spacing: 0.06em;
    font-weight: 600;
}

.comms-msg-time {
    font-size: 0.55rem;
    color: rgba(255, 255, 255, 0.35);
    font-family: monospace;
}

.comms-msg-body {
    color: rgba(255, 255, 255, 0.88);
    font-size: 0.82rem;
    line-height: 1.45;
    word-break: break-word;
}

/* ── Input row ────────────────────────────────── */

.comms-input-row {
    display: flex;
    gap: 0.5rem;
    padding: 0.8rem 1rem;
    border-top: 1px solid rgba(245, 200, 66, 0.12);
    background: rgba(0, 0, 0, 0.2);
}

.comms-input {
    flex: 1;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(245, 200, 66, 0.2);
    color: #fff;
    font-family: monospace;
    font-size: 0.82rem;
    padding: 0.5rem 0.8rem;
    border-radius: 4px;
    outline: none;
}
.comms-input:focus { border-color: #f5c842; }
.comms-input::placeholder { color: rgba(255, 255, 255, 0.25); }

.comms-send-btn {
    background: #f5c842;
    color: #1a0a00;
    border: none;
    font-family: 'Orbitron', monospace, sans-serif;
    font-size: 0.7rem;
    font-weight: 700;
    padding: 0.5rem 1.2rem;
    cursor: pointer;
    letter-spacing: 0.08em;
    border-radius: 4px;
    transition: background 0.2s;
}
.comms-send-btn:hover { background: #e0b53a; }

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

@media (max-width: 767px) {
    .comms-wrap { flex-direction: column; height: calc(100vh - 130px); }

    .comms-sidebar {
        width: 100%;
        min-width: 0;
        border-right: none;
        border-bottom: 1px solid rgba(245, 200, 66, 0.12);
        max-height: 100%;
    }
    .comms-sidebar--hidden-mobile { display: none; }

    .comms-thread { display: none; }
    .comms-thread--visible-mobile { display: flex; }

    .comms-back-btn { display: inline-block; }

    .comms-msg { max-width: 95%; }

    .comms-header { padding: 1rem; }
    .comms-title { font-size: 1.1rem; }
}
