/* ═══════════════════════════════════════════
   chatbot.css — Apex Systematic
   Page-specific styles for the chatbot demo.
   Requires: style.css, demo.css
═══════════════════════════════════════════ */

/* ── HEADER ── */

/* ── MAIN LAYOUT ── */


    .main-layout {
      display: grid;
      grid-template-columns: 1fr 340px;
      gap: 24px;
      align-items: start;
    }

/* ── CHAT CARD ── */


    .chat-card {
      background: var(--bg-card);
      border: 1px solid var(--border);
      border-radius: var(--radius);
      overflow: hidden;
      position: relative;
    }



    .chat-card::before {
      content: '';
      position: absolute;
      top: 0; left: 0; right: 0;
      height: 2px;
      background: linear-gradient(90deg, transparent, var(--gold), transparent);
    }



    .chat-header {
      display: flex;
      align-items: center;
      gap: 12px;
      padding: 16px 20px;
      border-bottom: 1px solid var(--border);
      background: rgba(255,255,255,0.02);
    }



    .chat-avatar {
      width: 34px; height: 34px;
      border-radius: var(--radius);
      background: var(--gold-dim);
      border: 1px solid var(--border-gold);
      display: flex;
      align-items: center;
      justify-content: center;
      font-size: 15px;
      flex-shrink: 0;
    }



    .chat-header-info strong {
      display: block;
      font-size: 14px;
      font-weight: 600;
    }



    .chat-header-info span {
      font-size: 11px;
      color: var(--text-muted);
    }



    .online-dot {
      width: 7px; height: 7px;
      border-radius: 50%;
      background: var(--green);
      box-shadow: 0 0 5px var(--green);
      margin-left: auto;
      animation: pulse 2s infinite;
    }

/* ── MESSAGES ── */


    .messages {
      height: 440px;
      overflow-y: auto;
      padding: 20px;
      display: flex;
      flex-direction: column;
      gap: 16px;
      scroll-behavior: smooth;
    }



    .messages::-webkit-scrollbar { width: 4px; }


    .messages::-webkit-scrollbar-track { background: transparent; }


    .messages::-webkit-scrollbar-thumb { background: var(--border); border-radius: var(--radius); }



    .msg {
      display: flex;
      gap: 10px;
      animation: msgIn 0.3s ease forwards;
      opacity: 0;
    }



    .msg.user { flex-direction: row-reverse; }



    .msg-avatar {
      width: 28px; height: 28px;
      border-radius: var(--radius);
      display: flex;
      align-items: center;
      justify-content: center;
      font-size: 12px;
      flex-shrink: 0;
      margin-top: 2px;
    }



    .msg.bot .msg-avatar {
      background: var(--gold-dim);
      border: 1px solid var(--border-gold);
      color: var(--gold);
    }



    .msg.user .msg-avatar {
      background: var(--bg-input);
      border: 1px solid var(--border);
      color: var(--text-muted);
    }



    .msg-bubble {
      max-width: 75%;
      padding: 12px 15px;
      border-radius: var(--radius);
      font-size: 14px;
      line-height: 1.65;
    }



    .msg.bot .msg-bubble {
      background: var(--bg-input);
      border: 1px solid var(--border);
      color: var(--text);
      border-top-left-radius: 3px;
    }



    .msg.user .msg-bubble {
      background: var(--bg-msg-user);
      border: 1px solid rgba(201,168,76,0.15);
      color: var(--text);
      border-top-right-radius: 3px;
    }

/* Typing indicator */


    .typing-indicator {
      display: flex;
      gap: 10px;
      align-items: flex-end;
    }



    .typing-dots {
      display: flex;
      gap: 4px;
      padding: 14px 16px;
      background: var(--bg-input);
      border: 1px solid var(--border);
      border-radius: var(--radius);
      border-top-left-radius: 3px;
    }



    .typing-dots span {
      width: 6px; height: 6px;
      border-radius: 50%;
      background: var(--text-dim);
      animation: typingBounce 1.2s infinite;
    }



    .typing-dots span:nth-child(2) { animation-delay: 0.2s; }


    .typing-dots span:nth-child(3) { animation-delay: 0.4s; }



    @keyframes typingBounce {
      0%, 60%, 100% { transform: translateY(0); opacity: 0.4; }
      30% { transform: translateY(-5px); opacity: 1; }
    }

/* ── INPUT AREA ── */


    .chat-input-area {
      padding: 16px 20px;
      border-top: 1px solid var(--border);
      display: flex;
      gap: 10px;
      align-items: center;
    }

    .chat-msg-input {
      flex: 1;
      background: var(--bg-input);
      border: 1px solid var(--border);
      border-radius: var(--radius);
      color: var(--text);
      font-family: var(--font-body);
      font-size: 14px;
      padding: 10px 14px;
      resize: none;
      outline: none;
      min-height: 64px;
      max-height: 100px;
      overflow-y: auto;
      line-height: 1.5;
      transition: border-color 0.2s;
    }

    .chat-msg-input::placeholder { color: var(--text-dim); }

    .chat-msg-input:focus { border-color: var(--border-gold); }

    .send-btn {
      width: 38px;
      height: 38px;
      background: var(--gold);
      border: none;
      border-radius: var(--radius);
      cursor: pointer;
      display: flex;
      align-items: center;
      justify-content: center;
      flex-shrink: 0;
      align-self: center;
      transition: all 0.2s;
      color: var(--bg);
      font-size: 16px;
    }

    .send-btn:hover { background: var(--gold-light); transform: translateY(-1px); }

    .send-btn:disabled { opacity: 0.4; cursor: not-allowed; transform: none; }

/* ── SIDE PANEL ── */


    .side-panel {
      display: flex;
      flex-direction: column;
      gap: 16px;
    }



    .panel-card {
      background: var(--bg-card);
      border: 1px solid var(--border);
      border-radius: var(--radius);
      overflow: hidden;
    }



    .panel-header {
      display: flex;
      align-items: center;
      gap: 9px;
      padding: 13px 16px;
      border-bottom: 1px solid var(--border);
      background: rgba(255,255,255,0.02);
    }



    .panel-icon {
      width: 24px; height: 24px;
      border-radius: var(--radius);
      display: flex;
      align-items: center;
      justify-content: center;
      font-size: 12px;
    }



    .panel-title {
      font-size: 11px;
      font-weight: 600;
      letter-spacing: 0.1em;
      text-transform: uppercase;
      color: var(--text-muted);
    }



    .panel-body { padding: 14px 16px; }

/* Pipeline steps */


    .pipeline {
      display: flex;
      flex-direction: column;
      gap: 0;
    }



    .pipeline-step {
      display: flex;
      gap: 12px;
      align-items: flex-start;
      padding: 10px 0;
      position: relative;
    }



    .pipeline-step:not(:last-child)::after {
      content: '';
      position: absolute;
      left: 11px;
      top: 30px;
      bottom: -2px;
      width: 1px;
      background: var(--border);
    }



    .step-dot {
      width: 23px; height: 23px;
      border-radius: 50%;
      border: 1.5px solid var(--border);
      display: flex;
      align-items: center;
      justify-content: center;
      font-size: 10px;
      flex-shrink: 0;
      background: var(--bg);
      transition: all 0.3s;
      z-index: 1;
    }



    .step-dot.active {
      border-color: var(--gold);
      background: var(--gold-dim);
      color: var(--gold);
      box-shadow: 0 0 8px rgba(201,168,76,0.25);
    }



    .step-dot.done {
      border-color: var(--green);
      background: var(--green-dim);
      color: var(--green);
    }



    .step-info { flex: 1; padding-top: 2px; }



    .step-name {
      font-size: 12px;
      font-weight: 500;
      color: var(--text-muted);
      transition: color 0.3s;
    }



    .step-name.active { color: var(--gold); }


    .step-name.done { color: var(--text); }



    .step-detail {
      font-size: 11px;
      color: var(--text-dim);
      margin-top: 2px;
      line-height: 1.4;
    }

/* Lead status */


    .lead-status {
      display: flex;
      flex-direction: column;
      gap: 10px;
    }



    .lead-field {
      display: flex;
      justify-content: space-between;
      align-items: center;
      font-size: 12px;
    }



    .lead-field-label {
      color: var(--text-dim);
      font-size: 11px;
      letter-spacing: 0.06em;
      text-transform: uppercase;
    }



    .lead-field-val {
      color: var(--text);
      font-size: 13px;
    }



    .lead-field-val.empty { color: var(--text-dim); font-style: italic; }



    .lead-captured-banner {
      display: flex;
      align-items: center;
      gap: 8px;
      padding: 10px 12px;
      background: var(--green-dim);
      border: 1px solid rgba(46,204,113,0.25);
      border-radius: var(--radius);
      font-size: 12px;
      color: var(--green);
      font-weight: 500;
      display: none;
    }

/* Suggested prompts */


    .prompts {
      display: flex;
      flex-direction: column;
      gap: 7px;
    }



    .prompt-btn {
      background: var(--bg-input);
      border: 1px solid var(--border);
      border-radius: var(--radius);
      padding: 9px 12px;
      font-family: var(--font-body);
      font-size: 12px;
      color: var(--text-muted);
      cursor: pointer;
      text-align: left;
      transition: all 0.2s;
      line-height: 1.4;
    }



    .prompt-btn:hover {
      border-color: var(--border-gold);
      color: var(--gold);
      background: var(--gold-dim);
    }

/* ── CTA ── */



    @media (max-width: 768px) {
      .main-layout { grid-template-columns: 1fr; }
      .cta-section { padding: 28px 20px; }
    }