/* Import Google font - Open Sans */
@import url('https://fonts.googleapis.com/css2?family=Open+Sans:ital,wght@0,300..800;1,300..800&display=swap');

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: "Open Sans", sans-serif;
}

body {
  background: #fff;
  height: 100vh;
  width: 100vw;
  overflow: hidden;
}

/* Chat container - Adjusted to fill the iframe */
.chatbot {
  width: 100%;
  height: 100%;
  background: #fff;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* Chat header */
.chatbot header {
  flex-shrink: 0;
  padding: 12px 0;
  position: relative;
  text-align: center;
  color: #fff;
  background: linear-gradient(138deg, rgba(70,102,255,1) 26%, rgba(69,92,209,1) 93%);
  box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.header-content {
  display: flex;
  align-items: center;
  padding: 0 20px;
}

.header-content .avatar {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  border: 2px solid #fff;
  margin-right: 15px;
}

.header-text {
  text-align: left;
}

.header-text h2 {
  font-size: 1.1rem;
  margin: 0;
  font-weight: 600;
}

.header-text p {
  font-size: 0.8rem;
  opacity: 0.9;
  margin: 0;
}

.chatbot header .close-btn {
  display: none;
}

/* Conversation area */
.chatbox {
  flex-grow: 1;
  overflow-y: auto;
  padding: 20px;
}

.chatbox .chat {
  display: flex;
  gap: 5px;
  list-style: none;
  margin: 15px 0;
}

.chatbox .outgoing {
  justify-content: flex-end;
}

.chatbox .incoming span.chat-logo {
  width: 32px;
  height: 32px;
  align-self: flex-end;
  margin: 0 10px 7px 0;
}

.chatbox .incoming span .chat-icon {
  width: 42px;
  height: 42px;
  border-radius: 50%;
}

.chatbox .outgoing div {
  background: #4666FF;
  color: #fff;
  border-radius: 18px 18px 4px 18px;
  padding: 12px 16px;
  max-width: 75%;
  word-wrap: break-word;
}

.chatbox .incoming .message-bubble {
  background: #f2f2f2;
  color: #333;
  border-radius: 18px 18px 18px 4px;
  padding: 12px 16px;
  max-width: 75%;
  font-size: 0.95rem;
  line-height: 1.4;
  word-wrap: break-word;
}

.chatbox .chat div.error {
  color: #721c24;
  background: #f8d7da;
}

/* Feedback controls */
li.chat.incoming.feedback {
  padding-left: 52px;
}

.chatbox .incoming .feedback-container {
  background: #f9f9f9;
  color: #555;
  border-radius: 18px;
  max-width: fit-content;
  padding: 8px 16px;
  margin-top: 5px;
  font-size: 0.85rem;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  justify-content: flex-start;
}

.chatbox .incoming .feedback-buttons {
  display: flex;
  gap: 8px;
}

.chatbox .incoming .feedback-buttons button {
  background: none;
  border: 1px solid #ccc;
  border-radius: 50%;
  width: 28px;
  height: 28px;
  cursor: pointer;
  transition: background-color 0.2s;
  font-size: 0.8rem;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}

.chatbox .incoming .feedback-buttons button:hover {
  background-color: #f0f0f0;
}

.chatbox .incoming .feedback-buttons button.selected {
  background-color: #dcedff;
  border-color: #4666FF;
}

.thank-you-message {
  padding: 6px 12px;
  border-radius: 12px;
  font-size: 0.85rem;
  background-color: #e6f7ff;
  color: #004a7c;
}


/* Chat input area */
.chatbot .chat-input {
  flex-shrink: 0;
  display: flex;
  gap: 5px;
  width: 100%;
  background: #fff;
  padding: 3px 20px;
  border-top: 1px solid #ddd;
}

.chat-input textarea {
  height: 55px;
  width: 100%;
  border: none;
  outline: none;
  resize: none;
  max-height: 180px;
  padding: 16px 15px 16px 0;
  font-size: 0.95rem;
}

.chat-input span {
  align-self: flex-end;
  color: #4666FF;
  cursor: pointer;
  height: 55px;
  display: flex;
  align-items: center;
  visibility: hidden;
  font-size: 1.35rem;
}

.chat-input textarea:valid ~ span {
  visibility: visible;
}

img.chat-advisor-image {
  width: 100%;
  border-radius: 10px;
  margin-top: 5px;
}


@media (max-width: 490px) {
  .chatbot .chatbox {
    padding: 15px;
  }
  .chatbot .chat-input {
    padding: 5px 15px;
  }
}
