/* ==========================
   Modern Chatbot Styling
   PbFreeOhio / CLELocalAgent
========================== */

.chatbot-container {
  position: fixed;
  bottom: 40px; /* lifted slightly higher */
  right: 24px;
  font-family: "Inter", sans-serif;
  z-index: 9999;
}

/* Floating Button */
.chatbot-button {
  background: linear-gradient(135deg, #003366, #0055a4);
  color: #fff;
  border-radius: 50%;
  width: 64px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.chatbot-button:hover {
  transform: scale(1.08);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.4);
}

/* Chat Window */
.chatbot-window {
  width: 360px;
  height: 500px;
  background: #ffffff;
  border-radius: 16px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  position: relative;
  animation: fadeIn 0.3s ease;
  margin-bottom: 20px; /* lift window slightly above button */
}

.hidden {
  display: none;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Header */
.chatbot-header {
  background: linear-gradient(90deg, #003366, #0066cc);
  color: #fff;
  padding: 12px 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.chatbot-header-info {
  display: flex;
  align-items: center;
  gap: 10px;
}

.chatbot-avatar {
  background-color: #00a8a8;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
}

.chatbot-name {
  font-weight: 600;
  font-size: 16px;
}

.chatbot-subtitle {
  font-size: 12px;
  color: #cce3ff;
}

.chatbot-close {
  background: none;
  border: none;
  color: white;
  font-size: 22px;
  cursor: pointer;
}

/* Messages */
.chatbot-messages {
  flex: 1;
  padding: 12px;
  overflow-y: auto;
  background: #f6f9fc;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.bot-message,
.user-message {
  padding: 10px 14px;
  border-radius: 14px;
  line-height: 1.5;
  max-width: 85%;
  word-wrap: break-word;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.bot-message {
  background-color: #e9f4ff;
  color: #0a2540;
  align-self: flex-start;
}

.user-message {
  background-color: #003366;
  color: #fff;
  align-self: flex-end;
}

/* Markdown Formatting */
.bot-message h1,
.bot-message h2 {
  font-size: 16px;
  margin-bottom: 6px;
}
.bot-message ul {
  margin-left: 20px;
}
.bot-message a {
  color: #0066cc;
  text-decoration: underline;
}

/* Input Area */
.chatbot-input-area {
  display: flex;
  padding: 10px;
  background: #fff;
  border-top: 1px solid #e0e0e0;
}

.chatbot-input-area input {
  flex: 1;
  border: 1px solid #ccc;
  border-radius: 12px;
  padding: 8px 12px;
  font-size: 14px;
  outline: none;
}

.chatbot-input-area button {
  background: linear-gradient(135deg, #ff7043, #ff5722);
  color: white;
  border: none;
  border-radius: 12px;
  margin-left: 8px;
  padding: 8px 16px;
  cursor: pointer;
  font-weight: 600;
  transition: 0.3s;
}

.chatbot-input-area button:hover {
  background: linear-gradient(135deg, #ff5722, #ff3d00);
}

/* Spinner */
.spinner {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 10px;
}

.dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: #999;
  animation: bounce 1.2s infinite ease-in-out;
}

.dot1 {
  animation-delay: 0s;
}
.dot2 {
  animation-delay: 0.2s;
}
.dot3 {
  animation-delay: 0.4s;
}

@keyframes bounce {
  0%,
  80%,
  100% {
    transform: scale(0);
  }
  40% {
    transform: scale(1);
  }
}

/* Scrollbar */
.chatbot-messages::-webkit-scrollbar {
  width: 6px;
}
.chatbot-messages::-webkit-scrollbar-thumb {
  background: #ccc;
  border-radius: 6px;
}

/* ==========================
   Responsive Design
========================== */

/* Tablets (max 768px) */
@media (max-width: 768px) {
  .chatbot-window {
    width: 320px;
    height: 460px;
    margin-bottom: 16px;
  }

  .chatbot-button {
    width: 58px;
    height: 58px;
    font-size: 24px;
  }
}

/* Mobile (max 480px) */
@media (max-width: 480px) {
  .chatbot-container {
    bottom: 20px;
    right: 16px;
  }

  .chatbot-window {
    width: 90vw;
    height: 70vh;
    margin-bottom: 12px;
  }

  .chatbot-button {
    width: 52px;
    height: 52px;
    font-size: 22px;
  }
}

/* Very Small Devices (max 360px) */
@media (max-width: 360px) {
  .chatbot-window {
    width: 94vw;
    height: 68vh;
  }

  .chatbot-input-area input {
    font-size: 13px;
  }

  .chatbot-input-area button {
    padding: 6px 12px;
  }
}
