/* SPC ChatBot — Floating widget */
.spc-chat-widget {
  position: fixed;
  bottom: 1.5rem;
  left: 1.5rem;
  z-index: 50;
  font-family: inherit;
  font-size: 13px;
  line-height: 1.4;
}

.spc-chat-toggle {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: #2563eb;
  color: white;
  border: none;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s, box-shadow 0.2s;
}
.spc-chat-toggle:hover {
  transform: scale(1.05);
  box-shadow: 0 6px 20px rgba(37, 99, 235, 0.5);
}
.spc-chat-toggle svg {
  width: 28px;
  height: 28px;
}

.spc-chat-panel {
  display: none;
  position: absolute;
  bottom: 70px;
  left: 0;
  width: 340px;
  max-width: calc(100vw - 2rem);
  height: 480px;
  max-height: calc(100vh - 120px);
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
  overflow: hidden;
  flex-direction: column;
  border: 1px solid #e5e7eb;
}
.dark .spc-chat-panel {
  background: #1e293b;
  border-color: #475569;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4);
}
.spc-chat-panel.is-open {
  display: flex;
}

.spc-chat-title {
  flex: 0 0 auto;
  background: linear-gradient(135deg, #1e40af, #2563eb);
  color: #fff;
  padding: 12px 14px 12px 50px;
  position: relative;
}
.spc-chat-title h3 {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
}
.spc-chat-title p {
  margin: 2px 0 0;
  font-size: 11px;
  opacity: 0.9;
}
.spc-chat-title .spc-chat-avatar {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  width: 32px;
  height: 32px;
  border-radius: 50%;
  overflow: hidden;
  border: 2px solid rgba(255, 255, 255, 0.3);
}
.spc-chat-title .spc-chat-avatar img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #fff;
}

.spc-chat-messages {
  flex: 1 1 auto;
  overflow-y: auto;
  padding: 12px;
  background: #f9fafb;
}
.dark .spc-chat-messages {
  background: #0f172a;
}

.spc-chat-msg-wrap {
  clear: both;
  overflow: hidden;
}
.spc-chat-msg {
  clear: both;
  margin-bottom: 10px;
  padding: 8px 12px;
  border-radius: 12px 12px 12px 0;
  max-width: 85%;
  font-size: 13px;
  line-height: 1.45;
  animation: spc-msg-in 0.3s ease;
}
@keyframes spc-msg-in {
  from { opacity: 0; transform: scale(0.95); }
  to { opacity: 1; transform: scale(1); }
}
.spc-chat-msg.bot {
  float: left;
  background: rgba(0, 0, 0, 0.06);
  color: #374151;
}
.dark .spc-chat-msg.bot {
  background: rgba(255, 255, 255, 0.08);
  color: #e2e8f0;
}
.spc-chat-msg.user {
  float: right;
  background: linear-gradient(120deg, #2563eb, #1d4ed8);
  color: #fff;
  border-radius: 12px 12px 0 12px;
}
.spc-chat-msg.loading {
  float: left;
  padding: 12px 16px;
}
.spc-chat-msg.loading::after {
  content: '';
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  margin-left: 4px;
  animation: spc-dot 0.6s ease-in-out infinite;
}
.spc-chat-msg.loading span {
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  animation: spc-dot 0.6s ease-in-out 0.2s infinite;
}
@keyframes spc-dot {
  0%, 100% { opacity: 0.4; transform: translateY(0); }
  50% { opacity: 1; transform: translateY(-4px); }
}
.spc-chat-typing-dots {
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 10px 0 0 currentColor, 20px 0 0 currentColor;
  animation: spc-dot 0.6s ease-in-out infinite;
}
.spc-chat-msg.loading .spc-chat-typing-dots {
  opacity: 0.9;
}

.spc-chat-input-wrap {
  flex: 0 0 auto;
  padding: 10px 12px;
  background: #fff;
  border-top: 1px solid #e5e7eb;
}
.dark .spc-chat-input-wrap {
  background: #1e293b;
  border-color: #475569;
}

.spc-chat-input-row {
  display: flex;
  gap: 8px;
  align-items: center;
}
.spc-chat-input {
  flex: 1;
  border: 1px solid #d1d5db;
  border-radius: 10px;
  padding: 10px 14px;
  font-size: 13px;
  outline: none;
  transition: border-color 0.2s;
}
.spc-chat-input:focus {
  border-color: #2563eb;
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.2);
}
.dark .spc-chat-input {
  background: #0f172a;
  border-color: #475569;
  color: #f1f5f9;
}
.spc-chat-input::placeholder {
  color: #9ca3af;
}
.spc-chat-send {
  flex-shrink: 0;
  padding: 10px 16px;
  background: #2563eb;
  color: white;
  border: none;
  border-radius: 10px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
}
.spc-chat-send:hover {
  background: #1d4ed8;
}

.spc-chat-feedback {
  margin: -4px 0 10px 0;
  padding-left: 4px;
  font-size: 12px;
  color: #6b7280;
}
.dark .spc-chat-feedback {
  color: #94a3b8;
}
.spc-chat-feedback-label {
  margin-right: 6px;
}
.spc-chat-feedback-btn {
  margin-right: 6px;
  padding: 4px 10px;
  font-size: 11px;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  background: #fff;
  color: #374151;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}
.spc-chat-feedback-btn:hover {
  background: #f3f4f6;
  border-color: #2563eb;
  color: #2563eb;
}
.dark .spc-chat-feedback-btn {
  background: #1e293b;
  border-color: #475569;
  color: #e2e8f0;
}
.dark .spc-chat-feedback-btn:hover {
  background: #334155;
  border-color: #60a5fa;
  color: #60a5fa;
}
.spc-chat-feedback-done .spc-chat-feedback-label {
  font-style: italic;
}


