/* CHAT CONTAINER (The Window Interface) */
.chatbot {
  position: fixed;
  bottom: 95px; /* Adjusted to sit nicely above your 60px button */
  right: 15px;
  width: 320px;
  height: 450px;
  background: #ffffff;
  border-radius: 16px;
  box-shadow: 0 10px 25px rgba(0,0,0,0.3);
  z-index: 9999;
  display: flex;
  flex-direction: column;
  overflow: hidden;

  /* Animation Logic */
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(20px);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.chatbot.show {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateY(0);
}

/* HEADER */
.chat-header {
  background: linear-gradient(135deg, #0e5a95, #2f68ba);
  color: #fff;
  padding: 12px 16px;
  display: flex;
  justify-content: space-between; 
  align-items: center;
  font-weight: 600;
  font-size: 15px;
}

.chat-actions {
  display: flex;
  gap: 8px; 
  align-items: center;
}

/* Specific styling for the SVG Header Buttons */
.header-btn {
  background: transparent !important;
  border: none !important;
  color: #ffffff !important;
  padding: 4px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s, opacity 0.2s;
  outline: none;
}

.header-btn:hover {
  opacity: 0.8;
  transform: scale(1.1);
}

/* MESSAGES AREA */
.chatbox {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 15px;
  overflow-y: auto;
  background: #fdfdfd;
  font-size: 13.5px;
  line-height: 1.5;
  scroll-behavior: smooth;
}

/* MESSAGE BUBBLES */
.msg-user {
  align-self: flex-end;
  background: #0e5a95;
  color: #fff;
  padding: 10px 12px;
  border-radius: 15px 15px 0 15px;
  margin: 8px 0;
  max-width: 85%;
  word-break: break-word;
  box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

.msg-ai {
  align-self: flex-start;
  background: #f1f1f1;
  color: #333;
  padding: 10px 12px;
  border-radius: 15px 15px 15px 0;
  margin: 8px 0;
  max-width: 85%;
  word-break: break-word;
  border: 1px solid #e0e0e0;
}

.msg-ai a {
  color: #0e5a95;
  text-decoration: underline;
  font-weight: 600;
}

/* INPUT AREA */
.chat-input {
  display: flex;
  border-top: 1px solid #eee;
  background: #fff;
  padding: 5px;
}

.chat-input input {
  flex: 1;
  border: none;
  padding: 12px;
  outline: none;
  font-size: 14px;
  background: transparent;
}

.chat-input button {
  background: #0e5a95;
  color: #fff;
  border: none;
  padding: 0 15px;
  border-radius: 8px;
  margin-left: 5px;
  cursor: pointer;
  font-weight: 600;
}

/* DARK MODE FOR CHAT WINDOW */
@media (prefers-color-scheme: dark) {
  .chatbot { background: #1e1e1e; color: #eee; }
  .chatbox { background: #121212; }
  .msg-ai { background: #2a2a2a; color: #eee; border: 1px solid #333; }
  .msg-ai a { color: #4da3ff; }
  .chat-input { border-top: 1px solid #333; background: #1e1e1e; }
  .chat-input input { color: #fff; }
}

/* MOBILE SAFE */
@media (max-width: 480px) {
  .chatbot {
    width: calc(100% - 30px);
    right: 15px;
    height: 400px;
    bottom: 95px;
  }
  }

/* ========================================= */
/* TOGGLE BUTTON & ANIMATIONS */
/* ========================================= */

#chat-toggle-btn {
  position: fixed;
  bottom: 20px;
  right: 15px;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: #0e5a95;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  border: 3px solid #0e5a95;
  cursor: pointer;
  padding: 0;
  animation: pulse-light 2s infinite;
  transition: transform 0.3s ease;
  overflow: hidden;
}

#chat-toggle-btn img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}

#chat-toggle-btn::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  box-shadow: inset 0 6px 8px rgba(255, 255, 255, 0.6), 
              inset 0 -6px 8px rgba(0, 0, 0, 0.4);
  pointer-events: none;
}

#chat-toggle-btn:active {
  transform: translateY(4px) scale(0.95);
}

@keyframes pulse-light {
  0% { box-shadow: 0 8px 15px rgba(0, 0, 0, 0.35), 0 0 0 0 rgba(14, 90, 149, 0.7); }
  70% { box-shadow: 0 8px 15px rgba(0, 0, 0, 0.35), 0 0 0 15px rgba(14, 90, 149, 0); }
  100% { box-shadow: 0 8px 15px rgba(0, 0, 0, 0.35), 0 0 0 0 rgba(14, 90, 149, 0); }
}

@keyframes pulse-dark {
  0% { box-shadow: 0 8px 15px rgba(0, 0, 0, 0.7), 0 0 0 0 rgba(77, 163, 255, 0.6); }
  70% { box-shadow: 0 8px 15px rgba(0, 0, 0, 0.7), 0 0 0 15px rgba(77, 163, 255, 0); }
  100% { box-shadow: 0 8px 15px rgba(0, 0, 0, 0.7), 0 0 0 0 rgba(77, 163, 255, 0); }
}

/* DARK MODE OVERRIDES */
@media (prefers-color-scheme: dark) {
  #chat-toggle-btn {
    background-color: #1a222c !important;
    border: 2px solid #4da3ff !important;
    animation: pulse-dark 2s infinite;
  }
}

/* ========================================= */
/* CHATBOT BUTTONS (Aesthetic Compact Mode)  */
/* ========================================= */
.chat-btn-group {
  display: flex;
  flex-direction: column;
  gap: 8px; /* Tighter spacing between buttons */
  margin-top: 12px;
  width: 100%;
}

.msg-ai .chat-btn-group a.btn {
  color: #fff !important; 
  text-decoration: none !important; 
  font-weight: 700 !important;
  padding: 8px 12px !important; /* Reduced from 12px to 8px */
  font-size: 13.5px !important;  /* Matches your chat message font size */
  border-radius: 8px !important;  /* Slightly sharper corners for small size */
  width: 100%;
  max-width: 210px; /* Prevents button from being too wide/bulky */
  margin: 0; 
  border: none !important;
  gap: 6px !important; /* Tighter gap between icon and text */
  justify-content: center;
}

