/* サムネイルツール専用スタイル */
.thumbnail-tool-container {
    padding: 20px 0;
    min-height: calc(100vh - 250px);
}

.tool-intro {
    text-align: center;
    margin-bottom: 30px;
}

.tool-intro h2 {
    font-size: 1.8rem;
    color: var(--header-bg);
    margin-bottom: 10px;
}

.tool-intro p {
    color: var(--text-sub);
}

.tool-card {
    background: var(--white);
    padding: 30px;
    border-radius: 8px;
    box-shadow: var(--shadow);
    max-width: 800px;
    margin: 0 auto;
}

.form-group label {
    display: block;
    font-weight: bold;
    margin-bottom: 10px;
    font-size: 1.1rem;
}

.form-control {
    width: 100%;
    padding: 15px;
    border: 2px solid var(--border-color);
    border-radius: 6px;
    font-size: 1.1rem;
    transition: border-color 0.3s;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-blue);
}

.form-help {
    font-size: 0.85rem;
    color: var(--text-sub);
    margin-top: 8px;
}

.submit-area {
    margin-top: 25px;
    text-align: center;
}

.btn-generate {
    background-color: var(--accent-orange);
    color: white;
    border: none;
    padding: 15px 40px;
    font-size: 1.2rem;
    font-weight: bold;
    border-radius: 30px;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-generate:hover {
    background-color: var(--accent-hover);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(249, 171, 0, 0.3);
}

/* 結果表示エリアのグリッド */
.thumbnail-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.thumbnail-item {
    background: white;
    padding: 10px;
    border-radius: 8px;
    box-shadow: var(--shadow);
    text-align: center;
}

.thumbnail-item img {
    width: 100%;
    height: auto;
    border-radius: 4px;
    border: 1px solid var(--border-color);
}

.item-actions {
    margin-top: 15px;
}

.btn-download {
    display: inline-block;
    background: var(--primary-blue);
    color: white;
    text-decoration: none;
    padding: 8px 20px;
    border-radius: 4px;
    font-size: 0.9rem;
    transition: background 0.2s;
}

.btn-download:hover {
    background: var(--header-bg);
}

.style-options {
    display: flex;
    gap: 15px;
    margin-bottom: 25px;
    margin-top: 25px;
}

.style-radio {
    display: none; /* 本物のラジオボタンは隠す */
}

.style-card {
    flex: 1;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    padding: 10px;
    cursor: pointer;
    text-align: center;
    transition: all 0.2s;
}

.style-radio:checked + .style-card {
    border-color: var(--primary-blue);
    background-color: #e8f0fe;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.style-preview {
    height: 60px;
    border-radius: 4px;
    margin-bottom: 5px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 0.8rem;
}

/* プレビュー用の色定義 */
.bg-white { background: #ffffff; color: #333; border: 1px solid #ddd; }
.bg-blue  { background: #1a73e8; color: #ffffff; }
.bg-dark  { background: #333333; color: #f9ab00; }

/* スイッチ全体のコンテナ */
.color-mode-switch {
    display: inline-flex;
    background-color: #3a3b3c; /* 濃いめのグレーに変更 */
    padding: 4px;
    border-radius: 30px;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.3);
    margin-left: 20px;
    border: 1px solid transparent; /* ガタつき防止のベース */
}

/* ラジオボタン本体は隠す */
.color-mode-switch input[type="radio"] {
    display: none;
}

/* ラベル共通スタイル */
.color-mode-switch label {
    padding: 8px 18px;
    border-radius: 25px;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: bold;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 6px;
    color: #bbb; /* 未選択時の文字色を明るく */
    border: 1px solid transparent; /* 選択時のボーダーによるガタつきを防止 */
}

/* --- 白背景ボタンの挙動 --- */
.color-mode-switch input#mode_white:checked + .label-white {
    background-color: #ffffff; /* 白地 */
    color: #333333;           /* 黒文字 */
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

/* --- 黒背景ボタンの挙動 --- */
.color-mode-switch input#mode_black:checked + .label-black {
    background-color: #333333; /* 黒地 */
    color: #ffffff;           /* 白文字 */
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

/* ホバー時のちょっとした演出 */
.color-mode-switch label:hover {
    color: #000;
    background-color: rgba(255,255,255,0.1);
}

/* --- グレーボタン（マットメタル） --- */
.color-mode-switch input#mode_gray:checked + .label-gray {
    background-color: #e8e9eb;
    color: #1a1a1a;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

/* --- メタリックボタン（グラデーション） --- */
.color-mode-switch input#mode_metallic:checked + .label-metallic {
    background: linear-gradient(135deg, #f0f2f5 0%, #d2d6dc 100%);
    color: #1a1a1a;
    /* border の代わりに box-shadow の inset を使って光沢を表現し、高さを維持 */
    box-shadow: 
        0 2px 10px rgba(0,0,0,0.4), 
        inset 0 0 0 1px #ccc, /* 枠線の代わり */
        inset 0 1px 0 rgba(255,255,255,0.8); 
}

/* 4項目並ぶので、スマホで溢れる場合は flex-wrap: wrap; を検討してください */
.color-mode-switch {
    display: inline-flex;
    flex-wrap: nowrap; 
    background-color: #eee;
    padding: 5px;
    border-radius: 30px;
    gap: 2px;
}

/* 画像表示エリア全体のコンテナ */
.preview-section {
    margin: 50px auto 0; /* 上に余白、左右は中央寄せ */
    width: 90%;          /* 幅を90%に設定 */
    max-width: 1200px;   /* あまりに巨大なモニターで広がりすぎないよう制限 */
    padding: 50px 20px;  /* 上下はゆったり、左右は程よく */
    background-color: #f0f0f0; 
    border-radius: 12px;
    border: 1px solid var(--border-color);
    text-align: center;
    box-shadow: inset 0 2px 10px rgba(0,0,0,0.05);
}

/* 生成された画像本体 */
.preview-section img {
    width: 100%;         /* コンテナの幅いっぱいに広げる */
    max-width: 960px;    /* 画像の解像感（ボケ）を防ぐため、本来のサイズ付近を上限に */
    height: auto;
    border-radius: 4px;
    box-shadow: 0 15px 40px rgba(0,0,0,0.2); /* 影を少し強めて浮遊感をアップ */
    border: 1px solid #ddd;
    margin: 0 auto 35px; /* 下にダウンロードボタンとの間隔を空ける */
    display: block;
}

/* ダウンロードボタンの調整 */
.preview-section .btn-download {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background-color: var(--header-bg); /* 信頼感のある濃い青 */
    color: white;
    padding: 12px 30px;
    font-size: 1.1rem;
    font-weight: bold;
    border-radius: 6px;
    text-decoration: none;
    transition: all 0.3s;
}

.preview-section .btn-download:hover {
    background-color: var(--primary-blue);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(21, 87, 176, 0.3);
}

/* AB風入力欄の調整 */
.ab-inputs {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 10px;
}

.ab-input {
    padding: 10px 15px !important; /* 少しコンパクトに */
    font-size: 0.95rem !important;
}

/* どちらの入力欄にフォーカスしているか視覚的にわかりやすくする */
.ab-section, .simple-section {
    padding: 15px;
    border-radius: 8px;
    transition: background 0.3s;
}

.form-group label {
    color: var(--header-bg);
}

.tool-section {
    padding: 20px;
    border: 1px solid transparent;
    border-radius: 12px;
    transition: background 0.3s;
}

/* 軽いホバー効果をつけると「ここが入力エリアだ」と分かりやすい */
.tool-section:hover {
    background: #fcfcfc;
    border-color: #eee;
}

.divider {
    text-align: center;
    position: relative;
    margin: 30px 0;
    border-top: 1px solid var(--border-color);
}
.divider span {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: var(--white);
    padding: 0 15px;
    color: var(--text-sub);
    font-weight: bold;
    font-size: 0.8rem;
}

.section-divider {
    margin-top: 20px;
}

html {
    scroll-behavior: smooth;
}

.preview-section {
    scroll-margin-top: 100px; /* ヘッダーの高さ + 余裕分を指定 */
}