/* ==========================================================================
   Anastasis Guide — Chat Widget Styles (anastasis.live theme)
   ========================================================================== */

/* --- Floating toggle button --- */
#anastasis-chat-btn {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background-color: #2B2E3D;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
  z-index: 9999;
  transition: background-color 0.2s ease, transform 0.15s ease;
}

#anastasis-chat-btn:hover {
  background-color: #252734;
  transform: scale(1.07);
}

#anastasis-chat-btn:focus-visible {
  outline: 3px solid #2B2E3D;
  outline-offset: 3px;
}

/* --- Side panel --- */
#anastasis-chat-panel {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: 380px;
  height: 100vh;
  background: #ffffff;
  box-shadow: -4px 0 24px rgba(0, 0, 0, 0.15);
  display: flex;
  flex-direction: column;
  z-index: 9998;
  transform: translateX(100%);
  transition: transform 0.28s cubic-bezier(0.4, 0, 0.2, 1);
  font-family: 'Public Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 14px;
  color: #22252E;
}

#anastasis-chat-panel.anastasis-panel-open {
  transform: translateX(0);
}

/* --- Header --- */
#anastasis-chat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  background-color: #2B2E3D;
  color: #ffffff;
  flex-shrink: 0;
}

#anastasis-chat-title {
  font-size: 16px;
  font-weight: 600;
  letter-spacing: 0.01em;
}

#anastasis-chat-close {
  background: none;
  border: none;
  color: #ffffff;
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
  padding: 0 4px;
  border-radius: 4px;
  transition: background-color 0.15s ease;
}

#anastasis-chat-close:hover {
  background-color: rgba(255, 255, 255, 0.2);
}

#anastasis-chat-close:focus-visible {
  outline: 2px solid #ffffff;
  outline-offset: 2px;
}

/* --- Message area --- */
#anastasis-chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  scroll-behavior: smooth;
}

/* --- Message bubbles --- */
.anastasis-msg {
  max-width: 88%;
  padding: 10px 14px;
  border-radius: 16px;
  line-height: 1.5;
  word-break: break-word;
}

.anastasis-msg-user {
  background-color: #2B2E3D;
  color: #ffffff;
  align-self: flex-end;
  border-bottom-right-radius: 4px;
}

.anastasis-msg-assistant {
  background-color: #F3F2F0;
  color: #22252E;
  align-self: flex-start;
  border-bottom-left-radius: 4px;
}

/* --- Source links --- */
.anastasis-msg-sources {
  background: none;
  padding: 2px 0 6px 0;
  font-size: 12px;
  color: #5B6178;
  align-self: flex-start;
  max-width: 100%;
}

.anastasis-sources-label {
  font-weight: 600;
}

.anastasis-msg-sources a {
  color: #2B2E3D;
  text-decoration: none;
}

.anastasis-msg-sources a:hover {
  text-decoration: underline;
}

/* --- Typing indicator --- */
.anastasis-typing {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 12px 16px;
}

.anastasis-typing span {
  display: inline-block;
  width: 8px;
  height: 8px;
  background-color: #95979E;
  border-radius: 50%;
  animation: anastasis-bounce 1.2s infinite ease-in-out;
}

.anastasis-typing span:nth-child(2) { animation-delay: 0.2s; }
.anastasis-typing span:nth-child(3) { animation-delay: 0.4s; }

@keyframes anastasis-bounce {
  0%, 80%, 100% { transform: scale(0.75); opacity: 0.5; }
  40%            { transform: scale(1);    opacity: 1;   }
}

/* --- Suggestion pills --- */
#anastasis-chat-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 8px 16px 0;
  flex-shrink: 0;
}

.anastasis-pill {
  background-color: #F3F2F0;
  color: #2B2E3D;
  border: 1px solid #E4E3E2;
  border-radius: 20px;
  padding: 6px 14px;
  font-size: 13px;
  cursor: pointer;
  transition: background-color 0.15s ease;
  white-space: nowrap;
}

.anastasis-pill:hover {
  background-color: #E4E3E2;
}

.anastasis-pill:focus-visible {
  outline: 2px solid #2B2E3D;
  outline-offset: 2px;
}

/* --- Input row --- */
#anastasis-chat-input-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  border-top: 1px solid #e0e0e0;
  flex-shrink: 0;
  background: #ffffff;
}

#anastasis-chat-input {
  flex: 1;
  border: 1px solid #dadce0;
  border-radius: 24px;
  padding: 10px 16px;
  font-size: 14px;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
  color: #22252E;
  background: #f8f9fa;
}

#anastasis-chat-input:focus {
  border-color: #2B2E3D;
  box-shadow: 0 0 0 2px rgba(43, 46, 61, 0.2);
  background: #ffffff;
}

#anastasis-chat-input:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

#anastasis-chat-send {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background-color: #2B2E3D;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background-color 0.15s ease;
}

#anastasis-chat-send:hover {
  background-color: #252734;
}

#anastasis-chat-send:disabled {
  background-color: #95979E;
  cursor: not-allowed;
}

#anastasis-chat-send:focus-visible {
  outline: 2px solid #2B2E3D;
  outline-offset: 2px;
}

/* ==========================================================================
   Mobile — below 768px: full-screen panel
   ========================================================================== */
@media (max-width: 768px) {
  #anastasis-chat-panel {
    width: 100vw;
    height: 100dvh;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    border-radius: 0;
  }

  #anastasis-chat-btn {
    bottom: 16px;
    right: 16px;
  }
}
