/* Chat Widget Styles */
#ai-chat-widget {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  width: 90vw;
  max-width: 540px;
  min-width: 375px;
  background: #11131a;
  border-radius: 18px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.32);
  display: flex;
  flex-direction: column;
  z-index: 9999;
  overflow: hidden;
  font-family: 'Inter', Arial, sans-serif;
  transition: height 0.3s cubic-bezier(.4,2,.6,1), background 0.2s;
  opacity: 0.9;
}
#ai-chat-widget.active {
  height: 480px;
}

/* Mobile devices - full height */
@media (max-width: 768px) {
  #ai-chat-widget.active {
    height: calc(100dvh - 48px); /* Use dynamic viewport height for mobile browsers */
    bottom: 24px;
    top: 24px;
    max-height: calc(100dvh - 48px);
  }
}
#ai-chat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  background: linear-gradient(135deg, #374151 0%, #1f2937 100%);
  color: white;
  border-radius: 12px 12px 0 0;
  font-weight: 600;
  font-size: 16px;
}
#ai-chat-widget.standby #ai-chat-header {
  display: none;
}
#ai-chat-messages {
  flex: 1;
  padding: 16px;
  overflow-y: auto;
  background: #181a20;
  font-size: 1rem;
  color: #fff;
  transition: background 0.2s;
  scrollbar-width: thin;
  scrollbar-color: #374151 #1a1c23;
}

/* Webkit scrollbar styling (Chrome, Safari, Edge) */
#ai-chat-messages::-webkit-scrollbar {
  width: 8px !important;
}

#ai-chat-messages::-webkit-scrollbar-track {
  background: #1a1c23 !important;
  border-radius: 4px !important;
}

#ai-chat-messages::-webkit-scrollbar-thumb {
  background: #374151 !important;
  border-radius: 4px !important;
  transition: background 0.2s ease !important;
  border: none !important;
}

#ai-chat-messages::-webkit-scrollbar-thumb:hover {
  background: #4b5563 !important;
}

#ai-chat-messages::-webkit-scrollbar-corner {
  background: #1a1c23 !important;
}

/* Force custom scrollbar on Windows Chrome */
@media screen and (-webkit-min-device-pixel-ratio: 0) {
  #ai-chat-messages {
    scrollbar-width: none !important;
    -ms-overflow-style: none !important;
  }
  
  #ai-chat-messages::-webkit-scrollbar {
    width: 8px !important;
    background: transparent !important;
  }
}
#ai-chat-widget.standby #ai-chat-messages {
  display: none;
  flex: 0 0 auto;
  padding: 0;
}
.ai-chat-message {
  margin-bottom: 12px;
  display: flex;
  flex-direction: column;
}
.ai-chat-message.user {
  align-items: flex-end;
}
.ai-chat-message.bot {
  align-items: flex-start;
}
.ai-chat-bubble {
  padding: 10px 16px;
  border-radius: 16px;
  max-width: 80%;
  word-break: break-word;
  margin-bottom: 2px;
  background: #222222;
  color: #fff;
}
.ai-chat-message.user .ai-chat-bubble {
  background: #4b5563;
  color: #fff;
  border-bottom-right-radius: 4px;
}
.ai-chat-message.bot .ai-chat-bubble {
  background: #222222;
  color: #fff;
  border-bottom-left-radius: 4px;
}
#ai-chat-quick-questions {
  display: flex;
  gap: 8px;
  padding: 10px 12px 0 12px;
  background: #181a20;
  flex-wrap: wrap;
}
.ai-chat-quick-btn {
  background: #222222;
  color: #fff;
  border: none;
  border-radius: 12px;
  padding: 6px 14px;
  font-size: 0.98rem;
  cursor: pointer;
  margin-bottom: 6px;
  transition: background 0.2s, color 0.2s;
}
.ai-chat-quick-btn:hover {
  background: #4b5563;
  color: #fff;
}
#ai-chat-input-row {
  display: flex;
  padding: 12px;
  background: #181a20;
  border-top: 1px solid #222222;
  margin: 0;
  box-sizing: border-box;
  margin-top: auto!important;
}
#ai-chat-input {
  flex: 1;
  border: none;
  border-radius: 12px;
  padding: 10px 14px;
  font-size: 1rem;
  background: #222222;
  color: #fff;
  margin-right: 8px;
  outline: none;
  box-shadow: 0 1px 2px rgba(0,0,0,0.08);
  transition: background 0.2s, color 0.2s;
}
#ai-chat-input::placeholder {
  color: #b3b8c5;
  transition: all 0.3s ease-in-out;
  opacity: var(--placeholder-opacity, 1);
}

/* Multi-language placeholder animation styles */
#ai-chat-input[data-lang="ar"]::placeholder {
  direction: rtl;
  text-align: right;
}

#ai-chat-input[data-lang="ja"]::placeholder,
#ai-chat-input[data-lang="zh"]::placeholder,
#ai-chat-input[data-lang="ko"]::placeholder {
  font-family: 'Inter', 'Hiragino Sans', 'Yu Gothic', 'Meiryo', sans-serif;
}

/* Apple-style placeholder animation */
#ai-chat-input.placeholder-animating::placeholder {
  /* background: linear-gradient(45deg, #667eea, #764ba2, #f093fb, #f5576c); */
  background: linear-gradient(45deg, #d1d5db, #9ca3af, #6b7280, #9ca3af);
  background-size: 400% 400%;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: placeholder-gradient 3s ease infinite;
}

@keyframes placeholder-gradient {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}
#ai-chat-send {
  background: #ffffff;
  color: #4b5563;
  border: none;
  border-radius: 12px;
  padding: 0 18px;
  font-size: 1rem;
  cursor: pointer;
  transition: background 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
}
#ai-chat-send:hover {
  background: #f3f4f6;
}

#ai-chat-send:disabled {
  background: #e5e7eb;
  color: #9ca3af;
  cursor: not-allowed;
}
#ai-chat-open-btn {
  display: none !important;
}
#ai-chat-quick-questions,
#ai-chat-input-row {
  flex: 0 0 auto;
  margin: 0;
}

.ai-chat-typing .ai-chat-bubble {
  display: flex;
  align-items: center;
  background: #f2f4f8;
  color: #101330;
  min-width: 48px;
  min-height: 32px;
}
.typing-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  margin: 0 2px;
  border-radius: 50%;
  background: #bbb;
  opacity: 0.7;
  animation: typing-bounce 1.2s infinite both;
}
.typing-dot:nth-child(2) {
  animation-delay: 0.2s;
}
.typing-dot:nth-child(3) {
  animation-delay: 0.4s;
}
@keyframes typing-bounce {
  0%, 80%, 100% {
    transform: scale(0.7);
    opacity: 0.5;
  }
  40% {
    transform: scale(1);
    opacity: 1;
  }
} 

/* Modern mute button styling */
#ai-chat-mute {
  background: none;
  border: none;
  color: #ffffff;
  cursor: pointer;
  padding: 8px;
  border-radius: 50%;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  margin-left: auto;
}

#ai-chat-mute:hover {
  background: rgba(255, 255, 255, 0.1);
  transform: scale(1.05);
}

#ai-chat-mute:active {
  transform: scale(0.95);
}

#ai-chat-mute svg {
  transition: all 0.2s ease;
}

#ai-chat-mute:hover svg {
  filter: brightness(1.2);
} 