/**
 * Shree Basavanna Tours & Travels - Static Frontend Chatbot Stylesheet
 * Brand Color Harmony: #F4C401 (Taxi Gold/Yellow), #0A0A0B (Obsidian Dark), #25D366 (WhatsApp Green)
 */

/* ==========================================================================
   FLOATING LAUNCHER BUTTON (Bottom-Left Corner)
   ========================================================================== */
.floating-chatbot-launcher {
  position: fixed;
  bottom: max(24px, env(safe-area-inset-bottom));
  left: max(24px, env(safe-area-inset-left));
  z-index: 1300;
  display: flex;
  align-items: center;
  pointer-events: auto;
}

.floating-chatbot-btn {
  background: linear-gradient(135deg, #1A1A1E 0%, #0A0A0B 100%);
  color: #F4C401 !important;
  border: 2px solid rgba(244, 196, 1, 0.45);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.6), 0 0 15px rgba(244, 196, 1, 0.25);
  cursor: pointer;
  position: relative;
  width: 54px;
  height: 54px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.55rem;
  transition: transform 0.28s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.28s ease, border-color 0.28s ease;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  outline: none;
}

.floating-chatbot-btn:hover {
  transform: translateY(-4px) scale(1.08);
  border-color: #F4C401;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.75), 0 0 25px rgba(244, 196, 1, 0.5);
  color: #F4C401 !important;
}

.floating-chatbot-btn:active {
  transform: translateY(0) scale(0.96);
}

.floating-chatbot-btn .floating-pulse-ring {
  border: 2px solid #F4C401;
  animation: floatRingPulse 2.8s infinite cubic-bezier(0.25, 1, 0.5, 1);
  animation-delay: 0.6s;
}

.floating-chatbot-btn.active-open {
  background: #F4C401;
  color: #0A0A0B !important;
  border-color: #F4C401;
  box-shadow: 0 8px 25px rgba(244, 196, 1, 0.6);
}

.floating-chatbot-btn.active-open .floating-pulse-ring {
  display: none;
}

.floating-chatbot-btn .chat-icon-close {
  display: none;
  font-size: 1.35rem;
}

.floating-chatbot-btn.active-open .chat-icon-msg {
  display: none;
}

.floating-chatbot-btn.active-open .chat-icon-close {
  display: inline-block;
}

/* ==========================================================================
   PERMANENT FLOATING CALLOUT BUBBLE (Always Visible with Cross Dismiss Button)
   ========================================================================== */
.floating-chatbot-callout {
  position: absolute;
  left: calc(100% + 12px);
  top: 50%;
  transform: translateY(-50%);
  background: rgba(14, 14, 18, 0.96);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1.5px solid rgba(244, 196, 1, 0.45);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.75), 0 0 18px rgba(244, 196, 1, 0.2);
  border-radius: 12px;
  padding: 6px 10px 6px 12px;
  display: flex;
  align-items: center;
  gap: 10px;
  white-space: nowrap;
  user-select: none;
  z-index: 1301;
  animation: sbttCalloutSlideIn 0.4s cubic-bezier(0.16, 1, 0.3, 1) both;
  transition: opacity 0.25s ease, transform 0.25s ease, visibility 0.25s ease;
}

.floating-chatbot-callout::before {
  content: '';
  position: absolute;
  left: -6px;
  top: 50%;
  transform: translateY(-50%) rotate(45deg);
  width: 10px;
  height: 10px;
  background: rgba(14, 14, 18, 0.96);
  border-left: 1.5px solid rgba(244, 196, 1, 0.45);
  border-bottom: 1.5px solid rgba(244, 196, 1, 0.45);
}

.floating-chatbot-callout .callout-content {
  display: flex;
  flex-direction: column;
  cursor: pointer;
}

.floating-chatbot-callout .callout-tag {
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  color: #F4C401;
  letter-spacing: 0.5px;
  line-height: 1.2;
}

.floating-chatbot-callout .callout-text {
  font-size: 0.82rem;
  font-weight: 600;
  color: #FFFFFF;
  line-height: 1.3;
}

.floating-chatbot-callout .callout-close-btn {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: rgba(255, 255, 255, 0.7);
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  cursor: pointer;
  transition: all 0.2s ease;
  padding: 0;
  outline: none;
  flex-shrink: 0;
}

.floating-chatbot-callout .callout-close-btn:hover {
  background: rgba(244, 196, 1, 0.25);
  color: #F4C401;
  border-color: #F4C401;
  transform: scale(1.1);
}

.floating-chatbot-callout.dismissed,
.floating-chatbot-btn.active-open ~ .floating-chatbot-callout {
  opacity: 0 !important;
  visibility: hidden !important;
  pointer-events: none !important;
  transform: translateY(-50%) translateX(-8px) !important;
}

@keyframes sbttCalloutSlideIn {
  from {
    opacity: 0;
    transform: translateY(-50%) translateX(-12px);
  }
  to {
    opacity: 1;
    transform: translateY(-50%) translateX(0);
  }
}

/* ==========================================================================
   CHATBOT PANEL (Main Window Container - Bottom-Left Position)
   ========================================================================== */
.sbtt-chat-panel {
  position: fixed;
  bottom: calc(max(24px, env(safe-area-inset-bottom)) + 74px);
  left: max(24px, env(safe-area-inset-left));
  right: auto;
  width: 380px;
  max-width: calc(100vw - 36px);
  height: 560px;
  max-height: calc(100vh - 130px);
  background: #0D0D10;
  border: 1px solid rgba(244, 196, 1, 0.25);
  border-radius: 18px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.85), 0 0 30px rgba(244, 196, 1, 0.12);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  z-index: 1400;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(20px) scale(0.95);
  transform-origin: bottom left;
  transition: opacity 0.3s cubic-bezier(0.16, 1, 0.3, 1),
              transform 0.3s cubic-bezier(0.16, 1, 0.3, 1),
              visibility 0.3s ease;
  font-family: 'Outfit', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.sbtt-chat-panel.open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateY(0) scale(1);
}

/* ==========================================================================
   CHATBOT HEADER
   ========================================================================== */
.sbtt-chat-header {
  background: linear-gradient(135deg, #16161B 0%, #0A0A0B 100%);
  border-bottom: 1px solid rgba(244, 196, 1, 0.2);
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
  position: relative;
}

.sbtt-chat-avatar {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: rgba(244, 196, 1, 0.12);
  border: 1.5px solid rgba(244, 196, 1, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: #F4C401;
  font-size: 1.35rem;
  overflow: hidden;
}

.sbtt-chat-avatar img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 4px;
}

.sbtt-chat-header-info {
  flex: 1;
  min-width: 0;
}

.sbtt-chat-header-title {
  color: #FFFFFF;
  font-size: 0.96rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  margin: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: flex;
  align-items: center;
  gap: 6px;
}

.sbtt-chat-header-title .sbtt-badge-verified {
  color: #F4C401;
  font-size: 0.85rem;
}

.sbtt-chat-header-status {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.74rem;
  color: rgba(255, 255, 255, 0.7);
  margin-top: 2px;
}

.sbtt-chat-status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #25D366;
  box-shadow: 0 0 8px #25D366;
  display: inline-block;
  animation: sbttStatusPulse 2s infinite ease-in-out;
}

@keyframes sbttStatusPulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(0.85); }
}

.sbtt-chat-close-btn {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: rgba(255, 255, 255, 0.85);
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 1.1rem;
  transition: all 0.2s ease;
  outline: none;
  flex-shrink: 0;
}

.sbtt-chat-close-btn:hover {
  background: rgba(244, 196, 1, 0.2);
  color: #F4C401;
  border-color: #F4C401;
  transform: rotate(90deg);
}

/* ==========================================================================
   CHAT BODY & MESSAGES
   ========================================================================== */
.sbtt-chat-body {
  flex: 1 1 auto;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  background: radial-gradient(circle at 50% 0%, rgba(244, 196, 1, 0.03) 0%, transparent 60%), #0D0D10;
  overscroll-behavior: contain;
}

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

.sbtt-chat-body::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.02);
}

.sbtt-chat-body::-webkit-scrollbar-thumb {
  background: rgba(244, 196, 1, 0.35);
  border-radius: 4px;
}

.sbtt-chat-body::-webkit-scrollbar-thumb:hover {
  background: #F4C401;
}

/* Bot Message Bubble */
.sbtt-msg-bot {
  align-self: flex-start;
  max-width: 90%;
  background: #17171C;
  border: 1px solid rgba(255, 255, 255, 0.09);
  color: #EEEEF0;
  padding: 12px 15px;
  border-radius: 16px 16px 16px 4px;
  font-size: 0.84rem;
  line-height: 1.55;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.35);
  animation: sbttFadeInUp 0.26s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.sbtt-msg-bot p {
  margin: 0 0 8px 0;
}

.sbtt-msg-bot p:last-child {
  margin-bottom: 0;
}

.sbtt-msg-bot strong {
  color: #F4C401;
  font-weight: 700;
}

.sbtt-msg-bot ul {
  margin: 6px 0 8px 0;
  padding-left: 18px;
}

.sbtt-msg-bot li {
  margin-bottom: 4px;
  color: rgba(255, 255, 255, 0.88);
}

/* User Message Bubble */
.sbtt-msg-user {
  align-self: flex-end;
  max-width: 85%;
  background: linear-gradient(135deg, #F4C401 0%, #E5A800 100%);
  color: #0A0A0B;
  font-weight: 600;
  padding: 10px 14px;
  border-radius: 16px 16px 4px 16px;
  font-size: 0.84rem;
  line-height: 1.45;
  box-shadow: 0 4px 16px rgba(244, 196, 1, 0.25);
  animation: sbttFadeInUp 0.26s cubic-bezier(0.16, 1, 0.3, 1) both;
  word-break: break-word;
}

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

/* Typing Animated Indicator */
.sbtt-typing-indicator {
  align-self: flex-start;
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 10px 14px;
  background: #17171C;
  border: 1px solid rgba(244, 196, 1, 0.2);
  border-radius: 16px 16px 16px 4px;
  width: fit-content;
  animation: sbttFadeInUp 0.2s ease both;
}

.sbtt-typing-dot {
  width: 6px;
  height: 6px;
  background: #F4C401;
  border-radius: 50%;
  animation: sbttBounceDot 1.2s infinite ease-in-out;
}

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

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

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

/* ==========================================================================
   QUICK ACTION BUTTONS & CHIPS
   ========================================================================== */
.sbtt-action-chips {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 10px;
}

.sbtt-action-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  margin-top: 8px;
}

.sbtt-chip-btn {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #F8F9FA;
  padding: 8px 12px;
  border-radius: 10px;
  font-size: 0.78rem;
  font-family: inherit;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.22s ease;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 7px;
  text-align: left;
  text-decoration: none;
  outline: none;
  user-select: none;
}

.sbtt-chip-btn i {
  color: #F4C401;
  font-size: 0.95rem;
  flex-shrink: 0;
}

.sbtt-chip-btn:hover {
  background: rgba(244, 196, 1, 0.15);
  border-color: #F4C401;
  color: #FFFFFF;
  transform: translateX(3px);
}

.sbtt-chip-btn.chip-primary {
  background: linear-gradient(135deg, #F4C401 0%, #d4a700 100%);
  color: #0A0A0B;
  font-weight: 700;
  border-color: #F4C401;
  box-shadow: 0 4px 12px rgba(244, 196, 1, 0.25);
}

.sbtt-chip-btn.chip-primary i {
  color: #0A0A0B;
}

.sbtt-chip-btn.chip-primary:hover {
  background: #FFE089;
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(244, 196, 1, 0.4);
}

.sbtt-chip-btn.chip-whatsapp {
  background: rgba(37, 211, 102, 0.12);
  border-color: rgba(37, 211, 102, 0.35);
  color: #25D366;
  font-weight: 600;
}

.sbtt-chip-btn.chip-whatsapp i {
  color: #25D366;
}

.sbtt-chip-btn.chip-whatsapp:hover {
  background: #25D366;
  color: #FFFFFF;
  border-color: #25D366;
}

.sbtt-chip-btn.chip-whatsapp:hover i {
  color: #FFFFFF;
}

.sbtt-chip-btn.chip-call {
  background: rgba(244, 196, 1, 0.12);
  border-color: rgba(244, 196, 1, 0.3);
  color: #F4C401;
  font-weight: 600;
}

.sbtt-chip-btn.chip-call:hover {
  background: #F4C401;
  color: #0A0A0B;
}

.sbtt-chip-btn.chip-call:hover i {
  color: #0A0A0B;
}

/* Restart / Explore More Chip */
.sbtt-restart-btn {
  align-self: flex-start;
  background: transparent;
  border: 1px dashed rgba(244, 196, 1, 0.35);
  color: rgba(244, 196, 1, 0.9);
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 0.74rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-top: 4px;
  transition: all 0.2s ease;
}

.sbtt-restart-btn:hover {
  background: rgba(244, 196, 1, 0.12);
  border-color: #F4C401;
  color: #FFFFFF;
}

/* ==========================================================================
   INPUT BAR & SEND CONTROLS
   ========================================================================== */
.sbtt-chat-input-area {
  padding: 10px 14px;
  background: #121216;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.sbtt-chat-input-form {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
}

.sbtt-chat-input {
  flex: 1;
  background: #1B1B22;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 24px;
  padding: 10px 16px;
  color: #FFFFFF;
  font-size: 0.84rem;
  font-family: inherit;
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.sbtt-chat-input::placeholder {
  color: rgba(255, 255, 255, 0.42);
  font-size: 0.81rem;
}

.sbtt-chat-input:focus {
  border-color: #F4C401;
  background: #202028;
  box-shadow: 0 0 0 3px rgba(244, 196, 1, 0.18);
}

.sbtt-chat-send-btn {
  background: #F4C401;
  border: none;
  color: #0A0A0B;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.05rem;
  cursor: pointer;
  transition: all 0.22s ease;
  flex-shrink: 0;
  outline: none;
}

.sbtt-chat-send-btn:hover {
  background: #FFE089;
  transform: scale(1.08);
  box-shadow: 0 4px 12px rgba(244, 196, 1, 0.4);
}

.sbtt-chat-send-btn:active {
  transform: scale(0.94);
}

/* ==========================================================================
   FOOTER QUICK REDIRECT ROW
   ========================================================================== */
.sbtt-chat-footer {
  padding: 8px 14px;
  background: #0A0A0B;
  border-top: 1px solid rgba(244, 196, 1, 0.15);
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}

.sbtt-footer-wa-link {
  flex: 1;
  background: #25D366;
  color: #FFFFFF !important;
  text-decoration: none;
  font-size: 0.76rem;
  font-weight: 700;
  padding: 7px 12px;
  border-radius: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: all 0.2s ease;
  box-shadow: 0 2px 8px rgba(37, 211, 102, 0.3);
}

.sbtt-footer-wa-link:hover {
  background: #20BA5A;
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(37, 211, 102, 0.45);
}

.sbtt-footer-call-link {
  background: rgba(244, 196, 1, 0.15);
  border: 1px solid rgba(244, 196, 1, 0.35);
  color: #F4C401 !important;
  text-decoration: none;
  font-size: 0.76rem;
  font-weight: 600;
  padding: 7px 12px;
  border-radius: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: all 0.2s ease;
}

.sbtt-footer-call-link:hover {
  background: #F4C401;
  color: #0A0A0B !important;
}

/* ==========================================================================
   MOBILE & VIEWPORT RESPONSIVENESS
   ========================================================================== */
/* ==========================================================================
   MOBILE & VIEWPORT RESPONSIVENESS (Bottom-Left Alignment)
   ========================================================================== */
@media (max-width: 768px) {
  .floating-chatbot-launcher {
    bottom: max(18px, env(safe-area-inset-bottom));
    left: max(16px, env(safe-area-inset-left));
  }
  .floating-chatbot-btn {
    width: 48px;
    height: 48px;
    font-size: 1.4rem;
  }
  .sbtt-chat-panel {
    left: 16px;
    right: auto;
    bottom: calc(max(18px, env(safe-area-inset-bottom)) + 66px);
    width: min(calc(100vw - 32px), 370px);
    height: min(72vh, 520px);
    border-radius: 16px;
  }
  
  .sbtt-action-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 400px) {
  .floating-chatbot-launcher {
    bottom: max(14px, env(safe-area-inset-bottom));
    left: max(12px, env(safe-area-inset-left));
  }
  .floating-chatbot-btn {
    width: 44px;
    height: 44px;
    font-size: 1.25rem;
  }
  .floating-chatbot-btn .floating-tooltip {
    display: none; /* Hide tooltips on extra small screens */
  }
  .sbtt-chat-panel {
    left: 10px;
    right: 10px;
    width: auto;
    max-width: none;
    bottom: calc(max(14px, env(safe-area-inset-bottom)) + 58px);
    height: min(74vh, 480px);
    border-radius: 14px;
  }

  .sbtt-chat-header {
    padding: 11px 13px;
  }

  .sbtt-chat-body {
    padding: 12px 10px;
    gap: 10px;
  }

  .sbtt-msg-bot,
  .sbtt-msg-user {
    font-size: 0.81rem;
    padding: 9px 12px;
  }

  .sbtt-chat-input {
    font-size: 0.8rem;
    padding: 8px 12px;
  }

  .sbtt-chat-send-btn {
    width: 32px;
    height: 32px;
    font-size: 0.95rem;
  }

  .sbtt-footer-wa-link,
  .sbtt-footer-call-link {
    font-size: 0.72rem;
    padding: 6px 8px;
  }
}

/* Extra Narrow Mobile (200px - 320px) */
@media (max-width: 320px) {
  .floating-chatbot-launcher {
    bottom: max(10px, env(safe-area-inset-bottom));
    left: max(8px, env(safe-area-inset-left));
  }
  .sbtt-chat-panel {
    left: 6px;
    right: 6px;
    bottom: calc(max(10px, env(safe-area-inset-bottom)) + 52px);
    height: min(76vh, 440px);
  }

  .sbtt-chat-header-title {
    font-size: 0.88rem;
  }

  .sbtt-chat-footer {
    flex-direction: column;
    gap: 5px;
  }
}
