/**
 * DeepSell Chatbot Styles for Squarespace
 * Converted from SCSS to vanilla CSS
 */

/* Main chatbot container */
.chatbot-footer {
  position: relative;
  width: 100%;
  background: white;
  border-top: 1px solid #e9ecef;
  box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.06);
  transition: all 0.3s ease;
}

.chatbot-footer__container {
  max-width: 1100px;
  margin: 0 auto;
  position: relative;
  padding: 16px 20px 32px;
}

/* Header styling */
.chatbot-footer__header {
  display: flex;
  align-items: center;
  padding: 8px 0 12px;
}

.chatbot-footer__header-left {
  display: flex;
  gap: 16px;
  align-items: center;
}

.chatbot-footer__title {
  font-size: 28px;
  font-weight: 700;
  color: #0f6b67;
  display: flex;
  align-items: center;
  gap: 4px;
}

.chatbot-footer__title-block {
  display: flex;
  flex-direction: column;
  margin-left: 24px;
}

.chatbot-footer__date {
  font-size: 12px;
  color: #596c6a;
  margin-top: 6px;
}

.chatbot-footer__subtitle {
  font-size: 13px;
  color: #596c6a;
  margin-top: 4px;
}

/* Chat panel */
.chatbot-footer__panel {
  background: #fff;
  border-top: none;
  display: flex;
  flex-direction: column;
  min-height: 250px;
  max-height: 400px;
  margin-top: 3px;
  overflow-y: auto;
}

/* Custom scrollbar for the panel */
.chatbot-footer__panel::-webkit-scrollbar {
  width: 6px;
}

.chatbot-footer__panel::-webkit-scrollbar-track {
  background: transparent;
}

.chatbot-footer__panel::-webkit-scrollbar-thumb {
  background: #ced4da;
  border-radius: 3px;
}

.chatbot-footer__panel::-webkit-scrollbar-thumb:hover {
  background: #adb5bd;
}

/* Action buttons */
.chatbot-footer__actions-top {
  position: absolute;
  top: 12px;
  right: 20px;
  display: flex;
  gap: 8px;
}

.chatbot-footer__action-btn {
  width: 32px;
  height: 32px;
  border: none;
  background: transparent;
  color: #6c757d;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
}

.chatbot-footer__action-btn:hover {
  background: #e9ecef;
  color: #495057;
}

/* Messages container */
.chatbot-footer__messages {
  flex: 1;
  overflow-y: auto;
}

.chatbot-footer__messages::-webkit-scrollbar {
  width: 6px;
}

.chatbot-footer__messages::-webkit-scrollbar-track {
  background: transparent;
}

.chatbot-footer__messages::-webkit-scrollbar-thumb {
  background: #ced4da;
  border-radius: 3px;
}

.chatbot-footer__messages::-webkit-scrollbar-thumb:hover {
  background: #adb5bd;
}

/* Welcome screen */
.chatbot-footer__welcome {
  padding: 28px 24px;
  text-align: left;
  display: block;
}

/* Suggestions */
.chatbot-footer__suggestions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-start;
  max-width: 760px;
  margin: 0;
}

.chatbot-footer__suggestion {
  padding: 8px 16px;
  border: 1px solid rgba(15, 107, 103, 0.12);
  background: #fff;
  border-radius: 20px;
  font-size: 13px;
  color: #0f6b67;
  cursor: pointer;
  transition: all 0.15s ease;
  box-shadow: 0 1px 2px rgba(15, 107, 103, 0.03);
}

.chatbot-footer__suggestion:hover {
  background: rgba(15, 107, 103, 0.04);
  border-color: rgba(15, 107, 103, 0.18);
}

/* Message list */
.chatbot-footer__message-list {
  padding: 16px 24px;
}

/* Chat messages */
.chat-message {
  margin-bottom: 16px;
  display: flex;
  flex-direction: column;
}

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

.chat-message--ai {
  align-items: flex-start;
}

.chat-message__content {
  max-width: 70%;
  padding: 12px 16px;
  border-radius: 18px;
  position: relative;
}

.chat-message--user .chat-message__content {
  background: #0f6b67;
  color: white;
  border-bottom-right-radius: 4px;
}

.chat-message--ai .chat-message__content {
  background: #f8f9fa;
  color: #333;
  border-bottom-left-radius: 4px;
}

.chat-message__text {
  font-size: 14px;
  line-height: 1.4;
  word-wrap: break-word;
}

.chat-message__time {
  font-size: 11px;
  opacity: 0.7;
  margin-top: 4px;
}

/* Typing indicator */
.chat-message--typing .chat-message__content {
  padding: 16px;
}

.typing-dots {
  display: flex;
  align-items: center;
  gap: 4px;
}

.typing-dots span {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #0f6b67;
  animation: typingDots 1.4s ease-in-out infinite both;
}

.typing-dots span:nth-child(1) {
  animation-delay: -0.32s;
}

.typing-dots span:nth-child(2) {
  animation-delay: -0.16s;
}

.typing-dots span:nth-child(3) {
  animation-delay: 0s;
}

@keyframes typingDots {
  0%, 80%, 100% {
    opacity: 0.3;
    transform: scale(1);
  }
  40% {
    opacity: 1;
    transform: scale(1.2);
  }
}

/* Chat input */
.chat-input {
  padding: 16px;
  border-top: 1px solid #e9ecef;
  background-color: white;
}

.chat-input__container {
  display: flex;
  align-items: flex-start;
  gap: 8px;
}

.chat-input__field {
  flex: 1;
  position: relative;
}

.chat-input__textarea {
  width: 100%;
  min-height: 48px;
  max-height: 160px;
  padding: 14px 18px;
  border: 2px solid rgba(15, 107, 103, 0.25);
  border-radius: 12px;
  font-size: 16px;
  line-height: 22px;
  resize: none;
  outline: none;
  font-family: inherit;
  box-sizing: border-box;
}

.chat-input__textarea:focus {
  border-color: rgba(15, 107, 103, 0.9);
  box-shadow: 0 4px 18px rgba(15, 107, 103, 0.08);
}

.chat-input__textarea:disabled {
  background-color: #e9ecef;
  opacity: 0.6;
  cursor: not-allowed;
}

.chat-input__textarea::placeholder {
  color: #6c757d;
}

.chat-input__send {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  border: none;
  background-color: #0f6b67;
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  align-self: flex-start;
  margin-top: 2px;
  cursor: pointer;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.chat-input__send:hover:not(:disabled) {
  background-color: #0d5b57;
  transform: translateY(-1px);
}

.chat-input__send:active:not(:disabled) {
  transform: scale(0.95);
}

.chat-input__send:disabled {
  background-color: rgba(15, 107, 103, 0.3);
  color: rgba(255, 255, 255, 0.7);
  cursor: not-allowed;
  transform: none;
}

.chat-input__error {
  margin-top: 4px;
  padding: 0 12px;
}

.text-danger {
  color: #dc3545;
}

/* Loading animation */
@keyframes spin {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

/* Mobile responsiveness */
@media (max-width: 768px) {
  .chatbot-footer__container {
    margin: 0;
    padding: 12px 16px 24px;
  }
  
  .chatbot-footer__welcome {
    padding: 20px 16px;
  }
  
  .chatbot-footer__message-list {
    padding: 16px;
  }
  
  .chat-input {
    padding: 12px;
  }
  
  .chat-input__textarea {
    font-size: 16px;
  }
  
  .chat-message__content {
    max-width: 85%;
  }
}

@media (max-width: 480px) {
  .chatbot-footer__title {
    font-size: 24px;
  }
  
  .chatbot-footer__title-block {
    margin-left: 16px;
  }
  
  .chatbot-footer__suggestions {
    gap: 6px;
  }
  
  .chatbot-footer__suggestion {
    padding: 6px 12px;
    font-size: 12px;
  }
  
  .chat-message__content {
    max-width: 90%;
    padding: 10px 14px;
  }
  
  .chatbot-footer__panel {
    min-height: 200px;
    max-height: 300px;
  }
}

/* Focus states for accessibility */
.chatbot-footer__suggestion:focus,
.chatbot-footer__action-btn:focus,
.chat-input__send:focus {
  outline: 2px solid #0f6b67;
  outline-offset: 2px;
}

.chat-input__textarea:focus {
  outline: none;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
  .chatbot-footer {
    border-top: 2px solid #333;
  }
  
  .chatbot-footer__suggestion {
    border: 2px solid #0f6b67;
  }
  
  .chat-input__textarea {
    border: 3px solid #0f6b67;
  }
}
