/* 🌸 RAIYA Chatbot Styles (Visible on all pages, bottom-right corner) */

/* Shared floating-action-button geometry (prevents overlap with scroll-top) */
:root {
  --chatbot-fab-offset: 25px;
  --chatbot-fab-size: 60px;
  --chatbot-fab-gap: 12px;
}

#chatbot-container {
  z-index: 9999;
  font-family: 'Inter', sans-serif;
  position: relative;
  /* Container doesn't restrain fixed elements */
}

/* Stack scroll-top above chatbot (no overlap) */
#scroll-top.scroll-top {
  right: var(--chatbot-fab-offset);
  bottom: calc(var(--chatbot-fab-offset) + var(--chatbot-fab-size) + var(--chatbot-fab-gap));
}

/* Hide page scroll-top button while chatbot is open */
body.chatbot-open #scroll-top {
  opacity: 0 !important;
  pointer-events: none !important;
  transform: translateY(8px) !important;
}

body.chatbot-open #whatsapp-icon {
  bottom: 25px;
  right: 400px;
  /* Window is 360px + 25px gap + 15px extra gap */
}

/* 🔘 Chat Icon */
#chat-icon {
  width: var(--chatbot-fab-size);
  height: var(--chatbot-fab-size);
  border-radius: 50%;
  background: orangered;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  position: fixed;
  bottom: var(--chatbot-fab-offset);
  right: var(--chatbot-fab-offset);
  z-index: 10000;
}

#chat-icon i {
  color: #fff;
  font-size: 28px;
}

#chat-icon:hover {
  transform: scale(1.08);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.3);
}

/* 🟢 WhatsApp Icon */
#whatsapp-icon {
  width: var(--chatbot-fab-size);
  height: var(--chatbot-fab-size);
  border-radius: 50%;
  background: #25D366;
  /* WhatsApp Green */
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
  transition: all 0.3s ease;
  position: fixed;
  bottom: calc(var(--chatbot-fab-offset) + var(--chatbot-fab-size) + var(--chatbot-fab-gap));
  right: var(--chatbot-fab-offset);
  z-index: 10000;
  text-decoration: none;
}

#whatsapp-icon i {
  color: #fff;
  font-size: 32px;
}

#whatsapp-icon:hover {
  transform: scale(1.08);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.3);
}

/* 🎟️ Eventbrite Demo Banner Popup */
#eb-popup-banner {
  position: fixed;
  bottom: 25px;
  left: 25px;
  width: 340px;
  background: #ffffff;
  border-radius: 16px;
  box-shadow: 0 15px 45px rgba(0, 0, 0, 0.15);
  z-index: 10001;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: all 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  transform: translateY(20px) scale(0.95);
  opacity: 0;
  pointer-events: none;
  font-family: 'Inter', sans-serif;
  border: 1px solid rgba(17, 24, 39, 0.08);
}

#eb-popup-banner.pop-up {
  transform: translateY(0) scale(1);
  opacity: 1;
  pointer-events: auto;
}

.eb-banner-img {
  width: 100%;
  height: 120px;
  object-fit: cover;
}

.eb-banner-content {
  padding: 20px 20px 15px;
  position: relative;
}

.eb-close-btn {
  position: absolute;
  top: -110px;
  right: 10px;
  background: rgba(0,0,0,0.5);
  color: #fff;
  border: none;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.2s;
  backdrop-filter: blur(4px);
}

.eb-close-btn:hover {
  background: orangered;
}

.eb-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.75rem;
  font-weight: 800;
  color: #ff4a17;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 8px;
}

.eb-label i {
  font-size: 12px;
}

.eb-title {
  font-size: 1.1rem;
  font-weight: 800;
  color: #111827;
  margin: 0 0 8px;
  line-height: 1.3;
}

.eb-date {
  font-size: 0.85rem;
  color: #6b7280;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 6px;
  font-weight: 500;
}

.eb-actions {
  padding: 0 20px 20px;
}

.eb-register-btn {
  display: block;
  width: 100%;
  text-align: center;
  background: linear-gradient(135deg, #1e4a5f 0%, #2c5f7c 100%);
  color: #ffffff;
  padding: 12px;
  border-radius: 10px;
  font-weight: 700;
  text-decoration: none;
  font-size: 0.95rem;
  transition: all 0.2s ease;
  box-shadow: 0 4px 12px rgba(44, 95, 124, 0.2);
}

.eb-register-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(44, 95, 124, 0.3);
  color: #fff;
}

@media (max-width: 600px) {
  #eb-popup-banner {
    left: 5%;
    width: 90%;
    bottom: 20px;
  }
}

/* 💬 Chat Window */
#chat-window {
  width: 360px;
  height: calc(100vh - 120px);
  max-height: 550px;
  background: #fff;
  border-radius: 20px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.25);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  position: fixed;
  bottom: var(--chatbot-fab-offset);
  right: var(--chatbot-fab-offset);
  z-index: 9999;
  transform: translateY(20px) scale(0.95);
  opacity: 0;
  transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
  transform-origin: bottom right;
}

#chat-window.hidden {
  pointer-events: none !important;
}

#chat-window:not(.hidden) {
  transform: translateY(0) scale(1);
  opacity: 1;
}

.hidden {
  display: none;
}

/* 🟣 Header */
.chat-header {
  background: linear-gradient(135deg, #1e4a5f 0%, #2c5f7c 100%);
  color: #fff;
  padding: 12px 15px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-weight: 600;
  border-top-left-radius: 20px;
  border-top-right-radius: 20px;
}

.chat-header-buttons {
  display: flex;
  align-items: center;
  gap: 12px;
}

.chat-header button {
  background: transparent;
  border: none;
  color: #fff;
  font-size: 22px;
  cursor: pointer;
  transition: opacity 0.2s;
}

.chat-header button:hover {
  opacity: 0.8;
}

/* 🌸 Chat Tabs Container */
.chat-content-container {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: #f7f9fc;
  position: relative;
}

.chat-tab {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  width: 100%;
}

.chat-tab.hidden {
  display: none !important;
}

/* Home Tab Styles */
#chat-tab-home {
  padding: 20px 15px;
  overflow-y: auto;
  align-items: center;
}

.home-intro {
  text-align: center;
  margin-bottom: 20px;
}

.home-avatar {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  margin-bottom: 10px;
}

.home-intro h4 {
  font-size: 18px;
  color: #1e4a5f;
  margin-bottom: 5px;
  font-weight: 700;
}

.home-intro p {
  color: #666;
  font-size: 14px;
}

.options-wrapper {
  width: 100%;
}

.options-title {
  font-size: 14px;
  color: #333;
  margin-bottom: 12px;
  font-weight: 600;
  padding-left: 5px;
}

/* 🌸 Chat Body (Inside Messages Tab) */
.chat-body {
  flex: 1;
  padding: 15px;
  overflow-y: auto;
  background: #f7f9fc;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  position: relative;
  scroll-behavior: smooth;
}

/* Quick action options */
.chatbot-options-container {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 0 auto;
  width: 100%;
}

.chat-option-btn {
  appearance: none;
  border: 1px solid rgba(17, 24, 39, 0.12);
  background: #ffffff;
  color: #111827;
  font-weight: 600;
  font-size: 13px;
  padding: 12px 14px;
  border-radius: 10px;
  cursor: pointer;
  text-align: left;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.04);
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.chat-option-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 35px rgba(0, 0, 0, 0.10);
  border-color: rgba(255, 74, 23, 0.35);
}

.chat-option-btn:active {
  transform: translateY(0);
}

.chat-option-btn:focus-visible {
  outline: 3px solid rgba(255, 74, 23, 0.25);
  outline-offset: 2px;
}

/* 🌟 Intro (hello) message — top heading style */
.intro-message {
  text-align: center;
  margin-top: 25px;
  margin-bottom: 25px;
  align-self: center;
  width: 100%;
  animation: fadeIn 1s ease-in-out;
}

.intro-message p {
  background: none;
  color: #333;
  font-size: 16px;
  line-height: 1.6;
  border: none;
  box-shadow: none;
  max-width: 85%;
  margin: 0 auto;
}

/* 💫 Fade animation */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* 🗨️ Chat Bubbles */
.user-message,
.bot-message {
  margin-bottom: 10px;
  display: flex;
  width: 100%;
}

/* ✅ User message (purple bubble) */
.user-message {
  justify-content: flex-end;
}

.user-message p {
  background: #2c5f7c;
  color: #fff;
  padding: 8px 12px;
  border-radius: 15px 15px 0 15px;
  max-width: 70%;
  word-wrap: break-word;
  animation: fadeIn 0.3s ease-in-out;
}

/* ✅ Bot message — clean, no background */
.bot-message {
  justify-content: flex-start;
}

.bot-message p {
  background: none;
  /* 🚫 no box */
  color: #111;
  padding: 5px 8px;
  border-radius: 0;
  max-width: 80%;
  word-wrap: break-word;
  animation: fadeIn 0.3s ease-in-out;
  font-size: 15px;
  line-height: 1.5;
}

/* Typing indicator */
.typing-indicator {
  opacity: 0.8;
}

/* Animated dots for Thinking text */
.typing-dots-animated {
  display: inline-block;
}

.typing-dots-animated span {
  display: inline-block;
  animation: dotPulse 1.4s infinite ease-in-out;
  margin-left: 2px;
}

.typing-dots-animated span:nth-child(1) {
  animation-delay: 0s;
}

.typing-dots-animated span:nth-child(2) {
  animation-delay: 0.2s;
}

.typing-dots-animated span:nth-child(3) {
  animation-delay: 0.4s;
}

@keyframes dotPulse {

  0%,
  60%,
  100% {
    opacity: 0.3;
    transform: translateY(0);
  }

  30% {
    opacity: 1;
    transform: translateY(-3px);
  }
}

/* 💬 Chat Footer */
.chat-footer {
  display: flex;
  padding: 10px;
  background: #f1f3f6;
  border-top: 1px solid #e5e7eb;
}

.chat-footer input {
  flex: 1;
  border: none;
  border-radius: 15px;
  padding: 8px 12px;
  outline: none;
  background: #fff;
  font-size: 15px;
  transition: opacity 0.2s ease, background-color 0.2s ease;
}

.chat-footer input:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  background: #f5f5f5;
}

.chat-footer button {
  background: orangered;
  border: none;
  border-radius: 50%;
  color: white;
  width: 36px;
  height: 36px;
  margin-left: 8px;
  cursor: pointer;
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s ease, opacity 0.2s ease, background-color 0.2s ease;
  position: relative;
}

.chat-footer button:hover:not(:disabled) {
  transform: scale(1.1);
}

.chat-footer button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  background: #ff8c66;
}

/* Loading spinner for send button */
.chat-footer button.loading {
  pointer-events: none;
}

.chat-footer button.loading::after {
  content: "";
  position: absolute;
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.chat-footer button.loading>* {
  opacity: 0;
}

/* 🧭 Bottom Navigation */
.chat-bottom-nav {
  display: flex;
  background: #fff;
  border-top: 1px solid #e5e7eb;
  padding: 0;
  width: 100%;
}

.nav-btn {
  flex: 1;
  background: none;
  border: none;
  padding: 12px 0;
  color: #6b7280;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  transition: color 0.2s ease;
}

.nav-btn i {
  font-size: 18px;
}

.nav-btn.active {
  color: orangered;
}

.nav-btn:hover:not(.active) {
  color: #374151;
}

#chat-icon img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
}


/* mobile view css  ******************************************************************/

/* 📱 Mobile Responsive Fix */
@media (max-width: 600px) {
  #chat-window {
    width: 90% !important;
    height: 80% !important;
    right: 5% !important;
    bottom: 20px !important;
    border-radius: 15px !important;
  }

  #chat-icon {
    width: 55px;
    height: 55px;
    right: 20px !important;
    bottom: 20px !important;
  }

  .chat-footer input {
    font-size: 14px;
  }

  .bot-message p,
  .user-message p {
    font-size: 14px;
  }

  .chatbot-options-container {
    grid-template-columns: 1fr;
    max-width: 100%;
  }
}