/* ─────────────────────────────────────────
   Demo page styles — Operatio Shopify Agent
   Uses theme.css variables, adds demo-specific styles
   ───────────────────────────────────────── */

.demo-page {
  min-height: 100vh;
  padding: 120px 24px 60px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.demo-header {
  text-align: center;
  max-width: 720px;
  margin-bottom: 32px;
}

.demo-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(245, 158, 11, 0.1);
  border: 1px solid rgba(245, 158, 11, 0.25);
  color: var(--accent);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 6px 14px;
  border-radius: 999px;
  margin-bottom: 20px;
}

.live-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(0.8); }
}

.demo-header h1 {
  font-family: 'Syne', sans-serif;
  font-weight: 800;
  font-size: clamp(1.6rem, 4vw, 2.4rem);
  letter-spacing: -0.03em;
  color: var(--fg);
  margin-bottom: 12px;
}

.demo-header p {
  color: var(--fg-muted);
  font-size: 1rem;
}

/* Quick action buttons */
.demo-quick {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: center;
  max-width: 900px;
  margin-bottom: 32px;
}

.quick-label {
  font-size: 0.75rem;
  color: var(--fg-muted);
  letter-spacing: 0.04em;
  flex-shrink: 0;
}

.quick-btn {
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--fg-muted);
  font-size: 0.78rem;
  font-family: 'DM Sans', sans-serif;
  padding: 7px 14px;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.quick-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-glow);
}

/* Action buttons get a distinct teal/green treatment */
.quick-btn--action {
  border-color: rgba(16, 185, 129, 0.35);
  color: rgb(16, 185, 129);
  background: rgba(16, 185, 129, 0.06);
}

.quick-btn--action:hover {
  border-color: rgb(16, 185, 129);
  color: rgb(16, 185, 129);
  background: rgba(16, 185, 129, 0.12);
}

/* WISMO quick-test button — teal/green, slightly bolder for primary CTA */
.quick-btn--wismo {
  border-color: rgba(20, 184, 166, 0.45);
  color: rgb(20, 184, 166);
  background: rgba(20, 184, 166, 0.08);
  font-weight: 500;
}

.quick-btn--wismo:hover {
  border-color: rgb(20, 184, 166);
  color: rgb(20, 184, 166);
  background: rgba(20, 184, 166, 0.15);
}

/* ─────────────────────────────────────────
   Two-column layout
   ───────────────────────────────────────── */

.demo-columns {
  display: flex;
  gap: 24px;
  width: 100%;
  max-width: 1100px;
  align-items: flex-start;
}

.demo-chat-col {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.actions-col {
  width: 320px;
  flex-shrink: 0;
}

/* On narrow viewports, stack columns */
@media (max-width: 900px) {
  .demo-columns {
    flex-direction: column;
  }
  .actions-col {
    width: 100%;
  }
}

/* Chat container */
.chat-container {
  width: 100%;
  min-height: 380px;
  max-height: 520px;
  overflow-y: auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  scroll-behavior: smooth;
}

/* Welcome message */
.agent-welcome {
  display: flex;
  gap: 12px;
  align-items: flex-start;
}

.agent-avatar {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: var(--accent-glow);
  border: 1px solid rgba(245, 158, 11, 0.25);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent);
  flex-shrink: 0;
}

.agent-msg strong {
  display: block;
  font-size: 0.8rem;
  color: var(--accent);
  margin-bottom: 4px;
}

.agent-msg p {
  font-size: 0.875rem;
  color: var(--fg-muted);
  line-height: 1.6;
}

/* Chat bubbles */
.chat-bubble {
  padding: 12px 16px;
  border-radius: 12px;
  font-size: 0.9rem;
  line-height: 1.65;
  max-width: 85%;
  animation: popIn 0.25s ease;
}

@keyframes popIn {
  from { opacity: 0; transform: translateY(8px) scale(0.97); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

.chat-bubble.user {
  background: var(--accent);
  color: var(--bg);
  font-weight: 500;
  align-self: flex-end;
  border-bottom-right-radius: 4px;
  margin-left: auto;
}

.chat-bubble.agent {
  background: var(--surface2);
  border: 1px solid var(--border);
  color: var(--fg);
  align-self: flex-start;
  border-bottom-left-radius: 4px;
}

.chat-bubble.agent strong {
  color: var(--accent);
  font-weight: 600;
}

/* Typing indicator */
.typing-indicator {
  display: flex;
  gap: 5px;
  align-items: center;
  padding: 14px 18px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 12px;
  border-bottom-left-radius: 4px;
  align-self: flex-start;
  max-width: 72px;
}

.typing-indicator span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--fg-muted);
  animation: bounce 1.2s infinite;
}

.typing-indicator span:nth-child(2) { animation-delay: 0.2s; }
.typing-indicator span:nth-child(3) { animation-delay: 0.4s; }

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

/* Input area */
.chat-input-area {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.input-wrap {
  display: flex;
  gap: 10px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 6px 6px 6px 16px;
  transition: border-color 0.15s;
}

.input-wrap:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

.input-wrap input {
  flex: 1;
  background: none;
  border: none;
  outline: none;
  font-family: 'DM Sans', sans-serif;
  font-size: 0.95rem;
  color: var(--fg);
  padding: 10px 0;
}

.input-wrap input::placeholder {
  color: var(--fg-muted);
}

.send-btn {
  width: 42px;
  height: 42px;
  border-radius: 9px;
  background: var(--accent);
  color: var(--bg);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all 0.15s;
}

.send-btn:hover:not(:disabled) {
  background: var(--accent-dim);
  transform: scale(1.05);
}

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

.send-btn.loading {
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.input-hint {
  font-size: 0.75rem;
  color: var(--fg-muted);
  text-align: center;
  padding-left: 8px;
}

/* ─────────────────────────────────────────
   Agent Actions Panel
   ───────────────────────────────────────── */

.actions-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  overflow: hidden;
  transition: border-color 0.3s, box-shadow 0.3s;
}

.actions-panel.panel-pulse {
  border-color: rgb(16, 185, 129);
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.15);
}

.actions-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--fg-muted);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.actions-icon {
  color: rgb(16, 185, 129);
  display: flex;
  align-items: center;
}

.actions-count {
  margin-left: auto;
  background: var(--surface2);
  color: var(--fg-muted);
  font-size: 0.7rem;
  font-weight: 700;
  border-radius: 999px;
  padding: 2px 8px;
  border: 1px solid var(--border);
  transition: all 0.2s;
}

.actions-count.has-actions {
  background: rgba(16, 185, 129, 0.12);
  color: rgb(16, 185, 129);
  border-color: rgba(16, 185, 129, 0.3);
}

.actions-empty {
  padding: 32px 20px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.actions-empty-icon {
  color: var(--border);
  margin-bottom: 4px;
}

.actions-empty p {
  font-size: 0.82rem;
  color: var(--fg-muted);
  line-height: 1.6;
  max-width: 220px;
}

.actions-empty-hint {
  font-size: 0.78rem !important;
  color: var(--accent) !important;
}

.actions-list {
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-height: 520px;
  overflow-y: auto;
}

/* Action cards */
.action-card {
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--surface2);
}

@keyframes actionPop {
  from { opacity: 0; transform: scale(0.92) translateY(-6px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}

.action-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px 8px;
  gap: 8px;
}

.action-type-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 3px 10px;
  border-radius: 999px;
}

.action-type-badge--refund {
  background: rgba(16, 185, 129, 0.12);
  color: rgb(16, 185, 129);
  border: 1px solid rgba(16, 185, 129, 0.25);
}

.action-type-badge--return {
  background: rgba(99, 102, 241, 0.12);
  color: rgb(129, 132, 241);
  border: 1px solid rgba(99, 102, 241, 0.25);
}

.action-type-badge--tracking {
  background: rgba(20, 184, 166, 0.12);
  color: rgb(20, 184, 166);
  border: 1px solid rgba(20, 184, 166, 0.25);
}

.action-detail-val a {
  color: rgb(20, 184, 166);
  text-decoration: none;
  word-break: break-all;
}

.action-detail-val a:hover {
  text-decoration: underline;
}

.action-timestamp {
  font-size: 0.7rem;
  color: var(--fg-muted);
  flex-shrink: 0;
}

.action-card-title {
  padding: 0 14px 10px;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--fg);
  line-height: 1.4;
}

.action-details {
  padding: 0 14px 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.action-detail {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
  font-size: 0.78rem;
}

.action-detail-key {
  color: var(--fg-muted);
  flex-shrink: 0;
}

.action-detail-val {
  color: var(--fg);
  font-weight: 500;
  text-align: right;
  word-break: break-word;
}

/* Shopify-style confirmation bar at bottom of card */
.action-shopify-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  background: rgba(149, 191, 71, 0.08);
  border-top: 1px solid rgba(149, 191, 71, 0.2);
  font-size: 0.7rem;
  font-weight: 600;
  color: rgb(149, 191, 71);
  letter-spacing: 0.04em;
}

/* ─────────────────────────────────────────
   Personalization Banner
   ───────────────────────────────────────── */

.personalization-banner {
  display: none;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  max-width: 1100px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 14px 20px;
  margin-bottom: 20px;
  gap: 16px;
  animation: bannerSlide 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes bannerSlide {
  from { opacity: 0; transform: translateY(-10px) scale(0.97); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

.personalization-banner-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  gap: 16px;
}

.personalization-brand-info {
  display: flex;
  align-items: center;
  gap: 12px;
}

.personalization-brand-logo {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: var(--accent-glow);
  border: 1px solid rgba(245, 158, 11, 0.25);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: var(--accent);
}

.personalization-brand-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.personalization-brand-name {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--accent);
  font-family: 'Syne', sans-serif;
  letter-spacing: -0.01em;
  transition: color 0.3s;
}

.personalization-brand-meta {
  font-size: 0.75rem;
  color: var(--fg-muted);
}

.personalization-actions {
  flex-shrink: 0;
}

.reset-store-link {
  font-size: 0.78rem;
  color: var(--fg-muted);
  text-decoration: none;
  padding: 6px 12px;
  border-radius: 7px;
  border: 1px solid var(--border);
  background: var(--surface2);
  transition: all 0.15s;
  white-space: nowrap;
}

.reset-store-link:hover {
  color: var(--fg);
  border-color: var(--fg-muted);
  background: var(--surface);
}

/* ─────────────────────────────────────────
   Suggested Prompts (personalized store)
   ───────────────────────────────────────── */

.suggested-prompts {
  display: none;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  max-width: 1100px;
  width: 100%;
  margin-bottom: 24px;
}

.suggested-prompts-inner {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: center;
}

.suggested-prompts .quick-label {
  font-size: 0.75rem;
  color: var(--fg-muted);
  letter-spacing: 0.04em;
  flex-shrink: 0;
}

.suggested-prompts .quick-btn {
  font-size: 0.78rem;
  padding: 6px 13px;
}

/* ─────────────────────────────────────────
   Try Your Own Store section
   ───────────────────────────────────────── */

.try-store-section {
  width: 100%;
  max-width: 1100px;
  margin-top: 40px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
}

.try-store-divider {
  display: flex;
  align-items: center;
  gap: 16px;
  width: 100%;
  max-width: 600px;
  margin-bottom: -20px;
}

.try-store-divider::before,
.try-store-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

.try-store-divider span {
  font-size: 0.78rem;
  color: var(--fg-muted);
  background: var(--bg);
  padding: 4px 12px;
  border: 1px solid var(--border);
  border-radius: 999px;
}

.try-store-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 28px 32px;
  width: 100%;
  max-width: 600px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  text-align: center;
}

.try-store-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: rgba(245, 158, 11, 0.1);
  border: 1px solid rgba(245, 158, 11, 0.25);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent);
}

.try-store-text {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.try-store-text strong {
  font-family: 'Syne', sans-serif;
  font-size: 1.05rem;
  color: var(--fg);
}

.try-store-text span {
  font-size: 0.85rem;
  color: var(--fg-muted);
  line-height: 1.5;
}

.try-store-input-row {
  display: flex;
  gap: 10px;
  width: 100%;
}

.try-store-input-row input {
  flex: 1;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 11px 16px;
  font-family: 'DM Sans', sans-serif;
  font-size: 0.88rem;
  color: var(--fg);
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.try-store-input-row input::placeholder {
  color: var(--fg-muted);
}

.try-store-input-row input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

.try-store-btn {
  background: var(--accent);
  color: var(--bg);
  border: none;
  border-radius: 10px;
  padding: 11px 22px;
  font-family: 'DM Sans', sans-serif;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s;
}

.try-store-btn:hover:not(:disabled) {
  background: var(--accent-dim);
  transform: scale(1.03);
}

.try-store-btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.try-store-hint {
  font-size: 0.72rem;
  color: var(--fg-muted);
  line-height: 1.5;
  transition: color 0.2s;
}
