/* =========================================================
   SALERO BUSINESS ADVISORS - CHATBOT WIDGET STYLING
   Luxury Glassmorphism & Salero Brand Aesthetics
   ========================================================= */

.chat-widget-container {
  position: fixed;
  bottom: 30px;
  left: 30px;
  z-index: 1000;
  font-family: var(--font-sans, 'Montserrat', sans-serif);
}

/* Floating Bubble Button */
.chat-fab-btn {
  width: 58px;
  height: 58px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--color-mauve, #AA6568) 0%, var(--color-mauve-hover, #965457) 100%);
  border: 1px solid rgba(255, 255, 255, 0.3);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 25px rgba(170, 101, 104, 0.4);
  transition: all 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  color: #FFFFFF;
}

.chat-fab-btn:hover {
  transform: scale(1.08) translateY(-2px);
  box-shadow: 0 12px 30px rgba(170, 101, 104, 0.55);
}

.chat-fab-btn.active {
  background: var(--color-dark, #28201E);
  color: var(--color-suede-pink, #E9C3C0);
  border: 1px solid var(--color-mauve, #AA6568);
  box-shadow: 0 8px 25px rgba(40, 32, 30, 0.6);
}

/* Teaser Badge */
.chat-teaser-badge {
  position: absolute;
  bottom: 72px;
  left: 0;
  background: rgba(40, 32, 30, 0.95);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(170, 101, 104, 0.4);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
  border-radius: 16px;
  padding: 12px 34px 12px 16px;
  display: flex;
  align-items: center;
  gap: 10px;
  width: 240px;
  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: var(--color-mauve, #AA6568);
  box-shadow: 0 12px 35px rgba(170, 101, 104, 0.3);
}

.chat-teaser-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--color-mauve, #AA6568);
  box-shadow: 0 0 10px var(--color-mauve, #AA6568);
  flex-shrink: 0;
  animation: pulseDotChat 1.5s infinite;
}

@keyframes pulseDotChat {
  0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(170, 101, 104, 0.7); }
  70% { transform: scale(1); box-shadow: 0 0 0 8px rgba(170, 101, 104, 0); }
  100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(170, 101, 104, 0); }
}

.chat-teaser-content {
  font-size: 0.8rem;
  line-height: 1.35;
  color: var(--color-sand, #F3EFEC);
}

.chat-teaser-content strong {
  display: block;
  color: #FFFFFF;
}

.chat-teaser-close {
  position: absolute;
  top: 6px;
  right: 10px;
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.5);
  font-size: 16px;
  cursor: pointer;
  padding: 0;
}

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

/* Chat Window */
.chat-window {
  position: absolute;
  bottom: 72px;
  left: 0;
  width: 370px;
  height: 520px;
  background: var(--color-sand-light, #F9F7F5);
  border: 1px solid var(--border-light, rgba(151, 134, 127, 0.2));
  border-radius: 20px;
  box-shadow: 0 20px 50px rgba(40, 32, 30, 0.25);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(20px) scale(0.95);
  transition: all 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  transform-origin: bottom left;
}

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

/* Header */
.chat-header {
  background: var(--color-dark, #28201E);
  color: #FFFFFF;
  padding: 16px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(170, 101, 104, 0.2);
}

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

.chat-header-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--color-mauve, #AA6568), var(--color-suede-pink, #E9C3C0));
  color: var(--color-dark, #28201E);
  font-weight: 700;
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-serif, serif);
}

.chat-header-title {
  margin: 0;
  font-size: 1.05rem;
  font-family: var(--font-serif, serif);
  font-weight: 600;
  letter-spacing: 0.02em;
  color: #FFFFFF !important;
}

.chat-header-status {
  font-size: 0.72rem;
  color: var(--color-suede-pink, #E9C3C0);
  display: flex;
  align-items: center;
  gap: 5px;
}

.chat-header-status::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #4EBE96;
}

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

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

/* Welcome Screen */
.chat-welcome-screen {
  padding: 30px 24px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
}

.chat-welcome-logo {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: rgba(170, 101, 104, 0.12);
  color: var(--color-mauve, #AA6568);
  font-size: 1.4rem;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
  font-family: var(--font-serif, serif);
}

.chat-welcome-screen h3 {
  font-family: var(--font-serif, serif);
  font-size: 1.3rem;
  margin: 0 0 8px 0;
  color: var(--color-dark, #28201E);
}

.chat-welcome-screen p {
  font-size: 0.85rem;
  color: var(--color-text-muted, #615652);
  margin: 0 0 20px 0;
  line-height: 1.4;
}

#chatStartForm {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

#chatStartForm input {
  width: 100%;
  padding: 12px 16px;
  border: 1px solid var(--border-light, rgba(151, 134, 127, 0.25));
  border-radius: 12px;
  background: #FFFFFF;
  font-size: 0.88rem;
  outline: none;
  transition: border-color 0.2s;
  box-sizing: border-box;
}

#chatStartForm input:focus {
  border-color: var(--color-mauve, #AA6568);
}

#chatStartForm button {
  width: 100%;
  padding: 12px;
  border-radius: 12px;
  background: var(--color-mauve, #AA6568);
  color: #FFFFFF;
  border: none;
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  transition: background 0.2s;
}

#chatStartForm button:hover {
  background: var(--color-mauve-hover, #965457);
}

/* Messages Body */
.chat-messages {
  flex: 1;
  padding: 20px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
  background: var(--color-sand-light, #F9F7F5);
}

.chat-msg {
  display: flex;
  flex-direction: column;
  max-width: 82%;
}

.chat-msg.msg-user {
  align-self: flex-end;
  align-items: flex-end;
}

.chat-msg.msg-bot {
  align-self: flex-start;
  align-items: flex-start;
}

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

.msg-user .chat-msg-bubble {
  background: var(--color-mauve, #AA6568);
  color: #FFFFFF;
  border-bottom-right-radius: 4px;
}

.msg-bot .chat-msg-bubble {
  background: #FFFFFF;
  color: var(--color-dark, #28201E);
  border: 1px solid var(--border-light, rgba(151, 134, 127, 0.2));
  border-bottom-left-radius: 4px;
  box-shadow: 0 2px 8px rgba(40, 32, 30, 0.04);
}

.chat-msg-time {
  font-size: 0.68rem;
  color: rgba(97, 86, 82, 0.6);
  margin-top: 4px;
  padding: 0 4px;
}

/* Typing Indicator */
.chat-typing-indicator {
  align-self: flex-start;
  background: #FFFFFF;
  border: 1px solid var(--border-light, rgba(151, 134, 127, 0.2));
  padding: 10px 16px;
  border-radius: 16px;
  border-bottom-left-radius: 4px;
  display: flex;
  align-items: center;
  gap: 4px;
}

.chat-typing-indicator span {
  width: 6px;
  height: 6px;
  background: var(--color-mauve, #AA6568);
  border-radius: 50%;
  animation: chatDotBounce 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 chatDotBounce {
  0%, 80%, 100% { transform: translateY(0); }
  40% { transform: translateY(-6px); }
}

/* Footer Input */
.chat-footer {
  padding: 14px 16px;
  background: #FFFFFF;
  border-top: 1px solid var(--border-light, rgba(151, 134, 127, 0.2));
  display: flex;
  align-items: center;
  gap: 8px;
}

#chatInputText {
  flex: 1;
  padding: 10px 14px;
  border: 1px solid var(--border-light, rgba(151, 134, 127, 0.25));
  border-radius: 20px;
  font-size: 0.88rem;
  outline: none;
  background: var(--color-sand-light, #F9F7F5);
}

#chatInputText:focus {
  border-color: var(--color-mauve, #AA6568);
  background: #FFFFFF;
}

.chat-send-btn {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--color-mauve, #AA6568);
  color: #FFFFFF;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
  flex-shrink: 0;
}

.chat-send-btn:hover {
  background: var(--color-mauve-hover, #965457);
}

@media (max-width: 600px) {
  .chat-widget-container {
    left: 20px;
    bottom: 20px;
  }
  .chat-window {
    width: calc(100vw - 40px);
    left: 0;
    height: 480px;
  }
}
