/**
 * 債務整理シミュレーター - 会話形式UI用CSS
 * simulator-chat.css
 * メインサイトのデザインに合わせたシンプルなスタイル
 */

/* ================================
   キャラクター紹介
================================ */
.character-intro {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    padding: 1.5rem;
    background: var(--background, #fff);
    margin-bottom: 2rem;
}

.character-intro .character {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

.character-intro .character img {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    border: 2px solid var(--border, #e2e8f0);
    background: #fff;
    object-fit: cover;
}

.character-intro .character span {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--muted-foreground, #64748b);
}

.character-intro .intro-text {
    flex: 1;
    font-size: 1rem;
    line-height: 1.7;
    color: var(--foreground, #1e293b);
}

/* ================================
   チャットセクション
================================ */
.chat-section {
    margin-bottom: 1.5rem;
}

.simulator-form-chat {
    background: transparent;
}

/* ================================
   吹き出し共通
================================ */
.chat-bubble {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.chat-bubble .avatar {
    flex-shrink: 0;
    width: 80px;
    height: 80px;
}

.chat-bubble .avatar img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    border: 1px solid var(--border, #e2e8f0);
}

.chat-bubble .bubble-content {
    flex: 1;
    padding: 1rem 1.25rem;
    border-radius: 12px;
    position: relative;
    line-height: 1.6;
}

/* 先生（左側） - シンプルなグレー背景 */
.chat-bubble.teacher {
    flex-direction: row;
}

.chat-bubble.teacher .bubble-content {
    background: var(--muted, #f1f5f9);
    color: var(--foreground, #1e293b);
    border: 1px solid var(--border, #e2e8f0);
}

.chat-bubble.teacher .bubble-content strong {
    color: var(--primary, #3b82f6);
}

.chat-bubble.teacher .bubble-content ul {
    margin: 0.5rem 0;
    padding-left: 1.2rem;
    list-style: disc;
}

.chat-bubble.teacher .bubble-content li {
    margin-bottom: 0.3rem;
    color: var(--foreground, #1e293b);
}

/* 生徒/相談者（右側） */
.chat-bubble.student {
    flex-direction: row-reverse;
}

.chat-bubble.student .bubble-content {
    background: #fff;
    color: var(--foreground, #334155);
    border: 1px solid var(--border, #e2e8f0);
}

/* ================================
   質問番号バッジ
================================ */
.q-number {
    display: inline-block;
    background: var(--primary, #3b82f6);
    color: #fff;
    padding: 0.15rem 0.5rem;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: bold;
    margin-bottom: 0.5rem;
}

.bubble-note {
    font-size: 0.85rem;
    color: var(--muted-foreground, #64748b);
    margin-top: 0.5rem;
}

/* ================================
   ユーザー入力エリア
================================ */
.user-input-area {
    margin-left: 92px;
    /* アバター幅 + gap */
    margin-top: 0;
}

.input-group-large {
    display: flex;
    align-items: center;
    background: #fff;
    border: 1px solid var(--border, #e2e8f0);
    border-radius: 8px;
    padding: 0.6rem 1rem;
    max-width: 200px;
    transition: all 0.2s ease;
}

.input-group-large:focus-within {
    border-color: var(--primary, #3b82f6);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.input-group-large input {
    flex: 1;
    border: none;
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--foreground, #1e293b);
    text-align: right;
    width: 100%;
    outline: none;
    background: transparent;
}

.input-group-large input::placeholder {
    color: var(--muted-foreground, #94a3b8);
    font-weight: normal;
    font-size: 0.9rem;
}

.input-group-large .unit {
    font-size: 0.95rem;
    color: var(--muted-foreground, #64748b);
    margin-left: 0.5rem;
}

/* ================================
   選択ボタン（Yes/No）
================================ */
.btn-choice-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.btn-choice {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    background: #fff;
    border: 1px solid var(--border, #e2e8f0);
    border-radius: 8px;
    font-size: 0.9rem;
    color: var(--foreground, #475569);
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-choice:hover {
    border-color: var(--primary, #3b82f6);
    background: #fafafa;
}

.btn-choice.active {
    border-color: var(--primary, #3b82f6);
    background: rgba(59, 130, 246, 0.05);
    color: var(--primary, #3b82f6);
}

.btn-choice .choice-icon {
    font-size: 1rem;
}

/* ================================
   結果サマリーカード
================================ */
.result-summary-card {
    background: #fff;
    border-radius: 12px;
    padding: 1.5rem;
    text-align: center;
    border: 1px solid var(--border, #e2e8f0);
    margin-bottom: 1.5rem;
    position: relative;
}

.result-summary-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    border-radius: 12px 12px 0 0;
}

.result-summary-card.niniseiri::before {
    background: var(--primary, #3b82f6);
}

.result-summary-card.kojinsaisei::before {
    background: #10b981;
}

.result-summary-card.jikohasan::before {
    background: #ef4444;
}

.result-badge {
    display: inline-block;
    background: var(--primary, #3b82f6);
    color: #fff;
    padding: 0.25rem 0.75rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.result-summary-card h2 {
    font-size: 1.5rem;
    color: var(--foreground, #1e293b);
    margin: 0.5rem 0;
}

.result-tagline {
    color: var(--muted-foreground, #64748b);
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

.result-numbers {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    margin: 1rem 0;
}

.number-item {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.number-item .label {
    font-size: 0.8rem;
    color: var(--muted-foreground, #64748b);
    margin-bottom: 0.25rem;
}

.number-item .value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--foreground, #1e293b);
}

.number-item .value small {
    font-size: 0.9rem;
    font-weight: normal;
}

.number-item.highlight .value {
    color: #059669;
}

.number-item .value.zero {
    color: #ef4444;
}

.number-arrow {
    font-size: 1.5rem;
    color: var(--muted-foreground, #94a3b8);
}

.reduction-badge {
    display: inline-block;
    background: #dcfce7;
    color: #166534;
    padding: 0.4rem 1rem;
    border-radius: 4px;
    font-weight: 600;
    font-size: 0.9rem;
    margin: 0.5rem 0;
}

.result-note {
    font-size: 0.8rem;
    color: var(--muted-foreground, #64748b);
}

/* ================================
   会話セクション（結果ページ）
================================ */
.chat-conversation {
    margin: 1.5rem 0;
}

/* ================================
   情報ボックス
================================ */
.info-box {
    background: #fff;
    border: 1px solid var(--border, #e2e8f0);
    border-radius: 8px;
    padding: 1.25rem;
    margin: 1rem 0;
}

.info-box h4 {
    font-size: 1rem;
    color: var(--foreground, #1e293b);
    margin-bottom: 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border, #e2e8f0);
}

.info-box ul {
    margin: 0 0 0.75rem 1rem;
    padding: 0;
    list-style: disc;
    text-align: left;
}

.info-box li {
    margin-bottom: 0.4rem;
    color: var(--foreground, #334155);
    font-size: 0.9rem;
}

.info-note {
    font-size: 0.85rem;
    color: var(--muted-foreground, #64748b);
    background: var(--muted, #f8fafc);
    padding: 0.75rem;
    border-radius: 6px;
    margin-top: 0.75rem;
}

/* ================================
   警告ボックス
================================ */
.warning-box {
    background: #fff;
    border: 1px solid #fca5a5;
    border-left: 4px solid #ef4444;
    border-radius: 8px;
    padding: 1.25rem;
    margin: 1rem 0;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.warning-box h4 {
    font-size: 1rem;
    color: #dc2626;
    margin-bottom: 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.warning-box .warning-content {
    display: block;
}

.warning-box .warning-intro,
.warning-box>p:first-of-type {
    margin-bottom: 0.75rem;
    color: var(--foreground, #334155);
    font-size: 0.9rem;
}

.warning-box ul {
    margin: 0 0 0.75rem 1rem;
    padding: 0;
    list-style: disc;
}

.warning-box li {
    margin-bottom: 0.4rem;
    color: var(--foreground, #334155);
    font-size: 0.9rem;
}

.warning-box .warning-note,
.warning-box>p:last-of-type {
    font-size: 0.85rem;
    color: var(--muted-foreground, #64748b);
    background: #fef2f2;
    padding: 0.75rem;
    border-radius: 6px;
    margin-top: 0.5rem;
}

/* ================================
   費用比較
================================ */
.fee-comparison {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin: 0.75rem 0;
}

.fee-item {
    background: var(--muted, #f8fafc);
    padding: 1rem;
    border-radius: 8px;
    border: 1px solid var(--border, #e2e8f0);
}

.fee-item h5 {
    font-size: 0.85rem;
    color: var(--foreground, #475569);
    margin-bottom: 0.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border, #e2e8f0);
}

.fee-item ul {
    margin: 0;
    padding-left: 1rem;
    list-style: disc;
}

.fee-item li {
    font-size: 0.8rem;
    margin-bottom: 0.25rem;
}

.fee-total {
    font-weight: 600;
    color: var(--primary, #3b82f6);
    margin-top: 0.5rem;
    padding-top: 0.5rem;
    border-top: 1px dashed var(--border, #cbd5e1);
    font-size: 0.85rem;
}

/* ================================
   メリット・デメリット
================================ */
.merit-demerit-box {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin: 1.5rem 0;
}

.merit,
.demerit {
    padding: 1rem;
    border-radius: 8px;
    border: 1px solid var(--border, #e2e8f0);
}

.merit {
    background: #fff;
    border-left: 4px solid #10b981;
}

.demerit {
    background: #fff;
    border-left: 4px solid #f59e0b;
}

.merit h4,
.demerit h4 {
    font-size: 0.9rem;
    margin-bottom: 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.merit h4 {
    color: #059669;
}

.demerit h4 {
    color: #d97706;
}

.merit ul,
.demerit ul {
    margin: 0;
    padding-left: 1rem;
    list-style: disc;
}

.merit li,
.demerit li {
    margin-bottom: 0.4rem;
    font-size: 0.85rem;
    color: var(--foreground, #334155);
}

/* ================================
   ユーザー選択セクション
================================ */
.user-choice-section {
    text-align: center;
    padding: 1.5rem;
    background: var(--muted, #f8fafc);
    border: 1px solid var(--border, #e2e8f0);
    border-radius: 12px;
    margin: 1.5rem 0;
}

.user-choice-section h3 {
    font-size: 1.1rem;
    color: var(--foreground, #1e293b);
    margin-bottom: 1rem;
}

.choice-buttons {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    align-items: center;
}

.choice-note {
    margin-top: 1rem;
    font-size: 0.85rem;
    color: var(--muted-foreground, #64748b);
    background: #fff;
    padding: 0.75rem;
    border-radius: 6px;
    border: 1px dashed var(--border, #cbd5e1);
}

/* ================================
   条件変更パネル
================================ */
.adjust-panel {
    background: #fff;
    border: 1px solid var(--border, #e2e8f0);
    border-radius: 8px;
    padding: 1.25rem;
    margin-top: 1.5rem;
}

.adjust-panel h4 {
    font-size: 1rem;
    color: var(--foreground, #475569);
    margin-bottom: 1rem;
}

.adjust-panel .form-row {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
}

.adjust-panel .form-group {
    flex: 1;
}

.adjust-panel .form-group label {
    display: block;
    font-size: 0.8rem;
    color: var(--muted-foreground, #64748b);
    margin-bottom: 0.4rem;
}

.adjust-panel .input-group {
    display: flex;
    align-items: center;
    background: var(--muted, #f8fafc);
    border: 1px solid var(--border, #e2e8f0);
    border-radius: 6px;
    padding: 0.5rem 0.75rem;
}

.adjust-panel .input-group input {
    flex: 1;
    border: none;
    background: transparent;
    font-size: 1rem;
    text-align: right;
    outline: none;
}

.adjust-panel .input-group .unit {
    color: var(--muted-foreground, #64748b);
    font-size: 0.85rem;
    margin-left: 0.4rem;
}

/* ================================
   ボタン追加スタイル
================================ */
.btn-xl {
    padding: 0.875rem 2rem;
    font-size: 1rem;
}

.btn-shadow {
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.2);
}

.btn-icon {
    margin-right: 0.4rem;
}

.form-note {
    font-size: 0.8rem;
    color: var(--muted-foreground, #94a3b8);
    margin-top: 0.75rem;
}

/* ================================
   免責事項・リスタート
================================ */
.disclaimer-section {
    text-align: center;
    margin-top: 2rem;
    padding: 1.5rem;
    background: #f8fafc;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
}

.disclaimer-text {
    font-size: 0.85rem;
    color: #334155;
    margin-bottom: 1.5rem;
    line-height: 1.7;
    text-align: left;
    font-weight: 500;
}

.btn-restart {
    display: inline-flex;
    align-items: center;
    background: #fff;
    border: 1px solid #cbd5e1;
    color: #475569;
    text-decoration: none;
    font-size: 0.9rem;
    padding: 0.6rem 1.25rem;
    border-radius: 6px;
    font-weight: 600;
    transition: all 0.2s;
}

.btn-restart:hover {
    background: #f1f5f9;
    border-color: #94a3b8;
    color: #1e293b;
}

/* ================================
   レスポンシブ対応
================================ */
@media (max-width: 768px) {
    .character-intro {
        flex-direction: column;
        text-align: center;
    }

    .user-input-area {
        margin-left: 0;
    }

    .input-group-large {
        max-width: 100%;
    }

    .result-numbers {
        flex-direction: column;
        gap: 0.75rem;
    }

    .number-arrow {
        transform: rotate(90deg);
    }

    .fee-comparison {
        grid-template-columns: 1fr;
    }

    .merit-demerit-box {
        grid-template-columns: 1fr;
    }

    .adjust-panel .form-row {
        flex-direction: column;
    }

    .chat-bubble {
        flex-direction: column !important;
    }

    .chat-bubble .avatar {
        align-self: flex-start;
    }

    .chat-bubble.student .avatar {
        align-self: flex-end;
    }
}