/* ==========================================================================
   Aura Interactive Demo Sandbox Component
   Matches the frosted periwinkle glass UI in reference
   ========================================================================== */

.aura-sandbox-window {
  width: 100%;
  max-width: 580px;
  min-height: 480px;
  background: linear-gradient(135deg, #cddcf9 0%, #d8e4fd 42%, #eadefc 100%);
  border: 1px solid rgba(255, 255, 255, 0.75);
  border-radius: 24px;
  box-shadow: 0 20px 48px -12px rgba(0, 130, 251, 0.16), 0 0 0 1px rgba(255, 255, 255, 0.6) inset;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color: #1e293b;
  box-sizing: border-box;
}

/* Window Chrome Top Header */
.aura-sandbox-chrome {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px 10px;
  background: rgba(255, 255, 255, 0.25);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.4);
}

.aura-sandbox-dots {
  display: flex;
  align-items: center;
  gap: 7px;
}

.aura-sandbox-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  display: inline-block;
}
.aura-sandbox-dot.red { background: #ff5f56; opacity: 0.85; }
.aura-sandbox-dot.yellow { background: #ffbd2e; opacity: 0.85; }
.aura-sandbox-dot.green { background: #27c93f; opacity: 0.85; }

.aura-sandbox-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-left: 12px;
}

.aura-chrome-btn {
  background: transparent;
  border: none;
  cursor: pointer;
  color: #64748b;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 3px;
  border-radius: 5px;
  transition: all 0.2s ease;
}
.aura-chrome-btn:hover {
  background: rgba(255, 255, 255, 0.5);
  color: #0f172a;
}

.aura-chrome-badge {
  font-size: 11px;
  font-weight: 600;
  color: #0082fb;
  background: rgba(255, 255, 255, 0.7);
  padding: 3px 10px;
  border-radius: 20px;
  border: 1px solid rgba(0, 130, 251, 0.2);
  display: flex;
  align-items: center;
  gap: 5px;
}
.aura-chrome-badge .live-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 6px #10b981;
}

/* Inner Body Workspace */
.aura-sandbox-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 22px 20px;
  position: relative;
  min-height: 410px;
}

/* ----------------------------------------------------
   VIEW A: Initial "Where should we begin?" Landing View
   ---------------------------------------------------- */
.aura-view-landing {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex: 1;
  text-align: center;
  padding: 10px 0 20px;
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.aura-landing-heading {
  font-size: 26px;
  font-weight: 500;
  color: #0f172a;
  margin: 0 0 24px;
  letter-spacing: -0.02em;
}

/* Floating Input Capsule Pill (Matches Image) */
.aura-input-pill-wrapper {
  width: 100%;
  max-width: 480px;
  background: rgba(255, 255, 255, 0.72);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid rgba(255, 255, 255, 0.85);
  box-shadow: 0 10px 28px -6px rgba(0, 80, 200, 0.08), 0 2px 6px rgba(0,0,0,0.02);
  border-radius: 40px;
  padding: 8px 10px 8px 12px;
  display: flex;
  align-items: center;
  gap: 10px;
  transition: all 0.25s ease;
}

.aura-input-pill-wrapper:focus-within,
.aura-input-pill-wrapper:hover {
  background: rgba(255, 255, 255, 0.88);
  border-color: #0082fb;
  box-shadow: 0 12px 32px -4px rgba(0, 130, 251, 0.16);
}

.aura-pill-add-btn {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(241, 245, 249, 0.9);
  border: 1px solid rgba(203, 213, 225, 0.8);
  color: #64748b;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: all 0.2s;
}
.aura-pill-add-btn:hover {
  background: #0082fb;
  color: #ffffff;
  border-color: #0082fb;
}

.aura-pill-input {
  flex: 1;
  border: none;
  background: transparent;
  outline: none;
  font-size: 14px;
  color: #1e293b;
  font-weight: 500;
  padding: 4px 0;
  min-width: 120px;
}
.aura-pill-input::placeholder {
  color: #64748b;
  font-weight: 400;
}

/* System Context Tags inside the Pill */
.aura-input-tags {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.aura-tag-chip {
  font-size: 11px;
  font-weight: 600;
  padding: 3px 9px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  letter-spacing: 0.01em;
}
.aura-tag-chip.tag-orange {
  background: #ffedd5;
  color: #c2410c;
  border: 1px solid #fed7aa;
}
.aura-tag-chip.tag-blue {
  background: #dbeafe;
  color: #1d4ed8;
  border: 1px solid #bfdbfe;
}
.aura-tag-chip.tag-emerald {
  background: #d1fae5;
  color: #047857;
  border: 1px solid #a7f3d0;
}

.aura-pill-send-btn {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #0082fb;
  border: none;
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: transform 0.15s, background 0.2s;
}
.aura-pill-send-btn:hover {
  background: #006cd0;
  transform: scale(1.06);
}

.aura-pill-mic-btn {
  background: transparent;
  border: none;
  color: #64748b;
  cursor: pointer;
  padding: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.2s;
}
.aura-pill-mic-btn:hover {
  color: #0082fb;
}

/* Suggestion Quick-Prompt Chips */
.aura-prompt-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  max-width: 490px;
  margin-top: 20px;
}

.aura-chip {
  background: rgba(255, 255, 255, 0.65);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.85);
  border-radius: 20px;
  padding: 6px 14px;
  font-size: 12px;
  font-weight: 500;
  color: #334155;
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.02);
}
.aura-chip:hover {
  background: #ffffff;
  color: #0082fb;
  border-color: #0082fb;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 130, 251, 0.12);
}
.aura-chip.active {
  background: #ffffff;
  color: #0082fb;
  border-color: #0082fb;
  box-shadow: 0 3px 10px rgba(0, 130, 251, 0.15);
  font-weight: 600;
}

/* Bottom Scroll Arrow Pill (Matches Attached Screenshot) */
.aura-landing-bottom-arrow {
  position: absolute;
  bottom: 10px;
  left: 50%;
  transform: translateX(-50%);
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.85);
  color: #64748b;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(0,0,0,0.03);
  transition: all 0.2s ease;
}
.aura-landing-bottom-arrow:hover {
  background: #ffffff;
  color: #0082fb;
  transform: translateX(-50%) translateY(2px);
}

/* ----------------------------------------------------
   VIEW B: Active Insight / Dynamic Results View
   ---------------------------------------------------- */
.aura-view-insight {
  display: none;
  flex-direction: column;
  gap: 12px;
  flex: 1;
  animation: auraFadeSlideIn 0.35s ease forwards;
}

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

/* User Query Bubble */
.aura-user-bubble {
  align-self: flex-end;
  max-width: 90%;
  background: #ffffff;
  border: 1px solid rgba(226, 232, 240, 0.8);
  border-radius: 18px 18px 4px 18px;
  padding: 10px 14px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.03);
  display: flex;
  align-items: center;
  gap: 10px;
}
.aura-user-text {
  font-size: 13px;
  font-weight: 600;
  color: #0f172a;
}

/* Aura Reasoning Indicator */
.aura-reasoning-pill {
  align-self: flex-start;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(0, 130, 251, 0.25);
  padding: 5px 12px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
  color: #0082fb;
  box-shadow: 0 2px 8px rgba(0, 130, 251, 0.06);
}
.aura-reasoning-spinner {
  width: 12px;
  height: 12px;
  border: 2px solid rgba(0, 130, 251, 0.2);
  border-top-color: #0082fb;
  border-radius: 50%;
  animation: auraSpin 0.8s linear infinite;
}
@keyframes auraSpin {
  to { transform: rotate(360deg); }
}

/* Results Card Container */
.aura-result-card {
  background: #ffffff;
  border: 1px solid rgba(226, 232, 240, 0.9);
  border-radius: 16px;
  padding: 16px 18px;
  box-shadow: 0 10px 24px -6px rgba(15, 23, 42, 0.06);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.aura-result-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid #f1f5f9;
  padding-bottom: 8px;
}
.aura-result-title {
  font-size: 13px;
  font-weight: 700;
  color: #0f172a;
  display: flex;
  align-items: center;
  gap: 6px;
}
.aura-result-badge {
  font-size: 11px;
  font-weight: 600;
  background: #fee2e2;
  color: #dc2626;
  padding: 2px 8px;
  border-radius: 10px;
}
.aura-result-badge.positive {
  background: #dcfce7;
  color: #15803d;
}

/* Interactive SVG Graph Area */
.aura-graph-box {
  width: 100%;
  height: 120px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 8px 12px;
  position: relative;
  overflow: hidden;
}

.aura-graph-svg {
  width: 100%;
  height: 100%;
  overflow: visible;
}

/* Root Causes List */
.aura-causes-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 12px;
  color: #334155;
  line-height: 1.45;
}
.aura-cause-item {
  display: flex;
  align-items: flex-start;
  gap: 6px;
}
.aura-cause-bullet {
  color: #f59e0b;
  font-weight: 700;
  font-size: 13px;
}
.aura-cause-bullet.red { color: #ef4444; }

/* Action Triggers (Decision & Action) */
.aura-actions-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 4px;
}

.aura-action-btn {
  background: #0082fb;
  color: #ffffff;
  border: none;
  border-radius: 8px;
  padding: 6px 12px;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  transition: all 0.2s ease;
}
.aura-action-btn:hover {
  background: #006cd0;
  transform: translateY(-1px);
  box-shadow: 0 4px 10px rgba(0, 130, 251, 0.25);
}

.aura-action-btn.secondary {
  background: #f1f5f9;
  color: #334155;
  border: 1px solid #e2e8f0;
}
.aura-action-btn.secondary:hover {
  background: #e2e8f0;
  color: #0f172a;
}

/* Bottom Controls in Result View */
.aura-insight-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 4px;
}

.aura-reset-link {
  font-size: 12px;
  font-weight: 600;
  color: #0082fb;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: rgba(255, 255, 255, 0.6);
  padding: 4px 10px;
  border-radius: 12px;
  border: 1px solid rgba(0, 130, 251, 0.2);
  transition: all 0.2s ease;
}
.aura-reset-link:hover {
  background: #ffffff;
  color: #0056b3;
}

.aura-prompt-switcher-mini {
  display: flex;
  gap: 6px;
}
.aura-mini-chip {
  font-size: 11px;
  font-weight: 500;
  color: #475569;
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid rgba(203, 213, 225, 0.8);
  padding: 3px 8px;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.2s;
}
.aura-mini-chip:hover {
  background: #ffffff;
  color: #0082fb;
  border-color: #0082fb;
}

/* Toast feedback when user clicks an action button */
.aura-action-toast {
  position: absolute;
  top: 14px;
  right: 18px;
  background: #0f172a;
  color: #ffffff;
  font-size: 11px;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: 20px;
  display: flex;
  align-items: center;
  gap: 6px;
  box-shadow: 0 4px 14px rgba(0,0,0,0.2);
  opacity: 0;
  pointer-events: none;
  transform: translateY(-8px);
  transition: all 0.25s ease;
  z-index: 10;
}
.aura-action-toast.show {
  opacity: 1;
  transform: translateY(0);
}
