/* ==============================
   Chatbot Styles (v13.26)
   ============================== */

#chatbot-container {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 1000;
  font-family: 'Poppins', sans-serif;
}

/* ==============================
   Floating Action Button (AI Star Icon)
   ============================== */
.cb-fab {
  background-color: #5AB562; /* Tappy Green */
  border: none;
  border-radius: 50%;
  width: 64px;
  height: 64px;
  display: flex;
  justify-content: center;
  align-items: center;
  cursor: pointer;
  box-shadow: 0 4px 10px rgba(0,0,0,0.3);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
  animation: fabGlow 3s ease-in-out infinite;
}

.cb-fab svg {
  width: 28px;
  height: 28px;
  fill: #fff; /* Always pure white */
  transition: transform 0.5s ease;
}

/* Hover: gentle scale and slow rotation */
.cb-fab:hover {
  transform: scale(1.07);
  box-shadow: 0 6px 14px rgba(0,0,0,0.35);
}
.cb-fab:hover svg {
  transform: rotate(20deg);
}

/* Active: quick pulse feedback */
.cb-fab:active svg {
  transform: scale(0.9);
}

/* Soft breathing glow when idle */
@keyframes fabGlow {
  0%,100% { box-shadow: 0 0 10px rgba(90,181,98,0.4); }
  50% { box-shadow: 0 0 18px rgba(90,181,98,0.8); }
}

/* ==============================
   Chat Window
   ============================== */
.cb-wrap {
  position: fixed;
  bottom: 100px;
  right: 20px;
  width: 340px;
  background: #fff;
  border-radius: 14px;
  box-shadow: 0 10px 24px rgba(0,0,0,0.25);
  display: none;
  flex-direction: column;
  overflow: hidden;
  max-height: 75vh;
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.4s ease, transform 0.4s ease;
}
.cb-wrap[open] {
  display: flex;
  opacity: 1;
  transform: translateY(0);
}

/* Header */
.cb-header {
  background-color: #5AB562;
  color: #fff;
  padding: 14px 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.cb-title { font-weight: 600; font-size: 1rem; }
.cb-sub { font-size: 0.8rem; opacity: 0.9; }

/* Chat Body */
.cb-body {
  padding: 14px;
  flex: 1;
  overflow-y: auto;
  font-size: 0.9rem;
  line-height: 1.4;
  scroll-behavior: smooth;
}

/* General Chat Message */
.cb-body p {
  margin: 4px 0;
  background: rgba(245,245,245,0.5);
  padding: 4px 6px;
  border-radius: 6px;
  line-height: 1.35;
}
.cb-body p strong { color: #0b0e3f; }

/* Thinking Animation */
@keyframes pulse {
  0%,100% { opacity: 1; }
  50% { opacity: 0.5; }
}
.cb-body p:has(strong:contains("⌛")) {
  animation: pulse 1.2s infinite;
}

/* Links */
.cb-body a, .cb-link {
  color: #4ca952;
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 3px;
  transition: all 0.25s ease;
}
.cb-body a:hover, .cb-link:hover {
  color: #0b0e3f;
  text-decoration-color: #5AB562;
  text-shadow: 0 0 6px rgba(90,181,98,0.4);
}

/* ==============================
   Input Bar (Fixed for Send Button Cutoff)
   ============================== */
.cb-input {
  border-top: 1px solid #e2e2e2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 10px;
  background: #fafafa;
  flex-shrink: 0;
  box-sizing: border-box;
}
.cb-input input {
  flex: 1;
  min-width: 0;
  border: 1px solid #ccc;
  border-radius: 8px;
  padding: 10px 12px;
  font-family: inherit;
  font-size: 0.9rem;
  height: 38px;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  box-sizing: border-box;
}
.cb-input input:focus {
  outline: none;
  border-color: #5AB562;
  box-shadow: 0 0 4px rgba(90,181,98,0.4);
}

/* Send Button */
.cb-input button {
  background-color: #5AB562;
  border: none;
  border-radius: 50%;
  color: #fff;
  width: 42px;
  height: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: background-color 0.2s ease, transform 0.15s ease;
  box-shadow: 0 2px 5px rgba(0,0,0,0.15);
}
.cb-input button:hover {
  background-color: #4aa050;
  transform: scale(1.05);
}
.cb-input button svg {
  width: 18px;
  height: 18px;
  fill: #fff;
}

/* Close Button */
.cb-close {
  background: transparent;
  border: none;
  color: #fff;
  font-size: 1.2rem;
  cursor: pointer;
  transition: opacity 0.2s ease;
}
.cb-close:hover { opacity: 0.8; }

/* Guided Options */
.cb-options {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}
.cb-opt {
  background: #0b0e3f;
  color: #fff;
  border: none;
  border-radius: 20px;
  padding: 6px 14px;
  cursor: pointer;
  font-size: 0.85rem;
  transition: background 0.25s, transform 0.15s;
}
.cb-opt:hover {
  background: #5AB562;
  transform: translateY(-2px);
}

/* Yes/No Buttons Animation (v13.25) */
.cb-yesno {
  display: flex;
  justify-content: space-around;
  margin-top: 10px;
  gap: 10px;
  opacity: 0;
  transform: scale(0.96);
  animation: cbFadeIn 0.25s ease forwards;
}
.cb-yesno button {
  flex: 1;
  border: none;
  border-radius: 10px;
  padding: 8px 10px;
  font-weight: 600;
  color: #fff;
  cursor: pointer;
  transition: transform 0.15s ease, opacity 0.25s ease, background-color 0.25s ease;
}
.cb-yesno .cb-btn-yes { background: #5AB562; }
.cb-yesno .cb-btn-yes:hover { background: #4aa050; }
.cb-yesno .cb-btn-no { background: #888; }
.cb-yesno .cb-btn-no:hover { background: #777; }
.cb-yesno button:active {
  opacity: 0.8;
  transform: scale(0.97);
}
@keyframes cbFadeIn {
  from { opacity: 0; transform: scale(0.96) translateY(4px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

/* Scrollbar */
.cb-body::-webkit-scrollbar { width: 6px; }
.cb-body::-webkit-scrollbar-thumb {
  background: #ccc;
  border-radius: 3px;
}
.cb-body::-webkit-scrollbar-thumb:hover { background: #aaa; }

/* Responsive */
@media (max-width: 480px) {
  .cb-wrap {
    right: 10px;
    width: 90%;
    max-height: 80vh;
  }
  .cb-fab {
    width: 58px;
    height: 58px;
  }
}
