/* ══════════════════════════════════════════════════════════
   MANTHRIX AI — INLINE SPLIT PANEL SECTION
   ══════════════════════════════════════════════════════════ */

.alex-section { background: var(--black); }

/* Header right */
.alex-header-right { align-self: flex-end; }

/* Stats row */
.alex-stats {
  display: flex;
  align-items: center;
  gap: 0;
  border: 1px solid #1e1e1e;
  border-radius: 10px;
  overflow: hidden;
  margin-bottom: 48px;
}
.alex-stat-item {
  flex: 1;
  padding: 20px 24px;
  text-align: center;
}
.alex-stat-divider {
  width: 1px;
  height: 48px;
  background: #1e1e1e;
  flex-shrink: 0;
}
.alex-stat-num {
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 800;
  color: var(--red);
  line-height: 1;
  margin-bottom: 4px;
}
.alex-stat-label {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: #444;
  font-family: 'Courier New', monospace;
}

/* Tag */
.alex-tag {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: #F0303C;
  background: rgba(240,48,60,.08);
  border: 1px solid rgba(240,48,60,.25);
  border-radius: 4px;
  padding: 8px 16px;
  margin-bottom: 24px;
  font-family: 'Courier New', monospace;
}
.alex-tag-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: #F0303C;
  animation: alex-pulse 1.8s ease-in-out infinite;
}
@keyframes alex-pulse { 0%,100%{opacity:1} 50%{opacity:.3} }

/* Split */
.alex-split {
  display: grid;
  grid-template-columns: 1fr 1.4fr;
  gap: 60px;
  align-items: center;
}

/* Left */
.alex-caps {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 48px;
}
.alex-cap {
  font-size: 12.5px;
  color: #555;
  font-family: 'Courier New', monospace;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border: 1px solid #1a1a1a;
  border-radius: 6px;
  transition: border-color .2s, color .2s;
}
.alex-cap:hover { border-color: rgba(240,48,60,.3); color: #888; }
.alex-cap::before {
  content: '';
  width: 4px; height: 4px;
  border-radius: 50%;
  background: var(--red);
  flex-shrink: 0;
}
.alex-model-badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 11px;
  color: #444;
  font-family: 'Courier New', monospace;
  letter-spacing: .04em;
}
.alex-model-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: #00ffff;
  flex-shrink: 0;
}

/* Terminal */
.alex-terminal {
  background: #0a0a0a;
  border: 1px solid #2a2a2a;
  border-radius: 14px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  height: 480px;
}
.alex-term-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 12px 16px;
  background: #181818;
  border-bottom: 1px solid #2a2a2a;
  flex-shrink: 0;
  position: relative;
}
.alex-term-dot {
  width: 9px; height: 9px;
  border-radius: 50%;
  display: inline-block;
}
.alex-term-title {
  font-size: 14px;
  color: #888;
  font-weight: 400;
  font-family: 'Courier New', monospace;
  margin: 0 auto;
  letter-spacing: .08em;
}
.alex-term-status {
  font-size: 9px;
  font-weight: 700;
  color: #00ffff;
  font-family: 'Courier New', monospace;
  letter-spacing: .08em;
}
.alex-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  scroll-behavior: smooth;
  background: #0a0a0a;
}
.alex-messages::-webkit-scrollbar { width: 3px; }
.alex-messages::-webkit-scrollbar-thumb { background: #2a2a2a; border-radius: 2px; }
.alex-msg {
  font-size: 14px;
  font-family: 'Courier New', monospace;
  line-height: 1.65;
  display: flex;
  gap: 8px;
}
.alex-msg.ai { color: #28CA41; }
.alex-msg.ai::before { content: '>>'; color: var(--red); flex-shrink: 0; font-weight: 700; min-width: 28px; }
.alex-msg.user { color: #00ffff; }
.alex-msg.user::before { content: '›'; color: #555; flex-shrink: 0; min-width: 28px; }
.alex-typing {
  font-size: 14px;
  font-family: 'Courier New', monospace;
  color: var(--red);
  display: flex;
  gap: 8px;
  align-items: center;
}
.alex-typing::before { content: '>>'; flex-shrink: 0; font-weight: 700; min-width: 28px; }
.alex-typing span {
  width: 5px; height: 5px; border-radius: 50%;
  background: #28CA41;
  animation: alex-dot 1.2s ease-in-out infinite;
}
.alex-typing span:nth-child(2) { animation-delay: .2s; }
.alex-typing span:nth-child(3) { animation-delay: .4s; }
@keyframes alex-dot { 0%,100%{opacity:.2} 50%{opacity:1} }

.alex-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  padding: 0 16px 10px;
  background: #0a0a0a;
}
.alex-chip {
  font-size: 14px;
  font-weight: 600;
  font-family: 'Courier New', monospace;
  color: #00ffff;
  background: transparent;
  border: 1px solid rgba(0,255,255,.25);
  border-radius: 3px;
  padding: 4px 9px;
  cursor: pointer;
  transition: border-color .2s, color .2s, background .2s;
  letter-spacing: .03em;
}
.alex-chip:hover { border-color: #00ffff; color: #fff; background: rgba(0,255,255,.08); }

/* ── Terminal border: thin spinning dot ── */
@keyframes alex-border-spin {
  from { --alex-angle: 0deg; }
  to   { --alex-angle: 360deg; }
}
@property --alex-angle {
  syntax: '<angle>';
  initial-value: 0deg;
  inherits: false;
}

.alex-terminal-wrap {
  position: relative;
  border-radius: 15px;
  padding: 1.5px;
  background: conic-gradient(
    from var(--alex-angle),
    #2a2a2a 0%,
    #2a2a2a 44%,
    rgba(240,48,60,.5) 47%,
    rgba(240,48,60,.9) 50%,
    rgba(240,48,60,.5) 53%,
    #2a2a2a 56%,
    #2a2a2a 100%
  );
  animation: alex-border-spin 4s linear infinite;
}
.alex-terminal-wrap:focus-within {
  animation: alex-border-spin 2s linear infinite;
}

.alex-terminal {
  border: none;
  border-radius: 13.5px;
  transition: box-shadow .3s;
  position: relative;
  z-index: 0;
}

/* Footer — prominent red-tinted bar that pulses */
@keyframes alex-footer-bg {
  0%,100% { background: #181414; }
  50%      { background: #201010; }
}
.alex-footer {
  padding: 12px 16px;
  border-top: 1px solid rgba(240,48,60,.45);
  background: #181414;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
  animation: alex-footer-bg 2s ease-in-out infinite;
  transition: background .2s, border-top-color .2s;
}
.alex-terminal:focus-within .alex-footer {
  animation: none;
}

/* Blinking cursor */
@keyframes alex-cursor-blink {
  0%, 49% { opacity: 1; }
  50%, 100% { opacity: 0; }
}
.alex-prompt {
  color: var(--red);
  font-family: 'Courier New', monospace;
  font-size: 16px;
  font-weight: 700;
  flex-shrink: 0;
  animation: alex-cursor-blink 1.1s step-end infinite;
}
.alex-terminal:focus-within .alex-prompt {
  animation: none;
  opacity: 1;
}

.alex-input {
  flex: 1;
  background: transparent;
  border: none;
  font-family: 'Courier New', monospace;
  font-size: 13.5px;
  color: #F5F3EE;
  resize: none;
  min-height: 24px;
  max-height: 80px;
  outline: none;
  line-height: 1.5;
}
.alex-input::placeholder {
  color: rgba(240,48,60,1);
  font-style: italic;
}
.alex-input:focus::placeholder { color: rgba(240,48,60,.5); }

/* Send button — always glowing, breathes */
@keyframes alex-send-pulse {
  0%,100% { box-shadow: 0 0 8px rgba(240,48,60,.5), 0 0 20px rgba(240,48,60,.25); }
  50%      { box-shadow: 0 0 14px rgba(240,48,60,.8), 0 0 32px rgba(240,48,60,.4); }
}
.alex-send {
  width: 32px; height: 32px;
  border-radius: 6px;
  background: var(--red);
  border: none;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; flex-shrink: 0;
  transition: background .2s, transform .15s;
  animation: alex-send-pulse 2s ease-in-out infinite;
}
.alex-send:hover {
  background: var(--red-d);
  transform: scale(1.08);
  animation: none;
  box-shadow: 0 0 20px rgba(240,48,60,.9), 0 0 40px rgba(240,48,60,.4);
}
.alex-send:disabled { background: #2a2a2a; cursor: not-allowed; transform: none; animation: none; box-shadow: none; }

/* Light mode — keep terminal always dark */
[data-theme="light"] .alex-stats { border-color: var(--border-l); }
[data-theme="light"] .alex-stat-divider { background: var(--border-l); }
[data-theme="light"] .alex-cap { border-color: var(--border-l); }
[data-theme="light"] .alex-terminal { background: #0a0a0a; border-color: #2a2a2a; }
[data-theme="light"] .alex-term-bar { background: #181818; border-color: #2a2a2a; }
[data-theme="light"] .alex-footer { background: #141414; border-color: #2a2a2a; }
[data-theme="light"] .alex-messages { background: #0a0a0a; }
[data-theme="light"] .alex-chips { background: #0a0a0a; }

/* Responsive */
@media (max-width: 900px) {
  .alex-split { grid-template-columns: 1fr; gap: 36px; }
  .alex-stats { flex-wrap: wrap; }
  .alex-terminal { height: 400px; }
}
@media (max-width: 600px) {
  .alex-stats { grid-template-columns: 1fr 1fr; display: grid; }
  .alex-stat-divider { display: none; }
  .alex-terminal { height: 360px; }
}

.alex-divider {
  width: 48px;
  height: 2px;
  background: var(--red);
  margin: 28px 0;
  border-radius: 1px;
}

.alex-prompts {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 28px;
}
.alex-prompt-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-family: 'Courier New', monospace;
  font-size: 13px;
  color: #666;
  padding: 10px 14px;
  border: 1px solid #1a1a1a;
  border-radius: 6px;
  cursor: pointer;
  transition: border-color .2s, color .2s, background .2s;
  line-height: 1.5;
}
.alex-prompt-item:hover {
  border-color: rgba(240,48,60,.35);
  color: #F5F3EE;
  background: rgba(240,48,60,.05);
}
.alex-prompt-icon {
  color: var(--red);
  font-weight: 700;
  flex-shrink: 0;
  margin-top: 1px;
}
.alex-hint {
  font-size: 12px;
  color: #F0303C;
  font-family: 'Courier New', monospace;
  letter-spacing: .03em;
  margin-bottom: 14px;
}
.alex-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 11px 20px;
  border: 1px solid rgba(240,48,60,.4);
  color: #F0303C;
  font-family: 'Courier New', monospace;
  font-size: 12px;
  letter-spacing: .06em;
  text-decoration: none;
  text-transform: uppercase;
  transition: background .2s, border-color .2s, color .2s;
}

.alex-btn:hover {
  background: rgba(240,48,60,.08);
  border-color: #F0303C;
}

.alex-btn-arrow {
  transition: transform .2s;
}

.alex-btn:hover .alex-btn-arrow {
  transform: translateX(4px);
}

[data-theme="light"] .alex-section {
  background: #EEECEA;
  border-top: 1px solid #D8D5CE;
  border-bottom: 1px solid #D8D5CE;
}

[data-theme="light"] .alex-title { color: #111; }

[data-theme="light"] .alex-body { color: #444; }

[data-theme="light"] .alex-divider { background: var(--red); }

[data-theme="light"] .alex-tag {
  background: rgba(240,48,60,.07);
  border-color: rgba(240,48,60,.3);
}

[data-theme="light"] .alex-prompt-item {
  border-color: #C8C4BC;
  color: #222;
  background: #FFFFFF;
  box-shadow: 0 1px 3px rgba(0,0,0,.06);
}
[data-theme="light"] .alex-prompt-item:hover {
  border-color: var(--red);
  color: #111;
  background: #FFFFFF;
  box-shadow: 0 2px 8px rgba(240,48,60,.1);
}
[data-theme="light"] .alex-prompt-icon { color: var(--red); }

[data-theme="light"] .alex-hint { color: #777; }

/* ── LEAD CAPTURE FORM ───────────────────────────────────── */
.alex-lead-form {
  display: flex;
  gap: 8px;
  margin-top: 8px;
  padding: 0 4px;
}
.alex-lead-form input[type="email"] {
  flex: 1;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 6px;
  color: var(--alex-text, #e0e0e0);
  font-family: 'Courier New', monospace;
  font-size: 0.8rem;
  padding: 6px 10px;
  outline: none;
  transition: border-color 0.2s;
}
.alex-lead-form input[type="email"]:focus {
  border-color: rgba(255,255,255,0.4);
}
.alex-lead-form button {
  background: var(--alex-accent, #e63946);
  border: none;
  border-radius: 6px;
  color: #fff;
  cursor: pointer;
  font-family: 'Courier New', monospace;
  font-size: 0.8rem;
  padding: 6px 14px;
  transition: opacity 0.2s;
}
.alex-lead-form button:hover {
  opacity: 0.85;
}

/* ── MOBILE CHAT HEIGHT FIX ──────────────────────────────── */
@media (max-width: 768px) {
  /* Hide desktop prompt items on mobile — too much space */
  .alex-prompt-item,
  .alex-hint {
    display: none !important;
  }

  /* Tighten left panel spacing on mobile */
  .alex-left {
    padding-bottom: 8px;
  }

  /* Hide prompt items and hint text on mobile — terminal takes full focus */
  .alex-prompt-item,
  .alex-hint {
    display: none !important;
  }

  /* Terminal — no fixed min-height, grows with content */
  .alex-terminal {
    min-height: 0 !important;
    height: auto !important;
  }

  /* Message area — compact, scrollable, no excess empty space */
  #inlineChatMessages,
  .alex-messages {
    min-height: 120px !important;
    max-height: 45vh !important;
    height: auto !important;
  }

  /* Tighter font on mobile */
  .alex-msg {
    font-size: 0.78rem;
    line-height: 1.55;
  }

  /* Chips stack vertically on narrow screens */
  #inlineChatChips {
    flex-direction: column;
    gap: 6px;
  }
}
