/* ===== ORIGINAL CSS (UNCHANGED) ===== */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', sans-serif;
}

body {
    background: linear-gradient(135deg, #0f172a, #1e293b);
    color: white;
}

/* NAVBAR */
.navbar {
    background: rgba(0,0,0,0.4);
    backdrop-filter: blur(10px);
    padding: 15px;
    text-align: center;
    position: sticky;
    top: 0;
}

.navbar a {
    color: white;
    margin: 15px;
    text-decoration: none;
    font-weight: bold;
    transition: 0.3s;
}

.navbar a:hover {
    color: #38bdf8;
}

/* CONTAINER */
.container {
    width: 85%;
    margin: auto;
    margin-top: 30px;
    text-align: center;
}

/* DASHBOARD CARDS */
.card {
    display: inline-block;
    width: 220px;
    margin: 15px;
    padding: 25px;
    border-radius: 15px;
    background: rgba(255,255,255,0.1);
    backdrop-filter: blur(12px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.3);
    transition: 0.3s;
}

.card:hover {
    transform: translateY(-8px);
}

/* INPUTS */
input {
    width: 60%;
    padding: 12px;
    margin: 10px;
    border-radius: 10px;
    border: none;
    outline: none;
}

/* BUTTON */
button {
    padding: 12px 20px;
    background: #38bdf8;
    border: none;
    color: black;
    font-weight: bold;
    border-radius: 10px;
    cursor: pointer;
    transition: 0.3s;
}

button:hover {
    background: #0ea5e9;
    color: white;
}

/* CHAT BOX */
#chatbox {
    height: 350px;
    overflow-y: scroll;
    background: rgba(255,255,255,0.08);
    padding: 15px;
    border-radius: 15px;
    margin-top: 20px;
}

/* CHAT MESSAGE */
.msg {
    background: #1e293b;
    margin: 8px;
    padding: 10px;
    border-radius: 10px;
    text-align: left;
}

.msg small {
    color: #94a3b8;
    font-size: 12px;
}

/* QR IMAGE */
img {
    margin-top: 15px;
    border-radius: 10px;
}

.chat-header {
    background: #111827;
    color: white;
    text-align: center;
    padding: 15px;
    font-size: 20px;
    font-weight: bold;
}

.chat-container {
    width: 80%;
    margin: auto;
    height: 400px;
    background: rgba(255,255,255,0.05);
    margin-top: 20px;
    border-radius: 15px;
    overflow-y: scroll;
    padding: 10px;
}

/* SAFE MSG */
.chat-container .msg {
    background: #1e293b;
    margin: 8px;
    padding: 10px;
    border-radius: 10px;
    width: fit-content;
    color: white;
}

/* INPUT AREA */
.chat-input {
    width: 80%;
    margin: auto;
    margin-top: 15px;
    display: flex;
    gap: 10px;
    justify-content: center;
}

.chat-input input {
    padding: 12px;
    border-radius: 10px;
    border: none;
    width: 30%;
    outline: none;
}

/* SEND BUTTON */
.chat-input button {
    padding: 12px 20px;
    background: #38bdf8;
    border: none;
    border-radius: 10px;
    cursor: pointer;
}

/* EXTRA OPTIONS */
.chat-extra {
    text-align: center;
    margin-top: 10px;
}

.chat-extra button {
    margin: 5px;
    padding: 8px 15px;
    border-radius: 8px;
    border: none;
    background: #334155;
    color: white;
    cursor: pointer;
}

.chat-extra button:hover {
    background: #38bdf8;
    color: black;
}

/* FOOTER */
.chat-footer {
    width: 80%;
    margin: auto;
    display: flex;
    gap: 10px;
    justify-content: center;
    margin-top: 15px;
    align-items: center;
}

.chat-footer input {
    padding: 10px;
    border-radius: 10px;
    border: none;
    outline: none;
}

.chat-footer button {
    padding: 10px 15px;
    background: #38bdf8;
    border: none;
    border-radius: 10px;
    cursor: pointer;
}

.chat-footer input[type="file"] {
    color: white;
}

/* ===== NEW ADDITIONS (ONLY ADDED, NOTHING REMOVED) ===== */

/* FLEX ALIGNMENT */
.chat-container {
    display: flex;
    flex-direction: column;
}

/* MESSAGE SIZE FIX */
.chat-container .msg {
    max-width: 70%;
    word-wrap: break-word;
}

/* USER RIGHT */
.chat-container .right {
    background: #38bdf8 !important;
    color: black;
    align-self: flex-end;
    text-align: right;
    border-bottom-right-radius: 3px;
}

/* BOT LEFT */
.chat-container .left {
    background: #1e293b !important;
    color: white;
    align-self: flex-start;
    text-align: left;
    border-bottom-left-radius: 3px;
}

.msg{
    padding:10px;
    margin:8px;
    border-radius:12px;
    max-width:70%;
    color:white;
    word-wrap:break-word;
}

/* USER RIGHT SIDE */
.user-msg{
    background: linear-gradient(135deg, #38bdf8, #0ea5e9);
    margin-left:auto;
    text-align:right;
}

/* BOT LEFT SIDE */
.bot-msg{
    background:#1e293b;
    margin-right:auto;
    text-align:left;
    border:1px solid rgba(56,189,248,0.3);
}

/* NAME STYLE */
.name{
    font-size:12px;
    opacity:0.8;
    margin-bottom:3px;
}

/* MESSAGE TEXT */
.text{
    font-size:14px;
}

/* TIME */
.msg small{
    display:block;
    font-size:10px;
    color:#cbd5e1;
    margin-top:5px;
}

.msg{
    padding:10px;
    margin:8px;
    border-radius:12px;
    max-width:70%;
    color:white;
    word-wrap:break-word;
}

/* USER RIGHT SIDE */
.right{
    background: linear-gradient(135deg, #38bdf8, #0ea5e9);
    margin-left:auto;
    text-align:right;
}

/* BOT LEFT SIDE */
.left{
    background:#1e293b;
    margin-right:auto;
    text-align:left;
    border:1px solid rgba(56,189,248,0.3);
}

/* TEXT */
.text{
    font-size:14px;
}

/* SMALL TIME + NAME */
.msg small{
    display:block;
    font-size:10px;
    color:#cbd5e1;
    margin-top:5px;
}