* {
    box-sizing: border-box;
}
html, body {
    margin: 0;
    padding: 0;
    height: 100%;
    font-family: Arial, sans-serif;
    background: #343541;
    color: #ececf1;
}
body {
    display: flex;
    justify-content: center;
    /* align-items: center; */
}
/* Container principal */
.container {
    width: 100%;
    max-width: 900px;
    height: 100vh;
    height: 100dvh;
    display: flex;
    flex-direction: column;
    background: #343541;
}
/* Cabeçalho */
.chat-header {
    padding: 16px 20px;
    background: #202123;
    border-bottom: 1px solid #4d4d4f;
    font-size: 18px;
    font-weight: bold;
    text-align: center;
}
/* Área de mensagens */
#chat-box {
    flex: 1;
    overflow-y: auto;
    /* padding: 20px 0; */
    display: flex;
    flex-direction: column;
    gap: 0;
    scroll-behavior: smooth;
    background: #ffffff08;
}
/* Linhas das mensagens */
/* .message-row {
    width: 100%;
    display: flex;
    justify-content: center;
    padding: 18px 16px;
    } */
    .message-row.user {
        border-radius: 12px;
        padding: 10px;
        margin: 5px 5px 5px 30%;
        background: #444a54;
        text-align: justify;
    }
    .message-row.bot {
        border-radius: 12px;
        padding: 10px;
        background: #454454;
        text-align: justify;
    }
    /* Conteúdo interno da mensagem */
    .message {
        background: transparent;
        /* max-width: 800px; */
        /* width: 100%;
        max-width: 800px;
        line-height: 1.6;
        font-size: 15px;
        word-wrap: break-word;
        overflow-wrap: break-word; */
    }
    /* Área de input */
    .input-wrapper {
        padding: 5px 0px;
        background: #343541;
        border-top: 1px solid #4d4d4f;
    }
    .input-area {
        /* max-width: 800px; */
        margin: 0 auto;
        display: flex;
        align-items: center;
        gap: 10px;
        background: #40414f;
        border: 1px solid #565869;
        padding: 10px;
        border-bottom-left-radius: 12px;
        border-bottom-right-radius: 12px;
}
#user-input {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    color: #ececf1;
    font-size: 16px;
    min-width: 0;
}
#user-input::placeholder {
    color: #a1a1aa;
}
button {
    background: #19c37d;
    border: none;
    color: white;
    padding: 10px 16px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: bold;
    white-space: nowrap;
    transition: background 0.2s ease;
}
button:hover {
    background: #15a46a;
}
/* Código inline */
code {
    background: #2d2f39;
    color: #f8f8f2;
    padding: 2px 6px;
    border-radius: 4px;
    font-family: Consolas, monospace;
}
/* Bloco de código */
pre {
    background-color: #1e1e1e;
    color: #f8f8f2;
    padding: 12px;
    border-radius: 8px;
    overflow-x: auto;
    margin: 12px 0;
    border: 1px solid #3a3a3a;
}
pre code {
    display: block;
    white-space: pre-wrap;
    background: transparent;
    padding: 0;
    font-size: 14px;
}
/* Scrollbar suave */
#chat-box::-webkit-scrollbar {
    width: 8px;
}
#chat-box::-webkit-scrollbar-track {
    background: #2c2d35;
}
#chat-box::-webkit-scrollbar-thumb {
    background: #565869;
    border-radius: 10px;
}
/* Tablet */
@media (max-width: 768px) {
    .chat-header {
        font-size: 16px;
        padding: 14px 16px;
    }
    .message-row {
        padding: 16px 12px;
    }
    .message {
        font-size: 14px;
    }
    .input-wrapper {
        padding: 10px 2px;
    }
    .input-area {
        padding: 8px 10px;
    }
    button {
        padding: 10px 14px;
        font-size: 14px;
    }
}
/* Mobile */
@media (max-width: 480px) {
    .container {
        height: 100vh;
        height: 100dvh;
    }
    .chat-header {
        font-size: 15px;
        padding: 12px;
    }
    #chat-box {
        padding: 10px 0;
    }
    .message-row {
        padding: 14px 10px;
    }
    .message {
        font-size: 14px;
        line-height: 1.5;
    }
    .input-wrapper {
        padding: 10px;
    }
    .input-area {
        gap: 8px;
        border-radius: 10px;
    }
    #user-input {
        font-size: 16px;
    }
    button {
        padding: 10px 12px;
        font-size: 13px;
    }

    pre code {
        font-size: 13px;
    }
}
/* Indicador de digitação */
.typing {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 0;
}
.typing span {
    width: 8px;
    height: 8px;
    background: #b4b7c5;
    border-radius: 50%;
    display: inline-block;
    animation: blink 1.4s infinite ease-in-out;
}
.typing span:nth-child(1) {
    animation-delay: 0s;
}
.typing span:nth-child(2) {
    animation-delay: 0.2s;
}
.typing span:nth-child(3) {
    animation-delay: 0.4s;
}
@keyframes blink {
    0%, 80%, 100% {
        opacity: 0.3;
        transform: translateY(0);
    }
    40% {
        opacity: 1;
        transform: translateY(-3px);
    }
}