/* BSM Omnichannel Webchat - Glassmorphism Design */
:root {
  --bsm-primary: #3b82f6; /* Blue BSM */
  --bsm-gradient: linear-gradient(135deg, #1e3a8a, #3b82f6);
  --bsm-dark: #0f172a;
}

#bsm-webchat-container {
  position: fixed;
  bottom: 30px;
  right: 30px;
  z-index: 999999;
  font-family: 'Inter', 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
}

#bsm-webchat-btn {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: var(--bsm-gradient);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 4px 20px rgba(59, 130, 246, 0.4);
  transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275), box-shadow 0.3s ease;
}
#bsm-webchat-btn:hover {
  transform: scale(1.1);
  box-shadow: 0 6px 25px rgba(59, 130, 246, 0.6);
}
#bsm-webchat-btn svg {
  width: 32px;
  height: 32px;
  fill: #ffffff;
}

#bsm-webchat-window {
  position: absolute;
  bottom: 80px;
  right: 0;
  width: 380px;
  height: 600px;
  max-width: calc(100vw - 40px);
  max-height: calc(100vh - 120px);
  background: rgba(15, 23, 42, 0.7);
  backdrop-filter: blur(15px);
  -webkit-backdrop-filter: blur(15px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 20px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  opacity: 0;
  transform: translateY(20px);
  pointer-events: none;
  transition: opacity 0.3s ease, transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

#bsm-webchat-window.active {
  opacity: 1;
  transform: translateY(0);
  pointer-events: all;
}

#bsm-webchat-header {
  background: rgba(15, 23, 42, 0.9);
  padding: 15px 20px;
  display: flex;
  align-items: center;
  border-bottom: 1px solid rgba(255,255,255,0.1);
}
#bsm-webchat-header-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--bsm-gradient);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-right: 15px;
  font-weight: bold;
  color: white;
  border: 2px solid rgba(255,255,255,0.2);
}
#bsm-webchat-header-info h4 {
  margin: 0;
  color: #fff;
  font-size: 16px;
  letter-spacing: 0.5px;
}
#bsm-webchat-header-info p {
  margin: 0;
  color: #94a3b8;
  font-size: 12px;
  display: flex;
  align-items: center;
}
#bsm-webchat-header-info p::before {
  content: '';
  display: inline-block;
  width: 8px;
  height: 8px;
  background: #10b981;
  border-radius: 50%;
  margin-right: 6px;
}

#bsm-webchat-close {
  margin-left: auto;
  cursor: pointer;
  color: #94a3b8;
  fill: #94a3b8;
}
#bsm-webchat-close:hover {
  color: #fff;
  fill: #fff;
}

#bsm-webchat-messages {
  flex: 1;
  padding: 20px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,0.2) transparent;
}
#bsm-webchat-messages::-webkit-scrollbar {
  width: 6px;
}
#bsm-webchat-messages::-webkit-scrollbar-thumb {
  background: rgba(255,255,255,0.2);
  border-radius: 3px;
}

.bsm-chat-bubble {
  max-width: 85%;
  padding: 12px 16px;
  border-radius: 18px;
  margin-bottom: 15px;
  font-size: 14px;
  line-height: 1.5;
  word-wrap: break-word;
  animation: bsmFadeInMsg 0.3s ease;
}

.bsm-chat-bubble.bot {
  align-self: flex-start;
  background: rgba(255, 255, 255, 0.05);
  color: #e2e8f0;
  border-bottom-left-radius: 4px;
  border: 1px solid rgba(255,255,255,0.05);
}
.bsm-chat-bubble.user {
  align-self: flex-end;
  background: var(--bsm-gradient);
  color: #fff;
  border-bottom-right-radius: 4px;
}

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

#bsm-webchat-input-area {
  padding: 15px;
  background: rgba(15, 23, 42, 0.9);
  border-top: 1px solid rgba(255,255,255,0.1);
  display: flex;
  align-items: center;
}
#bsm-webchat-input {
  flex: 1;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 12px 15px;
  border-radius: 20px;
  color: #fff;
  font-size: 14px;
  outline: none;
  transition: border 0.3s;
}
#bsm-webchat-input:focus {
  border-color: var(--bsm-primary);
}
#bsm-webchat-input::placeholder {
  color: #64748b;
}

#bsm-webchat-send {
  background: transparent;
  border: none;
  color: var(--bsm-primary);
  margin-left: 10px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 10px;
  border-radius: 50%;
  transition: background 0.3s;
}
#bsm-webchat-send:hover {
  background: rgba(59, 130, 246, 0.1);
}
#bsm-webchat-send svg {
  fill: currentColor;
  width: 24px;
  height: 24px;
}

/* Typing Indicator */
.bsm-typing-indicator {
  display: none;
  align-self: flex-start;
  background: rgba(255, 255, 255, 0.05);
  padding: 12px 20px;
  border-radius: 18px;
  border-bottom-left-radius: 4px;
  margin-bottom: 15px;
}
.bsm-typing-indicator.active {
  display: flex;
  gap: 5px;
}
.bsm-typing-dot {
  width: 6px;
  height: 6px;
  background: #94a3b8;
  border-radius: 50%;
  animation: bsmTypingBounce 1.4s infinite ease-in-out both;
}
.bsm-typing-dot:nth-child(1) { animation-delay: -0.32s; }
.bsm-typing-dot:nth-child(2) { animation-delay: -0.16s; }
@keyframes bsmTypingBounce {
  0%, 80%, 100% { transform: scale(0); }
  40% { transform: scale(1); }
}
