/* ==========================================================================
   Sri Shiva Sai Mahaa Shakthi Peetham — AI Assistant Widget Styles
   ========================================================================== */

/* Launcher Floating Button */
.chatbot-launcher {
  position: fixed;
  bottom: 28px;
  right: 28px;
  z-index: 99999;
  padding: 12px 22px;
  border-radius: 30px;
  background: linear-gradient(135deg, #FF8C00 0%, #D4AF37 100%);
  color: #060B18 !important;
  border: 1.5px solid #FFE58F;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.6), 0 0 16px rgba(255, 140, 0, 0.4);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-weight: 800;
  font-size: 0.95rem;
  transition: transform 300ms ease, box-shadow 300ms ease;
}

.chatbot-launcher:hover {
  transform: translateY(-3px) scale(1.04);
  box-shadow: 0 14px 34px rgba(255, 140, 0, 0.7);
}

.launcher-icon {
  font-size: 1.3rem;
}

.launcher-label {
  display: inline-block;
  letter-spacing: 0.02em;
  color: #060B18 !important;
}

/* Chat Panel Window */
.chatbot-panel {
  position: fixed;
  bottom: 96px;
  right: 24px;
  z-index: 100000;
  width: 400px;
  max-width: calc(100vw - 32px);
  height: 590px;
  max-height: calc(100vh - 120px);
  background: #0B132B !important; /* Deep Navy background */
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1.5px solid rgba(212, 175, 55, 0.45) !important;
  border-radius: 20px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.85);
  display: none;
  flex-direction: column;
  overflow: hidden;
  animation: chatSlideUp 0.3s ease-out;
  box-sizing: border-box;
}

.chatbot-panel.open {
  display: flex;
}

.chatbot-panel.fullscreen {
  inset: 16px;
  width: auto;
  height: auto;
  max-width: none;
  max-height: none;
}

@keyframes chatSlideUp {
  from { opacity: 0; transform: translateY(20px) scale(0.95); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

/* Header Bar */
.chat-header {
  background: linear-gradient(135deg, #170720 0%, #2B0818 100%) !important;
  color: #FFFFFF !important;
  padding: 14px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(212, 175, 55, 0.3);
  flex-shrink: 0;
}

.chat-title-group {
  display: flex;
  align-items: center;
  gap: 12px;
}

.chat-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: linear-gradient(135deg, #FF8C00, #D4AF37);
  display: grid;
  place-items: center;
  font-family: 'Tiro Devanagari Sanskrit', serif;
  font-size: 1.2rem;
  color: #060B18;
  font-weight: bold;
}

.chat-title-text {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-weight: 800;
  font-size: 0.98rem;
  line-height: 1.2;
  color: #FFFFFF !important;
}

.chat-subtitle-text {
  font-size: 0.75rem;
  color: #FBBF24 !important;
  font-weight: 600;
}

.chat-header-actions {
  display: flex;
  gap: 8px;
}

.chat-btn-icon {
  background: transparent;
  border: none;
  color: #D1D5DB !important;
  font-size: 1.1rem;
  cursor: pointer;
  padding: 4px 6px;
  border-radius: 6px;
  transition: background 200ms ease;
}

.chat-btn-icon:hover {
  background: rgba(255, 255, 255, 0.15);
  color: #FFFFFF !important;
}

/* Messages Body Area */
.chat-messages {
  flex-grow: 1;
  padding: 16px;
  overflow-y: auto;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
  gap: 14px;
  background: #060B18 !important; /* Pitch Dark Navy */
  scrollbar-width: thin;
  scrollbar-color: rgba(212, 175, 55, 0.35) #060B18;
}

.chat-messages::-webkit-scrollbar {
  width: 6px;
}
.chat-messages::-webkit-scrollbar-track {
  background: #060B18;
}
.chat-messages::-webkit-scrollbar-thumb {
  background: rgba(212, 175, 55, 0.35);
  border-radius: 4px;
}
.chat-messages::-webkit-scrollbar-thumb:hover {
  background: #FF8C00;
}

.chat-msg {
  display: flex;
  flex-direction: column;
  max-width: 88%;
  font-size: 0.90rem;
  line-height: 1.55;
  animation: fadeInMsg 0.25s ease-out;
  font-family: 'Poppins', sans-serif;
  word-break: break-word;
}

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

/* User Bubble */
.chat-msg.user {
  align-self: flex-end;
  background: linear-gradient(135deg, #FF8C00 0%, #E67E00 100%) !important;
  color: #FFFFFF !important;
  padding: 10px 16px;
  border-radius: 16px 16px 4px 16px;
  box-shadow: 0 4px 14px rgba(255, 140, 0, 0.35);
  font-weight: 500;
}

/* Assistant Bubble (High Contrast White Text on Dark Card) */
.chat-msg.assistant {
  align-self: flex-start;
  background: #141C2D !important;
  color: #FFFFFF !important;
  border: 1px solid rgba(212, 175, 55, 0.35) !important;
  padding: 12px 16px;
  border-radius: 16px 16px 16px 4px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.5);
}

.chat-msg p {
  margin: 0 0 8px;
  color: #FFFFFF !important;
}

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

.chat-msg strong {
  color: #FBBF24 !important; /* Glowing Gold headers */
}

/* Live Action Card Button inside Message */
.chat-action-btn {
  margin-top: 10px;
  background: linear-gradient(135deg, #FF8C00, #E67E00) !important;
  color: #FFFFFF !important;
  padding: 9px 15px;
  border-radius: 10px;
  font-size: 0.85rem;
  font-weight: 700;
  border: 1px solid rgba(255, 229, 143, 0.5);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  box-shadow: 0 4px 14px rgba(255, 140, 0, 0.4);
  transition: transform 200ms ease;
  font-family: 'Poppins', sans-serif;
}

.chat-action-btn:hover {
  transform: translateY(-2px);
}

/* Suggested Question Chips Wrap (Clean Scroll, Zero Native Scrollbars, Zero Overlap) */
.chat-chips-wrap {
  padding: 10px 14px;
  background: #0B132B !important;
  border-top: 1px solid rgba(255, 255, 255, 0.10);
  display: flex;
  align-items: center;
  gap: 8px;
  overflow-x: auto;
  overflow-y: hidden !important;
  white-space: nowrap;
  flex-shrink: 0;
  scrollbar-width: none !important; /* Firefox: Hide scrollbar */
  scrollbar-width: none !important; /* Firefox */
  -ms-overflow-style: none !important; /* IE / Edge */
  scroll-behavior: smooth;
}

.chat-chips-wrap::-webkit-scrollbar {
  display: none !important; /* Chrome / Safari / Edge */
  width: 0 !important;
  height: 0 !important;
}

.chat-chip {
  flex-shrink: 0 !important; /* Guarantees crisp non-overlapped chips */
  display: inline-flex;
  align-items: center;
  padding: 6px 14px;
  border-radius: 20px;
  background: rgba(20, 28, 45, 0.90) !important;
  border: 1px solid rgba(212, 175, 55, 0.4) !important;
  color: #FBBF24 !important;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 200ms ease;
  font-family: 'Poppins', sans-serif;
  line-height: 1.2;
  user-select: none;
}

.chat-chip:hover {
  background: #FF8C00 !important;
  color: #FFFFFF !important;
  border-color: #FF8C00 !important;
}

/* Input Bar */
.chat-input-bar {
  padding: 12px 14px;
  background: #0D152D !important;
  border-top: 1px solid rgba(212, 175, 55, 0.3);
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.chat-input-field {
  flex-grow: 1;
  background: #060B18 !important;
  border: 1px solid rgba(212, 175, 55, 0.4) !important;
  border-radius: 12px;
  padding: 10px 14px;
  color: #FFFFFF !important;
  font-size: 0.88rem;
  font-family: 'Poppins', sans-serif;
  outline: none;
  box-sizing: border-box;
}

.chat-input-field::placeholder {
  color: rgba(255, 255, 255, 0.5) !important;
}

.chat-input-field:focus {
  border-color: #FF8C00 !important;
}

.chat-send-btn {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: linear-gradient(135deg, #FF8C00, #E67E00) !important;
  color: #FFFFFF !important;
  border: none;
  font-size: 1.1rem;
  cursor: pointer;
  display: grid;
  place-items: center;
  box-shadow: 0 4px 12px rgba(255, 140, 0, 0.35);
  transition: transform 200ms ease;
  flex-shrink: 0;
}

.chat-send-btn:hover {
  transform: scale(1.05);
}

/* Typing Dots Animation */
.typing-dots {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 12px 16px;
  background: #141C2D;
  border-radius: 16px;
  width: fit-content;
}

.typing-dots .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #FBBF24;
  animation: dotPulse 1.4s infinite ease-in-out both;
}

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

@keyframes dotPulse {
  0%, 80%, 100% { transform: scale(0.6); opacity: 0.4; }
  40% { transform: scale(1); opacity: 1; }
}
