/* =========================================================
   AURORA MOTION - CHATBOT WIDGET STYLING
   Glassmorphism, Dark Mode & Brand Colors
   ========================================================= */

.chat-widget-container {
  position: fixed;
  bottom: 30px;
  right: 100px; /* Positioned nicely next to floating WhatsApp button */
  z-index: 1000;
  font-family: 'Plus Jakarta Sans', sans-serif;
}

/* Floating Bubble Button */
.chat-fab-btn {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: linear-gradient(135deg, #76F5F0 0%, #9C57FF 50%, #B541FA 100%);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 25px rgba(181, 65, 250, 0.4);
  transition: all 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  color: #080514;
}

.chat-fab-btn:hover {
  transform: scale(1.1) rotate(5deg);
  box-shadow: 0 8px 35px rgba(118, 245, 240, 0.6);
}

.chat-fab-btn.active {
  background: #1C133B;
  color: #76F5F0;
  border: 2px solid #76F5F0;
  box-shadow: 0 0 20px rgba(118, 245, 240, 0.4);
}

/* Non-invasive Floating Teaser Badge */
.chat-teaser-badge {
  position: absolute;
  bottom: 72px;
  right: 0;
  background: rgba(19, 13, 42, 0.95);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(118, 245, 240, 0.5);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6), 0 0 20px rgba(118, 245, 240, 0.25);
  border-radius: 16px;
  padding: 12px 34px 12px 16px;
  display: flex;
  align-items: center;
  gap: 10px;
  width: 230px;
  cursor: pointer;
  z-index: 999;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(12px);
  transition: opacity 0.4s ease, transform 0.4s ease, visibility 0.4s ease;
}

.chat-teaser-badge.visible {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateY(0);
}

.chat-teaser-badge:hover {
  border-color: #B541FA;
  box-shadow: 0 12px 35px rgba(181, 65, 250, 0.4);
}

@keyframes floatTeaser {
  0% { transform: translateY(0); }
  100% { transform: translateY(-6px); }
}

.chat-teaser-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #76F5F0;
  box-shadow: 0 0 10px #76F5F0;
  flex-shrink: 0;
  animation: pulseDotChat 1.5s infinite;
}

.chat-teaser-content {
  font-size: 0.8rem;
  line-height: 1.35;
  color: #FFFFFF;
}

.chat-teaser-content strong {
  color: #76F5F0;
  font-weight: 700;
  font-size: 0.82rem;
  display: block;
  margin-bottom: 2px;
}

.chat-teaser-close {
  position: absolute;
  top: 8px;
  right: 10px;
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.5);
  font-size: 1.1rem;
  cursor: pointer;
  line-height: 1;
  padding: 2px;
  transition: color 0.2s ease;
}

.chat-teaser-close:hover {
  color: #FFFFFF;
}

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

/* Chat Window */
.chat-window {
  position: absolute;
  bottom: 70px;
  right: 0;
  width: 360px;
  height: 500px;
  background: rgba(19, 13, 42, 0.95);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-radius: 20px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.7);
  border: 1px solid rgba(181, 65, 250, 0.25);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  opacity: 0;
  transform: translateY(20px) scale(0.95);
  pointer-events: none;
  transition: all 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  z-index: 1001;
}

.chat-window.open {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

/* Header */
.chat-header {
  background: #0B081B;
  padding: 16px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(181, 65, 250, 0.3);
  color: #FFFFFF;
}

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

.chat-header-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: linear-gradient(135deg, #76F5F0 0%, #9C57FF 50%, #B541FA 100%);
  color: #080514;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  box-shadow: 0 0 12px rgba(118, 245, 240, 0.4);
}

.chat-header-title {
  font-family: 'Syne', sans-serif;
  font-size: 1rem;
  font-weight: 700;
  margin: 0;
  color: #FFFFFF;
}

.chat-header-status {
  font-size: 0.75rem;
  color: #76F5F0;
  display: block;
}

.chat-close-btn {
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.7);
  font-size: 1.6rem;
  cursor: pointer;
  line-height: 1;
  transition: color 0.2s ease;
}

.chat-close-btn:hover {
  color: #76F5F0;
}

/* Welcome Screen */
.chat-welcome-screen {
  padding: 24px 20px;
  text-align: center;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  height: calc(100% - 70px);
  box-sizing: border-box;
  background: rgba(11, 8, 27, 0.6);
}

.chat-welcome-logo {
  font-size: 2.2rem;
  margin-bottom: 8px;
  animation: floatWelcome 3s ease-in-out infinite alternate;
}

@keyframes floatWelcome {
  0% { transform: translateY(0); }
  100% { transform: translateY(-8px); }
}

.chat-welcome-screen h3 {
  font-family: 'Syne', sans-serif;
  font-size: 1.15rem;
  font-weight: 700;
  color: #FFFFFF;
  margin-bottom: 6px;
}

.chat-welcome-screen p {
  font-size: 0.85rem;
  color: #B3B0CD;
  line-height: 1.4;
  margin-bottom: 20px;
}

.chat-welcome-screen form {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.chat-welcome-screen input {
  width: 100%;
  padding: 12px 16px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 10px;
  font-size: 0.9rem;
  background: rgba(255, 255, 255, 0.05);
  color: #FFFFFF;
  box-sizing: border-box;
  outline: none;
  transition: border-color 0.3s ease;
}

.chat-welcome-screen input:focus {
  border-color: #B541FA;
  background: rgba(181, 65, 250, 0.08);
}

.chat-welcome-screen form button {
  padding: 12px 20px;
  font-size: 0.9rem;
  font-weight: 700;
  border-radius: 999px;
  background: linear-gradient(135deg, #76F5F0 0%, #9C57FF 50%, #B541FA 100%);
  color: #080514;
  border: none;
  cursor: pointer;
  transition: all 0.3s ease;
  margin-top: 4px;
}

.chat-welcome-screen form button:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 20px rgba(118, 245, 240, 0.5);
}

/* Message Container */
.chat-messages {
  flex: 1;
  padding: 20px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 14px;
  background: rgba(11, 8, 27, 0.7);
}

/* Message Bubbles */
.chat-msg {
  display: flex;
  flex-direction: column;
  max-width: 85%;
}

.chat-msg-bubble {
  padding: 12px 16px;
  border-radius: 14px;
  font-size: 0.88rem;
  line-height: 1.5;
}

.chat-msg-time {
  font-size: 0.7rem;
  color: #7C779F;
  margin-top: 4px;
  padding: 0 4px;
}

/* Bot Message Bubble */
.msg-bot {
  align-self: flex-start;
}

.msg-bot .chat-msg-bubble {
  background: rgba(28, 19, 59, 0.9);
  color: #FFFFFF;
  border-bottom-left-radius: 2px;
  border: 1px solid rgba(181, 65, 250, 0.2);
  border-left: 3px solid #76F5F0;
}

/* User Message Bubble */
.msg-user {
  align-self: flex-end;
}

.msg-user .chat-msg-bubble {
  background: linear-gradient(135deg, #76F5F0 0%, #9C57FF 100%);
  color: #080514;
  font-weight: 600;
  border-bottom-right-radius: 2px;
  box-shadow: 0 4px 15px rgba(118, 245, 240, 0.25);
}

/* Typing Indicator */
.chat-typing-indicator {
  display: flex;
  gap: 6px;
  padding: 12px 16px;
  background: rgba(28, 19, 59, 0.9);
  border-radius: 14px;
  align-self: flex-start;
  border-left: 3px solid #76F5F0;
}

.chat-typing-indicator span {
  width: 7px;
  height: 7px;
  background: #76F5F0;
  border-radius: 50%;
  animation: pulseDotChat 1.2s infinite ease-in-out;
}

.chat-typing-indicator span:nth-child(2) { animation-delay: 0.2s; }
.chat-typing-indicator span:nth-child(3) { animation-delay: 0.4s; }

@keyframes pulseDotChat {
  0%, 100% { opacity: 0.3; transform: scale(0.8); }
  50% { opacity: 1; transform: scale(1.2); }
}

/* Input Footer */
.chat-footer {
  padding: 12px 16px;
  background: #0B081B;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  gap: 10px;
  align-items: center;
}

.chat-footer input {
  flex: 1;
  border: none;
  padding: 10px;
  font-size: 0.9rem;
  background: none;
  color: #FFFFFF;
  outline: none;
}

.chat-send-btn {
  background: linear-gradient(135deg, #76F5F0 0%, #9C57FF 100%);
  color: #080514;
  border: none;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform 0.2s ease;
  flex-shrink: 0;
}

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

/* Responsive adjustment */
@media (max-width: 768px) {
  .chat-widget-container {
    right: 18px;
    bottom: 84px; /* Positioned above floating WhatsApp button on mobile */
  }
  .chat-window {
    width: calc(100vw - 36px);
    right: 0;
    height: 440px;
    bottom: 64px;
  }
}
