/**
 * hero-ai-agent.css – Claymatics.net
 * Siri-style glowing cloud · AI agent code window · responsive
 */

/* ── AI Agent wrapper ───────────────────────────────────────── */
.ai-agent-wrap {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

/* ── Siri glow cloud ────────────────────────────────────────── */
.ai-glow-cloud {
    position: absolute;
    inset: -48px;
    border-radius: 50%;
    pointer-events: none;
    z-index: 0;

    /* Layered glow: blue + teal */
    background: radial-gradient(
        ellipse at 38% 45%,
        rgba(30, 107, 255, 0.28) 0%,
        rgba(24, 194, 156, 0.18) 40%,
        transparent 72%
    );
    filter: blur(28px);
    animation: siriPulse 2.8s ease-in-out infinite;
    will-change: opacity, transform;
}

/* Second cloud layer – offset colour mixing */
.ai-glow-cloud::before {
    content: '';
    position: absolute;
    inset: 10%;
    border-radius: 50%;
    background: radial-gradient(
        ellipse at 62% 55%,
        rgba(24, 194, 156, 0.22) 0%,
        rgba(30, 107, 255, 0.12) 50%,
        transparent 75%
    );
    filter: blur(18px);
    animation: siriPulse2 3.4s ease-in-out infinite;
    will-change: opacity, transform;
}

/* Third outer ring glow */
.ai-glow-cloud::after {
    content: '';
    position: absolute;
    inset: -20%;
    border-radius: 50%;
    background: radial-gradient(
        ellipse at 50% 50%,
        rgba(30, 107, 255, 0.08) 0%,
        transparent 65%
    );
    filter: blur(40px);
    animation: siriPulse 4s ease-in-out infinite reverse;
    will-change: opacity;
}

@keyframes siriPulse {
    0%, 100% { opacity: 0.7;  transform: scale(1);    }
    50%       { opacity: 1;    transform: scale(1.06); }
}
@keyframes siriPulse2 {
    0%, 100% { opacity: 0.5;  transform: scale(1.02) rotate(-3deg); }
    50%       { opacity: 0.9;  transform: scale(0.97) rotate(3deg);  }
}

/* Hover – glow intensifies */
.ai-agent-wrap:hover .ai-glow-cloud {
    animation: siriPulseHover 1.4s ease-in-out infinite;
}
@keyframes siriPulseHover {
    0%, 100% { opacity: 0.9;  transform: scale(1.02); filter: blur(22px); }
    50%       { opacity: 1;    transform: scale(1.1);  filter: blur(14px); }
}

/* ── Particles ──────────────────────────────────────────────── */
.ai-particles {
    position: absolute;
    inset: -60px;
    pointer-events: none;
    z-index: 0;
}
.ai-particle {
    position: absolute;
    border-radius: 50%;
    background: var(--p-color, #1E6BFF);
    width: var(--p-size, 4px);
    height: var(--p-size, 4px);
    opacity: 0;
    animation: particleFloat var(--p-dur, 4s) ease-in-out var(--p-delay, 0s) infinite;
    box-shadow: 0 0 6px var(--p-color, #1E6BFF);
}
@keyframes particleFloat {
    0%   { opacity: 0;    transform: translate(0, 0)       scale(0.5); }
    20%  { opacity: 0.8; }
    80%  { opacity: 0.4; }
    100% { opacity: 0;    transform: translate(var(--p-tx, 20px), var(--p-ty, -40px)) scale(1.2); }
}

/* ── AI Status indicator ────────────────────────────────────── */
.ai-status-bar {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 14px 6px 10px;
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(24,194,156,0.28);
    border-radius: 999px;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    margin-bottom: 14px;
    position: relative;
    z-index: 2;
    font-size: 0.75rem;
    font-family: 'JetBrains Mono', monospace;
    color: rgba(255,255,255,0.75);
    letter-spacing: 0.06em;
    cursor: default;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}
.ai-status-bar:hover {
    border-color: rgba(24,194,156,0.55);
    box-shadow: 0 0 14px rgba(24,194,156,0.2);
}
.ai-status-dot {
    width: 8px; height: 8px;
    border-radius: 50%;
    background: #18C29C;
    box-shadow: 0 0 6px #18C29C, 0 0 12px rgba(24,194,156,0.5);
    animation: statusBlink 1.6s ease-in-out infinite;
    flex-shrink: 0;
}
@keyframes statusBlink {
    0%, 100% { opacity: 1;   box-shadow: 0 0 6px #18C29C, 0 0 12px rgba(24,194,156,.5); }
    50%       { opacity: 0.4; box-shadow: 0 0 3px #18C29C; }
}
.ai-status-text { color: #18C29C; font-weight: 600; }

/* ── Code window ────────────────────────────────────────────── */
.ai-code-window {
    position: relative;
    z-index: 2;
    background: rgba(13, 17, 28, 0.92);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 16px;
    overflow: hidden;
    width: 100%;
    box-shadow:
        0 0 0 1px rgba(30,107,255,0.12),
        0 24px 60px rgba(0,0,0,0.5),
        inset 0 1px 0 rgba(255,255,255,0.05);
    backdrop-filter: blur(4px);
    transition: box-shadow 0.4s ease;
}
.ai-agent-wrap:hover .ai-code-window {
    box-shadow:
        0 0 0 1px rgba(24,194,156,0.25),
        0 0 40px rgba(30,107,255,0.12),
        0 30px 70px rgba(0,0,0,0.55),
        inset 0 1px 0 rgba(255,255,255,0.07);
}

/* Window chrome */
.ai-code-bar {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 10px 14px;
    background: rgba(255,255,255,0.04);
    border-bottom: 1px solid rgba(255,255,255,0.06);
}
.ai-code-bar .dot { width: 11px; height: 11px; border-radius: 50%; flex-shrink: 0; }
.ai-code-bar .dot-r { background: #FF5F57; }
.ai-code-bar .dot-y { background: #FFBD2E; }
.ai-code-bar .dot-g { background: #28C840; }
.ai-code-bar .bar-title {
    margin-left: 10px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.72rem;
    color: rgba(255,255,255,0.3);
    flex: 1;
}
.ai-code-bar .bar-badge {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.65rem;
    padding: 2px 8px;
    border-radius: 4px;
    background: rgba(24,194,156,0.15);
    border: 1px solid rgba(24,194,156,0.3);
    color: #18C29C;
    animation: badgePulse 2s ease-in-out infinite;
}
@keyframes badgePulse {
    0%,100% { opacity: 1; }
    50%      { opacity: 0.6; }
}

/* Code body */
.ai-code-body {
    padding: 20px 20px 20px 0;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.8rem;
    line-height: 2;
    color: #ABB2BF;
    min-height: 220px;
    overflow: hidden;
    position: relative;
}

/* Line numbers */
.ai-code-lines {
    display: flex;
}
.ai-line-nums {
    padding: 0 14px;
    text-align: right;
    color: rgba(255,255,255,0.15);
    user-select: none;
    min-width: 38px;
    flex-shrink: 0;
}
.ai-line-nums span { display: block; }
.ai-code-content { flex: 1; padding-right: 20px; }
.ai-code-content .code-line { display: block; min-height: 1.6em; }

/* Cursor */
.ai-cursor {
    display: inline-block;
    width: 2px; height: 1em;
    background: #18C29C;
    vertical-align: text-bottom;
    margin-left: 1px;
    box-shadow: 0 0 6px #18C29C;
    animation: cursorBlink 0.9s step-end infinite;
}
@keyframes cursorBlink { 0%,100%{opacity:1} 50%{opacity:0} }

/* Syntax colours */
.ck  { color: #C678DD; }   /* keyword: const */
.cv  { color: #9CDCFE; }   /* variable */
.cs  { color: #CE9178; }   /* string */
.cn  { color: #ABB2BF; }   /* neutral punctuation */
.cf  { color: #61AFEF; }   /* function */
.cc  { color: #6A9955; }   /* comment */
.ct  { color: #18C29C; }   /* teal value: status */
.cm  { color: #E5C07B; }   /* meta / number */

/* Running status line flash */
.status-flash {
    animation: statusFlash 0.25s ease-out;
}
@keyframes statusFlash {
    0%  { opacity: 0; transform: translateX(-4px); }
    100%{ opacity: 1; transform: translateX(0); }
}

/* Tooltip on hover */
.ai-tooltip {
    position: absolute;
    bottom: calc(100% + 14px);
    left: 50%;
    transform: translateX(-50%) translateY(6px);
    background: rgba(13,17,28,0.96);
    border: 1px solid rgba(24,194,156,0.3);
    border-radius: 10px;
    padding: 8px 14px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.72rem;
    color: #18C29C;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease, transform 0.25s ease;
    z-index: 10;
    box-shadow: 0 8px 24px rgba(0,0,0,0.4);
}
.ai-tooltip::after {
    content: '';
    position: absolute;
    top: 100%; left: 50%;
    transform: translateX(-50%);
    border: 5px solid transparent;
    border-top-color: rgba(24,194,156,0.3);
}
.ai-agent-wrap:hover .ai-tooltip {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* ── Run progress bar ───────────────────────────────────────── */
.ai-run-bar {
    height: 2px;
    background: rgba(255,255,255,0.05);
    overflow: hidden;
    border-radius: 0 0 16px 16px;
}
.ai-run-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #1E6BFF, #18C29C);
    box-shadow: 0 0 8px rgba(24,194,156,0.6);
    border-radius: 2px;
    transition: width 0.12s linear;
}

/* ── Responsive ─────────────────────────────────────────────── */
@media (max-width: 1199px) {
    .ai-code-body { font-size: 0.75rem; }
}
@media (max-width: 991px) {
    .ai-agent-wrap { margin-top: 2.5rem; }
    .ai-glow-cloud { inset: -32px; filter: blur(20px); }
}
@media (max-width: 575px) {
    .ai-code-body  { font-size: 0.7rem; min-height: 180px; }
    .ai-glow-cloud { inset: -20px; filter: blur(14px); }
}
