/* ==============================================================================
   Garuda Customer Chatbot Widget — Modern Terracotta Styling
   Positioned above the voice mic dock at bottom: 88px; right: 24px;
   ============================================================================== */

:root {
  --chatbot-primary: #b8422a;
  --chatbot-primary-dark: #9c331c;
  --chatbot-primary-light: #fdf2f0;
  --chatbot-bg: #ffffff;
  --chatbot-border: #e2e8f0;
  --chatbot-text: #1e293b;
  --chatbot-text-muted: #64748b;
  --chatbot-shadow: 0 16px 48px rgba(15, 23, 42, 0.16), 0 4px 14px rgba(184, 66, 42, 0.12);
}

/* Floating Launcher Button */
.garuda-chatbot-launcher {
  position: fixed;
  bottom: 88px;
  right: 24px;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: linear-gradient(135deg, #b8422a 0%, #9c331c 100%);
  color: #ffffff;
  border: 2px solid #ffffff;
  box-shadow: 0 8px 24px rgba(184, 66, 42, 0.38), 0 2px 6px rgba(0, 0, 0, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 99980;
  transition: all 0.28s cubic-bezier(0.34, 1.56, 0.64, 1);
  outline: none;
}

.garuda-chatbot-launcher i {
  font-size: 23px;
  transition: transform 0.2s ease;
}

.garuda-chatbot-launcher:hover {
  transform: translateY(-3px) scale(1.06);
  box-shadow: 0 12px 28px rgba(184, 66, 42, 0.48);
}

.garuda-chatbot-launcher .chatbot-tooltip {
  position: absolute;
  right: calc(100% + 12px);
  top: 50%;
  transform: translateY(-50%);
  background: #1e293b;
  color: #ffffff;
  font-size: 12.5px;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: 8px;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.2s ease, transform 0.2s ease;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.garuda-chatbot-launcher:hover .chatbot-tooltip {
  opacity: 1;
  transform: translateY(-50%) translateX(-4px);
}

/* Floating Chatbot Window */
.garuda-chatbot-window {
  position: fixed;
  bottom: 148px;
  right: 24px;
  width: 390px;
  max-width: calc(100vw - 32px);
  height: 540px;
  max-height: calc(100vh - 170px);
  background: var(--chatbot-bg);
  border: 1px solid var(--chatbot-border);
  border-radius: 20px;
  box-shadow: var(--chatbot-shadow);
  display: none;
  flex-direction: column;
  z-index: 99995;
  overflow: hidden;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  animation: chatbotPopIn 0.26s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  transition: width 0.26s cubic-bezier(0.16, 1, 0.3, 1), height 0.26s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.2s ease;
}

.garuda-chatbot-window.is-open {
  display: flex;
}

.garuda-chatbot-window.is-maximized {
  width: 680px;
  max-width: calc(100vw - 32px);
  height: 750px;
  max-height: calc(100vh - 100px);
  bottom: 88px;
  right: 24px;
  box-shadow: 0 24px 72px rgba(15, 23, 42, 0.26), 0 8px 24px rgba(184, 66, 42, 0.18);
}

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

/* Header */
.garuda-chatbot-header {
  background: linear-gradient(135deg, #b8422a 0%, #9c331c 100%);
  color: #ffffff;
  padding: 14px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  flex-shrink: 0;
}

.chatbot-header-brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.chatbot-avatar-wrap {
  position: relative;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: #ffffff;
  padding: 2px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

.chatbot-avatar {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
}

.chatbot-online-dot {
  position: absolute;
  bottom: 0;
  right: 0;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #10b981;
  border: 2px solid #ffffff;
}

.chatbot-header-text h3 {
  font-size: 15px;
  font-weight: 800;
  margin: 0;
  color: #ffffff;
  display: flex;
  align-items: center;
  gap: 6px;
}

.chatbot-header-text p {
  font-size: 11.5px;
  margin: 2px 0 0 0;
  color: rgba(255, 255, 255, 0.85);
}

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

.chatbot-header-btn {
  background: rgba(255, 255, 255, 0.16);
  border: none;
  color: #ffffff;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
  font-size: 13px;
  padding: 0;
}

.chatbot-header-btn:hover {
  background: rgba(255, 255, 255, 0.28);
  transform: scale(1.08);
}

.chatbot-header-close:hover {
  background: rgba(255, 255, 255, 0.28);
  transform: rotate(90deg);
}

/* Quick Topic Chips */
.chatbot-chips-container {
  padding: 10px 14px;
  background: #f8fafc;
  border-bottom: 1px solid var(--chatbot-border);
  display: flex;
  gap: 6px;
  overflow-x: auto;
  white-space: nowrap;
  scrollbar-width: none;
  flex-shrink: 0;
}

.chatbot-chips-container::-webkit-scrollbar {
  display: none;
}

.chatbot-quick-chip {
  background: #ffffff;
  border: 1px solid #cbd5e1;
  color: #334155;
  font-size: 11.5px;
  font-weight: 700;
  padding: 5px 11px;
  border-radius: 14px;
  cursor: pointer;
  transition: all 0.18s ease;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.chatbot-quick-chip:hover {
  background: var(--chatbot-primary-light);
  border-color: var(--chatbot-primary);
  color: var(--chatbot-primary);
  transform: translateY(-1px);
}

/* Conversation Body */
.garuda-chatbot-messages {
  flex: 1;
  padding: 16px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
  background: #fdfbf9;
}

.chatbot-msg-row {
  display: flex;
  gap: 8px;
  max-width: 86%;
}

.chatbot-msg-row.user {
  align-self: flex-end;
  flex-direction: row-reverse;
}

.chatbot-msg-row.bot {
  align-self: flex-start;
}

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

.chatbot-msg-bubble.user {
  background: var(--chatbot-primary);
  color: #ffffff;
  border-bottom-right-radius: 4px;
}

.chatbot-msg-bubble.bot {
  background: #ffffff;
  color: var(--chatbot-text);
  border: 1px solid var(--chatbot-border);
  border-bottom-left-radius: 4px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.02);
}

.chatbot-msg-bubble.bot a {
  color: var(--chatbot-primary);
  font-weight: 700;
  text-decoration: underline;
}

.chatbot-msg-bubble.bot strong {
  color: #0f172a;
}

.chatbot-msg-bubble.bot ul {
  margin: 6px 0 6px 16px;
  padding: 0;
}

.chatbot-msg-bubble.bot li {
  margin-bottom: 4px;
}

.chatbot-msg-time {
  font-size: 10.5px;
  color: #94a3b8;
  margin-top: 3px;
}

.chatbot-msg-row.user .chatbot-msg-time {
  text-align: right;
}

/* Typing Indicator */
.chatbot-typing-indicator {
  display: none;
  align-items: center;
  gap: 4px;
  padding: 10px 14px;
  background: #ffffff;
  border: 1px solid var(--chatbot-border);
  border-radius: 14px;
  width: fit-content;
  border-bottom-left-radius: 4px;
}

.chatbot-typing-dot {
  width: 7px;
  height: 7px;
  background: var(--chatbot-primary);
  border-radius: 50%;
  animation: chatbotTypingPulse 1.2s infinite ease-in-out;
}

.chatbot-typing-dot:nth-child(2) { animation-delay: 0.2s; }
.chatbot-typing-dot:nth-child(3) { animation-delay: 0.4s; }

@keyframes chatbotTypingPulse {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.4; }
  30% { transform: translateY(-4px); opacity: 1; }
}

/* Composer / Input Area */
.garuda-chatbot-composer {
  padding: 10px 14px;
  background: #ffffff;
  border-top: 1px solid var(--chatbot-border);
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.chatbot-composer-input {
  flex: 1;
  border: 1px solid #cbd5e1;
  border-radius: 22px;
  padding: 9px 14px;
  font-size: 13px;
  color: var(--chatbot-text);
  background: #f8fafc;
  outline: none;
  transition: all 0.2s ease;
}

.chatbot-composer-input:focus {
  background: #ffffff;
  border-color: var(--chatbot-primary);
  box-shadow: 0 0 0 3px rgba(184, 66, 42, 0.1);
}

.chatbot-btn-mic {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid #cbd5e1;
  background: #ffffff;
  color: #64748b;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.chatbot-btn-mic:hover {
  border-color: var(--chatbot-primary);
  color: var(--chatbot-primary);
  background: var(--chatbot-primary-light);
}

.chatbot-btn-mic.is-recording {
  background: #ef4444 !important;
  color: #ffffff !important;
  border-color: #ef4444 !important;
  animation: chatbotMicPulse 1.2s infinite ease-in-out;
}

@keyframes chatbotMicPulse {
  0%, 100% { box-shadow: 0 0 0 2px rgba(239, 68, 68, 0.25); }
  50% { box-shadow: 0 0 0 6px rgba(239, 68, 68, 0.45); }
}

.chatbot-btn-send {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: none;
  background: var(--chatbot-primary);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.chatbot-btn-send:hover {
  background: var(--chatbot-primary-dark);
  transform: scale(1.05);
}

.chatbot-btn-send:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

/* Mobile Responsiveness */
@media (max-width: 991px) {
  .garuda-chatbot-launcher {
    bottom: 130px !important;
    right: 16px !important;
    width: 48px !important;
    height: 48px !important;
  }
}

@media (max-width: 480px) {
  .garuda-chatbot-launcher {
    bottom: 130px !important;
    right: 16px !important;
    width: 46px !important;
    height: 46px !important;
  }
  .garuda-chatbot-window {
    bottom: 0 !important;
    right: 0 !important;
    left: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
    height: 82vh !important;
    max-height: 82vh !important;
    border-radius: 20px 20px 0 0 !important;
  }
}
