/*
 * Thread — Verlaufsdarstellung.
 * Uebernommen aus dem Bubble-/Dark-Mode-Teil des alten Thread-Plugins; die
 * Sidebar-/Channel-Regeln sind entfallen (es gibt keine Kanalliste mehr).
 * Prefix bewusst `thread-`, damit nichts mit fremden `.chat-*`-Regeln kollidiert.
 */

.thread-panel {
    display: flex;
    flex-direction: column;
}

.thread-messages {
    background: var(--bs-light, #f1f5f7);
    border-radius: 4px;
    padding: 12px;
    max-height: 480px;
    overflow-y: auto;
}

.thread-empty {
    padding: 24px 0;
    text-align: center;
}

/* Bubbles */
.thread-bubble {
    max-width: 70%;
    word-wrap: break-word;
    padding: 6px 12px;
}

.thread-bubble-out {
    border-radius: 12px 12px 0 12px;
}

.thread-bubble-in {
    border-radius: 12px 12px 12px 0;
}

.thread-bubble-name {
    margin-bottom: 2px;
}

.thread-bubble-time {
    font-size: 0.7rem;
    margin-top: 2px;
}

/* Interne Notiz — muss auf den ersten Blick als solche erkennbar sein */
.thread-bubble-internal {
    border-left: 3px solid var(--bs-warning, #f7b84b);
}

/* Systemmeldungen */
.thread-system-message {
    padding: 4px 0;
    text-align: center;
}

.thread-system-message small {
    background: rgba(0, 0, 0, 0.05);
    padding: 2px 12px;
    border-radius: 12px;
    font-style: italic;
}

/* Eingabe — einzeilig starten, mitwachsen (Hoehe setzt thread.js) */
.thread-input {
    background: var(--bs-card-bg, #fff);
    padding-top: 12px;
}

.thread-input .form-control {
    background: var(--bs-light, #f1f5f7);
    padding: 8px 16px;
}

.thread-input .form-control:focus {
    background: var(--bs-card-bg, #fff);
    box-shadow: 0 0 0 0.1rem rgba(59, 175, 218, 0.25);
}

.thread-input-field {
    resize: none;          /* Groesse regelt das Mitwachsen, nicht der Ziehgriff */
    overflow-y: hidden;    /* thread.js schaltet auf auto, sobald die Maximalhoehe greift */
    min-height: calc(1.5em + 1rem + 2px);
    line-height: 1.5;
}

/* Dark Mode */
body[data-mode=dark] .thread-messages {
    background: #323b44;
}

body[data-mode=dark] .thread-bubble-in {
    background-color: #424e5a !important;
    color: #94a0ad;
}

body[data-mode=dark] .thread-system-message small {
    background: rgba(255, 255, 255, 0.05);
}

body[data-mode=dark] .thread-input {
    background: #36404a;
}

body[data-mode=dark] .thread-input .form-control {
    background: #424e5a;
    color: #cedeef;
}

body[data-mode=dark] .thread-input .form-control:focus {
    background: #36404a;
}
