/* ==========================================================================
   Smart Abroad Global - Intelligent Live AI Chatbot Widget
   100% GoDaddy / Static Hosting Compatible • Fully Responsive
   ========================================================================== */

:root {
  --chat-primary: #0F172A;
  --chat-accent: #2563EB;
  --chat-accent-hover: #1D4ED8;
  --chat-lime: #84CC16;
  --chat-bg: #FFFFFF;
  --chat-surface: #F8FAFC;
  --chat-border: #E2E8F0;
  --chat-ink: #0F172A;
  --chat-ink-soft: #475569;
  --chat-ink-muted: #94A3B8;
  --chat-shadow: 0 20px 45px -10px rgba(15, 23, 42, 0.25), 0 8px 18px -6px rgba(15, 23, 42, 0.15);
}

/* 1. Floating Launcher Button */
.smart-chat-launcher {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: linear-gradient(135deg, #0F172A 0%, #1E3A8A 50%, #2563EB 100%);
  color: #FFFFFF;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 10px 28px rgba(37, 99, 235, 0.38), 0 4px 10px rgba(15, 23, 42, 0.2);
  cursor: pointer;
  z-index: 9995;
  transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.25s ease;
  border: 2px solid rgba(255, 255, 255, 0.2);
  outline: none;
}

.smart-chat-launcher:hover {
  transform: scale(1.08) translateY(-2px);
  box-shadow: 0 16px 36px rgba(37, 99, 235, 0.48), 0 6px 14px rgba(15, 23, 42, 0.25);
}

.smart-chat-launcher:active {
  transform: scale(0.96);
}

.smart-chat-launcher-icon {
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.3s ease, opacity 0.2s ease;
}

.smart-chat-launcher .close-icon {
  display: none;
}

.smart-chat-launcher.is-active .chat-icon {
  display: none;
}

.smart-chat-launcher.is-active .close-icon {
  display: flex;
}

/* Online Pulse Status Dot */
.smart-chat-online-dot {
  position: absolute;
  top: 3px;
  right: 3px;
  width: 14px;
  height: 14px;
  background: #84CC16;
  border: 2.5px solid #FFFFFF;
  border-radius: 50%;
  box-shadow: 0 0 0 0 rgba(132, 204, 22, 0.7);
  animation: smart-pulse 2s infinite;
}

@keyframes smart-pulse {
  0% { box-shadow: 0 0 0 0 rgba(132, 204, 22, 0.7); }
  70% { box-shadow: 0 0 0 8px rgba(132, 204, 22, 0); }
  100% { box-shadow: 0 0 0 0 rgba(132, 204, 22, 0); }
}

/* Greeting Tooltip Pill */
.smart-chat-tooltip {
  position: fixed;
  bottom: 34px;
  right: 96px;
  background: #0F172A;
  color: #FFFFFF;
  padding: 10px 16px;
  border-radius: 14px;
  font-size: 0.85rem;
  font-weight: 600;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
  z-index: 9994;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transform: translateX(10px);
  transition: opacity 0.3s ease, transform 0.3s ease;
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.smart-chat-tooltip.is-visible {
  opacity: 1;
  transform: translateX(0);
}

.smart-chat-tooltip::after {
  content: "";
  position: absolute;
  right: -6px;
  top: 50%;
  transform: translateY(-50%);
  border-width: 6px 0 6px 6px;
  border-style: solid;
  border-color: transparent transparent transparent #0F172A;
}

/* 2. Chatbot Main Window */
.smart-chat-window {
  position: fixed;
  bottom: 96px;
  right: 24px;
  width: 385px;
  max-width: calc(100vw - 32px);
  height: 580px;
  max-height: calc(100vh - 120px);
  background: var(--chat-bg);
  border-radius: 24px;
  box-shadow: var(--chat-shadow);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  z-index: 10000;
  border: 1px solid var(--chat-border);
  opacity: 0;
  visibility: hidden;
  transform: translateY(20px) scale(0.96);
  transform-origin: bottom right;
  transition: opacity 0.25s cubic-bezier(0.16, 1, 0.3, 1),
              transform 0.25s cubic-bezier(0.16, 1, 0.3, 1),
              visibility 0.25s;
}

.smart-chat-window.is-open {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
}

/* Chat Header */
.smart-chat-header {
  background: linear-gradient(135deg, #0F172A 0%, #1E293B 100%);
  color: #FFFFFF;
  padding: 16px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  flex-shrink: 0;
}

.smart-chat-brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.smart-chat-avatar {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: linear-gradient(135deg, #2563EB 0%, #38BDF8 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #FFFFFF;
  font-weight: 800;
  font-size: 1.1rem;
  position: relative;
  box-shadow: 0 4px 10px rgba(37, 99, 235, 0.3);
  flex-shrink: 0;
}

.smart-chat-avatar-dot {
  position: absolute;
  bottom: 0;
  right: 0;
  width: 11px;
  height: 11px;
  background: #84CC16;
  border: 2px solid #0F172A;
  border-radius: 50%;
}

.smart-chat-meta h3 {
  margin: 0;
  font-size: 0.98rem;
  font-weight: 700;
  color: #FFFFFF;
  letter-spacing: -0.01em;
  display: flex;
  align-items: center;
  gap: 6px;
}

.smart-chat-badge {
  font-size: 9px;
  font-weight: 800;
  background: rgba(132, 204, 22, 0.2);
  color: #A3E635;
  border: 1px solid rgba(132, 204, 22, 0.3);
  padding: 1px 6px;
  border-radius: 8px;
  text-transform: uppercase;
}

.smart-chat-meta p {
  margin: 2px 0 0 0;
  font-size: 0.76rem;
  color: #94A3B8;
  display: flex;
  align-items: center;
  gap: 5px;
}

.smart-chat-meta p span {
  width: 6px;
  height: 6px;
  background: #84CC16;
  border-radius: 50%;
  display: inline-block;
}

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

.smart-chat-btn-icon {
  background: transparent;
  border: none;
  color: #94A3B8;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s;
}

.smart-chat-btn-icon:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #FFFFFF;
}

/* Chat Messages Container */
.smart-chat-body {
  flex: 1;
  padding: 18px 16px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 14px;
  background: #F8FAFC;
  scroll-behavior: smooth;
}

.smart-chat-body::-webkit-scrollbar {
  width: 5px;
}

.smart-chat-body::-webkit-scrollbar-track {
  background: transparent;
}

.smart-chat-body::-webkit-scrollbar-thumb {
  background: #CBD5E1;
  border-radius: 4px;
}

/* Message Rows */
.smart-chat-msg {
  display: flex;
  flex-direction: column;
  max-width: 86%;
  animation: smart-msg-in 0.25s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes smart-msg-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.smart-chat-msg.bot {
  align-self: flex-start;
}

.smart-chat-msg.user {
  align-self: flex-end;
}

.smart-chat-bubble {
  padding: 12px 16px;
  border-radius: 18px;
  font-size: 0.9rem;
  line-height: 1.55;
  word-break: break-word;
  position: relative;
}

.smart-chat-msg.bot .smart-chat-bubble {
  background: #FFFFFF;
  color: #1E293B;
  border: 1px solid #E2E8F0;
  border-bottom-left-radius: 4px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.04);
}

.smart-chat-msg.user .smart-chat-bubble {
  background: linear-gradient(135deg, #2563EB 0%, #1D4ED8 100%);
  color: #FFFFFF;
  border-bottom-right-radius: 4px;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.25);
}

.smart-chat-time {
  font-size: 0.7rem;
  color: #94A3B8;
  margin-top: 4px;
  padding: 0 4px;
}

.smart-chat-msg.user .smart-chat-time {
  text-align: right;
}

/* Quick Action Suggestion Chips */
.smart-chat-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 6px;
}

.smart-chat-chip {
  background: #FFFFFF;
  color: #1E3A8A;
  border: 1px solid #BFDBFE;
  padding: 7px 12px;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}

.smart-chat-chip:hover {
  background: #EFF6FF;
  border-color: #3B82F6;
  color: #1D4ED8;
  transform: translateY(-1px);
}

/* Direct Action Buttons inside bot bubble */
.smart-chat-cta-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: #2563EB;
  color: #FFFFFF !important;
  font-size: 0.82rem;
  font-weight: 700;
  padding: 8px 14px;
  border-radius: 10px;
  text-decoration: none;
  margin-top: 10px;
  margin-right: 6px;
  transition: background 0.2s, transform 0.2s;
  box-shadow: 0 2px 6px rgba(37, 99, 235, 0.25);
}

.smart-chat-cta-btn:hover {
  background: #1D4ED8;
  transform: translateY(-1px);
}

.smart-chat-cta-btn.whatsapp {
  background: #16A34A;
  box-shadow: 0 2px 6px rgba(22, 163, 74, 0.25);
}

.smart-chat-cta-btn.whatsapp:hover {
  background: #15803D;
}

/* Typing Indicator Animation */
.smart-chat-typing {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 10px 14px;
  background: #FFFFFF;
  border: 1px solid #E2E8F0;
  border-radius: 18px;
  border-bottom-left-radius: 4px;
  width: fit-content;
}

.smart-chat-typing span {
  width: 7px;
  height: 7px;
  background: #94A3B8;
  border-radius: 50%;
  animation: smart-typing-dot 1.4s infinite ease-in-out both;
}

.smart-chat-typing span:nth-child(1) { animation-delay: -0.32s; }
.smart-chat-typing span:nth-child(2) { animation-delay: -0.16s; }

@keyframes smart-typing-dot {
  0%, 80%, 100% { transform: scale(0.6); opacity: 0.4; }
  40% { transform: scale(1); opacity: 1; background: #2563EB; }
}

/* Chat Footer & Input Area */
.smart-chat-footer {
  padding: 12px 14px;
  background: #FFFFFF;
  border-top: 1px solid #E2E8F0;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.smart-chat-input-wrapper {
  flex: 1;
  position: relative;
  display: flex;
  align-items: center;
}

.smart-chat-input {
  width: 100%;
  border: 1.5px solid #CBD5E1;
  border-radius: 24px;
  padding: 10px 16px;
  font-size: 0.9rem;
  font-family: inherit;
  outline: none;
  background: #F8FAFC;
  color: #0F172A;
  transition: all 0.2s ease;
}

.smart-chat-input:focus {
  border-color: #2563EB;
  background: #FFFFFF;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.smart-chat-send-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: #2563EB;
  color: #FFFFFF;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: all 0.2s ease;
  box-shadow: 0 4px 10px rgba(37, 99, 235, 0.3);
}

.smart-chat-send-btn:hover {
  background: #1D4ED8;
  transform: scale(1.05);
}

.smart-chat-send-btn:active {
  transform: scale(0.95);
}

.smart-chat-send-btn:disabled {
  background: #CBD5E1;
  box-shadow: none;
  cursor: not-allowed;
  transform: none;
}

/* WhatsApp Fast Launcher Pill inside chat */
.smart-chat-wa-quick {
  display: flex;
  align-items: center;
  justify-content: center;
  background: #F0FDF4;
  color: #166534;
  border-top: 1px solid #DCFCE7;
  padding: 7px 12px;
  font-size: 0.78rem;
  font-weight: 600;
  gap: 6px;
  text-decoration: none;
  transition: background 0.2s;
}

.smart-chat-wa-quick:hover {
  background: #DCFCE7;
  color: #14532D;
}

/* ==========================================================================
   RESPONSIVE DESIGN (Mobile, Tablet, Laptop)
   ========================================================================== */

/* Tablet (max-width: 820px) */
@media (max-width: 820px) {
  .smart-chat-window {
    width: 360px;
    height: 520px;
    bottom: 88px;
    right: 20px;
  }
  .smart-chat-launcher {
    bottom: 20px;
    right: 20px;
  }
  .smart-chat-tooltip {
    bottom: 30px;
    right: 88px;
  }
}

/* Mobile Screens (max-width: 540px) */
@media (max-width: 540px) {
  .smart-chat-window {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100vw;
    height: 100dvh;
    max-height: 100dvh;
    max-width: 100vw;
    border-radius: 0;
    border: none;
    box-shadow: none;
    transform: translateY(100%);
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  }

  .smart-chat-window.is-open {
    transform: translateY(0);
  }

  .smart-chat-header {
    padding: 14px 16px;
    padding-top: calc(14px + env(safe-area-inset-top, 0px));
  }

  .smart-chat-footer {
    padding: 10px 12px;
    padding-bottom: calc(10px + env(safe-area-inset-bottom, 0px));
  }

  .smart-chat-launcher {
    bottom: 18px;
    right: 18px;
    width: 54px;
    height: 54px;
  }

  .smart-chat-tooltip {
    display: none !important;
  }
}
