/* テーマ切り替え用のボタンを非表示にする */
#theme-toggle {
    display: none !important;
}

/* ステップの「使用済み」等の実行ステータスを非表示にする */
/*
[id^="step-"] > span {
    display: none !important;
}
*/

/* 実行ステータスとname(Consultant, Architect Thinking等) を消す */
[id^="step-Consultant"],
[id^="step-Architect Processing"],
[id^="step-Architect Thinking"],
[id^="step-Scenario Drafting"],
[id^="step-JSON Coding"],
p[id^="step"] > span {
    font-size: 0 !important;
}

/* 日本語のロールを表示 */
[id^="step-Consultant"] > span::after{
  content: "思考プロセス";
  margin-left: 5px;
  font-size: 16px !important;
}

[id="step-Architect Processing"] > span::after{
  content: "シナリオを設計・構築しています...";
  margin-left: 5px;
  font-size: 16px !important;
}
[id="step-Architect Processing Finish"] > span::after{
  content: "シナリオの設計・構築が完了しました";
  margin-left: 5px;
  font-size: 16px !important;
}

[id="step-Architect Thinking"] > span::after{
  content: "思考プロセス";
  margin-left: 5px;
  font-size: 16px !important;
}
[id="step-Architect Thinking Finish"] > span::after{
  content: "思考プロセス ✅";
  margin-left: 5px;
  font-size: 16px !important;
}

[id^="step-Scenario Drafting"]:not([id$=" Finish"]) > span::after{
  content: "構築シナリオ";
  margin-left: 5px;
  font-size: 16px !important;
  color: #4e4e4e;
}
[id="step-Scenario Drafting Finish"] > span::after{
  content: "構築シナリオ ✅";
  margin-left: 5px;
  font-size: 16px !important;
}

[id^="step-JSON Coding"] > span::after {
  content: "AIログ";
  margin-left: 5px;
  font-size: 16px !important;
}

/* 1. 光が流れるアニメーションの定義 */
@keyframes shimmer-text {
  0% {
    /* 開始地点をマイナス（左側）に設定 */
    background-position: 100% center;
  }
  100% {
    /* 終了地点をプラス（右側）に設定 */
    background-position: -100% center;
  }
}

/* 2. 実行中のステップタイトルに適用 */
[id="step-Consultant Running"],
[id="step-Architect Processing"],
[id^="step-Architect Thinking"]:not([id$=" Finish"]),
[id^="step-Scenario Drafting Running"]:not([id$=" Finish"]),
[id^="step-JSON coding"]:not([id$=" Finish"]) {
    /* ベースの色と、光る色（白や明るいグレー）のグラデーションを作る */
    /* linear-gradient(向き, 通常色, 光る色, 通常色) */
    /* background: linear-gradient(
    /*     90deg, 
    /*     #334155 0%, 
    /*     #334155 40%, 
    /*     #94a3b8 50%, 
    /*     #334155 60%, 
    /*     #334155 100%
    /* ); */
  
    /* ダークモード対応: 背景色に合わせて色を調整してください */
    /* もしダークモードメインなら、以下のように明るい色ベースにします */
    background: linear-gradient(
        90deg,
        #4e4e4e 0%,    /* ベース色: 少し暗めのグレー */
        #4e4e4e 35%,
        #ffffff 50%,   /* 光の色: 真っ白 */
        #4e4e4e 65%,
        #4e4e4e 100%
    );

    background-size: 200% auto;
    
    /* 文字の形に背景を切り抜く（重要！） */
    -webkit-background-clip: text;
    background-clip: text;
    
    /* 文字自体の色は透明にする（背景を見せるため） */
    -webkit-text-fill-color: transparent;
    color: transparent;

    /* アニメーション実行 */
    animation: shimmer-text 3s linear infinite;
    
    /* 太字にして光を目立たせる */
    font-weight: 800;
}

/* =========================================================
   モーダル画面全体 (背景の暗転)
========================================================= */
.custom-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px); /* 背景を少しぼかす */
    z-index: 9999; /* ChainlitのUIより確実に上に表示 */
    display: none; /* 初期状態は非表示 */
    justify-content: center;
    align-items: center;
    opacity: 0;
    transition: opacity 0.2s ease;
}

/* クラスが付与されたら表示 */
.custom-modal-overlay.active {
    display: flex;
    opacity: 1;
}

/* =========================================================
   モーダルのコンテンツ領域
========================================================= */
.custom-modal-content {
    background-color: #161616; /* より深い高級感のある漆黒へ */
    color: #ededed;
    padding: 32px;            /* 内部パディングにゆとりを持たせる */
    border-radius: 14px;       /* 下のメーター（10px）よりわずかに広くして外殻の美しさを表現 */
    width: 92%;
    max-width: 460px;          /* 横に間延びしない絶妙なジャストサイズ */
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.06); /* 境界線を極細の半透明にしてモダンに */
    position: relative;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    
    /* 縦スクロール安全対策 */
    max-height: 82vh;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: #333333 transparent;
}

/* ❌ 閉じるボタン（×）の劇的モダナイズ */
.custom-modal-close {
    position: absolute;
    top: 24px;   /* 右上の美しい余白位置へ固定 */
    right: 24px;
    width: 32px;  /* クリックエリアをしっかり確保 */
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    color: #666666;
    font-size: 20px;
    border-radius: 50%; /* 完全な真円にする */
    cursor: pointer;
    transition: all 0.2s ease;
}

/* マウスホバー時にうっすら浮かび上がる極上のUX */
.custom-modal-close:hover {
    background-color: rgba(255, 255, 255, 0.05);
    color: #ffffff;
}

/* 大見出し：アカウント情報 */
.custom-modal-header {
    font-size: 20px;
    font-weight: 700;
    color: #ffffff;
    margin-bottom: 28px; /* 下の要素としっかり距離を開けて独立させる */
    letter-spacing: -0.02em;
    line-height: 1.2;
}

/* 小見出し：各エリアのセクションタイトル */
.custom-modal-section-title {
    font-size: 11px;
    font-weight: 600;
    color: #737373; /* 一歩引いた上品なグレー */
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 8px; /* 💡 8pxに縮める：見出しと中身をくっつけて「1つのグループ」に見せる */
    display: flex;
    align-items: center;
    gap: 6px;
}

/* 👤 ログインアカウント表示ボックス */
.custom-modal-user-box {
    background: #1e1e1e; /* モーダル本体（#161616）よりわずかに明るくしてレイヤー感を演出 */
    padding: 14px 18px;  /* 上下を少しシャープに引き締め */
    border-radius: 10px;  /* 下のメーター（10px）と丸みを完璧にシンクロ */
    border: 1px solid rgba(255, 255, 255, 0.02);
    display: flex;
    align-items: center;
    margin-bottom: 28px; /* 💡 28pxに広げる：次のセクション（リソース状況）との境界線を明確にする */
}

/* アカウント文字列のタイポグラフィ */
.custom-modal-value-large {
    font-size: 14px; /* 16pxから14pxへわずかにシャープにし、メーターとのサイズバランスを統一 */
    font-weight: 600;
    color: #e5e5e5;
    letter-spacing: -0.01em;
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace; /* 開発者好みの美しい等幅フォント */
    word-break: break-all;
}

/* =========================================================
   📊 リソースメーターコンポーネント (下半分は既存の美しさを維持)
========================================================= */
.quota-item {
    margin-bottom: 12px; /* メーター同士の間隔を少し詰めてシャープに */
    background: #1e1e1e;
    padding: 14px 18px;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.02);
}

.quota-item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
    font-size: 13px;
}

.quota-item-label {
    font-weight: 500;
    color: #dddddd;
}

.quota-item-usage {
    font-size: 11px;
    color: #666666;
}
.quota-item-usage strong {
    font-size: 13px;
    font-weight: 600;
}

/* 🟢 安全色（シアンブルー） */
.quota-item-usage.status-safe strong { color: #00adb5; }
.quota-progress-bar.status-safe { background: linear-gradient(90deg, #0072ff, #00adb5); }

/* 🟡 警告色（山吹オレンジ） */
.quota-item-usage.status-warning strong { color: #ff9800; }
.quota-progress-bar.status-warning { background: linear-gradient(90deg, #f12711, #f5af19); }

/* 🔴 危険枠超過色（ネオンレッド） */
.quota-item-usage.status-danger strong { color: #ff416c; }
.quota-progress-bar.status-danger { background: linear-gradient(90deg, #8a2387, #e94057, #f27121); animation: quota-pulse 2s infinite; }

/* プログレスバーの土台（溝） */
.quota-progress-bg {
    width: 100%;
    height: 5px; /* 6pxから5pxへわずかにシャープに */
    background-color: #0d0d0d;
    border-radius: 10px;
    overflow: hidden;
}

/* プログレスバーの中身 */
.quota-progress-bar {
    height: 100%;
    border-radius: 10px;
    transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ローディングとエラーのデザイン */
.quota-skeleton, .quota-error {
    text-align: center;
    padding: 24px;
    font-size: 13px;
    color: #666666;
    background: #1e1e1e;
    border-radius: 10px;
    border: 1px dashed rgba(255, 255, 255, 0.06);
}
.quota-error { color: #ff416c; border-color: rgba(255, 65, 108, 0.3); }

/* アニメーション */
.animate-fade-in {
    animation: modal-fadeIn 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes modal-fadeIn {
    from { opacity: 0; transform: translateY(4px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes quota-pulse {
    0% { opacity: 0.85; }
    50% { opacity: 1; }
    100% { opacity: 0.85; }
}

/* =========================================================
   Chainlit標準メニュー: ユーザー名(ラベル)のホバー効果追加
========================================================= */
[role="menu"] .text-sm.font-normal {
    border-radius: 6px;                  /* ログアウトボタンに合わせた角丸 */
    transition: background-color 0.1s ease; 
}

[role="menu"] .text-sm.font-normal:hover {
    background-color: rgba(255, 255, 255, 0.1) !important; /* ダークモードに馴染むハイライト色 */
}

/* =========================================================
   🔑 パスワード変更フォーム専用スタイル
========================================================= */
.pwd-input-group {
    display: flex;
    flex-direction: column;
}

/* 入力フィールドのモダンデザイン */
.pwd-input-field {
    background-color: #0d0d0d;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    padding: 12px 14px;
    color: #ffffff;
    font-size: 14px;
    outline: none;
    transition: all 0.2s ease;
    margin-top: 6px;
}

/* フォーカス時にシアンブルーの極細発光 */
.pwd-input-field:focus {
    border-color: #00adb5;
    box-shadow: 0 0 0 2px rgba(0, 173, 181, 0.15);
}

/* ステータスメッセージ */
.pwd-status-msg {
    font-size: 13px;
    margin-top: 14px;
    font-weight: 500;
    min-height: 18px;
}
.pwd-status-msg.error-color { color: #ff416c; }
.pwd-status-msg.success-color { color: #00adb5; }

/* 確定ボタン（グラデーションフェードイン） */
.pwd-submit-btn {
    width: 100%;
    background: linear-gradient(90deg, #0072ff, #00adb5);
    color: #ffffff;
    border: none;
    padding: 12px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    margin-top: 20px;
    transition: opacity 0.2s ease;
}

.pwd-submit-btn:hover {
    opacity: 0.9;
}

/* =====================================================
   🚪 ログイン画面カスタムフッター用スタイル
   ===================================================== */
#custom-login-footer {
    margin-top: 52px;
    text-align: center;
    font-size: 12px;
    color: rgba(255, 255, 255, 0.3);
    line-height: 1.8;
    width: 100%;
    user-select: none;
}

.custom-footer-top {
    margin-bottom: 4px;
}

.custom-footer-version {
    font-weight: 500;
    letter-spacing: 0.05em;
}

.custom-footer-separator {
    margin: 0 10px;
    color: rgba(255, 255, 255, 0.1);
}

.custom-footer-link {
    color: rgba(255, 255, 255, 0.45);
    text-decoration: none;
    transition: color 0.2s ease;
}

/* 💡 マウスホバー時のエフェクトもCSS側でスマートに処理 */
.custom-footer-link:hover {
    color: #ffffff;
}

.custom-footer-copyright {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.25);
}