/* =========================================================
   BASE LAYOUT & BACKGROUND
   ========================================================= */

html, body {
    height: 100%;
    margin: 0;
    background: linear-gradient(
        to right,
        rgb(38, 51, 61),
        rgb(50, 55, 65),
        rgb(33, 33, 78)
    );
}

.chat {
    margin-top: auto;
    margin-bottom: auto;
}

/* =========================================================
   CARD
   ========================================================= */

.card {
    height: 500px;
    border-radius: 15px !important;
    background-color: rgba(0, 0, 0, 0.4) !important;
}

.msg_card_body {
    overflow-y: auto;
    padding: 10px;
}

/* =========================================================
   INPUT
   ========================================================= */

.type_msg {
    background-color: rgba(0, 0, 0, 0.3) !important;
    border: 0 !important;
    color: white !important;
    height: 55px !important;
}

.type_msg:focus {
    box-shadow: none !important;
    outline: 0 !important;
}

/* =========================================================
   HEADER
   ========================================================= */

.user_img {
    height: 60px;
    width: 60px;
    border: 1.5px solid #f5f6fa;
}

.user_info span {
    font-size: 18px;
    color: white;
}

.user_info p {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.6);
}

/* =========================================================
   MESSAGE BUBBLES — FINAL FIX
   ========================================================= */

.msg_cotainer,
.msg_cotainer_send {
    max-width: 75%;

    /* 🔥 KEY FIXES */
    padding: 6px 12px;           /* tighter vertical padding */
    margin: 0;                   /* remove inherited margins */
    line-height: 1.35;
    word-wrap: break-word;

    border-radius: 22px;
    display: inline-block;
    vertical-align: top;
}

/* Bot bubble */
.msg_cotainer {
    background-color: rgb(82, 172, 255);
    margin-left: 8px;
}

/* User bubble */
.msg_cotainer_send {
    background-color: #58cc71;
    margin-right: 8px;
}

/* =========================================================
   REMOVE ALL DEFAULT TEXT SPACING
   ========================================================= */

/* 🔥 This fixes the "floating text" issue */
.msg_cotainer * ,
.msg_cotainer_send * {
    margin: 0 !important;
    padding: 0 !important;
}

/* Bullet lists */
.msg_cotainer ul {
    padding-left: 14px !important;
    margin-top: 4px !important;
}

.msg_cotainer li {
    margin-bottom: 3px !important;
}

/* Line breaks */
.msg_cotainer br {
    display: block;
    margin-top: 4px;
}

/* =========================================================
   MESSAGE ROW SPACING
   ========================================================= */

/* 🔥 OVERRIDE BOOTSTRAP CARD BODY */
.card-body.msg_card_body {
    padding: 6px 10px !important;   /* very small top padding */
    overflow-y: auto;
}
/* 🔥 NO GAP ABOVE FIRST MESSAGE */
.msg_card_body > div:first-child {
    margin-top: 0 !important;
}



/* =========================================================
   LOADING / THINKING STATE
   ========================================================= */

#loadingBubble .msg_cotainer {
    padding: 5px 10px;
    line-height: 1.2;
}
