/* ── SFB Chat Page ── */

.sfb-chat-card {
    display: flex;
    flex-direction: column;
    height: calc(100vh - 180px);
    min-height: 500px;
}

.sfb-chat-card .sfb-card__body {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
}

/* Messages area */
.sfb-chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-height: 0;
}

/* Message bubble */
.sfb-chat-msg {
    display: flex;
    gap: 10px;
    max-width: 85%;
    animation: chatFadeIn 0.15s ease;
}

@keyframes chatFadeIn {
    from { opacity: 0; transform: translateY(4px); }
    to { opacity: 1; transform: translateY(0); }
}

.sfb-chat-msg--me {
    align-self: flex-end;
    flex-direction: row-reverse;
}

.sfb-chat-msg--system {
    align-self: center;
    max-width: 100%;
}

.sfb-chat-msg__avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(100, 181, 246, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 15px;
    font-weight: 700;
    color: #64b5f6;
    flex-shrink: 0;
    text-transform: uppercase;
}

.sfb-chat-msg--me .sfb-chat-msg__avatar {
    background: rgba(255, 199, 95, 0.2);
    color: #ffc75f;
}

.sfb-chat-msg__avatar-img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
}

.sfb-chat-msg__bubble {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 12px;
    padding: 10px 14px;
    min-width: 70px;
}

.sfb-chat-msg--me .sfb-chat-msg__bubble {
    background: rgba(100, 181, 246, 0.1);
    border-color: rgba(100, 181, 246, 0.15);
}

.sfb-chat-msg--private .sfb-chat-msg__bubble {
    background: rgba(187, 134, 252, 0.1);
    border-color: rgba(187, 134, 252, 0.15);
}

.sfb-chat-msg--system .sfb-chat-msg__bubble {
    background: rgba(255, 255, 255, 0.03);
    border: none;
    text-align: center;
    font-size: 14px;
    color: rgba(245, 243, 255, 0.4);
    padding: 6px 14px;
}

.sfb-chat-msg__name {
    font-size: 13px;
    font-weight: 700;
    color: #64b5f6;
    margin-bottom: 2px;
    cursor: pointer;
}

.sfb-chat-msg__name:hover {
    text-decoration: underline;
}

.sfb-chat-msg--me .sfb-chat-msg__name {
    color: #ffc75f;
    text-align: right;
}

.sfb-chat-msg--private .sfb-chat-msg__name {
    color: #bb86fc;
}

.sfb-chat-msg__text {
    font-size: 15px;
    color: #f5f3ff;
    word-break: break-word;
    line-height: 1.45;
}

.sfb-chat-msg__time {
    font-size: 12px;
    color: rgba(245, 243, 255, 0.3);
    margin-top: 3px;
    text-align: right;
}

.sfb-chat-msg__private-tag {
    font-size: 11px;
    color: #bb86fc;
    font-weight: 600;
    text-transform: uppercase;
}

/* Input area */
.sfb-chat-input {
    display: flex;
    gap: 8px;
    padding: 12px 16px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(0, 0, 0, 0.15);
    border-radius: 0 0 12px 12px;
}

.sfb-chat-input .form-control {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #f5f3ff;
    border-radius: 10px;
    font-size: 15px;
    padding: 10px 14px;
}

.sfb-chat-input .form-control:focus {
    border-color: rgba(100, 181, 246, 0.4);
    box-shadow: 0 0 0 2px rgba(100, 181, 246, 0.1);
    background: rgba(0, 0, 0, 0.4);
}

.sfb-chat-input .form-control::placeholder {
    color: rgba(245, 243, 255, 0.3);
}

.sfb-chat-send-btn {
    background: linear-gradient(135deg, #64b5f6, #42a5f5);
    color: #fff;
    border: none;
    border-radius: 10px;
    padding: 10px 18px;
    font-size: 18px;
    transition: all 0.2s ease;
}

.sfb-chat-send-btn:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 3px 10px rgba(100, 181, 246, 0.3);
    color: #fff;
}

.sfb-chat-send-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

/* Channel buttons */
.sfb-chat-channel-btn {
    display: block;
    width: 100%;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    color: rgba(245, 243, 255, 0.6);
    padding: 8px 14px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s ease;
    text-align: left;
    margin-bottom: 4px;
}

.sfb-chat-channel-btn:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #f5f3ff;
}

.sfb-chat-channel-btn--active {
    background: rgba(100, 181, 246, 0.15);
    border-color: rgba(100, 181, 246, 0.3);
    color: #64b5f6;
}

/* Online users list */
.sfb-chat-online-list {
    max-height: 400px;
    overflow-y: auto;
}

.sfb-chat-online-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    cursor: pointer;
    transition: background 0.15s ease;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.sfb-chat-online-item:hover {
    background: rgba(255, 255, 255, 0.05);
}

.sfb-chat-online-item:last-child {
    border-bottom: none;
}

.sfb-chat-online-dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: #4caf50;
    flex-shrink: 0;
}

.sfb-chat-online-name {
    font-size: 14px;
    color: #f5f3ff;
    font-weight: 500;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Responsive */
@media (max-width: 991px) {
    .sfb-chat-card {
        height: calc(100vh - 250px);
        min-height: 400px;
    }
}

@media (max-width: 576px) {
    .sfb-chat-messages {
        padding: 10px;
    }

    .sfb-chat-msg {
        max-width: 92%;
    }

    .sfb-chat-input {
        padding: 8px 10px;
    }
}
