/* Chat Widget Styles - Gruvbox themed */
.chat-widget-fab {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  width: 3.5rem;
  height: 3.5rem;
  border-radius: 50%;
  background: #fe8019;
  color: #282828;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  z-index: 9999;
  transition: transform 0.2s, background 0.2s;
}

.chat-widget-fab:hover {
  transform: scale(1.1);
  background: #d65d0e;
}

.chat-widget-fab svg {
  width: 1.5rem;
  height: 1.5rem;
}

.chat-widget-panel {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  width: 24rem;
  max-width: calc(100vw - 3rem);
  height: 32rem;
  max-height: calc(100vh - 6rem);
  background: #282828;
  border: 1px solid #504945;
  border-radius: 0.75rem;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
  z-index: 9999;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.chat-widget-header {
  background: #3c3836;
  padding: 0.75rem 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid #504945;
  border-radius: 0.75rem 0.75rem 0 0;
}

.chat-widget-header-title {
  color: #fe8019;
  font-weight: 600;
  font-size: 0.875rem;
  font-family: 'JetBrains Mono', monospace;
}

.chat-widget-header-badge {
  color: #928374;
  font-size: 0.7rem;
  margin-left: 0.5rem;
}

.chat-widget-header-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.chat-widget-header-btn {
  background: none;
  border: none;
  color: #a89984;
  cursor: pointer;
  font-size: 0.75rem;
  font-family: 'JetBrains Mono', monospace;
  padding: 0.25rem;
  transition: color 0.2s;
}

.chat-widget-header-btn:hover {
  color: #ebdbb2;
}

.chat-widget-close {
  background: none;
  border: none;
  color: #a89984;
  cursor: pointer;
  padding: 0.25rem;
  display: flex;
  align-items: center;
  transition: color 0.2s;
}

.chat-widget-close:hover {
  color: #ebdbb2;
}

.chat-widget-close svg {
  width: 1.25rem;
  height: 1.25rem;
}

.chat-widget-messages {
  flex: 1;
  overflow-y: auto;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.chat-widget-messages::-webkit-scrollbar {
  width: 4px;
}

.chat-widget-messages::-webkit-scrollbar-track {
  background: transparent;
}

.chat-widget-messages::-webkit-scrollbar-thumb {
  background: #504945;
  border-radius: 2px;
}

.chat-widget-empty {
  text-align: center;
  color: #a89984;
  font-size: 0.875rem;
  padding: 2rem 0;
  font-family: 'JetBrains Mono', monospace;
}

.chat-widget-empty-sub {
  font-size: 0.75rem;
  margin-top: 0.5rem;
  color: #928374;
}

.chat-widget-msg {
  display: flex;
}

.chat-widget-msg-user {
  justify-content: flex-end;
}

.chat-widget-msg-assistant {
  justify-content: flex-start;
}

.chat-widget-bubble {
  max-width: 80%;
  padding: 0.5rem 0.75rem;
  border-radius: 0.5rem;
  font-size: 0.8125rem;
  line-height: 1.5;
  white-space: pre-wrap;
  word-break: break-word;
  font-family: 'JetBrains Mono', -apple-system, sans-serif;
}

.chat-widget-bubble-user {
  background: #504945;
  color: #ebdbb2;
}

.chat-widget-bubble-assistant {
  background: #3c3836;
  color: #ebdbb2;
}

.chat-widget-typing {
  display: inline-flex;
  gap: 0.25rem;
  padding: 0.25rem 0;
}

.chat-widget-typing-dot {
  width: 0.375rem;
  height: 0.375rem;
  border-radius: 50%;
  background: #a89984;
  animation: chat-bounce 1.2s infinite;
}

.chat-widget-typing-dot:nth-child(2) {
  animation-delay: 0.15s;
}

.chat-widget-typing-dot:nth-child(3) {
  animation-delay: 0.3s;
}

@keyframes chat-bounce {
  0%, 60%, 100% {
    transform: translateY(0);
  }
  30% {
    transform: translateY(-4px);
  }
}

.chat-widget-error {
  text-align: center;
  color: #fb4934;
  font-size: 0.75rem;
  padding: 0.25rem 0;
}

.chat-widget-form {
  padding: 0.75rem;
  border-top: 1px solid #504945;
  display: flex;
  gap: 0.5rem;
}

.chat-widget-input {
  flex: 1;
  background: #3c3836;
  color: #ebdbb2;
  border: 1px solid #504945;
  border-radius: 0.5rem;
  padding: 0.5rem 0.75rem;
  font-size: 0.8125rem;
  font-family: 'JetBrains Mono', -apple-system, sans-serif;
  outline: none;
  transition: border-color 0.2s;
}

.chat-widget-input::placeholder {
  color: #928374;
}

.chat-widget-input:focus {
  border-color: #fe8019;
}

.chat-widget-input:disabled {
  opacity: 0.5;
}

.chat-widget-send {
  background: #fe8019;
  color: #282828;
  border: none;
  border-radius: 0.5rem;
  padding: 0.5rem 0.75rem;
  font-size: 0.8125rem;
  font-weight: 600;
  font-family: 'JetBrains Mono', monospace;
  cursor: pointer;
  transition: background 0.2s;
}

.chat-widget-send:hover {
  background: #d65d0e;
}

.chat-widget-send:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
