﻿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: none;
    border-radius: 30px;
    display: flex;
    flex-direction: column;
    /*height: 85vh;*/
    font-family: system-ui, -apple-system, BlinkMacSystemFont;
    overflow: hidden;
}
    .chat-container:has(.message) {
        border: 1px solid #ddd;
        border-radius: 30px;
    }
/* ====== 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 */
    flex-direction: column;
}
    .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;
        }
.bot-section img {
    width: 100px;
    animation: botFloat 2s ease-in-out infinite;
    filter: drop-shadow(0 10px 15px rgba(0,0,0,0.2));
}
@keyframes botFloat {
    0%,100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-12px);
    }
} 

/* ====== Input ====== */
.chat-input {
    display: flex;
    align-items: center;
    border: 1px solid #e5e7eb;
    border-radius: 30px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, .06);
    transition: .3s;
    box-sizing: border-box;
    padding: 10px 15px;
}
    .chat-input:focus-within {
        border-color: #2563eb;
        box-shadow: 0 0 0 4px rgba(37, 99, 235, .1), 0 4px 20px rgba(0, 0, 0, .08);
    }
    .chat-input textarea {
        flex: 1;
        border: none;
        outline: none;
        resize: none;
        height: 24px;
        min-height: 24px;
        max-height: 150px;
        overflow-y: hidden;
        padding: 0;
        font-size: 15px;
        line-height: 24px;
        font-family: inherit;
        background: transparent;
        box-sizing: border-box;
    }
        .chat-input textarea:not(:placeholder-shown) {
            padding-top: 2px;
        }

        .chat-input textarea::placeholder {
            color: #9ca3af;
        }
    .chat-input button {
        width: 42px;
        height: 42px;
        border: none;
        border-radius: 50%;
        background: #1b4194;
        color: white;
        cursor: pointer;
        font-size: 18px;
        margin-left: 10px;
        display: flex;
        align-items: center;
        justify-content: center;
        transition: .3s;
    }
        .chat-input button:hover {
            transform: scale(1.08);
        }

        .chat-input button:active {
            transform: scale(.95);
        }

        .chat-input button:disabled {
            background: #d1d5db;
            cursor: not-allowed;
        }

/* ====== 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;
    }
}

/*Bot Welcome Card*/
.welcome-card {
    position: relative;
    display: flex;
    align-items: center;
    justify-content:center;
    gap: 16px;
    
}


.hello {
    font-size: 20px;
    font-weight: 600;
}

/*.content-section h1 {
    font-size: 25px;
}*/

.content-section h2 span {
    color: #1b4194;
}

.content-section p {
    color: #666;
    margin-bottom: 5px;
}