/* ReportGen AI — Futuristic AI design system & dashboard mocks */

:root {
  --ai-void: #030014;
  --ai-deep: #0a0a1a;
  --ai-surface: #12122a;
  --ai-glass: rgba(18, 18, 42, 0.72);
  --ai-cyan: #22d3ee;
  --ai-violet: #8b5cf6;
  --ai-magenta: #d946ef;
  --ai-indigo: #6366f1;
  --ai-emerald: #10b981;
  --ai-amber: #f59e0b;
  --ai-rose: #f43f5e;
  --ai-glow-cyan: rgba(34, 211, 238, 0.45);
  --ai-glow-violet: rgba(139, 92, 246, 0.5);
  --ai-glow-magenta: rgba(217, 70, 239, 0.35);
  --ai-gradient-text: linear-gradient(135deg, #22d3ee 0%, #818cf8 40%, #d946ef 100%);
  --ai-gradient-btn: linear-gradient(135deg, #6366f1 0%, #8b5cf6 50%, #d946ef 100%);
  --ai-mesh:
    radial-gradient(ellipse 80% 60% at 10% 20%, rgba(139, 92, 246, 0.22), transparent 50%),
    radial-gradient(ellipse 60% 50% at 90% 10%, rgba(34, 211, 238, 0.15), transparent 45%),
    radial-gradient(ellipse 50% 40% at 50% 100%, rgba(217, 70, 239, 0.12), transparent 50%),
    var(--ai-void);
}

body.ai-site {
  background: var(--ai-mesh);
  background-attachment: fixed;
}

/* Ambient orbs */
.ai-orbs {
  position: fixed; inset: 0; pointer-events: none; z-index: 0; overflow: hidden;
}
.ai-orb {
  position: absolute; border-radius: 50%; filter: blur(80px); opacity: 0.5;
  animation: orbFloat 20s ease-in-out infinite;
}
.ai-orb-1 { width: 400px; height: 400px; background: var(--ai-violet); top: -10%; left: -5%; }
.ai-orb-2 { width: 300px; height: 300px; background: var(--ai-cyan); top: 40%; right: -8%; animation-delay: -7s; }
.ai-orb-3 { width: 250px; height: 250px; background: var(--ai-magenta); bottom: 10%; left: 30%; animation-delay: -14s; opacity: 0.35; }
@keyframes orbFloat {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33% { transform: translate(30px, -20px) scale(1.05); }
  66% { transform: translate(-20px, 15px) scale(0.95); }
}

.ai-gradient-text {
  background: var(--ai-gradient-text);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.ai-badge {
  display: inline-flex; align-items: center; gap: 0.375rem;
  font-size: 0.625rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em;
  padding: 0.3125rem 0.625rem; border-radius: 9999px;
  background: rgba(0, 113, 227, 0.1);
  border: 1px solid rgba(0, 113, 227, 0.28);
  color: #0071e3;
}
.ai-badge::before {
  content: ''; width: 6px; height: 6px; border-radius: 50%;
  background: #34c759; box-shadow: 0 0 6px rgba(52, 199, 89, 0.55);
  animation: pulse 2s infinite;
}

/* ── Full dashboard mock — light theme (Apple-adjacent) ── */
.ai-dash,
.ai-dash--light {
  --dash-bg: #f5f5f7;
  --dash-surface: #ffffff;
  --dash-border: #d2d2d7;
  --dash-text: #1d1d1f;
  --dash-muted: #6e6e73;
  --dash-accent: #0071e3;
  --dash-good: #248a3d;
  --dash-bad: #d70015;
  background:
    linear-gradient(180deg, #ffffff 0%, #f5f5f7 100%);
  border: 1px solid var(--dash-border);
  border-radius: 16px;
  overflow: hidden;
  box-shadow:
    0 1px 2px rgba(0, 0, 0, 0.04),
    0 12px 40px rgba(0, 0, 0, 0.08);
  position: relative;
  color: var(--dash-text);
}
.ai-dash::before {
  content: '';
  position: absolute; inset: 0;
  background:
    radial-gradient(ellipse 70% 50% at 0% 0%, rgba(0, 113, 227, 0.06), transparent 55%),
    radial-gradient(ellipse 50% 40% at 100% 0%, rgba(52, 199, 89, 0.05), transparent 50%);
  pointer-events: none;
}

.ai-dash-toolbar {
  display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 0.5rem;
  padding: 0.875rem 1rem;
  background: rgba(255, 255, 255, 0.85);
  border-bottom: 1px solid var(--dash-border);
  position: relative; z-index: 1;
}
.ai-dash-title { font-size: 0.875rem; font-weight: 700; color: var(--dash-text); display: flex; align-items: center; gap: 0.5rem; }
.ai-dash-title svg { width: 18px; height: 18px; color: var(--dash-accent); }
.ai-dash-meta { font-size: 0.625rem; color: var(--dash-muted); margin-top: 0.125rem; }
.ai-dash-actions { display: flex; gap: 0.375rem; }
.ai-dash-btn {
  font-size: 0.625rem; font-weight: 600; padding: 0.375rem 0.625rem;
  border-radius: 8px; border: 1px solid var(--dash-border);
  background: #fff; color: var(--dash-text);
}
.ai-dash-btn.accent {
  background: var(--dash-accent); border-color: var(--dash-accent); color: #fff;
}

.ai-dash-filters {
  display: flex; flex-wrap: wrap; gap: 0.5rem; padding: 0.625rem 1rem;
  border-bottom: 1px solid var(--dash-border);
  background: #fafafa;
  position: relative; z-index: 1;
}
.ai-dash-filter {
  display: flex; flex-direction: column; gap: 0.125rem; min-width: 90px;
}
.ai-dash-filter label { font-size: 0.5625rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: var(--dash-muted); }
.ai-dash-filter span {
  font-size: 0.6875rem; font-weight: 600; color: var(--dash-text);
  padding: 0.3125rem 0.5rem; border-radius: 8px;
  background: #fff; border: 1px solid var(--dash-border);
}

/* Rich AI Insights panel */
.ai-dash-insights {
  margin: 0.75rem 1rem 0;
  padding: 0.875rem 1rem;
  border-radius: 12px;
  border: 1px solid rgba(0, 113, 227, 0.22);
  background: linear-gradient(135deg, rgba(0, 113, 227, 0.06) 0%, rgba(255, 255, 255, 0.95) 45%, rgba(52, 199, 89, 0.05) 100%);
  position: relative; z-index: 1;
}
.ai-dash-insights-head {
  display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap;
  margin-bottom: 0.75rem;
}
.ai-dash-insights-head strong {
  font-size: 0.8125rem; font-weight: 700; color: var(--dash-text);
}
.ai-dash-insights-badge {
  display: inline-flex; align-items: center;
  font-size: 0.5625rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.08em;
  padding: 0.25rem 0.5rem; border-radius: 6px;
  background: var(--dash-accent); color: #fff;
}
.ai-dash-insights-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.875rem;
}
.ai-dash-insights-col h5 {
  margin: 0 0 0.375rem;
  font-size: 0.625rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.06em;
  color: var(--dash-muted);
}
.ai-dash-insights-col p {
  margin: 0 0 0.5rem;
  font-size: 0.6875rem; line-height: 1.55; color: #3a3a3c;
}
.ai-dash-insights-col p:last-child { margin-bottom: 0; }
.ai-dash-insights-note { color: var(--dash-muted) !important; }
.ai-dash-insights-col ul,
.ai-dash-insights-col ol {
  margin: 0; padding-left: 1rem;
  font-size: 0.6875rem; line-height: 1.55; color: #3a3a3c;
}
.ai-dash-insights-col li { margin-bottom: 0.35rem; }
.ai-dash-insights-col li:last-child { margin-bottom: 0; }
.ai-dash-insights-col .find-alert { color: var(--dash-bad); }
.ai-dash-insights-col .find-positive { color: var(--dash-good); }
.ai-dash-insights-col .find-info { color: #3a3a3c; }

.ai-dash-body { padding: 0.75rem; position: relative; z-index: 1; }

.ai-dash-kpi-row {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 0.5rem; margin-bottom: 0.75rem;
}
.ai-dash-kpi {
  background: var(--dash-surface);
  border: 1px solid var(--dash-border);
  border-radius: 12px; padding: 0.625rem 0.75rem;
  position: relative; overflow: hidden;
}
.ai-dash-kpi::after {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 2px;
  background: var(--kpi-accent, var(--dash-accent));
  opacity: 0.9;
}
.ai-dash-kpi:nth-child(1) { --kpi-accent: #0071e3; }
.ai-dash-kpi:nth-child(2) { --kpi-accent: #248a3d; }
.ai-dash-kpi:nth-child(3) { --kpi-accent: #5e5ce6; }
.ai-dash-kpi:nth-child(4) { --kpi-accent: #ff9f0a; }
.ai-dash-kpi-head { display: flex; justify-content: space-between; align-items: flex-start; }
.ai-dash-kpi label { font-size: 0.5625rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; color: var(--dash-muted); }
.ai-dash-kpi-trend { font-size: 0.5625rem; font-weight: 700; padding: 0.125rem 0.375rem; border-radius: 4px; }
.ai-dash-kpi-trend.up { background: rgba(52, 199, 89, 0.14); color: var(--dash-good); }
.ai-dash-kpi-trend.down { background: rgba(215, 0, 21, 0.1); color: var(--dash-bad); }
.ai-dash-kpi val { display: block; font-size: 1.125rem; font-weight: 800; margin: 0.25rem 0; letter-spacing: -0.02em; color: var(--dash-text); }
.ai-dash-kpi:nth-child(1) val { color: #0071e3; }
.ai-dash-kpi:nth-child(2) val { color: #248a3d; }
.ai-dash-kpi:nth-child(3) val { color: #5e5ce6; }
.ai-dash-kpi:nth-child(4) val { color: #c93400; }
.ai-sparkline { height: 28px; margin-top: 0.375rem; display: flex; align-items: flex-end; gap: 2px; }
.ai-sparkline i {
  flex: 1; border-radius: 2px 2px 0 0; min-height: 4px;
  background: linear-gradient(180deg, var(--kpi-accent, var(--dash-accent)), transparent);
  opacity: 0.75;
  animation: sparkGrow 1.2s ease backwards;
}
.ai-sparkline i:nth-child(1) { height: 40%; animation-delay: 0.1s; }
.ai-sparkline i:nth-child(2) { height: 65%; animation-delay: 0.15s; }
.ai-sparkline i:nth-child(3) { height: 45%; animation-delay: 0.2s; }
.ai-sparkline i:nth-child(4) { height: 80%; animation-delay: 0.25s; }
.ai-sparkline i:nth-child(5) { height: 55%; animation-delay: 0.3s; }
.ai-sparkline i:nth-child(6) { height: 90%; animation-delay: 0.35s; }
.ai-sparkline i:nth-child(7) { height: 70%; animation-delay: 0.4s; }
@keyframes sparkGrow { from { transform: scaleY(0); } to { transform: scaleY(1); } }

.ai-dash-grid {
  display: grid; grid-template-columns: repeat(12, 1fr); gap: 0.5rem;
}
.ai-dash-widget {
  background: var(--dash-surface);
  border: 1px solid var(--dash-border);
  border-radius: 12px; padding: 0.625rem 0.75rem;
  min-height: 100px;
}
.ai-dash-widget.col-5 { grid-column: span 5; }
.ai-dash-widget.col-4 { grid-column: span 4; }
.ai-dash-widget.col-3 { grid-column: span 3; }
.ai-dash-widget.col-6 { grid-column: span 6; }
.ai-dash-widget h4 {
  margin: 0 0 0.5rem; font-size: 0.6875rem; font-weight: 600; color: var(--dash-muted);
  display: flex; align-items: center; gap: 0.375rem;
}
.ai-dash-widget h4 svg { width: 14px; height: 14px; opacity: 0.85; color: var(--dash-accent); }
.ai-dash-widget-note {
  margin: 0; font-size: 0.6875rem; line-height: 1.55; color: #3a3a3c;
}
.ai-dash-widget-note .text-alert { color: var(--dash-bad); }

/* CSS bar chart */
.ai-bars { display: flex; align-items: flex-end; gap: 0.375rem; height: 72px; padding-top: 0.5rem; }
.ai-bars span {
  flex: 1; border-radius: 4px 4px 0 0; min-height: 8px;
  background: linear-gradient(180deg, #2997ff, #0071e3);
  animation: barRise 1s ease backwards;
}
.ai-bars span:nth-child(1) { height: 45%; animation-delay: 0.2s; }
.ai-bars span:nth-child(2) { height: 78%; animation-delay: 0.3s; background: linear-gradient(180deg, #64d2ff, #0071e3); }
.ai-bars span:nth-child(3) { height: 55%; animation-delay: 0.4s; }
.ai-bars span:nth-child(4) { height: 92%; animation-delay: 0.5s; background: linear-gradient(180deg, #30d158, #248a3d); }
.ai-bars span:nth-child(5) { height: 68%; animation-delay: 0.6s; background: linear-gradient(180deg, #ffd60a, #ff9f0a); }
.ai-bars span:nth-child(6) { height: 40%; animation-delay: 0.7s; }
@keyframes barRise { from { transform: scaleY(0); transform-origin: bottom; } to { transform: scaleY(1); transform-origin: bottom; } }

/* SVG line chart area */
.ai-line-chart { height: 72px; width: 100%; }
.ai-line-chart .ai-line-fill { fill: url(#aiLineGrad); stroke: none; }
.ai-line-chart .ai-line-stroke { fill: none; stroke: #0071e3; stroke-width: 2.25; }

/* Donut */
.ai-donut-wrap { display: flex; align-items: center; gap: 0.75rem; }
.ai-donut {
  width: 64px; height: 64px; border-radius: 50%; flex-shrink: 0;
  background: conic-gradient(#0071e3 0 35%, #64d2ff 35% 60%, #30d158 60% 82%, #d2d2d7 82% 100%);
  position: relative;
}
.ai-donut::after {
  content: ''; position: absolute; inset: 14px; border-radius: 50%; background: #fff;
}
.ai-donut-legend { flex: 1; font-size: 0.5625rem; color: var(--dash-muted); line-height: 1.6; }
.ai-donut-legend b { color: var(--dash-text); }

/* Gauge */
.ai-gauge { text-align: center; }
.ai-gauge-ring {
  width: 72px; height: 36px; margin: 0 auto; border-radius: 72px 72px 0 0;
  background: conic-gradient(from 180deg, #30d158 0deg, #30d158 120deg, #e8e8ed 120deg);
  position: relative; overflow: hidden;
}
.ai-gauge-ring::after {
  content: ''; position: absolute; bottom: 0; left: 50%; transform: translateX(-50%);
  width: 52px; height: 26px; background: #fff; border-radius: 52px 52px 0 0;
}
.ai-gauge val { display: block; font-size: 1rem; font-weight: 800; color: #248a3d; margin-top: 0.25rem; }

/* Multi-metric table */
.ai-mini-table { font-size: 0.625rem; width: 100%; border-collapse: collapse; }
.ai-mini-table td { padding: 0.3125rem 0; border-bottom: 1px solid #e8e8ed; color: var(--dash-muted); }
.ai-mini-table td:last-child { text-align: right; font-weight: 700; color: var(--dash-text); }

/* Feature icons — SVG style boxes */
.ai-icon-box {
  width: 44px; height: 44px; border-radius: 12px;
  display: grid; place-items: center;
  background: linear-gradient(135deg, rgba(99,102,241,0.2), rgba(217,70,239,0.15));
  border: 1px solid rgba(139, 92, 246, 0.3);
  box-shadow: 0 0 24px rgba(139, 92, 246, 0.15);
  margin-bottom: 1rem;
}
.ai-icon-box svg { width: 22px; height: 22px; color: var(--ai-cyan); }
.ai-icon-box.emerald svg { color: var(--ai-emerald); }
.ai-icon-box.magenta svg { color: var(--ai-magenta); }

/* Glass cards */
.ai-glass-card {
  background: var(--ai-glass);
  backdrop-filter: blur(16px);
  border: 1px solid rgba(139, 92, 246, 0.2);
  border-radius: var(--radius-lg, 16px);
  box-shadow: 0 8px 32px rgba(0,0,0,0.3);
}

/* Enhanced buttons */
.btn-ai {
  background: var(--ai-gradient-btn);
  color: #fff;
  box-shadow: 0 4px 24px var(--ai-glow-violet), 0 0 40px rgba(217, 70, 239, 0.15);
  border: none;
}
.btn-ai:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 32px var(--ai-glow-violet), 0 0 60px rgba(34, 211, 238, 0.2);
}

/* Demo modal — wider for full dashboard */
.enterprise-modal.demo-wide { max-width: 960px; }

/* Solution page dashboard embed */
.solution-dash-wrap { margin: 2rem 0; max-width: 900px; }

@media (max-width: 900px) {
  .ai-dash-insights-grid { grid-template-columns: 1fr; }
}
@media (max-width: 768px) {
  .ai-dash-kpi-row { grid-template-columns: repeat(2, 1fr); }
  .ai-dash-widget.col-3, .ai-dash-widget.col-4, .ai-dash-widget.col-5, .ai-dash-widget.col-6 {
    grid-column: span 12;
  }
}

@media (prefers-reduced-motion: reduce) {
  .ai-orb, .ai-sparkline i, .ai-bars span { animation: none !important; }
}
