/* WEVAL AI Signature Animations Library - D-OPUS131 */
/* Reusable cutting-edge animated components signaling AI sophistication */

/* === NEURAL NETWORK LIVE === */
.wai-neural { position: relative; width: 100%; aspect-ratio: 2/1; max-width: 100%; background: radial-gradient(ellipse at center, rgba(124,58,237,0.06) 0%, transparent 70%); border-radius: 16px; overflow: hidden; }
.wai-neural svg { width: 100%; height: 100%; }
.wai-neural-node { fill: var(--nn-color, #7c3aed); }
.wai-neural-edge { stroke: var(--nn-edge, #7c3aed); stroke-width: 0.8; opacity: 0.25; }
.wai-neural-pulse { stroke-dasharray: 4 8; animation: wai-pulse-flow 2s linear infinite; }
@keyframes wai-pulse-flow { to { stroke-dashoffset: -120; } }
.wai-neural-label { font-family: 'JetBrains Mono', monospace; font-size: 10px; fill: #555; letter-spacing: 1px; text-transform: uppercase; }
.wai-neural-active { animation: wai-pulse-glow 1.6s ease-in-out infinite; }
@keyframes wai-pulse-glow { 0%, 100% { opacity: 0.4; r: 6; } 50% { opacity: 1; r: 8; } }

/* === STREAM SPARKLINE LIVE === */
.wai-stream { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 14px; }
.wai-stream-card { background: #0c0c1c; color: white; border-radius: 12px; padding: 18px; border-left: 3px solid var(--st-color, #06b6d4); position: relative; overflow: hidden; }
.wai-stream-card::before { content: ''; position: absolute; top: 0; right: 0; width: 60%; height: 3px; background: linear-gradient(90deg, transparent, var(--st-color, #06b6d4)); animation: wai-scan 3s linear infinite; }
@keyframes wai-scan { 0% { transform: translateX(-100%); } 100% { transform: translateX(100%); } }
.wai-stream-lbl { font-family: 'JetBrains Mono', monospace; font-size: 9px; color: rgba(255,255,255,0.55); letter-spacing: 2px; text-transform: uppercase; margin-bottom: 6px; }
.wai-stream-lbl::before { content: '◉ '; color: var(--st-color, #06b6d4); animation: wai-blink 1.5s ease-in-out infinite; }
@keyframes wai-blink { 0%, 100% { opacity: 1; } 50% { opacity: 0.3; } }
.wai-stream-val { font-family: var(--we-font); font-size: 30px; font-weight: 500; color: white; letter-spacing: -.02em; line-height: 1; margin-bottom: 4px; }
.wai-stream-val .unit { color: var(--st-color, #06b6d4); font-size: 16px; }
.wai-stream-trend { font-size: 10px; color: rgba(255,255,255,0.55); font-family: 'JetBrains Mono', monospace; letter-spacing: 1px; }
.wai-stream-trend.up { color: #4ade80; }
.wai-stream-trend.down { color: #f87171; }
.wai-stream-spark { height: 30px; margin-top: 10px; display: flex; gap: 2px; align-items: flex-end; }
.wai-stream-spark .bar { flex: 1; background: linear-gradient(180deg, var(--st-color, #06b6d4), transparent); border-radius: 1px 1px 0 0; opacity: 0.8; transition: height 0.4s; }

/* === PARTICLE CONSTELLATION === */
.wai-constellation { width: 100%; aspect-ratio: 16/9; background: radial-gradient(ellipse at center, #1e1b4b 0%, #0c0c1c 100%); border-radius: 14px; overflow: hidden; position: relative; }
.wai-constellation canvas { width: 100%; height: 100%; }
.wai-const-label { position: absolute; top: 16px; left: 20px; font-family: 'JetBrains Mono', monospace; font-size: 10px; color: #06b6d4; letter-spacing: 2px; text-transform: uppercase; z-index: 2; }
.wai-const-label::before { content: '◆ '; color: #f59e0b; }

/* === GEO FLOW MAP MAROC === */
.wai-geo { width: 100%; aspect-ratio: 16/10; background: white; border-radius: 14px; padding: 24px; position: relative; }
.wai-geo svg { width: 100%; height: 100%; }
.wai-geo-route { fill: none; stroke-width: 2; stroke-dasharray: 6 4; animation: wai-route-flow 1.5s linear infinite; }
@keyframes wai-route-flow { to { stroke-dashoffset: -20; } }
.wai-geo-node { transition: transform 0.3s; cursor: pointer; }
.wai-geo-node:hover { transform: scale(1.15); transform-origin: center; }
.wai-geo-node circle { stroke: white; stroke-width: 3; }
.wai-geo-pulse { animation: wai-geo-ping 2s ease-out infinite; }
@keyframes wai-geo-ping { 0% { r: 8; opacity: 0.8; } 100% { r: 32; opacity: 0; } }

/* === RADAR CHART LIVE === */
.wai-radar { display: grid; grid-template-columns: 1fr 280px; gap: 24px; }
.wai-radar svg { width: 100%; }
.wai-radar-axis { stroke: rgba(0,0,0,0.08); fill: none; }
.wai-radar-grid { stroke: rgba(0,0,0,0.05); fill: rgba(124,58,237,0.02); }
.wai-radar-shape { fill: url(#radarGrad); stroke: #7c3aed; stroke-width: 2; opacity: 0.7; animation: wai-radar-breathe 3s ease-in-out infinite; transform-origin: center; }
@keyframes wai-radar-breathe { 0%, 100% { transform: scale(1); opacity: 0.7; } 50% { transform: scale(1.03); opacity: 0.85; } }
.wai-radar-label { font-family: 'DM Sans', sans-serif; font-size: 11px; font-weight: 600; fill: #1a1a1a; }
.wai-radar-value { font-family: var(--we-font); font-size: 11px; fill: #7c3aed; }
.wai-radar-side { display: flex; flex-direction: column; gap: 10px; }
.wai-radar-row { padding: 12px 16px; background: white; border: 1px solid var(--we-bd); border-left: 4px solid var(--rd-color, #7c3aed); border-radius: 8px; }
.wai-radar-row-h { display: flex; justify-content: space-between; align-items: center; margin-bottom: 4px; }
.wai-radar-row-name { font-size: 12px; font-weight: 700; color: #1a1a1a; }
.wai-radar-row-val { font-family: var(--we-font); font-size: 18px; font-weight: 600; color: var(--rd-color, #7c3aed); letter-spacing: -.02em; line-height: 1; }
.wai-radar-row-meta { font-size: 10px; color: #666; font-family: 'JetBrains Mono', monospace; letter-spacing: 1px; }

/* === 3D FORCE GRAPH === */
.wai-force { position: relative; width: 100%; aspect-ratio: 16/10; background: linear-gradient(135deg, #fafafa, white); border-radius: 14px; overflow: hidden; }
.wai-force-stats { position: absolute; top: 16px; left: 20px; z-index: 2; display: flex; gap: 14px; font-family: 'JetBrains Mono', monospace; font-size: 10px; color: #555; letter-spacing: 1.5px; }
.wai-force-stats span strong { color: #7c3aed; font-size: 14px; font-weight: 700; }

/* === SANKEY/FLOW DIAGRAM === */
.wai-sankey { padding: 28px; background: white; border-radius: 14px; }
.wai-sankey-stage { display: flex; align-items: stretch; gap: 60px; margin-bottom: 24px; position: relative; }
.wai-sankey-col { flex: 1; display: flex; flex-direction: column; gap: 8px; position: relative; }
.wai-sankey-col-h { font-size: 10px; text-transform: uppercase; letter-spacing: 2px; color: #555; font-weight: 700; padding-bottom: 8px; border-bottom: 1px solid rgba(0,0,0,0.06); margin-bottom: 4px; }
.wai-sankey-node { padding: 14px 16px; background: linear-gradient(135deg, var(--sk-color, #7c3aed), var(--sk-color2, #06b6d4)); color: white; border-radius: 10px; position: relative; transition: all 0.3s; }
.wai-sankey-node:hover { transform: translateX(4px); }
.wai-sankey-node h5 { font-size: 13px; font-weight: 700; letter-spacing: -.01em; margin-bottom: 2px; }
.wai-sankey-node p { font-size: 10px; opacity: 0.85; margin: 0; }
.wai-sankey-flow { position: absolute; top: 0; bottom: 0; right: -60px; width: 60px; pointer-events: none; }
.wai-sankey-flow path { fill: none; stroke: var(--sk-color, #7c3aed); stroke-width: 2; opacity: 0.3; animation: wai-flow-anim 2s linear infinite; }
.wai-sankey-flow path.thick { stroke-width: 6; opacity: 0.2; }
@keyframes wai-flow-anim { 0% { stroke-dashoffset: 0; } 100% { stroke-dashoffset: -30; } }
.wai-sankey-flow path { stroke-dasharray: 6 6; }

/* === ANIMATED COUNTER === */
.wai-counter-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 14px; margin-bottom: 28px; }
.wai-counter { background: white; border: 1px solid var(--we-bd); border-radius: 12px; padding: 22px 20px; position: relative; overflow: hidden; }
.wai-counter::before { content: ''; position: absolute; bottom: 0; left: 0; right: 0; height: 3px; background: linear-gradient(90deg, var(--ct-color, #7c3aed), transparent); transform: scaleX(0); transform-origin: left; transition: transform 1.2s ease-out; }
.wai-counter.animated::before { transform: scaleX(1); }
.wai-counter-lbl { font-size: 10px; text-transform: uppercase; letter-spacing: 2px; color: #555; font-weight: 600; margin-bottom: 12px; }
.wai-counter-lbl .icon { color: var(--ct-color, #7c3aed); margin-right: 6px; }
.wai-counter-val { font-family: var(--we-font); font-size: 42px; font-weight: 500; color: var(--we-fg); letter-spacing: -.04em; line-height: 1; }
.wai-counter-val .small { color: var(--ct-color, #7c3aed); font-size: 18px; margin-left: 2px; }
.wai-counter-trend { font-size: 11px; color: #555; margin-top: 6px; }
.wai-counter-trend.up { color: #16a34a; }
.wai-counter-trend.up::before { content: '↗ '; }
.wai-counter-trend.down { color: #dc2626; }
.wai-counter-trend.down::before { content: '↘ '; }

/* === D993 GLOBAL FIX (append) — wai-stream + sector eyebrows readable on light bg === */
/* Root cause: original CSS assumes dark wai-stream-card bg #0c0c1c but later light theme overrides to white */
/* Fix: force dark labels for AA contrast regardless of bg theme */

/* KPI stream labels (energy/insurance/telecom/cybersecurity/cloud propale showcases) */
.wai-stream-card .wai-stream-lbl,
div.wai-stream-card div.wai-stream-lbl,
.wai-stream-lbl {
  color: #475569 !important;
  -webkit-text-fill-color: #475569 !important;
  opacity: 1 !important;
}
.wai-stream-card .wai-stream-trend,
.wai-stream-trend {
  color: #64748b !important;
  -webkit-text-fill-color: #64748b !important;
}
.wai-stream-card .wai-stream-trend.up,
.wai-stream-trend.up {
  color: #16a34a !important;
  -webkit-text-fill-color: #16a34a !important;
}
.wai-stream-card .wai-stream-trend.down,
.wai-stream-trend.down {
  color: #dc2626 !important;
  -webkit-text-fill-color: #dc2626 !important;
}
.wai-stream-val,
.wai-stream-card .wai-stream-val {
  color: #0f172a !important;
  -webkit-text-fill-color: #0f172a !important;
}
/* End D993 GLOBAL append */
