﻿html {
    font-size: 14px;
    min-height: 100%;
    position: relative;
}

@media (min-width: 768px) {
  html {
    font-size: 16px;
  }
}

.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
  box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #258cfb;
}

body {
  margin-bottom: 60px;
}
a {
    text-decoration: none;
}
/* ====== Container ====== */
.chat-container {
    max-width: 900px;
    margin: 30px auto;
    border: 1px solid #ddd;
    border-radius: 10px;
    display: flex;
    flex-direction: column;
    /*height: 85vh;*/
    font-family: system-ui, -apple-system, BlinkMacSystemFont;
    overflow: hidden;
}

/* ====== Header ====== */
.chat-header {
    padding: 15px;
    font-weight: 600;
    background: #f7f7f8;
    border-bottom: 1px solid #ddd;

}

/* ====== Body ====== */
.chat-body {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    background: #ffffff;
}

/* ====== Message (chung) ====== */
.message {
    display: flex;
    margin-bottom: 14px;
}

.bubble {
    position: relative;
    padding: 12px 16px;
    border-radius: 12px;
    max-width: 90%;
    line-height: 1.5;
    font-size: 15px;
}

    /* ====== User ====== */
.message.user {
    justify-content: flex-end;
    align-self: flex-end;
    white-space: pre-line; /* user nhập text thuần */
}
    .message.user .bubble {
        background: #4a90e2;
        color: #fff;
        border-top-right-radius: 4px;
    }
        /* Tam giác bên phải */
        .message.user .bubble::before {
            content: "";
            position: absolute;
            right: -10px;
            top: 14px;
            border-width: 8px 0 8px 10px;
            border-style: solid;
            border-color: transparent transparent transparent #4a90e2;
        }
    /* ====== Bot ====== */
.message.bot {
    justify-content: flex-start;
    background: #fff;
    align-self: flex-start;
    white-space: normal; /* QUAN TRỌNG */
}
    .message.bot .bubble {
        background: #e9eef5;
        color: #333;
        border-top-left-radius: 4px;
    }
        /* Tam giác bên trái */
        .message.bot .bubble::before {
            content: "";
            position: absolute;
            left: -10px;
            top: 14px;
            border-width: 8px 10px 8px 0;
            border-style: solid;
            border-color: transparent #e9eef5 transparent transparent;
        }
        /* ====== Markdown inside bot ====== */
        .message.bot p {
            margin: 0 0 10px 0;
        }

        .message.bot ul,
        .message.bot ol {
            margin: 6px 0 10px 20px;
            padding: 0;
        }

        .message.bot li {
            margin-bottom: 6px;
        }

        .message.bot h1,
        .message.bot h2,
        .message.bot h3 {
            margin: 10px 0 8px 0;
            font-weight: 600;
        }

        .message.bot a {
            color: #10a37f;
            text-decoration: underline;
        }
   

/* ====== Input ====== */
.chat-input {
    display: flex;
    border-top: 1px solid #ddd;
}

    .chat-input textarea {
        flex: 1;
        border: none;
        padding: 10px;
        resize: none;
        outline: none;
        font-size: 15px;
    }

    .chat-input button {
        width: 100px;
        border: none;
        background: #204096;
        color: #fff;
        font-weight: 600;
        cursor: pointer;
    }

/* ====== Typing ====== */
.dot {
    display: inline-block;
    width: 6px;
    height: 6px;
    margin-right: 4px;
    background: #999;
    border-radius: 50%;
    animation: blink 1.4s infinite both;
}

    .dot:nth-child(2) {
        animation-delay: .2s;
    }

    .dot:nth-child(3) {
        animation-delay: .4s;
    }

@keyframes blink {
    0% {
        opacity: .2;
    }

    20% {
        opacity: 1;
    }

    100% {
        opacity: .2;
    }
}