

/* ── CHATBOT BUTTON ── */
#chatbot-btn {
  position: fixed;
  right: 1.5rem;
  bottom: 1.5rem;
  z-index: 9999;
  width: 4rem;
  height: 4rem;
  border-radius: 9999px;
  border: none;
  cursor: pointer;
    /* background: var(--primary); */
  /* color: #fff; */
  color: #fff;

  display: flex;
  align-items: center;
  justify-content: center;

  background: linear-gradient(145deg, #292a59, #3b3da8);

  /* 3D depth */
  box-shadow:
    0 10px 20px rgba(0,0,0,0.2),
    inset 0 -2px 4px rgba(0,0,0,0.25),
    inset 0 2px 4px rgba(255,255,255,0.1);

  transform-style: preserve-3d;
  transition: all 0.25s ease;

  position: fixed;
  overflow: visible;
}

/* 🔥 Hover = lift + tilt */
#chatbot-btn:hover {
  transform: translateY(-6px) scale(1.08) rotateX(8deg) rotateY(-8deg);
}

/* 👇 Click */
#chatbot-btn:active {
  transform: translateY(2px) scale(0.97);
}

/* ✏️ DOODLE OUTLINE */
#chatbot-btn::after {
  content: "";
  position: absolute;
  inset: -6px;
  border-radius: 9999px;
  border: 2px dashed rgba(41, 42, 89, 0.6);

  /* hand-drawn vibe */
  filter: blur(0.3px);
  transform: rotate(0deg);
  animation: doodleWiggle 3s ease-in-out infinite;
}

/* ✨ subtle glow */
#chatbot-btn::before {
  content: "";
  position: absolute;
  inset: -10px;
  border-radius: inherit;
  background: radial-gradient(circle, rgba(95,97,214,0.35), transparent 70%);
  opacity: 0;
  transition: opacity 0.3s ease;
}

#chatbot-btn:hover::before {
  opacity: 1;
}

/* 🌊 ping */
#chatbot-btn .ping {
  position: absolute;
  inset: 0;
  border-radius: 9999px;
  background: #5f61d6;
  opacity: 0.15;
  animation: ping 2s cubic-bezier(0.4, 0, 0.2, 1) infinite;
}

@keyframes ping {
  0% {
    transform: scale(1);
    opacity: 0.25;
  }
  70% {
    transform: scale(1.6);
    opacity: 0;
  }
  100% {
    opacity: 0;
  }
}

/* ✏️ doodle wiggle animation */
@keyframes doodleWiggle {
  0%, 100% {
    transform: rotate(0deg) scale(1);
  }
  25% {
    transform: rotate(1deg) scale(1.02);
  }
  50% {
    transform: rotate(-1deg) scale(0.98);
  }
  75% {
    transform: rotate(0.5deg) scale(1.01);
  }
}

/* ── CHAT WIDGET ── */
#chat-widget {
  position: fixed;
  right: 0.75rem;
  bottom: 1.75rem;
  z-index: 9998;
  width: calc(100% - 1.5rem);
  max-width: 380px;
  height: 80vh;
  max-height: 600px;
  background: #fff;
  border-radius: 1.5rem;
  box-shadow: 0 25px 60px rgba(0,0,0,0.18);
  border: 1px solid rgba(17,17,31,0.1);
  display: none;
  flex-direction: column;
  overflow: hidden;
  animation: widgetIn 0.3s ease forwards;
}
#chat-widget.open { display: flex; }
@keyframes widgetIn {
  from { opacity: 0; transform: translateY(40px) scale(0.95); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* Widget Header */
.widget-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid #e2e8f0;
  /* background: #fff; */
  background: #292a59;
  flex-shrink: 0;
}
.widget-header .bot-info { display: flex; align-items: center; gap: 0.75rem; }
.widget-header .avatar {
  width: 2.5rem; height: 2.5rem;
  border-radius: 9999px;
  overflow: hidden;
  border: 1px solid #e2e8f0;
  /* display: none; */
}
/* .widget-header .avatar img { width: 100%; height: 100%; object-fit: cover; } */
/* .widget-header .avatar img { width: 100%; height: 75%; } */

.widget-header .avatar {
  display: flex;
  justify-content: center;  /* horizontal center */
  align-items: center;      /* vertical center */
}

.widget-header .avatar img {
  width: 100%;
  height: 70%;
  object-fit: contain; /* optional: keeps image nicely scaled */
}
/* .widget-header .bot-name { font-weight: 700; font-size: 0.875rem; color: #1e293b; } */


.widget-header .bot-name {
  font-weight: 700;
  font-size: 0.875rem;
  color: #ffffff;
  animation: colorPulse 2.5s infinite ease-in-out, glowPulse 2.5s infinite ease-in-out;
}

/* Smooth color breathing */
@keyframes colorPulse {
  0%, 100% {
    color: #dadaff;
  }
  50% {
    color: #ddebff;
  }
}

/* Soft glow layering */
@keyframes glowPulse {
  0%, 100% {
    text-shadow:
      0 0 2px rgba(41, 42, 89, 0.3),
      0 0 6px rgba(41, 42, 89, 0.2),
      0 0 10px rgba(41, 42, 89, 0.1);
  }
  50% {
    text-shadow:
      0 0 4px rgba(95, 97, 214, 0.6),
      0 0 10px rgba(95, 97, 214, 0.5),
      0 0 18px rgba(95, 97, 214, 0.4);
  }
}

/* .widget-header .bot-sub { font-size: 0.75rem; color: #64748b; } */
.widget-header .bot-sub { font-size: 0.75rem; color: #dadaff; }

.widget-header .header-actions { display: flex; gap: 0.5rem; }
.widget-header .header-actions button {
  padding: 0.5rem;
  border: none;
  background: transparent;
  border-radius: 0.5rem;
  cursor: pointer;
  color: #64748b;
  transition: background 0.2s;
}

.widget-header .header-actions button:hover {
  color: #ffffff;
}
/* .widget-header .header-actions button:hover { background: #f1f5f9; } */
.widget-header .header-actions button:hover { background: #000000; }

/* Messages */
#chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0;
}

/* Chat message row */
.msg-row {
  display: flex;
  gap: 1rem;
  margin-bottom: 1.5rem;
  animation: msgIn 0.3s ease forwards;
}
@keyframes msgIn {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}
.msg-row.user { flex-direction: row-reverse; }

.msg-avatar {
  flex-shrink: 0;
  width: 2.5rem; height: 2.5rem;
  border-radius: 9999px;
  overflow: hidden;
  display: flex; align-items: center; justify-content: center;
}
.msg-avatar.user-avatar { background: linear-gradient(135deg, var(--primary), var(--secondary)); }
.msg-avatar.bot-avatar  { border: 2px solid rgba(21,154,187,0.2); }
.msg-avatar.bot-avatar img { height: 100%; width: 20px; object-fit: contain; }
.msg-avatar img { width: 100%; height: 100%; object-fit: cover; }
.msg-avatar svg { width: 1.25rem; height: 1.25rem; color: #fff; }

.msg-content { flex: 1; max-width: 70%; }
.msg-row.user .msg-content { display: flex; flex-direction: column; align-items: flex-end; }

.chat-bubble {
  padding: 0.75rem 1.25rem;
  border-radius: 1rem;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
  font-size: 0.9rem;
  line-height: 1.6;
}
.chat-bubble.user-bubble {
  background: var(--primary);
  color: #fff;
  border-bottom-right-radius: 0.25rem;
}
.chat-bubble.bot-bubble {
  background: #fff;
  border: 1px solid rgba(17,17,31,0.1);
  color: var(--secondary);
  border-bottom-left-radius: 0.25rem;
}
.chat-bubble p { margin: 0 0 0.5rem; }
.chat-bubble p:last-child { margin: 0; }
.chat-bubble strong { font-weight: 700; }

/* Option buttons below bot message */
.msg-options { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 0.75rem; }
.msg-options button {
  padding: 0.5rem 1rem;
  background: #fff;
  /* border: 1px solid rgba(21,154,187,0.3); */
  border: 2px solid rgba(116, 144, 255, 0.3);
  border-radius: 0.5rem;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--secondary);
  cursor: pointer;
  transition: all 0.3s;
  display: flex; align-items: center; gap: 0.4rem;
}
.msg-options button:hover {
  color: #dadaff;
  border-color: #dadaff;
  /* background: rgba(21,154,187,0.05); */
  background: #20295a;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.msg-meta {
  display: flex; align-items: center; gap: 0.5rem;
  margin-top: 0.5rem;
  font-size: 0.7rem;
  color: var(--highlight);
}
.msg-meta .model-badge {
  /* padding: 0.1rem 0.5rem; */
  padding: 5px 10px;
  /* background: rgba(21,154,187,0.1); */
  background: #20295a;
  letter-spacing: 1.2px;
  border: 1px solid rgba(116, 144, 255, 0.3);
  /* color: var(--primary); */
  color: #ffffff;
  border-radius: 9999px;
  display: flex; align-items: center;
}

/* Typing indicator */
#typing-indicator {
  display: none;
  gap: 1rem;
  margin-bottom: 1rem;
  align-items: center;
}
#typing-indicator.show { display: flex; }
.typing-avatar {
  width: 2rem; height: 2rem;
  border-radius: 9999px;
  background: var(--primary);
  display: flex; align-items: center; justify-content: center;
}
.typing-dots { display: flex; gap: 0.25rem; align-items: center; }
.typing-dots span {
  width: 0.5rem; height: 0.5rem;
  background: var(--primary);
  border-radius: 9999px;
  animation: bounce 1.2s infinite ease-in-out;
}
.typing-dots span:nth-child(2) { animation-delay: 0.15s; }
.typing-dots span:nth-child(3) { animation-delay: 0.30s; }
@keyframes bounce {
  0%, 80%, 100% { transform: scale(0.6); opacity: 0.4; }
  40%           { transform: scale(1);   opacity: 1; }
}

/* Input area */
.widget-input {
  border-top: 1px solid #e2e8f0;
  padding: 0.5rem 0.75rem;
  background: #fff;
  flex-shrink: 0;
}
.input-row { display: flex; align-items: flex-end; gap: 0.75rem; }
.input-row textarea {
  flex: 1;
  padding: 0.75rem 1.25rem;
  border: 1px solid rgba(17,17,31,0.2);
  border-radius: 1rem;
  outline: none;
  resize: none;
  font-family: inherit;
  font-size: 0.875rem;
  color: var(--secondary);
  background: #fff;
  min-height: 52px;
  max-height: 200px;
  transition: border 0.2s, box-shadow 0.2s;
  line-height: 1.5;
}
/* .input-row textarea:focus { border-color: var(--primary); box-shadow: 0 0 0 4px rgba(21,154,187,0.15); } */
.input-row textarea:focus { border: 2px solid rgba(116, 144, 255, 0.3); box-shadow: 0 0 0 4px rgba(93, 115, 204, 0.3); }
.input-row textarea:disabled { background: rgba(17,17,31,0.05); cursor: not-allowed; }
#send-btn {
  flex-shrink: 0;
  /* margin-bottom: 0.625rem; */
  width: 3rem; height: 3rem;
  border-radius: 1rem;
  border: none;
  /* background: linear-gradient(135deg, var(--primary), var(--secondary)); */
  background: #292a59;
  color: #ffffff;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: transform 0.2s, box-shadow 0.2s;
  box-shadow: 0 4px 12px rgba(21,154,187,0.35);
}
#send-btn:hover:not(:disabled) { transform: scale(1.05); box-shadow: 0 6px 20px rgba(21,154,187,0.45); }
#send-btn:disabled { background: rgba(17,17,31,0.1); color: rgba(17,17,31,0.3); cursor: not-allowed; box-shadow: none; }

/* ── FORMS ── */
.chat-form {
  background: #fff;
  border-radius: 1rem;
  padding: 1.25rem;
  border: 1px solid rgba(17,17,31,0.1);
  box-shadow: 0 4px 16px rgba(0,0,0,0.08);
  max-width: 100%;
}
.chat-form h3 { font-size: 1.1rem; font-weight: 700; color: var(--secondary); margin-bottom: 0.25rem; }
.chat-form p.sub  { font-size: 0.8rem; color: var(--highlight); margin-bottom: 1rem; }
.form-group { margin-bottom: 1rem; }
.form-group label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--secondary);
  margin-bottom: 0.4rem;
  display: flex; align-items: center; gap: 0.4rem;
}
.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 0.625rem 1rem;
  border: 1px solid rgba(17,17,31,0.2);
  border-radius: 0.5rem;
  font-family: inherit;
  font-size: 0.875rem;
  color: var(--secondary);
  outline: none;
  transition: border 0.2s, box-shadow 0.2s;
  background: #fff;
}
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(21,154,187,0.15);
}
.form-group textarea { resize: none; }
.form-hint { font-size: 0.7rem; color: var(--highlight); margin-top: 0.25rem; }

/* .btn-submit {
  width: 100%;
  padding: 0.75rem 1.5rem;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  color: #fff;
  font-weight: 700;
  font-size: 0.875rem;
  border: none;
  border-radius: 0.75rem;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center; gap: 0.5rem;
  transition: box-shadow 0.2s, transform 0.15s;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
} */
.btn-submit:hover:not(:disabled) { box-shadow: 0 8px 24px rgba(0,0,0,0.2); transform: scale(1.01); }
.btn-submit:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-back {
  flex: 1;
  padding: 0.75rem 1.5rem;
  background: transparent;
  color: var(--secondary);
  font-weight: 600;
  font-size: 0.875rem;
  border: 1px solid rgba(17,17,31,0.2);
  border-radius: 0.75rem;
  cursor: pointer;
  transition: background 0.2s;
}
.btn-back:hover { background: rgba(17,17,31,0.05); }
.btn-row { display: flex; gap: 0.75rem; margin-top: 1.25rem; }

/* Spinner */
.spinner {
  width: 1.25rem; height: 1.25rem;
  border: 2px solid rgba(255,255,255,0.4);
  border-top-color: #fff;
  border-radius: 9999px;
  animation: spin 0.7s linear infinite;
  display: inline-block;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Slot picker */
.slot-day { border: 1px solid rgba(17,17,31,0.1); border-radius: 0.75rem; padding: 1rem; margin-bottom: 0.75rem; }
.slot-day h4 { font-weight: 700; font-size: 0.875rem; color: var(--secondary); margin-bottom: 0.75rem; }
.slot-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0.5rem; }
@media (min-width: 400px) { .slot-grid { grid-template-columns: repeat(3, 1fr); } }
.slot-btn {
  padding: 0.5rem;
  border: 1px solid rgba(21,154,187,0.3);
  border-radius: 0.5rem;
  background: #fff;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--secondary);
  cursor: pointer;
  display: flex; align-items: center; justify-content: center; gap: 0.3rem;
  transition: all 0.2s;
}
.slot-btn:hover { border-color: var(--primary); background: rgba(21,154,187,0.05); transform: scale(1.04); }
.no-slots { font-size: 0.8rem; color: var(--highlight); font-style: italic; }

/* Success message in chat */
.success-msg { color: #16a34a; font-weight: 600; white-space: pre-line; }


.msg-avatar.bot-avatar{

}