// uimocks.jsx — UI mockups (dashboard, chat, document) for hero / quote sections

// ==========================================================
// MockDashboard — AI業務改善ダッシュボード
// ==========================================================
function MockDashboard() {
  return (
    <div className="uimock uimock--dashboard">
      <div className="uimock__chrome">
        <div className="uimock__dots">
          <span></span><span></span><span></span>
        </div>
        <div className="uimock__url">
          <svg width="11" height="11" viewBox="0 0 16 16" fill="none"><path d="M5 7V5a3 3 0 116 0v2M4 7h8v6H4z" stroke="currentColor" strokeWidth="1.4" strokeLinecap="round" strokeLinejoin="round"/></svg>
          ai-improvement.app
        </div>
        <div className="uimock__chrome-actions">
          <span></span><span></span>
        </div>
      </div>
      <div className="uimock__body">
        <div className="uimock-dash__head">
          <div className="uimock-dash__title-group">
            <div className="uimock-dash__appmark">AE</div>
            <div>
              <div className="uimock-dash__title">AI業務改善ダッシュボード</div>
              <div className="uimock-dash__subtitle">2026年5月 · 月次サマリ</div>
            </div>
          </div>
          <div className="uimock-dash__period">
            5月 ▾
          </div>
        </div>
        <div className="uimock-dash__stats">
          <div className="uimock-dash__stat">
            <div className="uimock-dash__stat-label">削減時間（今月）</div>
            <div className="uimock-dash__stat-value">42<small>h</small></div>
            <div className="uimock-dash__stat-trend up">↑ 18% vs 先月</div>
          </div>
          <div className="uimock-dash__stat">
            <div className="uimock-dash__stat-label">改善対象業務</div>
            <div className="uimock-dash__stat-value">3<small>件</small></div>
            <div className="uimock-dash__stat-trend neutral">● 進行中</div>
          </div>
          <div className="uimock-dash__stat">
            <div className="uimock-dash__stat-label">育成済み推進者</div>
            <div className="uimock-dash__stat-value">2<small>名</small></div>
            <div className="uimock-dash__stat-trend up">✓ 完了</div>
          </div>
        </div>
        <div className="uimock-dash__chart">
          <div className="uimock-dash__chart-head">
            <span>改善時間の推移</span>
            <span className="uimock-dash__chart-legend">
              <span><i style={{ background: "var(--blue)" }}></i>削減時間</span>
              <span><i style={{ background: "oklch(70% 0.12 155)" }}></i>目標</span>
            </span>
          </div>
          <svg viewBox="0 0 320 100" width="100%" height="100" preserveAspectRatio="none">
            {/* grid */}
            <line x1="0" y1="20" x2="320" y2="20" stroke="currentColor" strokeWidth="0.5" opacity="0.1" />
            <line x1="0" y1="50" x2="320" y2="50" stroke="currentColor" strokeWidth="0.5" opacity="0.1" />
            <line x1="0" y1="80" x2="320" y2="80" stroke="currentColor" strokeWidth="0.5" opacity="0.1" />
            {/* target line (dashed) */}
            <line x1="0" y1="40" x2="320" y2="40" stroke="oklch(70% 0.12 155)" strokeWidth="1.4" strokeDasharray="4 4" opacity="0.7" />
            {/* area fill */}
            <path d="M0,82 L40,78 L80,72 L120,60 L160,55 L200,42 L240,38 L280,30 L320,22 L320,100 L0,100 Z" fill="url(#dashGrad)" opacity="0.18" />
            <defs>
              <linearGradient id="dashGrad" x1="0" y1="0" x2="0" y2="1">
                <stop offset="0%" stopColor="oklch(54% 0.18 252)" />
                <stop offset="100%" stopColor="oklch(54% 0.18 252)" stopOpacity="0" />
              </linearGradient>
            </defs>
            {/* line */}
            <polyline points="0,82 40,78 80,72 120,60 160,55 200,42 240,38 280,30 320,22" fill="none" stroke="oklch(54% 0.18 252)" strokeWidth="2.4" strokeLinecap="round" strokeLinejoin="round" />
            {/* dots */}
            {[[0,82],[40,78],[80,72],[120,60],[160,55],[200,42],[240,38],[280,30],[320,22]].map(([x,y],i) => (
              <circle key={i} cx={x} cy={y} r="2.5" fill="white" stroke="oklch(54% 0.18 252)" strokeWidth="1.6" />
            ))}
          </svg>
        </div>
        <div className="uimock-dash__list">
          <div className="uimock-dash__list-head">改善対象業務</div>
          <div className="uimock-dash__row">
            <span className="uimock-dash__status done">✓</span>
            <span className="uimock-dash__row-title">月次報告コメントのたたき台作成</span>
            <span className="uimock-dash__row-meta">12h 削減 / 月</span>
          </div>
          <div className="uimock-dash__row">
            <span className="uimock-dash__status inprogress">●</span>
            <span className="uimock-dash__row-title">顧問先への確認メール下書き</span>
            <span className="uimock-dash__row-meta">進行中</span>
          </div>
          <div className="uimock-dash__row">
            <span className="uimock-dash__status queued">○</span>
            <span className="uimock-dash__row-title">資料回収状況の整理フロー</span>
            <span className="uimock-dash__row-meta">次月着手</span>
          </div>
        </div>
      </div>
    </div>
  );
}

// ==========================================================
// MockChat — Chatworkスタイルの伴走チャット
// ==========================================================
function MockChat() {
  const messages = [
    { who: "consult", name: "AIエージェント", time: "10:42", text: "月次報告コメントのプロンプト、たたき台こちらに作りました。顧問先5社で試してみてください。" },
    { who: "consult", name: "AIエージェント", time: "10:43", attach: "monthly_comment_prompt_v2.md" },
    { who: "client", name: "K様（推進担当・仮名）", time: "11:08", text: "ありがとうございます！1社で試したら、税理士が「これ使える」と言っていました。" },
    { who: "consult", name: "AIエージェント", time: "11:14", text: "良かったです🙌  次は資料回収の催促メール、テンプレ化しましょうか？" },
  ];
  return (
    <div className="uimock uimock--chat">
      <div className="uimock__chrome uimock__chrome--app">
        <div className="uimock-chat__head">
          <span className="uimock-chat__avatar">AE</span>
          <div>
            <div className="uimock-chat__room">AIエージェント・パートナーズ</div>
            <div className="uimock-chat__sub">Chatwork · 月次伴走</div>
          </div>
        </div>
        <span className="uimock-chat__online">● オンライン</span>
      </div>
      <div className="uimock__body uimock-chat__body">
        <div className="uimock-chat__day">2026/5/14 (水)</div>
        {messages.map((m, i) => (
          <div key={i} className={`uimock-chat__msg ${m.who === "client" ? "is-client" : ""}`}>
            <div className="uimock-chat__msg-avatar" style={{ background: m.who === "client" ? "oklch(85% 0.06 145)" : "oklch(85% 0.10 252)", color: m.who === "client" ? "oklch(40% 0.10 145)" : "oklch(40% 0.16 252)" }}>
              {m.who === "client" ? "K" : "AE"}
            </div>
            <div className="uimock-chat__msg-body">
              <div className="uimock-chat__msg-meta">
                <strong>{m.name}</strong>
                <span>{m.time}</span>
              </div>
              {m.text && <div className="uimock-chat__msg-text">{m.text}</div>}
              {m.attach && (
                <div className="uimock-chat__attach">
                  <span className="uimock-chat__attach-icon">
                    <svg width="14" height="14" viewBox="0 0 16 16" fill="none"><path d="M3 2h7l3 3v9H3z" stroke="currentColor" strokeWidth="1.4" strokeLinejoin="round"/><path d="M10 2v3h3" stroke="currentColor" strokeWidth="1.4" strokeLinejoin="round"/></svg>
                  </span>
                  {m.attach}
                </div>
              )}
            </div>
          </div>
        ))}
      </div>
      <div className="uimock-chat__compose">
        <div className="uimock-chat__compose-field">メッセージを入力…</div>
        <button className="uimock-chat__compose-send">送信</button>
      </div>
    </div>
  );
}

// ==========================================================
// MockDocument — Google Docs風 + AIサイドバー
// ==========================================================
function MockDocument({ title = "月次報告コメント（5月）", industry = "AI業務改善" }) {
  return (
    <div className="uimock uimock--doc">
      <div className="uimock__chrome uimock__chrome--app">
        <div className="uimock-doc__head">
          <span className="uimock-doc__icon">
            <svg width="14" height="14" viewBox="0 0 16 16" fill="none"><path d="M3 2h7l3 3v9H3z" stroke="currentColor" strokeWidth="1.6" strokeLinejoin="round"/><path d="M10 2v3h3" stroke="currentColor" strokeWidth="1.6" strokeLinejoin="round"/></svg>
          </span>
          <div>
            <div className="uimock-doc__title">{title}</div>
            <div className="uimock-doc__sub">Google Docs · AI下書き</div>
          </div>
        </div>
        <span className="uimock-doc__status">自動保存済</span>
      </div>
      <div className="uimock__body uimock-doc__body">
        <div className="uimock-doc__main">
          <h5 className="uimock-doc__h">{title}</h5>
          <div className="uimock-doc__line w90"></div>
          <div className="uimock-doc__line w70"></div>
          <div className="uimock-doc__line w80"></div>
          <div className="uimock-doc__h2">{industry}のポイント</div>
          <div className="uimock-doc__line w85"></div>
          <div className="uimock-doc__line w65"></div>
          <div className="uimock-doc__line w75"></div>
          <div className="uimock-doc__h2">推奨アクション</div>
          <div className="uimock-doc__line w90"></div>
          <div className="uimock-doc__line w60"></div>
        </div>
        <div className="uimock-doc__sidebar">
          <div className="uimock-doc__ai-head">
            <span className="uimock-doc__ai-mark">AI</span>
            <span>AIアシスト</span>
          </div>
          <div className="uimock-doc__ai-prompt">「前月との差分と要因をまとめて」</div>
          <div className="uimock-doc__ai-actions">
            <button className="uimock-doc__ai-btn primary">
              <svg width="12" height="12" viewBox="0 0 16 16" fill="none"><path d="M3 8l3 3 7-7" stroke="currentColor" strokeWidth="2" strokeLinecap="round" strokeLinejoin="round"/></svg>
              下書きを挿入
            </button>
            <button className="uimock-doc__ai-btn">再生成</button>
          </div>
          <div className="uimock-doc__ai-divider"></div>
          <div className="uimock-doc__ai-history">
            <div>履歴</div>
            <div className="uimock-doc__ai-history-item">
              <span className="dot"></span>
              要点を3行に要約
            </div>
            <div className="uimock-doc__ai-history-item">
              <span className="dot"></span>
              敬語に書き換え
            </div>
            <div className="uimock-doc__ai-history-item">
              <span className="dot"></span>
              注意点を抽出
            </div>
          </div>
        </div>
      </div>
    </div>
  );
}

Object.assign(window, { MockDashboard, MockChat, MockDocument, MockStrategy, MockCode, MockKnowledge });

// ==========================================================
// MockStrategy — 業務改善設計マップ（コンサル業務の可視化）
// ==========================================================
function MockStrategy() {
  return (
    <div className="uimock uimock--strategy">
      <div className="uimock__chrome uimock__chrome--app">
        <div className="uimock-mini__head">
          <span className="uimock-mini__icon" style={{ background: "var(--blue-soft)", color: "var(--blue)" }}>
            <svg width="14" height="14" viewBox="0 0 16 16" fill="none"><circle cx="8" cy="3" r="1.6" stroke="currentColor" strokeWidth="1.4"/><circle cx="3" cy="13" r="1.6" stroke="currentColor" strokeWidth="1.4"/><circle cx="13" cy="13" r="1.6" stroke="currentColor" strokeWidth="1.4"/><path d="M8 5v3M6 10l-2 2M10 10l2 2" stroke="currentColor" strokeWidth="1.4" strokeLinecap="round"/></svg>
          </span>
          <div>
            <div className="uimock-mini__title">業務改善テーマMAP</div>
            <div className="uimock-mini__sub">Obsidian · 共有ボード</div>
          </div>
        </div>
      </div>
      <div className="uimock__body uimock-strategy__body">
        <svg viewBox="0 0 320 200" width="100%" height="200">
          {/* connectors */}
          <path d="M160 30 L80 90" stroke="var(--blue)" strokeWidth="1.4" />
          <path d="M160 30 L160 90" stroke="var(--blue)" strokeWidth="1.4" />
          <path d="M160 30 L240 90" stroke="var(--blue)" strokeWidth="1.4" />
          <path d="M80 130 L80 168" stroke="var(--muted-2)" strokeWidth="1" strokeDasharray="3 3" />
          <path d="M160 130 L160 168" stroke="var(--muted-2)" strokeWidth="1" strokeDasharray="3 3" />
          <path d="M240 130 L240 168" stroke="var(--muted-2)" strokeWidth="1" strokeDasharray="3 3" />

          {/* root node */}
          <rect x="120" y="10" width="80" height="36" rx="6" fill="oklch(20% 0.06 255)" />
          <text x="160" y="32" textAnchor="middle" fontFamily="var(--sans)" fontSize="10.5" fill="white" fontWeight="700">業務改善テーマ</text>

          {/* child nodes */}
          <rect x="36" y="90" width="88" height="40" rx="6" fill="white" stroke="var(--blue-line)" strokeWidth="1.4" />
          <text x="80" y="106" textAnchor="middle" fontFamily="var(--sans)" fontSize="9.5" fill="var(--ink)" fontWeight="700">月次報告</text>
          <text x="80" y="120" textAnchor="middle" fontFamily="var(--sans)" fontSize="8.5" fill="var(--muted)">優先度: 高</text>

          <rect x="116" y="90" width="88" height="40" rx="6" fill="white" stroke="var(--blue-line)" strokeWidth="1.4" />
          <text x="160" y="106" textAnchor="middle" fontFamily="var(--sans)" fontSize="9.5" fill="var(--ink)" fontWeight="700">資料回収</text>
          <text x="160" y="120" textAnchor="middle" fontFamily="var(--sans)" fontSize="8.5" fill="var(--muted)">優先度: 中</text>

          <rect x="196" y="90" width="88" height="40" rx="6" fill="white" stroke="var(--blue-line)" strokeWidth="1.4" />
          <text x="240" y="106" textAnchor="middle" fontFamily="var(--sans)" fontSize="9.5" fill="var(--ink)" fontWeight="700">FAQ整備</text>
          <text x="240" y="120" textAnchor="middle" fontFamily="var(--sans)" fontSize="8.5" fill="var(--muted)">優先度: 低</text>

          {/* status badges */}
          <rect x="56" y="168" width="48" height="20" rx="10" fill="oklch(92% 0.05 155)" />
          <text x="80" y="181" textAnchor="middle" fontFamily="var(--sans)" fontSize="8.5" fill="oklch(40% 0.14 155)" fontWeight="700">完了</text>

          <rect x="132" y="168" width="56" height="20" rx="10" fill="var(--blue-soft)" />
          <text x="160" y="181" textAnchor="middle" fontFamily="var(--sans)" fontSize="8.5" fill="var(--blue)" fontWeight="700">進行中</text>

          <rect x="216" y="168" width="48" height="20" rx="10" fill="var(--bg-tint)" />
          <text x="240" y="181" textAnchor="middle" fontFamily="var(--sans)" fontSize="8.5" fill="var(--muted)" fontWeight="700">予定</text>
        </svg>
      </div>
    </div>
  );
}

// ==========================================================
// MockCode — AIエンジニア業務の可視化（Claude Code風）
// ==========================================================
function MockCode() {
  return (
    <div className="uimock uimock--code">
      <div className="uimock__chrome uimock__chrome--app">
        <div className="uimock-mini__head">
          <span className="uimock-mini__icon" style={{ background: "oklch(94% 0.04 30)", color: "oklch(50% 0.16 30)" }}>
            <svg width="14" height="14" viewBox="0 0 16 16" fill="none"><path d="M6 4L2 8l4 4M10 4l4 4-4 4" stroke="currentColor" strokeWidth="1.5" strokeLinecap="round" strokeLinejoin="round"/></svg>
          </span>
          <div>
            <div className="uimock-mini__title">monthly_report.py</div>
            <div className="uimock-mini__sub">Claude Code · 業務アプリ開発</div>
          </div>
        </div>
      </div>
      <div className="uimock__body uimock-code__body">
        <pre className="uimock-code__pre">
          <span className="line"><span className="ln">1</span><span className="kw">def</span> <span className="fn">generate_comment</span>(<span className="arg">client_id</span>):</span>
          <span className="line"><span className="ln">2</span>  <span className="cm"># Drive内の月次資料を要約</span></span>
          <span className="line"><span className="ln">3</span>  docs = drive.<span className="fn">fetch</span>(client_id)</span>
          <span className="line"><span className="ln">4</span>  summary = ai.<span className="fn">summarize</span>(docs)</span>
          <span className="line"><span className="ln">5</span>  <span className="kw">return</span> template.<span className="fn">render</span>(summary)</span>
        </pre>
        <div className="uimock-code__ai">
          <span className="uimock-code__ai-tag">AI suggest</span>
          <span className="uimock-code__ai-text">エラーハンドリングを追加しますか？</span>
          <button className="uimock-code__ai-accept">適用</button>
        </div>
      </div>
    </div>
  );
}

// ==========================================================
// MockKnowledge — ナレッジネットワーク図
// ==========================================================
function MockKnowledge() {
  return (
    <div className="uimock uimock--knowledge">
      <div className="uimock__chrome uimock__chrome--app">
        <div className="uimock-mini__head">
          <span className="uimock-mini__icon" style={{ background: "oklch(94% 0.04 295)", color: "oklch(50% 0.18 295)" }}>
            <svg width="14" height="14" viewBox="0 0 16 16" fill="none"><circle cx="8" cy="8" r="2" stroke="currentColor" strokeWidth="1.5"/><circle cx="3" cy="3" r="1.5" stroke="currentColor" strokeWidth="1.5"/><circle cx="13" cy="3" r="1.5" stroke="currentColor" strokeWidth="1.5"/><circle cx="3" cy="13" r="1.5" stroke="currentColor" strokeWidth="1.5"/><circle cx="13" cy="13" r="1.5" stroke="currentColor" strokeWidth="1.5"/><path d="M4.5 4.5L7 7M11.5 4.5L9 7M4.5 11.5L7 9M11.5 11.5L9 9" stroke="currentColor" strokeWidth="1.2"/></svg>
          </span>
          <div>
            <div className="uimock-mini__title">社内ナレッジネットワーク</div>
            <div className="uimock-mini__sub">Cortex · プロンプト集</div>
          </div>
        </div>
      </div>
      <div className="uimock__body uimock-knowledge__body">
        <svg viewBox="0 0 320 200" width="100%" height="200">
          {/* connectors */}
          <line x1="160" y1="100" x2="60" y2="40" stroke="oklch(50% 0.18 295)" strokeWidth="1.2" opacity="0.5" />
          <line x1="160" y1="100" x2="260" y2="40" stroke="oklch(50% 0.18 295)" strokeWidth="1.2" opacity="0.5" />
          <line x1="160" y1="100" x2="40" y2="140" stroke="oklch(50% 0.18 295)" strokeWidth="1.2" opacity="0.5" />
          <line x1="160" y1="100" x2="280" y2="140" stroke="oklch(50% 0.18 295)" strokeWidth="1.2" opacity="0.5" />
          <line x1="160" y1="100" x2="160" y2="170" stroke="oklch(50% 0.18 295)" strokeWidth="1.2" opacity="0.5" />
          <line x1="60" y1="40" x2="40" y2="140" stroke="oklch(50% 0.18 295)" strokeWidth="1" opacity="0.3" strokeDasharray="2 3" />
          <line x1="260" y1="40" x2="280" y2="140" stroke="oklch(50% 0.18 295)" strokeWidth="1" opacity="0.3" strokeDasharray="2 3" />

          {/* nodes */}
          <circle cx="160" cy="100" r="26" fill="oklch(20% 0.06 255)" />
          <text x="160" y="98" textAnchor="middle" fontFamily="var(--sans)" fontSize="9" fill="white" fontWeight="700">業務</text>
          <text x="160" y="110" textAnchor="middle" fontFamily="var(--sans)" fontSize="9" fill="white" fontWeight="700">ナレッジ</text>

          <g>
            <circle cx="60" cy="40" r="18" fill="white" stroke="oklch(50% 0.18 295)" strokeWidth="1.4" />
            <text x="60" y="44" textAnchor="middle" fontFamily="var(--sans)" fontSize="8.5" fill="var(--ink)" fontWeight="700">手順書</text>
          </g>
          <g>
            <circle cx="260" cy="40" r="18" fill="white" stroke="oklch(50% 0.18 295)" strokeWidth="1.4" />
            <text x="260" y="44" textAnchor="middle" fontFamily="var(--sans)" fontSize="8.5" fill="var(--ink)" fontWeight="700">FAQ</text>
          </g>
          <g>
            <circle cx="40" cy="140" r="18" fill="white" stroke="oklch(50% 0.18 295)" strokeWidth="1.4" />
            <text x="40" y="144" textAnchor="middle" fontFamily="var(--sans)" fontSize="8.5" fill="var(--ink)" fontWeight="700">事例</text>
          </g>
          <g>
            <circle cx="280" cy="140" r="18" fill="white" stroke="oklch(50% 0.18 295)" strokeWidth="1.4" />
            <text x="280" y="144" textAnchor="middle" fontFamily="var(--sans)" fontSize="8.5" fill="var(--ink)" fontWeight="700">用語</text>
          </g>
          <g>
            <circle cx="160" cy="170" r="18" fill="white" stroke="oklch(50% 0.18 295)" strokeWidth="1.4" />
            <text x="160" y="174" textAnchor="middle" fontFamily="var(--sans)" fontSize="8.5" fill="var(--ink)" fontWeight="700">プロンプト</text>
          </g>
        </svg>
      </div>
    </div>
  );
}
