/* =========================
   BODY
========================= */

body {
    font-family: Arial, sans-serif;

    background: #f4f4f9;

    display: flex;

    justify-content: center;
    align-items: center;

    height: 100vh;

    margin: 0;
}


/* =========================
   CHAT CONTAINER
========================= */

.chat-container {

    width: 500px;

    height: 500px;

    background: white;

    border-radius: 8px;

    box-shadow:
        0 4px 10px rgba(0, 0, 0, 0.1);

    display: flex;

    flex-direction: column;

    overflow: hidden;
}


/* =========================
   HEADER
========================= */

.chat-header {

    background: #007bff;

    color: white;

    padding: 12px;

    text-align: center;

    font-weight: bold;

    font-size: 15px;

    flex-shrink: 0;
}


/* =========================
   CHAT BOX
========================= */

.chat-box {

    flex: 1;

    padding: 12px;

    overflow-y: auto;

    display: flex;

    flex-direction: column;

    gap: 8px;

    box-sizing: border-box;
}


/* =========================
   PESAN BIASA
========================= */

.message {

    padding: 8px 11px;

    border-radius: 13px;

    max-width: 75%;

    word-wrap: break-word;

    font-size: 13px;

    line-height: 1.3;

    box-sizing: border-box;
}


/* =========================
   PESAN USER
========================= */

.user-message {

    background: #007bff;

    color: white;

    align-self: flex-end;

    border-bottom-right-radius: 2px;
}


/* =========================
   PESAN BOT
========================= */

.bot-message {

    background: #e4e6eb;

    color: #333;

    align-self: flex-start;

    border-bottom-left-radius: 2px;
}


/* =========================
   ASCII CHORD
========================= */

.ascii-message {

    background: #e4e6eb;

    color: #333;

    align-self: flex-start;

    width: 100%;

    max-width: 100%;

    box-sizing: border-box;

    padding: 10px 12px;

    margin: 0;

    border-radius: 10px;


    /*
     * Monospace membuat setiap
     * karakter memiliki lebar sama.
     */

    font-family: "Courier New", monospace;


    /*
     * Ukuran awal ASCII.
     * JavaScript akan mengecilkannya
     * jika terlalu lebar.
     */

    font-size: 20px;

    line-height: 1.4;


    /*
     * Sangat penting untuk ASCII.
     * Spasi dan baris tidak diubah.
     */

    white-space: pre;


    /*
     * Tidak menggunakan horizontal scroll.
     */

    overflow-x: hidden;

    overflow-y: auto;
}


/* =========================
   INPUT AREA
========================= */

.chat-input {

    display: flex;

    border-top: 1px solid #ddd;

    padding: 9px;

    background: #fff;

    box-sizing: border-box;

    flex-shrink: 0;
}


/* =========================
   INPUT
========================= */

.chat-input input {

    flex: 1;

    padding: 9px;

    border: 1px solid #ddd;

    border-radius: 4px;

    outline: none;

    font-size: 13px;

    min-width: 0;
}


/* =========================
   BUTTON
========================= */

.chat-input button {

    background: #007bff;

    color: white;

    border: none;

    padding: 9px 14px;

    margin-left: 7px;

    border-radius: 4px;

    cursor: pointer;

    font-size: 13px;
}


.chat-input button:hover {

    background: #0056b3;
}


/* =========================
   MOBILE
========================= */

@media (max-width: 700px) {

    .chat-container {

        width: 95vw;

        height: 90vh;
    }


    .ascii-message {

        font-size: 18px;
    }

}