/* 全体のスタイル */
body {
    font-family: 'Arial', sans-serif;
    background-color: #eef2f7;
    margin: 0;
    padding: 0;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    min-height: 100vh;
    overflow-x: hidden;
}

h2 {
    color: #2c3e50;
    font-size: 28px;
    font-weight: bold;
    margin-bottom: 0px;
    margin-top: 20px;
}

h3 {
    color: #2c3e50;
    font-size: 24px;
    font-weight: bold;
    margin-bottom: 0px;
    margin-top: 0px;
}


/* フォームのスタイル */
.form-container {
    background: white;
    padding: 25px;
    border-radius: 12px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
    text-align: center;
    width: 90%;
    max-width: 500px;
    margin-bottom: 20px;
}

label {
    display: block;
    font-weight: bold;
    margin-top: 20px;
    color: #34495e;
    font-size: 14px;
    text-align: left;
}

/* 修正: フォームの幅を統一（/home のフォームも含む） */
input, select {
    width: 90%;
    max-width: 450px;
    padding: 10px;
    margin-top: 6px;
    border: 1px solid #bdc3c7;
    border-radius: 6px;
    font-size: 14px;
    transition: all 0.3s ease-in-out;
    display: block;
    margin-left: auto;
    margin-right: auto;
}

input:focus, select:focus {
    border-color: #007bff;
    outline: none;
    box-shadow: 0 0 5px rgba(0, 123, 255, 0.5);
}

/* 「完成イメージの表示」と「送信」ボタンを横並びにする */
.button-group {
    display: flex;
    justify-content: center; /* 中央寄せ */
    gap: 60px; /* ボタン同士の間隔 */
}

/* 「ホームへ戻る」ボタンを下に配置 */
.home-button {
    display: flex;
    justify-content: center;
    width: 100%;
    margin-top: 20px;
    position: relative;
    padding-top: 30px;
}

.home-button::before {
    content: "";
    display: block;
    width: 90%;
    max-width: 450px;
    height: 2px; /* 線の太さ */
    background-color: #ccc; /* 線の色 */
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
}

.index-home-button {
    display: flex;
    justify-content: center;
    width: 100%;
    margin-top: 20px;
    position: relative;
    padding-top: 30px;
}

.index-home-button::before {
    content: "";
    display: block;
    width: 90%;
    max-width: 450px;
    height: 2px; /* 線の太さ */
    background-color: #ccc; /* 線の色 */
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
}



/* ホバー時のスタイル */
button:hover {
    background: linear-gradient(135deg, #0056b3, #003d80);
    transform: translateY(-2px);
}

/* ボタンの配置調整（フォーム内に配置） */
.form-buttons {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    margin-top: 20px;
}


/* /home の注文ID・メールフォームの入力エリアを大きくする */
input[type="text"], input[type="email"] {
    width: 100%;
    max-width: 450px;  /* 最大幅を 450px に拡大 */
    min-width: 350px;  /* 最小幅を 350px に設定 */
    padding: 15px;  /* 入力しやすくするためにパディングを増加 */
    font-size: 18px;  /* 文字サイズを大きく */
    border: 2px solid #007bff;  /* 視認しやすくするために枠を太めに */
    border-radius: 8px;  /* 角を丸く */
    display: block;
    margin: 10px auto;  /* 中央配置 */
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1); /* 軽い影をつける */
}

input:focus {
    border-color: #ff4500;  /* フォーカス時の色変更 */
    outline: none;
    box-shadow: 0 0 8px rgba(255, 69, 0, 0.5); /* フォーカス時のハイライト */
}

/* 「新規作成」ボタンのサイズを適切に調整 */
form button {
    width: auto;  /* 幅を内容に合わせる */
    max-width: 200px;  /* 最大幅を制限 */
    padding: 12px 20px;  /* 余白を調整 */
    font-size: 16px;  /* フォントサイズ維持 */
    display: block;  /* 中央配置 */
    margin: 0px auto;  /* 上下に適度な間隔 */
}


#image-container {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 15px;  /* 画像間のスペース */
}

.image-wrapper {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    background: wheat;
    padding: 10px;
    border-radius: 10px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    max-width: 250px;
    text-align: center;
}

.image-wrapper img {
    width: 200px;
    height: auto;
    border-radius: 5px;
}

.piece-wrapper {
    display: flex;
    align-items: center;  /* ✅ 垂直方向の中央揃え */
    gap: 10px;  /* ✅ 各要素の間隔 */
    width: 100%;
    padding: 5px;
}

.image-wrapper {
    display: flex;
    flex-direction: column; /* ✅ 画像と削除ボタンを縦並びに */
    align-items: center; /* ✅ 水平方向の中央揃え */
    gap: 5px;
}

.image-checkbox {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

.piece-status {
    font-size: 14px;
    font-weight: bold;
    flex-grow: 1;
    text-align: left;
}

.delete-button-wrapper {
    width: 100%;
    display: flex;
    justify-content: center; /* ✅ 削除ボタンを中央に配置 */
    padding-top: 5px;
    min-height: 40px; /* ✅ 削除ボタンがなくても高さを一定にする */
}

.delete-button {
    background: #ff4d4d;
    color: white;
    border: none;
    padding: 5px 10px;
    border-radius: 5px;
    font-size: 12px;
    cursor: pointer;
    transition: background 0.3s ease-in-out;
    width: 60px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.delete-button:hover {
    background: #cc0000;
}

/* ✅ 削除ボタンがない場合でも高さを統一 */
.empty-button-placeholder {
    width: 60px;
    height: 30px;
    visibility: hidden; /* ✅ ボタンがないときは見えなくするが、高さは確保 */
}

/* /fin の画像サイズを固定 */
.fin-image-container {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-top: 20px; /* 上のテキストとの余白 */
}

.fin-image {
    width: 350px;
    height: 350px;
    object-fit: cover; /* 画像を中央に収める */
    border-radius: 10px; /* 角を少し丸める（任意） */
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1); /* 軽い影をつける（任意） */
}

/* プルダウンとボタンを横並びにする */
.horizontal-container {
    display: flex;
    align-items: center;
    gap: 15px; /* プルダウンとボタンの間隔 */
    justify-content: center;
    margin-top: 15px;
}

.horizontal-container select {
    width: 250px; /* プルダウンのサイズを調整 */
}

.horizontal-container button {
    width: auto;
}

/* 「作成済みのピースを確認」ボタンを右寄せ */
.button-right {
    display: flex;
    max-width: 450px;  /* 最大幅を 450px に拡大 */
    min-width: 350px;  /* 最小幅を 350px に設定 */
    justify-content: right; /* 右寄せ */
    width: 90%;
    padding-left: 0; /* 右端との間隔を調整 */
    margin-top: 10px;
}

form {
    max-width: 450px;  /* 最大幅を 450px に拡大 */
    min-width: 350px;  /* 最小幅を 350px に設定 */
    width: 90%;
    margin: 0 auto; /* 中央配置 */
}

/* ステータスと削除ボタンを横並びに */
.status-delete-wrapper {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    width: 90%;
    margin-top: 5px;
}

.piece-status {
    font-size: 14px;
    font-weight: bold;
}

/* ステータスの色付け */
.piece-status.blue { color: blue; }
.piece-status.orange { color: orange; }
.piece-status.green { color: green; }
.piece-status.gray { color: gray; }

/* 削除ボタンの無効化スタイル */
.delete-button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* 検索結果のリスト */
.search-list {
    list-style: none;
    padding: 0;
    width: 100%;
    max-width: 800px;
    margin: 0 auto;
}

/* 各検索結果のアイテムを横並びに */
.search-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid #ddd;
    padding: 10px 0;
    gap: 10px;
}

/* データ部分のスタイル */
.search-data {
    flex-grow: 2;
    font-size: 14px;
}

/* ステータスのドロップダウン */
.status-dropdown {
    width: 120px;
    padding: 5px;
    font-size: 14px;
}

/* ボタン共通のスタイル */
.save-button, .delete-button {
    padding: 5px 10px;
    font-size: 14px;
    cursor: pointer;
    border: none;
    border-radius: 5px;
}

/* 保存ボタン */
.save-button {
    background-color: #007bff;
    color: white;
}

/* 削除ボタン */
.delete-button {
    background-color: #ff4d4d;
    color: white;
}

/* ボタンのホバー効果 */
.save-button:hover {
    background-color: #0056b3;
}
.delete-button:hover {
    background-color: #cc0000;
}

.radio-group {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin: 10px 0;
}

.radio-group input[type="radio"] {
    display: none;
}

.radio-group label {
    padding: 8px 16px;
    background: #ffffff;
    border: 1px solid #007bff;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.2s ease-in-out;
}

.radio-group input[type="radio"]:checked + label {
    background: #007bff;
    color: white;
}

.option-group {
    display: inline-flex;
    align-items: center;
    gap: 30px;
    margin-top: 0px;
}


.radio-group {
    display: flex;
    gap: 10px;
    align-items: center; /* ラジオボタンとラベルの中央揃え */
}

.radio-group input[type="radio"] {
    display: none;
}

.radio-group label {
    padding: 10px 16px;
    background: #ffffff;
    border: 1px solid #007bff;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.2s ease-in-out;
    display: flex;
    align-items: center; /* 中央揃え */
    justify-content: center; /* テキストを中央配置 */
    height: 40px; /* ボタンと高さを統一 */
    line-height: 1; /* テキストの高さ調整 */
}

.radio-group input[type="radio"]:checked + label {
    background: #007bff;
    color: white;
}

button {
    padding: 10px 20px;
    font-size: 16px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    background: linear-gradient(135deg, #007bff, #0056b3);
    color: white;
    transition: transform 0.2s ease-in-out;
    height: 40px; /* ラジオボタンのラベルと同じ高さ */
    display: flex;
    align-items: center; /* 中央揃え */
    justify-content: center;
    margin-top: 10px;
    margin-bottom: 20px;
}

button:hover {
    background: linear-gradient(135deg, #0056b3, #003d80);
    transform: translateY(-2px);
}

#createButton {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 40px;
    padding: 10px 20px;
    font-size: 18px;
    margin-top: 20px;
}

.button-right {
    display: flex;
    justify-content: center; /* ボタンを中央揃え */
    width: 100%;
    margin-top: 20px;
    position: relative;
    padding-top: 20px;
}

.button-right::before {
    content: "";
    display: block;
    width: 90%;
    max-width: 450px;
    height: 2px; /* 線の太さ */
    background-color: #ccc; /* 線の色 */
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
}

/* 「ピースデータ作成・送信サイト」と「?」ボタンの配置 */
.title-with-help {
    display: flex;
    align-items: center;
    gap: 10px; /* 「?」ボタンとの間隔 */
    justify-content: center; /* 中央配置 */
}

/* ? ボタンのスタイル */
.help-button {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background-color: #007bff;
    color: white;
    border: none;
    font-size: 14px;
    font-weight: bold;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.3s ease-in-out;
    padding: 0;
}

.help-button:hover {
    background-color: #0056b3;
}

/* 説明テキストのスタイル */
.help-text {
    background: #f8f9fa;
    padding: 10px;
    border-radius: 8px;
    border: 1px solid #ddd;
    font-size: 14px;
    text-align: left;
    width: 90%;
    max-width: 500px;
    margin: 10px auto 0; /* 上下の隙間を最小限に */
}

/* 検索フォームの最大幅を500pxに設定 */
.search-form {
    max-width: 500px;
    width: 90%;
    margin: 0 auto; /* 中央配置 */
}
