<style>
  * { box-sizing: border-box; }

  body {
    margin: 0;
    padding: 16px;
    background: #f4f6fb;
    font-family: Arial, sans-serif;
    color: #202338;
  }

  .chatbot {
    width: 100%;
    max-width: 750px;
    margin: 20px auto;
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 10px 35px rgba(30, 40, 80, .09);
  }

  .chat-header {
    padding: 12px 20px;
    color: white;
    background: linear-gradient(135deg, #FFB400, #FFB500);
  }

  .chat-header h2 {
    margin-bottom: 3px;
    font-size: 21px;
  }

  .chat-header p {
    margin: 0;
    font-size: 13px;
    opacity: .9;
  }

  .chat-messages {
    height: 300px;
    overflow-y: auto;
    padding: 18px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    background: #fafbff;
  }

  .message {
    max-width: 88%;
    padding: 12px 15px;
    border-radius: 16px;
    font-size: 15px;
    line-height: 1.6;
    overflow-wrap: anywhere;
    white-space: pre-wrap;
  }

  .bot {
    align-self: flex-start;
    background: #ecebff;
    border-bottom-left-radius: 4px;
  }

  .user {
    align-self: flex-end;
    color: white;
    background: linear-gradient(135deg, #FFDD55, #FFDD77);
    border-bottom-right-radius: 4px;
  }

  .chat-form {
    display: flex;
    gap: 6px;
    padding: 8px;
    border-top: 1px solid #e5e7eb;
    background: white;
  }

  .chat-form textarea {
    flex: 1;
    min-width: 0;
    min-height: 48px;
    max-height: 120px;
    padding: 13px;
    resize: vertical;
    border: 1px solid #d1d5db;
    border-radius: 13px;
    font: inherit;
    font-size: 16px;
    outline: none;
  }

  .chat-form textarea:focus {
    border-color: #8b5cf6;
    box-shadow: 0 0 0 3px #8b5cf622;
  }

  .chat-form button {
    align-self: flex-end;
    min-height: 48px;
    padding: 0 18px;
    border: none;
    border-radius: 13px;
    background: linear-gradient(135deg, #7c3aed, #2563eb);
    color: white;
    font-size: 15px;
    font-weight: bold;
    cursor: pointer;
  }

  .chat-form button:hover {
    filter: brightness(1.1);
  }

  .chat-form button:disabled {
    opacity: .6;
    cursor: wait;
  }

  .chat-note {
    margin: 0;
    padding: 0 14px 12px;
    color: #777;
    background: white;
    font-size: 11px;
  }

  @media (max-width: 480px) {
    body { padding: 8px; }
    .chatbot { margin: 8px auto; border-radius: 16px; }
    .chat-messages { height: 55vh; min-height: 260px; }
    .chat-form { padding: 10px; gap: 8px; }
    .chat-form button { padding: 0 13px; }
    .message { max-width: 94%; }
  }


/* AI thinking indicator */
.typing-indicator {
  display: flex;
  align-items: center;
  gap: 5px;
  width: fit-content;
  padding: 14px 18px;
  background: #ecebff;
  border-radius: 16px;
  border-bottom-left-radius: 4px;
}

.typing-indicator span {
  width: 7px;
  height: 7px;
  background: #7c3aed;
  border-radius: 50%;
  animation: thinking 1.2s infinite ease-in-out;
}

.typing-indicator span:nth-child(2) {
  animation-delay: 0.2s;
}

.typing-indicator span:nth-child(3) {
  animation-delay: 0.4s;
}

@keyframes thinking {
  0%, 60%, 100% {
    transform: translateY(0);
    opacity: 0.4;
  }
  30% {
    transform: translateY(-6px);
    opacity: 1;
  }
}

@media (prefers-reduced-motion: reduce) {
  .typing-indicator span {
    animation: none;
  }
}

/* #shareButton {
  display: inline;
  margin: 10px auto;
  background: transparent;
  color: #2563eb;
  border: none;
  #ont-size: 12px;
  padding: 5px 10px;
  cursor: pointer;
  text-align: none;
}*/

/* #shareButton:hover {
  color: #1d4ed8;
  text-decoration: underline;
}*/

#shareButton {
  display: inline;
  width: fit-content;
  margin: 0 auto;
  color: #2563eb;
  font-size: 12px;
  text-decoration: none;
  cursor: pointer;
}

#shareButton:hover {
  text-decoration: underline;
  color: #1d4ed8;
}

@media (max-width: 480px) {
  .chat-form label,
  .chat-form p {
    margin-bottom: 3px !important;
    padding-bottom: 0 !important;
  }
 
 .chat-form textarea {
    margin-top: 0 !important;
  }
}
</style>
