/* Floating AI assistant widget — isolated from styles.css, brand-consistent. */

.ai-widget-toggle {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 1050;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 18px;
  border-radius: 999px;
  border: 1px solid rgba(50, 205, 50, 0.4);
  background: #0a0a0a;
  color: #32cd32;
  font-weight: 600;
  font-size: 0.9rem;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
  cursor: pointer;
  transition: transform 0.2s ease, background 0.2s ease;
}

.ai-widget-toggle:hover {
  background: rgba(50, 205, 50, 0.12);
  transform: translateY(-2px);
}

.ai-widget-panel {
  position: fixed;
  right: 20px;
  bottom: 84px;
  z-index: 1050;
  width: min(380px, calc(100vw - 40px));
  height: min(560px, calc(100vh - 120px));
  display: none;
  flex-direction: column;
  background: #141414;
  border: 1px solid rgba(50, 205, 50, 0.25);
  border-radius: 1rem;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
  overflow: hidden;
}

.ai-widget-panel.is-open {
  display: flex;
}

.ai-widget-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border-bottom: 1px solid rgba(50, 205, 50, 0.15);
  color: #32cd32;
  font-weight: 700;
}

.ai-widget-header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.ai-widget-close {
  background: none;
  border: none;
  color: #ffffff;
  font-size: 1.1rem;
  cursor: pointer;
  line-height: 1;
}

.ai-widget-clear {
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.55);
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  cursor: pointer;
  padding: 0;
}

.ai-widget-clear:hover {
  color: #32cd32;
}

.ai-widget-messages {
  flex: 1;
  overflow-y: auto;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  font-size: 0.88rem;
  line-height: 1.5;
}

.ai-widget-msg {
  padding: 8px 12px;
  border-radius: 10px;
  max-width: 88%;
  white-space: pre-wrap;
}

.ai-widget-msg--assistant {
  align-self: flex-start;
  background: rgba(255, 255, 255, 0.05);
  color: #e5e5e5;
}

.ai-widget-msg--user {
  align-self: flex-end;
  background: rgba(50, 205, 50, 0.15);
  color: #ffffff;
}

.ai-widget-msg--error {
  align-self: flex-start;
  background: rgba(220, 53, 69, 0.15);
  color: #f5a3ab;
}

.ai-widget-form {
  display: flex;
  gap: 8px;
  padding: 12px;
  border-top: 1px solid rgba(50, 205, 50, 0.15);
}

.ai-widget-input {
  flex: 1;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  padding: 8px 10px;
  color: #ffffff;
  font-size: 0.85rem;
}

.ai-widget-input:focus {
  outline: none;
  border-color: #32cd32;
}

.ai-widget-send {
  background: #32cd32;
  color: #0a0a0a;
  border: none;
  border-radius: 8px;
  padding: 8px 14px;
  font-weight: 600;
  font-size: 0.85rem;
  cursor: pointer;
}

.ai-widget-send:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.ai-widget-disclaimer {
  padding: 0 14px 12px;
  font-size: 0.72rem;
  color: rgba(255, 255, 255, 0.45);
  line-height: 1.4;
}

.ai-widget-disclaimer a {
  color: #32cd32;
}

@media (max-width: 480px) {
  .ai-widget-panel {
    right: 12px;
    left: 12px;
    width: auto;
  }
  .ai-widget-toggle {
    right: 12px;
  }
}
