/*
 * Basehim theme: the homepage hero's code window as a two-step demo.
 * Step 1 types a request to an AI assistant (the "Prompt" tab); step 2
 * writes the app it produces, line by line (the "App.php" tab), then loops.
 * Without JavaScript, or with reduced motion, the code shows in full and
 * the tabs switch by hand.
 */

/* Tabs in the window's title bar */
.bh-hai-tabs{display:inline-flex;gap:2px;margin-left:.5rem;padding:2px;border-radius:.6rem;
  background:rgb(255 255 255/.03);border:1px solid rgb(51 65 85/.7)}
.bh-hai-tab{display:inline-flex;align-items:center;gap:.35rem;padding:.25rem .6rem;border:0;border-radius:.45rem;
  background:transparent;color:#94a3b8;cursor:pointer;
  font:500 11.5px/1.2 "JetBrains Mono",ui-monospace,SFMono-Regular,Menlo,monospace;
  transition:color .2s ease,background-color .2s ease}
.bh-hai-tab:hover{color:#e2e8f0}
.bh-hai-tab[aria-selected="true"]{color:#fff;background:rgb(255 255 255/.09)}
.bh-hai-tab:focus-visible{outline:2px solid #8ecdff;outline-offset:1px}
.bh-hai-tab svg{color:#a5b4fc}
.bh-hai-tab[aria-selected="true"] svg{color:#c4b5fd}
.bh-hai-path{margin-left:auto;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}

/* Both panels share one cell, so switching never changes the window's height */
.bh-hai-stage{display:grid}
.bh-hai-panel{grid-area:1/1;min-width:0;display:flex;flex-direction:column;opacity:1;transform:none;visibility:visible;
  transition:opacity .35s ease,transform .35s ease,visibility 0s}
.bh-hai-panel[aria-hidden="true"]{opacity:0;transform:translateY(6px);visibility:hidden;
  transition:opacity .35s ease,transform .35s ease,visibility 0s linear .35s}

/* The conversation */
.bh-hai-chat{flex:1;display:flex;flex-direction:column;gap:1rem;padding:1.25rem;font-size:13.5px;line-height:1.65}
.bh-hai-msg{display:flex;align-items:flex-start;gap:.75rem}
.bh-hai-who{flex:none;display:inline-grid;place-items:center;width:1.85rem;height:1.85rem;border-radius:.55rem;
  font:700 10px/1 Inter,ui-sans-serif,system-ui,sans-serif;letter-spacing:.03em}
.bh-hai-msg--you .bh-hai-who{background:#1e293b;color:#cbd5e1}
.bh-hai-msg--ai .bh-hai-who{background:linear-gradient(135deg,#0c89fd,#482cfb);color:#fff;box-shadow:0 0 0 3px rgb(72 44 251/.18)}
.bh-hai-text{margin:0;min-width:0;color:#e2e8f0;white-space:pre-wrap;overflow-wrap:anywhere}
.bh-hai-msg--you .bh-hai-text{flex:1;padding:.65rem .85rem;border:1px solid rgb(51 65 85/.7);border-radius:.8rem;
  border-top-left-radius:.25rem;background:rgb(255 255 255/.035)}
.bh-hai-text code{font-family:"JetBrains Mono",ui-monospace,SFMono-Regular,Menlo,monospace;font-size:12px;color:#86efac}
.bh-hai-text .bh-hai-link{color:#8ecdff}

/* Typing caret on the prompt */
.bh-hai-text.is-typing::after{content:"";display:inline-block;width:7px;height:1.05em;margin-left:2px;
  vertical-align:text-bottom;background:#8ecdff;animation:bh-caret 1s step-end infinite}

/* The assistant's reply appears once the prompt is sent */
.bh-hai-msg--ai{transition:opacity .4s ease,transform .4s ease}
[data-bh-hero-demo].is-animating .bh-hai-msg--ai:not(.is-in){opacity:0;transform:translateY(4px)}
.bh-hai-reply{flex:1;color:#cbd5e1;white-space:normal}
.bh-hai-status{margin:0 0 .5rem}
.bh-hai-steps{margin:0;padding:0;list-style:none;display:grid;gap:.4rem;font-size:12.5px}
.bh-hai-steps li{display:flex;gap:.55rem;align-items:baseline;transition:opacity .3s ease,transform .3s ease}
[data-bh-hero-demo].is-animating .bh-hai-steps li:not(.is-in){opacity:0;transform:translateX(-4px)}
.bh-hai-ok{flex:none;display:inline-grid;place-items:center;width:1rem;height:1rem;border-radius:50%;
  background:rgb(16 185 129/.15);color:#34d399;font-size:10px;font-weight:700;line-height:1}
.bh-hai-dots{display:inline-flex;gap:3px;margin-left:5px;vertical-align:middle}
.bh-hai-dots i{width:4px;height:4px;border-radius:50%;background:#94a3b8;animation:bh-hai-dot 1.1s ease-in-out infinite}
.bh-hai-dots i:nth-child(2){animation-delay:.15s}
.bh-hai-dots i:nth-child(3){animation-delay:.3s}
@keyframes bh-hai-dot{0%,80%,100%{opacity:.25;transform:translateY(0)}40%{opacity:1;transform:translateY(-2px)}}

.bh-hai-foot{display:flex;flex-wrap:wrap;align-items:center;gap:.5rem;margin-top:auto;padding-top:.85rem;
  border-top:1px dashed rgb(51 65 85/.7);font-size:11.5px;color:#64748b}
.bh-hai-chip{display:inline-flex;align-items:center;gap:.35rem;padding:.2rem .55rem;border-radius:999px;
  border:1px solid rgb(72 44 251/.35);background:rgb(72 44 251/.12);color:#c4b5fd;
  font:500 11px/1.4 "JetBrains Mono",ui-monospace,monospace}

/* Code lines appear one by one while the demo runs */
.bh-hai-ln{transition:opacity .22s ease}
[data-bh-hero-demo].is-animating .bh-hai-ln:not(.is-in){opacity:0}

@media (max-width:420px){
  .bh-hai-path{display:none}
  .bh-hai-chat{padding:1rem;font-size:13px}
}
@media (prefers-reduced-motion:reduce){
  .bh-hai-panel,.bh-hai-msg--ai,.bh-hai-ln,.bh-hai-steps li{transition:none}
  .bh-hai-dots i{animation:none;opacity:.6}
}
