/* ================================
   SS DRIVING CENTER — AI CHATBOT
   THEME: PURPLE & WHITE
   ================================ */

/* Toggle Button */
#ss-chat-toggle {
  position: fixed;
  bottom: 28px;
  right: 28px;
  z-index: 9998;
  width: 58px;
  height: 58px;
  border-radius: 50%;
  background: #6c3bff;
  color: #fff;
  font-size: 22px;
  border: none;
  cursor: pointer;
  box-shadow: 0 6px 24px rgba(108,59,255,0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.25s ease, box-shadow 0.25s ease, background 0.2s;
  animation: ssChatPulse 2.5s ease-in-out infinite;
}
#ss-chat-toggle:hover {
  background: #5a2ee6;
  transform: scale(1.1);
  box-shadow: 0 12px 36px rgba(108,59,255,0.55);
}
@keyframes ssChatPulse {
  0%, 100% { box-shadow: 0 6px 24px rgba(108,59,255,0.45), 0 0 0 0 rgba(108,59,255,0.35); }
  50%       { box-shadow: 0 6px 24px rgba(108,59,255,0.45), 0 0 0 12px rgba(108,59,255,0); }
}

/* Chat Window */
#ss-chat-window {
  position: fixed;
  bottom: 98px;
  right: 28px;
  width: 350px;
  height: 520px;
  background: #fff;
  border-radius: 20px;
  border: 1.5px solid rgba(108,59,255,0.12);
  box-shadow: 0 16px 56px rgba(108,59,255,0.18), 0 2px 8px rgba(0,0,0,0.08);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  z-index: 9997;
  transition: opacity 0.25s ease, transform 0.25s ease;
}
#ss-chat-window.ss-hidden {
  opacity: 0;
  pointer-events: none;
  transform: translateY(18px) scale(0.97);
}

/* Header */
.ss-chat-header {
  background: linear-gradient(135deg, #6c3bff 0%, #9b6dff 100%);
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
  position: relative;
  overflow: hidden;
}
/* Subtle shimmer line at bottom of header */
.ss-chat-header::after {
  content: '';
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.4), transparent);
}

.ss-chat-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(255,255,255,0.15);
  border: 2px solid rgba(255,255,255,0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 17px;
  color: #fff;
  flex-shrink: 0;
}
.ss-chat-info { flex: 1; }
.ss-chat-info .ss-bot-name {
  font-family: var(--font-h, 'Plus Jakarta Sans', sans-serif);
  font-size: 14px;
  font-weight: 800;
  color: #fff;
  line-height: 1.2;
}
.ss-chat-info .ss-bot-status {
  font-size: 11px;
  color: rgba(255,255,255,0.65);
  display: flex;
  align-items: center;
  gap: 5px;
  margin-top: 2px;
  font-family: var(--font, 'Inter', sans-serif);
}
.ss-chat-info .ss-bot-status::before {
  content: '';
  width: 6px;
  height: 6px;
  background: #86efac;
  border-radius: 50%;
  display: inline-block;
  flex-shrink: 0;
}

.ss-close-btn {
  background: none;
  border: none;
  color: rgba(255,255,255,0.65);
  font-size: 17px;
  cursor: pointer;
  padding: 6px;
  border-radius: 8px;
  transition: color 0.2s, background 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
}
.ss-close-btn:hover {
  color: #fff;
  background: rgba(255,255,255,0.15);
}

/* Messages Area */
#ss-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: #f9f7ff;
}
#ss-messages::-webkit-scrollbar { width: 4px; }
#ss-messages::-webkit-scrollbar-thumb {
  background: rgba(108,59,255,0.18);
  border-radius: 4px;
}

/* Messages */
.ss-msg {
  max-width: 84%;
  padding: 10px 14px;
  border-radius: 16px;
  font-size: 13.5px;
  line-height: 1.6;
  word-wrap: break-word;
  font-family: var(--font, 'Inter', sans-serif);
}
.ss-msg.bot {
  background: #fff;
  color: #1e1040;
  border: 1.5px solid rgba(108,59,255,0.1);
  border-bottom-left-radius: 4px;
  align-self: flex-start;
  box-shadow: 0 2px 10px rgba(108,59,255,0.08);
}
.ss-msg.user {
  background: linear-gradient(135deg, #6c3bff, #9b6dff);
  color: #fff;
  border-bottom-right-radius: 4px;
  align-self: flex-end;
  box-shadow: 0 4px 14px rgba(108,59,255,0.3);
  border: none;
}
.ss-msg.error {
  background: #fff5f5;
  color: #dc2626;
  border: 1.5px solid #fecaca;
  border-bottom-left-radius: 4px;
  align-self: flex-start;
  font-size: 13px;
}

/* Typing Indicator */
.ss-typing {
  display: flex;
  gap: 5px;
  align-items: center;
  padding: 12px 14px;
  background: #fff;
  border: 1.5px solid rgba(108,59,255,0.1);
  border-radius: 16px;
  border-bottom-left-radius: 4px;
  align-self: flex-start;
  width: fit-content;
  box-shadow: 0 2px 8px rgba(108,59,255,0.07);
}
.ss-typing span {
  width: 7px;
  height: 7px;
  background: #9b6dff;
  border-radius: 50%;
  animation: ssBounce 1.2s infinite;
}
.ss-typing span:nth-child(2) { animation-delay: 0.2s; }
.ss-typing span:nth-child(3) { animation-delay: 0.4s; }
@keyframes ssBounce {
  0%, 80%, 100% { transform: translateY(0); opacity: 0.55; }
  40%           { transform: translateY(-6px); opacity: 1; }
}

/* Quick Reply Chips */
.ss-quick-replies { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 2px; }
.ss-qr-btn {
  background: #f3eeff;
  color: #6c3bff;
  border: 1.5px solid rgba(108,59,255,0.2);
  border-radius: 999px;
  padding: 5px 14px;
  font-size: 12px;
  font-family: var(--font, 'Inter', sans-serif);
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s, transform 0.15s;
}
.ss-qr-btn:hover {
  background: #6c3bff;
  color: #fff;
  border-color: #6c3bff;
  transform: translateY(-1px);
}

/* Input Area */
.ss-chat-input {
  display: flex;
  gap: 8px;
  padding: 12px 14px;
  border-top: 1.5px solid rgba(108,59,255,0.1);
  background: #fff;
  align-items: center;
  flex-shrink: 0;
}
.ss-chat-input input {
  flex: 1;
  padding: 9px 14px;
  border: 1.5px solid rgba(108,59,255,0.15);
  border-radius: 12px;
  font-size: 13px;
  font-family: var(--font, 'Inter', sans-serif);
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
  color: #1e1040;
  background: #f9f7ff;
}
.ss-chat-input input:focus {
  border-color: #6c3bff;
  background: #fff;
  box-shadow: 0 0 0 3px rgba(108,59,255,0.1);
}
.ss-chat-input input::placeholder { color: rgba(108,59,255,0.35); }

.ss-send-btn {
  background: #6c3bff;
  color: #fff;
  border: none;
  width: 38px;
  height: 38px;
  border-radius: 12px;
  cursor: pointer;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background 0.2s, transform 0.15s, box-shadow 0.2s;
  box-shadow: 0 4px 12px rgba(108,59,255,0.35);
}
.ss-send-btn:hover {
  background: #5a2ee6;
  transform: scale(1.07);
  box-shadow: 0 6px 18px rgba(108,59,255,0.45);
}
.ss-send-btn:disabled {
  background: #c4b3ff;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

/* Mobile */
@media (max-width: 480px) {
  #ss-chat-window {
    width: calc(100vw - 24px);
    right: 12px;
    bottom: 90px;
  }
  #ss-chat-toggle {
    bottom: 20px;
    right: 16px;
    width: 52px;
    height: 52px;
    font-size: 20px;
  }
}
