.plugin-chat-container {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 50;
  font-family: system-ui, -apple-system, sans-serif;
}

.plugin-chat-toggle {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: var(--primary-color, #000);
  color: white;
  border: none;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s;
}

.plugin-chat-toggle:hover {
  transform: scale(1.05);
}

.plugin-chat-drawer {
  position: absolute;
  bottom: 80px;
  right: 0;
  width: 350px;
  height: 500px;
  max-height: calc(100vh - 100px);
  background: white;
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.2);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid #e5e7eb;
}

.plugin-chat-drawer.hidden {
  display: none;
}

.plugin-chat-header {
  background: var(--primary-color, #000);
  color: white;
  padding: 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.plugin-chat-header h3 {
  margin: 0;
  font-size: 16px;
}

.plugin-chat-close {
  background: none;
  border: none;
  color: white;
  font-size: 24px;
  cursor: pointer;
  line-height: 1;
}

.plugin-chat-messages {
  flex: 1;
  padding: 16px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
  background: #f9fafb;
}

.plugin-chat-message {
  max-width: 85%;
  padding: 10px 14px;
  border-radius: 12px;
  font-size: 14px;
  line-height: 1.4;
  word-break: break-word;
}

.plugin-chat-message.user {
  align-self: flex-end;
  background: var(--primary-color, #000);
  color: white;
  border-bottom-right-radius: 4px;
}

.plugin-chat-message.assistant {
  align-self: flex-start;
  background: #e5e7eb;
  color: #111827;
  border-bottom-left-radius: 4px;
}

.plugin-chat-message.loading {
  color: #6b7280;
  animation: pulse 1.5s infinite;
}

.plugin-chat-form {
  display: flex;
  padding: 12px;
  background: white;
  border-top: 1px solid #e5e7eb;
}

.plugin-chat-input {
  flex: 1;
  padding: 10px 12px;
  border: 1px solid #d1d5db;
  border-radius: 20px;
  outline: none;
  font-size: 14px;
}

.plugin-chat-input:focus {
  border-color: var(--primary-color, #000);
}

.plugin-chat-submit {
  background: none;
  border: none;
  color: var(--primary-color, #000);
  font-weight: 600;
  padding: 0 12px;
  cursor: pointer;
}

.plugin-chat-submit:disabled {
  color: #9ca3af;
  cursor: not-allowed;
}

@keyframes pulse {
  0% { opacity: 0.5; }
  50% { opacity: 1; }
  100% { opacity: 0.5; }
}

@media (max-width: 480px) {
  .plugin-chat-drawer {
    width: calc(100vw - 40px);
    right: 0;
  }
}
