/* Action Agent for WordPress - Floating Public Widget Styles */

.aa-widget-container {
  position: fixed;
  z-index: 999999;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  line-height: 1.4;
  color: #1e293b;
  box-sizing: border-box;
}

.aa-widget-container * {
  box-sizing: border-box;
}

.aa-widget-bottom-right {
  bottom: 24px;
  right: 24px;
}

.aa-widget-bottom-left {
  bottom: 24px;
  left: 24px;
}

/* Floating Launcher Button */
.aa-launcher-btn {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background-color: var(--aa-brand-color, #b7791f);
  color: #ffffff;
  border: none;
  border-radius: 9999px;
  /* Minimal icon-only launcher: a small circle, not a wide labelled pill. */
  width: 40px;
  height: 40px;
  padding: 0;
  gap: 0;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 10px 25px -5px rgba(183, 121, 31, 0.4), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.aa-launcher-icon {
  width: 19px;
  height: 19px;
  display: block;
}

.aa-launcher-btn:hover {
  transform: translateY(-2px) scale(1.02);
  box-shadow: 0 14px 30px -5px rgba(183, 121, 31, 0.5);
}

.aa-preview-bubble {
  display: none;
  max-width: 280px;
  margin: 0 0 12px auto;
  padding: 12px 14px;
  background: #ffffff;
  color: #1e293b;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.14);
  font-size: 13px;
  line-height: 1.4;
  text-align: left;
  cursor: pointer;
}

.aa-widget-bottom-left .aa-preview-bubble {
  margin-right: auto;
  margin-left: 0;
}

.aa-preview-bubble-visible {
  display: block;
  animation: aa-slide-up 0.25s ease-out forwards;
}

.aa-launcher-badge {
  /* Corner status dot: absolute so it does not offset the centred icon. */
  position: absolute;
  top: 2px;
  right: 2px;
  width: 7px;
  height: 7px;
  background-color: #22c55e;
  border: 1.5px solid #ffffff;
  border-radius: 50%;
}

/* Main Agent Panel Window */
.aa-panel {
  display: none;
  flex-direction: column;
  position: absolute;
  bottom: 54px;
  width: 390px;
  max-width: calc(100vw - 32px);
  height: 600px;
  max-height: calc(100vh - 100px);
  background: #ffffff;
  border-radius: 20px;
  box-shadow: 0 20px 40px -15px rgba(0, 0, 0, 0.18), 0 0 0 1px rgba(0, 0, 0, 0.05);
  overflow: hidden;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.aa-panel.aa-panel-open {
  display: flex;
  animation: aa-slide-up 0.3s ease-out forwards;
}

@keyframes aa-slide-up {
  from { opacity: 0; transform: translateY(16px) scale(0.96); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.aa-widget-bottom-right .aa-panel { right: 0; }
.aa-widget-bottom-left .aa-panel { left: 0; }

/* Panel Header */
.aa-panel-header {
  background: linear-gradient(135deg, var(--aa-brand-color, #b7791f) 0%, #8a5a12 100%);
  color: #ffffff;
  padding: 20px;
  position: relative;
}

.aa-header-title {
  font-size: 18px;
  font-weight: 700;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 8px;
}

.aa-header-subtitle {
  font-size: 13px;
  opacity: 0.88;
  margin-top: 4px;
}

.aa-close-btn {
  position: absolute;
  top: 16px;
  right: 16px;
  background: rgba(255, 255, 255, 0.15);
  border: none;
  color: #ffffff;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.aa-close-btn:hover {
  background: rgba(255, 255, 255, 0.25);
}

/* Panel Body Views */
.aa-panel-body {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  background-color: #f8fafc;
}

/* Home Screen Card & Greeting */
.aa-greeting-card {
  background: #ffffff;
  border-radius: 14px;
  padding: 16px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
  border: 1px solid #e2e8f0;
}

.aa-greeting-card h4 {
  margin: 0 0 6px 0;
  font-size: 15px;
  color: #0f172a;
}

.aa-greeting-card p {
  margin: 0;
  font-size: 13px;
  color: #64748b;
  line-height: 1.5;
}

/* Whole Prompt Suggestions Section */
.aa-prompts-section {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.aa-section-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #94a3b8;
  margin-bottom: 2px;
}

.aa-prompt-chip {
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  padding: 10px 14px;
  font-size: 13px;
  font-weight: 500;
  color: #1e293b;
  text-align: left;
  cursor: pointer;
  transition: all 0.15s ease;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.aa-prompt-chip:hover {
  border-color: var(--aa-brand-color, #b7791f);
  background-color: #f0f6ff;
  color: #8a5a12;
  transform: translateX(2px);
}

.aa-prompt-chip::after {
  content: ">";
  opacity: 0.5;
  font-size: 14px;
}

/* Chat Messages */
.aa-chat-messages {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.aa-msg {
  max-width: 85%;
  padding: 12px 16px;
  border-radius: 14px;
  font-size: 14px;
  line-height: 1.5;
  word-wrap: break-word;
}

.aa-msg-assistant {
  align-self: flex-start;
  background: #ffffff;
  color: #1e293b;
  border: 1px solid #e2e8f0;
  border-bottom-left-radius: 4px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

.aa-msg-user {
  align-self: flex-end;
  background: var(--aa-brand-color, #b7791f);
  color: #ffffff;
  border-bottom-right-radius: 4px;
}

/* Action Cards */
.aa-action-card {
  background: #ffffff;
  border: 1.5px solid #b7791f;
  border-radius: 12px;
  padding: 14px;
  margin-top: 8px;
  box-shadow: 0 4px 12px rgba(183, 121, 31, 0.08);
}

.aa-action-card h5 {
  margin: 0 0 4px 0;
  font-size: 14px;
  color: #1e293b;
}

.aa-action-card p {
  margin: 0 0 12px 0;
  font-size: 12px;
  color: #64748b;
}

.aa-action-btn {
  display: block;
  width: 100%;
  padding: 8px 12px;
  background: var(--aa-brand-color, #b7791f);
  color: #ffffff;
  border: none;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  text-align: center;
  cursor: pointer;
}

.aa-action-btn:hover {
  background: #8a5a12;
}

/* Panel Footer Input Area */
.aa-panel-footer {
  padding: 12px 16px;
  background: #ffffff;
  border-top: 1px solid #e2e8f0;
  display: flex;
  gap: 8px;
  align-items: center;
}

.aa-input-field {
  flex: 1;
  border: 1px solid #cbd5e1;
  border-radius: 20px;
  padding: 10px 16px;
  font-size: 14px;
  outline: none;
  transition: border-color 0.2s;
}

.aa-input-field:focus {
  border-color: var(--aa-brand-color, #b7791f);
}

.aa-send-btn {
  background: var(--aa-brand-color, #b7791f);
  color: #ffffff;
  border: none;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
}

.aa-send-btn:hover {
  background: #8a5a12;
}

/* Modal / Form Overlays */
.aa-form-card {
  background: #ffffff;
  border-radius: 12px;
  padding: 16px;
  border: 1px solid #e2e8f0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.aa-form-card label {
  font-size: 12px;
  font-weight: 600;
  color: #475569;
}

.aa-form-card input, .aa-form-card select, .aa-form-card textarea {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  font-size: 13px;
}

/* Dark Mode Support */
.aa-dark-mode .aa-panel {
  background: #0f172a;
  color: #f8fafc;
}

.aa-dark-mode .aa-panel-body {
  background: #1e293b;
}

.aa-dark-mode .aa-greeting-card,
.aa-dark-mode .aa-prompt-chip,
.aa-dark-mode .aa-msg-assistant,
.aa-dark-mode .aa-panel-footer,
.aa-dark-mode .aa-form-card {
  background: #0f172a;
  color: #f8fafc;
  border-color: #334155;
}

.aa-dark-mode .aa-prompt-chip:hover {
  background: #1e293b;
  border-color: #d6ad60;
  color: #f4c978;
}
