﻿/* Scoped chat CSS (chat-root) */
.chat-root {
    --chat-bg1: #0f0f12;
    --chat-radial-1: rgba(255,20,147,0.06);
    --chat-radial-2: rgba(0,0,0,0.25);
    --chat-bubble-in: #2b2b2b;
    --chat-bubble-in-2: #161616;
    --chat-bubble-in-text: #e8e8e8;
    --chat-bubble-out: #ff1493;
    --chat-bubble-out-2: #ff72b7;
    --chat-bubble-out-text: #ffffff;
    --chat-accent: #ff1493;
    --chat-muted: #9b9b9b;
    box-sizing: border-box;
    font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    color: var(--chat-bubble-in-text);
    display: block;
}

    /* Make chat-card fill its parent width */
    .chat-root .chat-card {
        width: 100%;
        max-width: none;
        height: 520px;
        background: radial-gradient(1200px 600px at 10% 10%, var(--chat-radial-1), transparent 8%), radial-gradient(900px 400px at 90% 90%, var(--chat-radial-2), transparent 10%), var(--chat-bg1);
        border-radius: 12px;
        padding: 18px;
        box-shadow: 0 12px 30px rgba(7,6,12,0.6);
        display: flex;
        flex-direction: column;
        gap: 12px;
        overflow: hidden;
    }

    /* Header / day divider */
    .chat-root .chat-header {
        text-align: center;
        color: var(--chat-muted);
        font-size: 13px;
        letter-spacing: 0.6px;
        margin-top: 4px;
    }

    /* Messages area */
    .chat-root .messages {
        flex: 1 1 auto;
        overflow: auto;
        display: flex;
        flex-direction: column;
        gap: 14px;
        padding: 10px 6px 6px 6px;
        scroll-behavior: smooth;
    }

    /* Message row */
    .chat-root .msg-row {
        display: flex;
        gap: 10px;
        align-items: flex-end;
        max-width: 100%;
    }

    /* Avatar */
    .chat-root .avatar {
        width: 36px;
        min-width: 36px;
        height: 36px;
        border-radius: 50%;
        background: linear-gradient(135deg, #1e90ff, #0b60d1);
        display: flex;
        align-items: center;
        justify-content: center;
        color: #fff;
        font-weight: 700;
        font-size: 14px;
        box-shadow: 0 4px 14px rgba(7,6,12,0.6);
        flex-shrink: 0;
    }

    /* Bubble base */
    .chat-root .bubble {
        padding: 12px 14px;
        border-radius: 14px;
        max-width: 78%;
        line-height: 1.4;
        word-wrap: break-word;
        box-shadow: 0 6px 18px rgba(2,2,6,0.6);
        font-size: 14px;
        display: inline-block;
    }

        /* Incoming bubble */
        .chat-root .bubble.incoming {
            background: linear-gradient(180deg, var(--chat-bubble-in), var(--chat-bubble-in-2));
            color: var(--chat-bubble-in-text);
            border-top-left-radius: 6px;
            border-top-right-radius: 14px;
        }

    /* Outgoing row & bubble */
    .chat-root .msg-row.outgoing {
        flex-direction: row-reverse;
    }

    .chat-root .bubble.outgoing {
        margin-left: auto;
        background: linear-gradient(180deg, var(--chat-bubble-out), var(--chat-bubble-out-2));
        color: var(--chat-bubble-out-text);
        border-top-left-radius: 14px;
        border-top-right-radius: 6px;
        box-shadow: 0 10px 28px rgba(255,20,147,0.12);
    }

    /* Hide avatar on outgoing */
    .chat-root .msg-row.outgoing .avatar {
        display: none;
    }

    /* incoming avatar wrap */
    .chat-root .incoming-avatar-wrap {
        display: flex;
        align-items: flex-end;
        gap: 10px;
    }

    /* composer */
    .chat-root .composer {
        display: flex;
        gap: 8px;
        align-items: center;
        padding: 10px;
        border-top: 1px solid rgba(255,255,255,0.03);
        background: linear-gradient(180deg, rgba(255,255,255,0.01), transparent);
        box-sizing: border-box;
    }

    /* input */
    .chat-root .composer-input {
        flex: 1 1 auto;
        min-height: 40px;
        padding: 10px 12px;
        border-radius: 10px;
        border: 1px solid rgba(255,255,255,0.04);
        background: rgba(255,255,255,0.02);
        color: inherit;
        outline: none;
        font-size: 14px;
    }

    /* send button */
    .chat-root .send-btn {
        padding: 10px 14px;
        border-radius: 10px;
        border: none;
        background: linear-gradient(180deg, var(--chat-bubble-out), var(--chat-bubble-out-2));
        color: var(--chat-bubble-out-text);
        font-weight: 600;
        cursor: pointer;
        box-shadow: 0 6px 16px rgba(255,20,147,0.12);
    }

        .chat-root .send-btn:disabled {
            opacity: 0.55;
            cursor: not-allowed;
        }

    /* small centered status text */
    .chat-root .chat-status {
        text-align: center;
        color: var(--chat-muted);
        font-size: 12px;
        margin-top: 6px;
    }

/* responsive */
@media (max-width:520px) {
    .chat-root .chat-card {
        border-radius: 10px;
        height: calc(100vh - 40px);
        padding: 12px;
    }

    .chat-root .avatar {
        width: 34px;
        height: 34px;
        min-width: 34px;
        font-size: 13px;
    }

    .chat-root .bubble {
        font-size: 15px;
        padding: 12px;
    }

    .chat-root .composer-input {
        min-height: 44px;
        font-size: 15px;
    }
}
