:root {
  --chat-bg: rgba(240, 248, 255, 0.92); /* Um tom claro para o fundo do chat */
  --text-color: rgba(0, 0, 0, 0.65); /* Cor escura para o texto */
  --user-bg: rgba(161, 184, 242, 0.9); /* Sem transparência */
  --assistant-bg: rgba(143, 167, 255, 1); /* Sem transparência */ 
  --input-bg: rgba(240, 248, 255, 0.97); /* Fundo claro para o campo de e */
  --button-bg: rgba(100, 149, 237, 0.92); /* Azul suave para botões */
  --button-text: #ffffff; /* Texto branco nos botões */
  --border-color: rgba(173, 216, 230, 0.7); /* Azul claro para as bordas */
  
}

.chat-wrapper.dark-mode {
    --chat-bg: rgba(0, 26, 102, 0.97); /* Tom escuro com transparência */
    --text-color: rgba(179, 198, 255, 0.9); /* Tom claro com um pouco de transparência */
    --user-bg: rgba(0, 42, 128, 0.8); /* Tom intermediário com transparência */
    --assistant-bg: rgba(0, 51, 161, 0.8); /* Tom mais escuro com transparência */
    --input-bg: rgba(0, 34, 79, 0.9); /* Tom escuro para input com menos transparência */
    --button-bg: rgba(0, 72, 212, 0.9); /* Tom intermediário do botão com menos transparência */
    --button-text: rgba(255, 255, 255, 1); /* Texto do botão branco, sem transparência */
    --border-color: rgba(0, 63, 142, 0.8); /* Tom intermediário com transparência */
}

/* Tema Claro */


/* Tema Escuro */
.chat-wrapper.dark-mode #theme-toggle {
    color: rgba(255, 255, 255, 0.8); /* Cor clara para o ícone no tema escuro */
    font-size: 26px;
}


.chat-wrapper {
  position: fixed;
  bottom: 90px;
  right: 20px;
  width: 90%;
  max-width: 390px;
  height: calc(95% - 4px);
  max-height: 646px;
  display: flex;
  flex-direction: column;
  z-index: 1000;
}

#chat-container {
  flex: 1;
  display: flex;
  flex-direction: column;
  border: 2px solid var(--border-cht);
  background-color: var(--chat-bg);
  box-shadow: 0 0 10px rgba(0,0,0,0.1);
  transition: background-color 0.3s, color 0.3s;
  margin-bottom: 4px;
  max-height: 600px;
  border-radius: 14px;
  overflow: hidden;
}

#chat-messages {
  flex: 1 1 auto;
  overflow-y: auto;
  padding: 10px;
  color: var(--text-color);
  line-height: 1.5;
  /* Garante que o scroll funcione adequadamente */
  height: 0;
}

#loading {
  padding: 10px;
  position: sticky;
  bottom: 0;
  background-color: var(--chat-bg);
}

#input-container {
  flex: 0 0 auto;
  display: flex;
  border: 0px solid var(--border-color);
  border-radius: 12px;
  overflow: hidden;
  margin-top: auto;
  padding: 0px;
  background-color: transparent;
 
}

#user-input {
  border-radius: 12px;
  flex: 1;
  padding: 10px;
  border: 1px solid var(--border-cht);
  font-size: 16px;
  outline: none;
  background-color: var(--chat-bg);
  color: var(--text-color);
  min-height: 40px;
  width: 90%;
}



#user-input:focus {
    outline: 1px solid var(--border-color);
}

#send-button {
    padding: 10px;
    background-color: transparent;
    color: var(--button-text);
    border: none;
    cursor: pointer;
    font-size: 24px;
    white-space: nowrap;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 0; /* Removemos o border-radius do botão */
}

.message {
    margin-bottom: 10px;
    padding: 8px;
    border-radius: 10px;
    max-width: 80%;
    line-height: 1.5;
}

.user {
    background-color: var(--user-bg) !important;
    align-self: flex-end;
    margin-left: auto;
    font-size: 20px;
    font-family: Poppins, sans-serif;
    font-weight: 400;
    line-height: 1.5;
}

.assistant {
    background-color: var(--assistant-bg) !important;
    align-self: flex-start;
    font-size: 20px;
    font-family: Poppins, sans-serif;
    font-weight: 800;
    line-height: 1.5;
}

.assistant a {
    color: var(--button-bg) ;
    text-decoration: none;
}

.assistant a:hover {
    text-decoration: underline;
}

#loading {
    display: none;
    text-align: center;
    padding: 10px;
}

#theme-toggle {
    position: absolute;
    top: 10px;
    right: 10px;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 24px;
    z-index: 1002;
}


#chat-button-wrapper {
    position: fixed;
    bottom: 20px;
    right: 8px;
    width: 70px;
    height: 70px;
    z-index: 1000;
    display: block; /* Explicitamente definindo o display inicial */
}

        #chat-button {
            position: absolute;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background-color: transparent;
            border: none;
            padding: 0;
            cursor: pointer;
            z-index: 1002;
        }

        .button-content {
            position: absolute;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            border-radius: 50%;
            overflow: hidden;
            box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
            z-index: 1001;
        }

        .button-content::before {
            content: '';
            position: absolute;
            top: -2px;
            left: -2px;
            right: -2px;
            bottom: -2px;
            background: linear-gradient(45deg, #ff0000, #ff7f00, #ffff00, #00ff00, #0000ff, #8b00ff, #ff00ff, #ff0000);
            z-index: 1;
            border-radius: 50%;
            animation: rainbow 5s linear infinite;
        }

        .button-content::after {
            content: '';
            position: absolute;
            top: 2px;
            left: 2px;
            right: 2px;
            bottom: 2px;
            background-color: white;
            border-radius: 50%;
            z-index: 2;
        }

        .button-content img {
            position: absolute;
            top: 50%;
            left: 50%;
            transform: translate(-50%, -50%);
            width: 90%;
            height: 90%;
            object-fit: cover;
            border-radius: 50%;
            z-index: 3;
        }

        @keyframes rainbow {
            0% { transform: rotate(0deg); }
            100% { transform: rotate(360deg); }
        }

        #chat-button:hover + .button-content {
            transform: scale(1.1);
        }


#help-text {
    position: fixed;
    right: 65px;
    background-color: rgba(0, 102, 204, 0.9);
    color: #FFF;
    padding: 10px 20px;
    border-radius: 20px 0 0 20px;
    font-size: 16px;
    opacity: 0;
    transform: translateX(100%);
    transition: opacity 1.5s, transform 2.5s;
    z-index: 900;
    white-space: nowrap;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    height: 10px; /* Altura fixa para o botão de ajuda */
    margin-bottom: 15px; /* Espaço abaixo do botão */
}

#help-text.active {
    opacity: 1;
    transform: translateX(0);
}

/* Media query para dispositivos móveis */
@media (max-width: 600px) {
    #help-text {
        right: 65px;
        font-size: 14px;
        padding: 15px 15px;
        height: 15px; /* Altura ligeiramente menor para telas menores */
    }
}

/* Media query para telas muito pequenas */
@media (max-width: 320px) {
    #help-text {
        font-size: 12px;
        right: 60px;
        max-width: calc(100vw - 70px);
        height: 10px; /* Altura ainda menor para telas muito pequenas */
        padding: 6px 10px;
    }
}

/* Adicione esta regra para alinhar verticalmente o help-text com o chat-button */
#chat-button, #help-text {
    bottom: 20px;
}

#theme-toggle i {
    color: var(--icon-fa-color); /* Cor padrão do ícone */
}

/* Cor do ícone no modo escuro */
.chat-wrapper.dark-mode #theme-toggle i {
    color: var(--icon-fa-color); /* Cor do ícone no modo escuro */
}




/* Media query para mobile mantendo o border-radius */
@media (max-width: 600px) {
  .chat-wrapper {
    width: 90%;
    height: 65%;
    max-width: 400px;
    max-height: 500px;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
  }

  #chat-container {
    border-radius: 12px; /* Border radius apenas para mobile */
  }

 
    #chat-button {
        bottom: 10px;
        left: 50%; /* Alterado de right para left */
        transform: translateX(-50%); /* Adicionado para centralizar */
    }
    #user-input {
        width: calc(100% - 80px);
    }
    #send-button svg {
    width: 20px;
    height: 20px;
    fill: currentColor;
}

.modern-cursor {
  animation: blink 1s infinite;
}

@keyframes blink {
  50% {
    opacity: 0;
  }
}