@media only screen and (max-width: 800px) {

    .chat-info {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 20px;
        border: 1px solid #7e319c;
        margin: 4px;
        cursor: pointer;
        border-radius: 20px;
        transition: background-color 0.3s, color 0.3s;
    }

    .sidebarright {
        position: fixed;
        top: 0;
        right: 0; /* Esconde o sidebar para fora da tela */
        width: 90%;
        min-width: 135px;
        height: 100vh;
        background-color: var(--surface-background);
        color: var(--text-primary);
        box-shadow: 0 12px 30px color-mix(in srgb, var(--surface-overlay-strong) 40%, transparent);
        z-index: 1999;
        transition: right 0.3s ease-in-out; /* Suaviza a transição */
    }
    
    .sidebarright.collapsed {
        right: -90%; /* Move para dentro da tela */
    }

    .chat-div {
        position: fixed;
        bottom: 0;
        right: 0px;
        width: 90%;
        height: 81%;
        background-color: var(--surface-elevated);
        border: 1px solid var(--border-color);
        border-radius: 5px;
        transition: transform 0.5s ease-in-out;
        z-index: 999999;
    }

    .name {
        flex: 1;
        text-align: right;
    }
}

@media only screen and (min-width: 800px) {

    .chat-info {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 20px;
        border: 1px solid #7e319c;
        margin: 4px;
        cursor: pointer;
        border-radius: 20px;
        transition: background-color 0.3s, color 0.3s; /* Smooth transition effect */
    }

    .sidebarright {
        position: fixed;
        top: 0;
        right: 0;
        width: 300px;
        height: 100vh;
        background-color: var(--surface-background);
        color: var(--text-primary);
        box-shadow: 0 12px 30px color-mix(in srgb, var(--surface-overlay-strong) 40%, transparent);
        z-index: 1999;
        transition: transform 0.3s ease-in-out;
    }
    
    .sidebarright.collapsed {
        transform: translateX(300px); /* Move sidebar to the left */
    }

    .chat-div {
        position: fixed;
        bottom: 0;
        right: 300px;
        width: 25%;
        height: 70%;
        background-color: var(--surface-elevated);
        border: 1px solid var(--border-color);
        border-radius: 5px;
        transition: transform 0.5s ease-in-out;
        z-index: 999999;
    }

    .name {
        flex: 1;
        text-align: left;
    }
}

.chats-div{
    max-height: 86vh;
    overflow-y: auto;
}

/* Personalizando a scrollbar para Chrome, Edge e Safari */
.chats-div::-webkit-scrollbar {
    width: 8px; /* Define a largura da scrollbar */
}

.chats-div::-webkit-scrollbar-track {
    background: transparent; /* Torna a área de fundo invisível */
}

.chats-div::-webkit-scrollbar-thumb {
    background: var(--scrollbar-thumb); /* Cor da barra de rolagem */
    border-radius: 4px; /* Cantos arredondados */
}

.chats-div::-webkit-scrollbar-thumb:hover {
    background: color-mix(in srgb, var(--scrollbar-thumb) 82%, var(--text-primary) 18%);
}

.chat-info:hover {
    background-color: #7e319c; /* Purple background on hover */
    color: white; /* White font on hover */
}

.datetime {
    text-align: right;
    color: var(--text-muted);
}

.chat-hidden {
    transform: translateY(100%);
}

.chat-top-bar {
    background-color: var(--primary-color); /* Example color for the top bar */
    padding: 10px;
    cursor:pointer;
    color: var(--primary-contrast-text);
}

#chat-input {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1px;
    border-top: 1px solid var(--border-color);
    background: var(--surface-background);
}

#message-input {
    flex: 1;
    margin-right: 10px;
}

/* Style for the message container */
.message-container {
    margin: 20px auto;
    border-radius: 8px;
    width: 100%;
    height: calc(100% - 135px); /* Subtract height of input field */
    overflow-y: auto; /* Enable vertical scroll if content exceeds height */
}

.chat-button {
    flex-shrink: 0; /* Prevent button from shrinking */
    background-color: #7e319c; /* Blue login button */
    color: #fff; /* White text color */
    border: none;
    padding: 10px 20px;
    border-radius: 5px; /* Rounded corners */
    font-size: 16px;
    cursor: pointer;
    transition: background-color 0.3s ease; /* Smooth background color transition */
    text-decoration: none; /* Remove underline */
}

.chat-button:hover {
    background-color: #511f64; /* Darker blue on hover */
    text-decoration: none; /* Remove underline */
}

.message {
    background-color: var(--surface-muted);
    color: var(--text-primary);
    padding: 5px 10px;
    margin-bottom: 5px;
    border-radius: 10px;
    max-width: 70%;
    position: relative;
}

.message.from-me {
    background-color: transparent;
    color: var(--text-secondary);
    border: 1px solid color-mix(in srgb, var(--primary-color) 42%, var(--border-color));
    align-self: flex-end;
    margin-left: auto;
}

.message.from-me::after {
    content: '';
    position: absolute;
    width: 0;
    height: 0;
    border-top: 10px solid transparent;
    border-bottom: 10px solid transparent;
    border-right: 10px solid color-mix(in srgb, var(--primary-color) 40%, var(--border-color));
    right: -9px;
    top: 7px;
}

.message.from-you::before {
    content: '';
    position: absolute;
    width: 0;
    height: 0;
    border-top: 10px solid transparent;
    border-bottom: 10px solid transparent;
    border-left: 10px solid var(--primary-color);
    right: -9px;
    top: 7px;
}

.message.from-you {
    background-color: var(--primary-color);
    color: var(--primary-contrast-text);
}

.message.from-you .message-time {
    font-size: 12px;
    color: color-mix(in srgb, var(--primary-contrast-text) 85%, transparent);
    margin-top: 3px;
}

.message-time {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 3px;
}

.circle-number {
    display: inline-block;
    width: 15px; /* Defina a largura do círculo */
    height: 15px; /* Defina a altura do círculo */
    border-radius: 50%; /* Faz o elemento ter bordas arredondadas, criando o círculo */
    background-color: var(--status-info);
    color: #fff; /* Cor do texto branco */
    text-align: center; /* Alinha o texto horizontalmente no centro */
    font-size: 12px; /* Tamanho da fonte */
    margin-right: 10px;
}

.chat-context-info {
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 10px;
    text-align: left;
    margin: 10px 0;
    background-color: var(--surface-muted);
    font-size: 0.9em;
    color: var(--text-secondary);
}

.chat-context-info a {
    color: var(--link-color);
}