/* ============================================================
   agents.css — Spécifique page Agents IA
   ============================================================ */

/* ── SVG générique ── */
.ag-svg {
  width: 100%;
  height: 360px;
  overflow: visible;
}

/* ── Hero viz section 0 ── */
.ag-hero-viz {
  width: 420px;
  height: 420px;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ── Boucle ReAct ── */
.ag-react-viz {
  width: 100%;
  max-width: 520px;
  height: 460px; /* hauteur fixe */
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
}

/* ── Tools viz ── */
.ag-tools-viz {
  width: 100%;
  height: 440px;
  position: relative;
}

/* ── Demo agent ── */
.ag-demo-wrap {
  width: 100%;
  max-width: 860px;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.ag-demo-query {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1.25rem;
  background: rgba(59, 130, 246, 0.1);
  border: 1px solid rgba(59, 130, 246, 0.25);
  border-radius: 10px;
  font-family: var(--ss-font-mono);
  font-size: 0.85rem;
  color: var(--ss-text);
}
.ag-demo-query .material-icons-round {
  color: var(--ss-accent);
  font-size: 18px;
  flex-shrink: 0;
}

.ag-demo-terminal {
  background: #020609;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  padding: 1rem 1.25rem;
  height: 280px;
  overflow-y: auto;
  font-family: var(--ss-font-mono);
  font-size: 0.78rem;
  line-height: 1.8;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}
.ag-demo-terminal::-webkit-scrollbar {
  width: 4px;
}
.ag-demo-terminal::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 2px;
}

.ag-line {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  animation: agLineFade 0.25s ease;
}
@keyframes agLineFade {
  from {
    opacity: 0;
    transform: translateY(4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.ag-line-icon {
  font-size: 13px;
  flex-shrink: 0;
  margin-top: 2px;
}
.ag-line--thought .ag-line-icon {
  color: #fbbf24;
}
.ag-line--action .ag-line-icon {
  color: #3b82f6;
}
.ag-line--observe .ag-line-icon {
  color: #10b981;
}
.ag-line--final .ag-line-icon {
  color: #a78bfa;
}
.ag-line--error .ag-line-icon {
  color: #f43f5e;
}

.ag-line-label {
  font-size: 0.62rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  flex-shrink: 0;
  margin-top: 1px;
  opacity: 0.6;
}
.ag-line--thought .ag-line-label {
  color: #fbbf24;
}
.ag-line--action .ag-line-label {
  color: #3b82f6;
}
.ag-line--observe .ag-line-label {
  color: #10b981;
}
.ag-line--final .ag-line-label {
  color: #a78bfa;
}
.ag-line--error .ag-line-label {
  color: #f43f5e;
}

.ag-line-text {
  color: rgba(255, 255, 255, 0.75);
  flex: 1;
}
.ag-line--final .ag-line-text {
  color: #c4b5fd;
  font-weight: 600;
}

.ag-cursor {
  display: inline-block;
  width: 7px;
  height: 13px;
  background: rgba(255, 255, 255, 0.5);
  border-radius: 1px;
  vertical-align: middle;
  animation: agBlink 0.7s step-end infinite;
}
@keyframes agBlink {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0;
  }
}

.ag-demo-controls {
  display: flex;
  gap: 0.75rem;
}

/* ── Context viz ── */
.ag-context-viz {
  width: 100%;
  max-width: 520px;
  display: flex;
  flex-direction: column;
  gap: 0;
}

.ag-context-bar {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}
.ag-context-label {
  font-family: var(--ss-font-mono);
  font-size: 0.65rem;
  color: rgba(255, 255, 255, 0.35);
  letter-spacing: 0.06em;
  display: flex;
  justify-content: space-between;
}
.ag-context-track {
  height: 28px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 6px;
  overflow: hidden;
  display: flex;
}
.ag-context-segment {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--ss-font-mono);
  font-size: 0.58rem;
  color: rgba(0, 0, 0, 0.7);
  font-weight: 600;
  transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
  overflow: hidden;
  white-space: nowrap;
}
.ag-context-segment--task {
  background: #3b82f6;
}
.ag-context-segment--thought {
  background: #fbbf24;
}
.ag-context-segment--tool {
  background: #10b981;
}
.ag-context-segment--result {
  background: #8b5cf6;
}
.ag-context-segment--free {
  background: rgba(255, 255, 255, 0.04);
}

.ag-context-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.5rem;
}
.ag-context-legend-item {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-family: var(--ss-font-mono);
  font-size: 0.62rem;
  color: rgba(255, 255, 255, 0.4);
}
.ag-context-legend-dot {
  width: 8px;
  height: 8px;
  border-radius: 2px;
  flex-shrink: 0;
}

/* ── Risks viz ── */
.ag-risks-viz {
  width: 100%;
  max-width: 580px;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.ag-risk-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 10px;
  padding: 0.9rem 1.1rem;
  display: flex;
  gap: 0.75rem;
  align-items: flex-start;
  opacity: 0;
  transform: translateX(16px);
  transition:
    opacity 0.4s ease,
    transform 0.4s ease,
    border-color 0.3s ease;
}
.ag-risk-card.is-visible {
  opacity: 1;
  transform: translateX(0);
}
.ag-risk-card:hover {
  border-color: rgba(244, 63, 94, 0.3);
}

.ag-risk-icon {
  width: 46px;
  height: 46px;
  border-radius: 8px;
  background: rgba(244, 63, 94, 0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.ag-risk-icon .material-icons-round {
  font-size: 28px;
  color: #f43f5e;
}

.ag-risk-title {
  font-family: var(--ss-font-mono);
  font-size: 1.2rem;
  color: var(--ss-text);
  font-weight: 600;
  margin-bottom: 0.2rem;
}
.ag-risk-desc {
  font-size: 0.9rem;
  color: var(--ss-muted);
  line-height: 1.5;
}

/* ── Today viz ── */
.ag-today-viz {
  width: 100%;
  max-width: 580px;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.ag-today-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 10px;
  padding: 0.75rem 1rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  opacity: 0;
  transform: translateY(10px);
  transition:
    opacity 0.4s ease,
    transform 0.4s ease;
}
.ag-today-card.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.ag-today-dot {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  flex-shrink: 0;
  animation: agPulse 2s ease-in-out infinite;
}
@keyframes agPulse {
  0%,
  100% {
    opacity: 1;
    transform: scale(1);
  }
  50% {
    opacity: 0.6;
    transform: scale(1.3);
  }
}

.ag-today-name {
  font-family: var(--ss-font-mono);
  font-size: 1.2rem;
  color: var(--ss-text);
  font-weight: 600;
  flex: 0 0 140px;
}
.ag-today-desc {
  font-size: 0.9rem;
  color: var(--ss-muted);
  line-height: 1.4;
  flex: 1;
}

.ag-slide-demo .ss-layout--full {
  align-items: center;
  max-width: 780px;
}

.ag-slide-demo .ss-text-block {
  max-width: 100%;
  flex: 0 0 100%;
  text-align: center;
}

.ag-slide-demo .ss-viz-panel {
  width: 100%;
}

/* ── Responsive ── */
@media (max-width: 900px) {
  .ag-hero-viz {
    display: none;
  }
  .ag-react-viz {
    height: 260px;
  }
  .ag-tools-viz {
    height: 260px;
  }
  .ag-demo-wrap {
    max-width: 100%;
  }
}
