*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html,
body {
    height: 100%;
}

body {
    background: linear-gradient(135deg, #044f48, #2a7561);
    background-size: cover;
    font-family: 'Open Sans', sans-serif;
    font-size: 14px;
    line-height: 1.3;
    overflow: hidden;
}

.bg {
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    z-index: 1;
    background: url('../img/bg.jpg') no-repeat 0 0;
    transform: scale(1.2);
    filter: blur(80px);
}

.chat {
    width: 700px;
    height: 150vh;
    max-width: 800px;
    max-height: 800px;
    z-index: 2;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0, 0, 0, 0.5);
    border-radius: 20px;
    box-shadow: 0 5px 30px rgba(0, 0, 0, 0.2);
}

.chat-title {
    background: rgba(0, 0, 0, 0.2);
    padding: 12px 10px 10px 55px;
    color: #fff;
    flex: 0 1 55px;
    position: relative;
    z-index: 2;
    text-align: left;
}

.chat-title h1 {
    font-weight: normal;
    font-size: 12px;
    margin: 0;
    padding: 0;
}

.chat-title h2 {
    font-weight: normal;
    margin: 0;
    color: rgba(255, 255, 255, 0.5);
    font-size: 8px;
}

.chat-title .avatar {
    position: absolute;
    top: 10px;
    left: 10px;
    width: 40px;
    height: 40px;
    z-index: 1;
    border-radius: 30px;
    overflow: hidden;
    margin: 0;
    padding: 0;
    border: 2px solid rgba(255, 255, 255, 0.24);
}

.chat-title .avatar img {
    width: 100%;
    height: auto;
}

.clear-chat {
    position: absolute;
    top: 55%;
    transform: translateY(-50%);
    right: 5px;
    background-color: transparent;
    border: none;
    color: white;
    padding: 8px 10px;
    font-size: 18px;
    cursor: pointer;
    border-radius: 4px;
}

.clear-chat:hover {
    color: #da190b;
}

.copiar-btn {
    position: absolute;
    top: 98%;
    right: 0.5%;
    left: auto;
    transform: translateY(-50%);
    background-color: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.7);
    font-size: 11px;
    cursor: pointer;
    padding: 0;
    opacity: 0;
    transition: opacity 0.2s ease;
    pointer-events: none;
}

.copiar-btn-pessoal {
    left: 0.5%;
    right: auto;
}

.msg:hover .copiar-btn {
    opacity: 1;
    pointer-events: auto;
}

.copiar-btn:hover {
    color: #ababab;
}

.download-btn {
    position: absolute;
    top: 98%;
    right: 0.5%;
    transform: translateY(-50%);
    background-color: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.3);
    font-size: 11px;
    cursor: pointer;
    padding: 0;
    opacity: 0;
    transition: opacity 0.2s ease;
    pointer-events: none;
}

.msg:hover .download-btn {
    opacity: 1;
    pointer-events: auto;
}

.download-btn:hover {
    color: #ababab;
}

.msgs {
    flex: 1 1 auto;
    color: rgba(255, 255, 255, 0.5);
    overflow: hidden;
    position: relative;
    width: 100%;
}

.msg-box {
    flex: 0 1 40px;
    width: 100%;
    background: rgba(0, 0, 0, 0.3);
    padding: 15px;
    position: relative;
}

.msg p,
.msg ul,
.msg ol {
    margin: 1px 0;
}

.msg a {
    position: relative;
    color: #28a745;
    text-decoration: underline;
}

.msg-box .msg-input {
    display: block;
    background: none;
    border: none;
    outline: none !important;
    resize: none;
    color: rgba(255, 255, 255, 0.7);
    font-size: 14px;
    margin: 0;
    padding-right: 20px;
    width: 100%;
    overflow: auto;
    resize: none;
    white-space: pre-wrap;
    max-height: 100px;
    min-height: 17px;
}

.msg-box .msg-input::-webkit-scrollbar {
    display: none;
}

.msg-box .msg-input {
    scrollbar-width: none;
}

.msg-box textarea:focus:-webkit-placeholder {
    color: transparent;
}

.microphone-btn {
    position: absolute;
    z-index: 1;
    top: 50%;
    right: 7px;
    border: none;
    color: #e0e0e0;
    background: none;
    font-size: 20px;
    cursor: pointer;
    line-height: 1;
    padding: 9px 12px;
    outline: none !important;
    transition: color 0.2s ease;
    transform: translateY(-50%);
}

.microphone-btn:hover {
    color: #248a52;
}

.microphone-btn-recording {
    color: #da190b;
}

.microphone-btn-recording:hover {
    color: #da190bb3;
}

.msg-box .msg-submit {
    position: absolute;
    z-index: 1;
    top: 50%;
    right: 7px;
    border: none;
    color: #e0e0e0;
    background: none;
    font-size: 20px;
    cursor: pointer;
    line-height: 1;
    padding: 9px 12px;
    outline: none !important;
    transition: color 0.2s ease;
    transform: translateY(-50%);
}

.msg-box .msg-submit:hover {
    color: #248a52;
}

.msgs .msgs-content {
    position: absolute;
    top: 0;
    left: 0;
    height: 101%;
    width: 100%;
    white-space: pre-wrap;
    overflow-wrap: break-word;
    word-wrap: break-word;
    hyphens: auto;
}

.msgs .msg {
    clear: both;
    float: left;
    padding: 6px 10px 7px;
    border-radius: 10px 10px 10px 0;
    background: rgba(0, 0, 0, 0.3);
    margin: 8px 0;
    font-size: 14px;
    line-height: 1.4;
    margin-left: 35px;
    position: relative;
    text-shadow: 0 1px 1px rgba(0, 0, 0, 0.2);
}

.msgs .msg .timestamp {
    position: absolute;
    bottom: -15px;
    font-size: 10px;
    color: rgba(255, 255, 255, 0.3);
}

.msgs .msg.new .timestamp {
    right: auto;
    left: 1vh;
}

.msgs .msg.msg-personal .timestamp {
    left: auto;
    right: 1vh;
}

.msgs .msg::before {
    content: '';
    position: absolute;
    bottom: -6px;
    border-top: 6px solid rgba(0, 0, 0, 0.3);
    left: 0;
    border-right: 7px solid transparent;
}

.msgs .msg .avatar {
    position: absolute;
    z-index: 1;
    bottom: -15px;
    left: -35px;
    border-radius: 30px;
    width: 30px;
    height: 30px;
    overflow: hidden;
    margin: 0;
    padding: 0;
    border: 2px solid rgba(255, 255, 255, 0.24);
}

.msgs .msg .avatar img {
    width: 100%;
    height: auto;
}

.msgs .msg.msg-personal {
    float: right;
    color: #fff;
    text-align: left;
    background: linear-gradient(120deg, #248a24, #257287);
    border-radius: 10px 10px 0 10px;
    overflow-wrap: break-word;
    max-width: 95%;
}

.msgs .msg.msg-personal::before {
    left: auto;
    right: 0;
    border-right: none;
    border-left: 5px solid transparent;
    border-top: 4px solid #257287;
    bottom: -4px;
}

.msgs .msg:last-child {
    margin-bottom: 30px;
}

.msgs .msg.new {
    transform: scale(0);
    transform-origin: 0 0;
    animation: bounce 500ms linear both;
    -webkit-animation: bounce 500ms linear both;
    overflow-wrap: break-word;
    max-width: 95%;
}

.msg.new ul,
.msg.new ol,
.msg.msg.msg-personal ul,
.msg.msg.msg-personal ol {
    margin: 0 10px;
    padding: 0 10px;
}

.msgs .msg.loading::before {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    content: '';
    display: block;
    width: 3px;
    height: 3px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.5);
    z-index: 2;
    margin-top: 4px;
    animation: ball 0.45s cubic-bezier(0, 0, 0.15, 1) alternate infinite;
    -webkit-animation: ball 0.45s cubic-bezier(0, 0, 0.15, 1) alternate infinite;
    border: none;
    animation-delay: 0.15s;
    -webkit-animation-delay: 0.15s;
}

.msgs .msg.loading span {
    display: block;
    font-size: 0;
    width: 20px;
    height: 10px;
    position: relative;
}

.msgs .msg.loading span::before {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    content: '';
    display: block;
    width: 3px;
    height: 3px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.5);
    z-index: 2;
    margin-top: 4px;
    margin-left: -7px;
    animation: ball 0.45s cubic-bezier(0, 0, 0.15, 1) alternate infinite;
    -webkit-animation: ball 0.45s cubic-bezier(0, 0, 0.15, 1) alternate infinite;
}

.msgs .msg.loading span::after {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    content: '';
    display: block;
    width: 3px;
    height: 3px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.5);
    z-index: 2;
    margin-top: 4px;
    margin-left: 7px;
    animation: ball 0.45s cubic-bezier(0, 0, 0.15, 1) alternate infinite;
    -webkit-animation: ball 0.45s cubic-bezier(0, 0, 0.15, 1) alternate infinite;
    animation-delay: 0.3s;
    -webkit-animation-delay: 0.3s;
}

.comando {
    font-weight: bold;
    color: purple;
}

.mCSB_scrollTools {
    margin: 1px -3px 1px 0;
    opacity: 0;
}

.mCSB_inside > .mCSB_container {
    margin-right: 0;
    padding: 0 10px;
}

.mCSB_scrollTools .mCSB_dragger .mCSB_dragger_bar {
    background-color: rgba(0, 0, 0, 0.5) !important;
}

@-webkit-keyframes bounce {
    0% {
        transform: matrix3d(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1);
    }

    4.7% {
        transform: matrix3d(0.45, 0, 0, 0, 0, 0.45, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1);
    }

    9.41% {
        transform: matrix3d(0.883, 0, 0, 0, 0, 0.883, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1);
    }

    14.11% {
        transform: matrix3d(1.141, 0, 0, 0, 0, 1.141, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1);
    }

    18.72% {
        transform: matrix3d(1.212, 0, 0, 0, 0, 1.212, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1);
    }

    24.32% {
        transform: matrix3d(1.151, 0, 0, 0, 0, 1.151, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1);
    }

    29.93% {
        transform: matrix3d(1.048, 0, 0, 0, 0, 1.048, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1);
    }

    35.54% {
        transform: matrix3d(0.979, 0, 0, 0, 0, 0.979, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1);
    }

    41.04% {
        transform: matrix3d(0.961, 0, 0, 0, 0, 0.961, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1);
    }

    52.15% {
        transform: matrix3d(0.991, 0, 0, 0, 0, 0.991, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1);
    }

    63.26% {
        transform: matrix3d(1.007, 0, 0, 0, 0, 1.007, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1);
    }

    85.49% {
        transform: matrix3d(0.999, 0, 0, 0, 0, 0.999, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1);
    }

    100% {
        transform: matrix3d(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1);
    }
}

@keyframes bounce {
    0% {
        transform: matrix3d(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1);
    }

    4.7% {
        transform: matrix3d(0.45, 0, 0, 0, 0, 0.45, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1);
    }

    9.41% {
        transform: matrix3d(0.883, 0, 0, 0, 0, 0.883, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1);
    }

    14.11% {
        transform: matrix3d(1.141, 0, 0, 0, 0, 1.141, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1);
    }

    18.72% {
        transform: matrix3d(1.212, 0, 0, 0, 0, 1.212, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1);
    }

    24.32% {
        transform: matrix3d(1.151, 0, 0, 0, 0, 1.151, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1);
    }

    29.93% {
        transform: matrix3d(1.048, 0, 0, 0, 0, 1.048, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1);
    }

    35.54% {
        transform: matrix3d(0.979, 0, 0, 0, 0, 0.979, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1);
    }

    41.04% {
        transform: matrix3d(0.961, 0, 0, 0, 0, 0.961, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1);
    }

    52.15% {
        transform: matrix3d(0.991, 0, 0, 0, 0, 0.991, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1);
    }

    63.26% {
        transform: matrix3d(1.007, 0, 0, 0, 0, 1.007, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1);
    }

    85.49% {
        transform: matrix3d(0.999, 0, 0, 0, 0, 0.999, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1);
    }

    100% {
        transform: matrix3d(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1);
    }
}

@-webkit-keyframes ball {
    from {
        transform: translateY(0) scaleY(0.8);
    }

    to {
        transform: translateY(-10px);
    }
}

@keyframes ball {
    from {
        transform: translateY(0) scaleY(0.8);
    }

    to {
        transform: translateY(-10px);
    }
}

/* Media Queries */
@media screen and (max-device-width: 1000px) and (-webkit-min-device-pixel-ratio: 2) {
    .chat {
        position: absolute;
        width: 100%;
        overflow: hidden;
    }
}

@media screen and (max-width: 1000px) {
    html,
    body {
        max-width: 100%;
        overflow-x: hidden;
    }

    body {
        position: relative;
        max-height: 100vh;
        transition: height 0.2s ease;
    }

    .chat {
        width: 100%;
        height: 100%;
        max-width: 100%;
        max-height: 100%;
        bottom: 0;
        transition: bottom 0.3s;
        z-index: 2;
        overflow: auto;
        display: flex;
        flex-direction: column;
        justify-content: space-between;
        position: absolute;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
        background: rgba(0, 0, 0, 0.5);
        border-radius: 20px;
        box-shadow: 0 5px 30px rgba(0, 0, 0, 0.2);
    }

    .chat-title {
        padding: 10px 10px 10px 50px;
        flex: 0 0 45px;
    }

    .chat-title h1 {
        font-size: 10px;
    }

    .chat-title .avatar {
        position: absolute;
        top: 8px;
        left: 9px;
        width: 30px;
        height: 30px;
        z-index: 1;
        border-radius: 30px;
        overflow: hidden;
        margin: 0;
        padding: 0;
        border: 2px solid rgba(255, 255, 255, 0.24);
    }

    .chat-title .avatar img {
        width: 100%;
        height: auto;
    }

    .clear-chat {
        font-size: 15px;
    }

    .msgs {
        flex: 1 1 auto;
        color: rgba(255, 255, 255, 0.5);
        overflow: hidden;
        position: relative;
        width: 100%;
    }

    .msg-box {
        flex: 0 1 40px;
        width: 100%;
        background: rgba(0, 0, 0, 0.3);
        padding: 10px;
        position: relative;
    }

    .msg p,
    .msg ul,
    .msg ol {
        margin: 1px 0;
    }

    .msg a {
        color: #28a745;
        text-decoration: underline;
    }

    .msg-box .msg-submit {
        font-size: 18px;
    }
}

/* Estilos para o fundo do código realçado */
.hljs {
    border-radius: 0 0 10px 10px;
    overflow: auto;
}

/*  se a linguagem for undefined */
.hljs.language-undefined {
    border-radius: 10px 10px 10px 10px;
    padding: 0.2rem;
    margin: 0 0 -0.5rem 0;
    overflow: auto;
    font-size: 14px;
    display: inline-block;
    height: auto;
    width: auto;
}

.language-header {
    flex: 1;
    font-size: 12px;
    background-color: #292a2d;
    padding: 7px;
    border-radius: 10px 0 0 0;
    overflow: auto;
}

.header-and-copy {
    display: flex;
    justify-content: space-between;
}

.copy-button {
    background-color: #292a2d;
    padding: 7px;
    color: #fff;
    border-radius: 0 10px 0 0;
    border: none;
    cursor: pointer;
    margin-left: auto;
    transition: background-color 0.3s ease, color 0.3s ease; /* Adiciona transição suave para background e cor do texto */
    position: relative; /* Necessário para o posicionamento absoluto do check-mark */
}

.check-mark {
    color: greenyellow;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    opacity: 0; /* Começa com opacidade 0 */
    transition: opacity 0.3s ease; /* Adiciona transição suave para a opacidade */
}

/* tag img */
img {
    max-width: 100%;
    height: auto;
    border-radius: 10px;
}
