/* WP Assistant Chatbot Styles */

.wp-assistant-chatbot {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
  font-size: 14px;
  line-height: 1.5;
  color: #333;
}

/* Chat Toggle Button */
.wp-assistant-chat-toggle {
  position: fixed;
  width: 60px;
  height: 60px;
  /* border-radius: 50%; */
  /* background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); */
  background-color: transparent;
  border: none;
  /* box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15); */
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  transition: all 0.3s ease;
  z-index: 999998;
}

.wp-assistant-position-bottom-right .wp-assistant-chat-toggle {
  bottom: 20px;
  right: 20px;
}

.wp-assistant-position-bottom-left .wp-assistant-chat-toggle {
  bottom: 20px;
  left: 20px;
}

.wp-assistant-chat-toggle:hover {
  transform: scale(1.1);
  /* box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2); */
}

.wp-assistant-chat-toggle-text {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Chat Window */
.wp-assistant-chat-window {
  position: fixed;
  width: 380px;
  height: 600px;
  max-height: 80vh;
  background: white;
  border-radius: 16px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
  display: flex;
  flex-direction: column;
  z-index: 999999;
  animation: slideUp 0.3s ease-out;
  overflow: hidden;
}

.wp-assistant-position-bottom-right .wp-assistant-chat-window {
  bottom: 20px;
  right: 20px;
}

.wp-assistant-position-bottom-left .wp-assistant-chat-window {
  bottom: 20px;
  left: 20px;
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Chat Header */
.wp-assistant-chat-header {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  padding: 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-shrink: 0;
}

.wp-assistant-chat-header-content {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.wp-assistant-chat-title {
  color: white;
  margin: 0;
  font-size: 18px;
  font-weight: 600;
}

.wp-assistant-chat-status {
  font-size: 13px;
  opacity: 0.9;
}

.wp-assistant-chat-header-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}

.wp-assistant-chat-minimize,
.wp-assistant-chat-close,
.wp-assistant-clear-button {
  background: rgba(255, 255, 255, 0.2);
  border: none;
  color: white;
  cursor: pointer;
  padding: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  transition: all 0.2s ease;
  backdrop-filter: blur(10px);
}

.wp-assistant-chat-minimize:hover,
.wp-assistant-chat-close:hover,
.wp-assistant-clear-button:hover {
  background: rgba(255, 255, 255, 0.3);
  transform: translateY(-1px);
}

/* Thread and Messages Area */
.wp-assistant-thread {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.wp-assistant-chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.wp-assistant-chat-messages::-webkit-scrollbar {
  width: 6px;
}

.wp-assistant-chat-messages::-webkit-scrollbar-track {
  background: #f1f1f1;
}

.wp-assistant-chat-messages::-webkit-scrollbar-thumb {
  background: #c1c1c1;
  border-radius: 3px;
}

.wp-assistant-chat-messages::-webkit-scrollbar-thumb:hover {
  background: #a8a8a8;
}

/* Messages */
.wp-assistant-message-user,
.wp-assistant-message-assistant {
  display: flex;
  gap: 12px;
  animation: fadeIn 0.3s ease-out;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.wp-assistant-message-user {
  flex-direction: row-reverse;
}

.wp-assistant-message-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.wp-assistant-message-user .wp-assistant-message-avatar {
  background: #f0f0f0;
  color: #667eea;
}

.wp-assistant-message-assistant .wp-assistant-message-avatar {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
}

.wp-assistant-message-content {
  max-width: 75%;
  padding: 12px 16px;
  border-radius: 16px;
  word-wrap: break-word;
  font-size: 14px;
  line-height: 1.5;
}

.wp-assistant-message-user .wp-assistant-message-content {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border-bottom-right-radius: 4px;
}

.wp-assistant-message-assistant .wp-assistant-message-content {
  background: #f8f9fa;
  color: #333;
  border-bottom-left-radius: 4px;
}

/* Suggested Questions */
.wp-assistant-suggested-questions {
  background: linear-gradient(135deg, rgba(102, 126, 234, 0.05) 0%, rgba(118, 75, 162, 0.05) 100%);
  border: 1px solid rgba(102, 126, 234, 0.15);
  border-radius: 12px;
  padding: 20px;
  margin: 16px 0;
}

.wp-assistant-suggested-questions-title {
  margin: 0 0 12px 0;
  font-size: 14px;
  font-weight: 600;
  color: #667eea;
}

.wp-assistant-suggested-questions-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.wp-assistant-suggested-question {
  background: white;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: left;
  color: #333;
}

.wp-assistant-suggested-question:hover {
  background: #f8f9fa;
  border-color: #667eea;
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(102, 126, 234, 0.15);
}

/* Composer */
.wp-assistant-chat-composer {
  padding: 20px;
  border-top: 1px solid #e0e0e0;
  background: #f8f9fa;
  display: flex;
  gap: 12px;
  align-items: center;
  flex-shrink: 0;
}

.wp-assistant-composer-input {
  flex: 1;
  background: white;
  border: 1px solid #e0e0e0;
  border-radius: 24px;
  outline: none;
  font-size: 14px;
  padding: 12px 16px;
  color: #333;
  transition: all 0.2s ease;
}

.wp-assistant-composer-input:focus {
  border-color: #667eea;
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.wp-assistant-composer-input::placeholder {
  color: #999;
}

.wp-assistant-composer-input:disabled {
  background: #f5f5f5;
  color: #999;
}

.wp-assistant-composer-send {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border: none;
  color: white;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
  padding: 0;
  min-width: 40px;
  min-height: 40px;
}

.wp-assistant-composer-send:hover:not(:disabled) {
  transform: scale(1.05);
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.wp-assistant-composer-send:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  background: #ccc;
}

/* Ensure the SVG icon inside the button is properly sized */
.wp-assistant-composer-send svg {
  width: 20px;
  height: 20px;
  display: block;
}

/* Clear button in header */
.wp-assistant-clear-button {
  background: rgba(255, 255, 255, 0.2);
  border: none;
  color: white;
  cursor: pointer;
  padding: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  transition: all 0.2s ease;
  backdrop-filter: blur(10px);
}

.wp-assistant-clear-button:hover {
  background: rgba(255, 255, 255, 0.3);
  transform: translateY(-1px);
}

/* Theme Variations */
.wp-assistant-theme-dark .wp-assistant-chat-window {
  background: #1a1a1a;
  color: #e0e0e0;
}

.wp-assistant-theme-dark .wp-assistant-chat-header {
  background: linear-gradient(135deg, #4a5568 0%, #2d3748 100%);
}

.wp-assistant-theme-dark .wp-assistant-chat-messages {
  background: #1a1a1a;
}

.wp-assistant-theme-dark .wp-assistant-message-assistant .wp-assistant-message-content {
  background: #2d2d2d;
  color: #e0e0e0;
}

.wp-assistant-theme-dark .wp-assistant-chat-composer {
  background: #1a1a1a;
  border-top-color: #333;
}

.wp-assistant-theme-dark .wp-assistant-composer-input {
  background: #2d2d2d;
  border-color: #444;
  color: #e0e0e0;
}

.wp-assistant-theme-dark .wp-assistant-suggested-questions {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.05) 0%, rgba(255, 255, 255, 0.03) 100%);
  border-color: rgba(255, 255, 255, 0.1);
}

.wp-assistant-theme-dark .wp-assistant-suggested-question {
  background: #2d2d2d;
  border-color: #444;
  color: #e0e0e0;
}

.wp-assistant-theme-dark .wp-assistant-suggested-question:hover {
  background: #3d3d3d;
  border-color: #667eea;
}

/* Mobile Responsive */
@media (max-width: 480px) {
  .wp-assistant-chat-window {
    width: calc(100vw - 20px);
    height: calc(100vh - 100px);
    max-height: none;
    bottom: 10px !important;
    right: 10px !important;
    left: 10px !important;
  }
  
  .wp-assistant-chat-toggle {
    bottom: 10px !important;
    right: 10px !important;
    left: auto !important;
  }
  
  .wp-assistant-chat-messages {
    padding: 16px;
  }
  
  .wp-assistant-chat-header {
    padding: 16px;
  }
  
  .wp-assistant-chat-composer {
    padding: 16px;
  }
}

/* Minimal Theme */
.wp-assistant-theme-minimal .wp-assistant-chat-window {
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  border: 1px solid #e0e0e0;
}

.wp-assistant-theme-minimal .wp-assistant-chat-header {
  background: white;
  color: #333;
  border-bottom: 1px solid #e0e0e0;
}

.wp-assistant-theme-minimal .wp-assistant-chat-minimize,
.wp-assistant-theme-minimal .wp-assistant-chat-close,
.wp-assistant-theme-minimal .wp-assistant-clear-button {
  color: #666;
  background: #f0f0f0;
}

.wp-assistant-theme-minimal .wp-assistant-chat-toggle {
  background: white;
  color: #667eea;
  border: 2px solid #667eea;
}

.wp-assistant-theme-minimal .wp-assistant-message-user .wp-assistant-message-content {
  background: #f0f0f0;
  color: #333;
}

/* Light Theme */
.wp-assistant-theme-light .wp-assistant-chat-header {
  background: #f8f9fa;
  color: #333;
  border-bottom: 1px solid #dee2e6;
}

.wp-assistant-theme-light .wp-assistant-chat-minimize,
.wp-assistant-theme-light .wp-assistant-chat-close,
.wp-assistant-theme-light .wp-assistant-clear-button {
  color: #495057;
  background: #e9ecef;
}

.wp-assistant-theme-light .wp-assistant-chat-toggle {
  background: #f8f9fa;
  color: #495057;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* Markdown content styling */
.wp-assistant-message-content h1,
.wp-assistant-message-content h2,
.wp-assistant-message-content h3 {
  margin: 0 0 8px 0;
  font-weight: bold;
}

.wp-assistant-message-content h1 { font-size: 1.2em; }
.wp-assistant-message-content h2 { font-size: 1.1em; }
.wp-assistant-message-content h3 { font-size: 1em; }

.wp-assistant-message-content blockquote {
  margin: 8px 0;
  padding-left: 12px;
  border-left: 3px solid #667eea;
  color: #666;
}

.wp-assistant-message-content table {
  border-collapse: collapse;
  margin: 8px 0;
  font-size: 0.9em;
}

.wp-assistant-message-content th,
.wp-assistant-message-content td {
  border: 1px solid #ddd;
  padding: 6px 8px;
  text-align: left;
}

.wp-assistant-message-content th {
  background: #f5f5f5;
  font-weight: bold;
}

.wp-assistant-message-content hr {
  border: none;
  border-top: 1px solid #ddd;
  margin: 12px 0;
}
