/* Grav AI Chatbot Glassmorphic Widget Styling */
.grav-chatbot-container {
  position: fixed;
  z-index: 99999;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  box-sizing: border-box;
}

.grav-chatbot-container.bottom-right {
  bottom: 24px;
  right: 24px;
}

.grav-chatbot-container.bottom-left {
  bottom: 24px;
  left: 24px;
}

/* Notification Toast */
.grav-chatbot-toast {
  position: absolute;
  bottom: 70px;
  width: 260px;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(229, 231, 235, 0.8);
  border-radius: 12px;
  padding: 12px 14px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.12);
  font-size: 13px;
  color: #1f2937;
  line-height: 1.4;
  display: none;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  animation: gravToastFade 0.3s ease;
  cursor: pointer;
}

.grav-chatbot-toast.active {
  display: flex !important;
}

.grav-chatbot-container.bottom-right .grav-chatbot-toast { right: 0; }
.grav-chatbot-container.bottom-left .grav-chatbot-toast { left: 0; }

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

.grav-chatbot-toast-close {
  background: transparent;
  border: none;
  font-size: 16px;
  color: #9ca3af;
  cursor: pointer;
  padding: 0;
  line-height: 1;
}

.grav-chatbot-toast-close:hover { color: #4b5563; }

/* Launcher Button */
.grav-chatbot-launcher {
  width: 56px;
  height: 56px;
  border-radius: 28px;
  border: none;
  background: #3b82f6;
  color: #ffffff;
  box-shadow: 0 8px 24px rgba(59, 130, 246, 0.4);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.grav-chatbot-launcher:hover {
  transform: scale(1.06);
  box-shadow: 0 12px 28px rgba(59, 130, 246, 0.5);
}

/* Chat Window Box */
.grav-chatbot-window {
  position: absolute;
  bottom: 72px;
  width: 360px;
  height: 500px;
  max-width: calc(100vw - 32px);
  max-height: calc(100vh - 100px);
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.4);
  border-radius: 18px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.15);
  display: none;
  flex-direction: column;
  overflow: hidden;
  animation: gravChatbotSlideUp 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.grav-chatbot-window.active {
  display: flex !important;
}

.grav-chatbot-container.bottom-right .grav-chatbot-window { right: 0; }
.grav-chatbot-container.bottom-left .grav-chatbot-window { left: 0; }

@keyframes gravChatbotSlideUp {
  from { opacity: 0; transform: translateY(16px) scale(0.96); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.grav-chatbot-header {
  padding: 14px 18px;
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-weight: 600;
  font-size: 15px;
}

.grav-chatbot-status-dot {
  width: 8px;
  height: 8px;
  background-color: #10b981;
  border-radius: 50%;
  display: inline-block;
  margin-right: 8px;
}

.grav-chatbot-header-close {
  background: transparent;
  border: none;
  color: #ffffff;
  font-size: 22px;
  cursor: pointer;
  line-height: 1;
}

.grav-chatbot-messages {
  flex: 1;
  padding: 16px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.grav-chatbot-msg {
  display: flex;
  max-width: 85%;
}

.grav-chatbot-msg.user { align-self: flex-end; }
.grav-chatbot-msg.assistant { align-self: flex-start; }

.grav-chatbot-bubble {
  padding: 10px 14px;
  border-radius: 14px;
  font-size: 14px;
  line-height: 1.45;
  word-break: break-word;
}

.grav-chatbot-msg.user .grav-chatbot-bubble {
  background-color: #3b82f6;
  color: #ffffff;
  border-bottom-right-radius: 4px;
}

.grav-chatbot-msg.assistant .grav-chatbot-bubble {
  background-color: rgba(243, 244, 246, 0.9);
  color: #1f2937;
  border-bottom-left-radius: 4px;
  border: 1px solid rgba(229, 231, 235, 0.8);
}

.grav-chatbot-badge {
  display: inline-block;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 2px 6px;
  border-radius: 4px;
  margin-bottom: 4px;
  font-weight: 700;
}

.grav-chatbot-badge.faq {
  background-color: #d1fae5;
  color: #065f46;
}

/* FAQ Confirmation Box */
.grav-chatbot-confirm-box {
  margin-top: 8px;
  padding-top: 6px;
  border-top: 1px dashed rgba(209, 213, 219, 0.8);
  font-size: 12px;
}

.grav-chatbot-confirm-label {
  display: block;
  font-size: 11px;
  color: #6b7280;
  margin-bottom: 6px;
}

.grav-chatbot-confirm-buttons {
  display: flex;
  gap: 6px;
}

.grav-chatbot-confirm-btn {
  padding: 4px 10px;
  font-size: 11px;
  border-radius: 12px;
  border: 1px solid #d1d5db;
  background: #ffffff;
  color: #374151;
  cursor: pointer;
  transition: all 0.15s ease;
}

.grav-chatbot-confirm-btn.yes:hover {
  background: #d1fae5;
  border-color: #10b981;
  color: #065f46;
}

.grav-chatbot-confirm-btn.no:hover {
  background: #fee2e2;
  border-color: #ef4444;
  color: #991b1b;
}

.grav-chatbot-confirm-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.grav-chatbot-quick-actions {
  padding: 8px 12px;
  display: flex;
  gap: 6px;
  overflow-x: auto;
  border-top: 1px solid rgba(229, 231, 235, 0.5);
  background: rgba(255, 255, 255, 0.5);
}

.grav-chatbot-pill {
  white-space: nowrap;
  font-size: 12px;
  padding: 5px 10px;
  border-radius: 12px;
  border: 1px solid rgba(209, 213, 219, 0.8);
  background: #ffffff;
  color: #374151;
  cursor: pointer;
  transition: background 0.15s ease;
}

.grav-chatbot-pill:hover { background: #f3f4f6; }

.grav-chatbot-input-area {
  padding: 12px;
  display: flex;
  gap: 8px;
  background: rgba(255, 255, 255, 0.9);
  border-top: 1px solid rgba(229, 231, 235, 0.8);
}

.grav-chatbot-input-area input {
  flex: 1;
  padding: 10px 14px;
  border-radius: 20px;
  border: 1px solid #d1d5db;
  font-size: 14px;
  outline: none;
}

.grav-chatbot-input-area input:focus { border-color: #3b82f6; }

.grav-chatbot-input-area button {
  width: 38px;
  height: 38px;
  border-radius: 19px;
  border: none;
  background: #3b82f6;
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.grav-chatbot-disclaimer {
  padding: 4px 12px 10px 12px;
  font-size: 11px;
  color: #6b7280;
  text-align: center;
  background: rgba(255, 255, 255, 0.9);
  border-top: none;
  line-height: 1.3;
}

/* Theme Presets */
.theme-emerald_dark .grav-chatbot-launcher,
.theme-emerald_dark .grav-chatbot-header,
.theme-emerald_dark .grav-chatbot-msg.user .grav-chatbot-bubble,
.theme-emerald_dark .grav-chatbot-input-area button {
  background: #059669 !important;
}

.theme-emerald_dark .grav-chatbot-window {
  background: rgba(15, 23, 42, 0.92);
  border-color: rgba(51, 65, 85, 0.8);
}

.theme-emerald_dark .grav-chatbot-msg.assistant .grav-chatbot-bubble {
  background: #1e293b;
  color: #f8fafc;
  border-color: #334155;
}

.theme-emerald_dark .grav-chatbot-input-area {
  background: #0f172a;
  border-top-color: #334155;
}

.theme-emerald_dark .grav-chatbot-disclaimer {
  background: #0f172a;
  color: #94a3b8;
}

.theme-emerald_dark .grav-chatbot-input-area input {
  background: #1e293b;
  color: #f8fafc;
  border-color: #334155;
}

.theme-purple_haze .grav-chatbot-launcher,
.theme-purple_haze .grav-chatbot-header,
.theme-purple_haze .grav-chatbot-msg.user .grav-chatbot-bubble,
.theme-purple_haze .grav-chatbot-input-area button {
  background: #8b5cf6 !important;
}

.theme-sunset_orange .grav-chatbot-launcher,
.theme-sunset_orange .grav-chatbot-header,
.theme-sunset_orange .grav-chatbot-msg.user .grav-chatbot-bubble,
.theme-sunset_orange .grav-chatbot-input-area button {
  background: #f97316 !important;
}
