/* 1. 全体レイアウト：左右に並べる設定 */
.main-wrapper {
    display: flex;
    flex-direction: row;
    /* 横並び */
    align-items: stretch;
    /* 地図の高さを写真エリアに合わせる */
    gap: 15px;
    width: 100%;
    max-width: none;
    /* 全体の最大幅を広げて写真を大きくする */
    margin: 0 auto 5 auto;
    padding: 10px;
    box-sizing: border-box;
}

/* General page styling */
body {
    font-family: Arial, sans-serif;
    background-color: #f9f9f9;
    display: flex;
    flex-direction: column;
    align-items: center;
    margin: 0;
    padding: 10px 5px;
    box-sizing: border-box;
    min-height: 100vh;
    width: 100%;
}

.grid-container {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    width: 80%;
    /* 全体の半分を占める設定（お好みで調整） */
    margin-bottom: 0;
    /* 下の余白をリセット */
}

/* Individual grid item styling */
.grid-item {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    background-color: white;
    padding: 2px;
    border: 1px solid #ddd;
    /* box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1); */
    box-sizing: border-box;
    position: relative;
}

/* Image styling with aspect ratio 3:4 */
.grid-item img {
    width: 32px;
    height: 32px;
    object-fit: cover;
    margin-top: 3px;
    margin-bottom: 3px;
}

red {
    color: red;
}


/* Text styling */
.text-box {
    font-size: 16px;
    color: #ff0000;
    text-align: center;
    margin-bottom: 1px;
}

/* Hidden button container */
.button-container {
    display: none;
    /* Initially hidden */
    flex-direction: row;
    gap: 10px;
    margin-bottom: 15px;
    position: absolute;
    top: 110%;
    left: 50%;
    transform: translateX(-50%);
    background-color: #fff;
    padding: 10px;
    border: 1px solid #ddd;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    border-radius: 8px;
    z-index: 10;
}

.button-container button {
    width: 50px;
    /* お好みの固定幅 */
    text-align: center;
    /* テキストを中央揃え */
    padding: 8px 0;
    /* 縦方向の余白調整 */
    background-color: #fff;
    border: 2px solid #f00;
    /* ボーダー設定 */
    border-radius: 5px;
    /* 角を丸く */
    cursor: pointer;
    /* カーソルを変更 */
    color: red;
    /* 全てのボタンの文字色を赤に */
}

/* Yellow button styling */
.yellow-button {
    background-color: #ffeb3b;
    color: #333;
    border: none;
    padding: 8px 15px;
    cursor: pointer;
    border-radius: 5px;
    font-weight: bold;
    display: flex;
    align-items: center;
    gap: 5px;
}

/* Red mark styling (outside of button group) */
.red-mark {
    width: 15px;
    height: 15px;
    background-color: #ff0000;
    border-radius: 50%;
}

/* 3. 右側：マップの設定 */
#map {
    width: 30%;
    /* 全体の半分を占める設定 */
    min-height: 400px;
    /* マップが見えるように高さを確保 */
    background-color: #e0e0e0;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #ccc;
}

/* 各グリッドアイテム内のドロップエリアのサイズ調整 */
/* 横に3つ並ぶため、少し小さめに調整すると綺麗です */
[id^="drop-area"] {
    width: 100%;
    aspect-ratio: 1 / 1;
    /* 4/3より正方形に近くすることで、縦方向にも大きく見せます */
    border: 2px dashed #ccc;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 5px auto;
    color: #999;
    font-size: 16px;
    position: relative;
    overflow: hidden;
    background-color: #fff;
}

/* --- 1. すべてのドロップエリアに共通のスタイル --- */
[id^="drop-area"] {
    width: 100%;
    /* 親要素（grid-item）の幅いっぱいに広げる */
    aspect-ratio: 1 / 1;
    /* 正方形にして高さを出す */
    border: 2px dashed #ccc;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 5px auto;
    color: #999;
    font-size: 18px;
    position: relative;
    overflow: hidden;
    background-color: #fff;
    box-sizing: border-box;
}

/* --- 2. ドロップエリア内に入った画像の設定（共通） --- */
[id^="drop-area"] img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

/* --- 3. その他（infoやボタンなど） --- */
#info0 {
    margin-top: 15px;
    font-size: 14px;
    color: #333;
}

p {
    text-align: center;
    line-height: 1;
}

#btn0delete {
    background-color: transparent;
    border: none;
    cursor: pointer;
    font-size: 20px;
    color: #777;
}

#btn0delete:hover {
    color: #111;
}

.qr-container {
    flex: 1;
    aspect-ratio: 1 / 1;
    min-width: 0;
    border: 1px solid #ddd;
    background-color: #fff;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    overflow: hidden;
}

/* 数字アイコン（幅10%に縮小） */
.qr-container .num-icon {
    width: 10%;
    /* 20%から10%へ変更 */
    height: auto;
    object-fit: contain;
    opacity: 0.4;
    /* さらに控えめにして馴染ませます */
    margin-left: 2px;
    /* 端に寄りすぎないよう微調整 */
}

/* メインの画像（幅90%に拡大） */
.qr-container .main-qr-img {
    width: 90%;
    /* 80%から90%へ変更 */
    height: 100%;
    object-fit: contain;
}

/* 90%領域の画像の設定 */
.main-qr-img {
    width: 90%;
    height: 100%;
    object-fit: contain;
}

img:not([src]),
img[src=""] {
    opacity: 0;
}

/* 新しい親コンテナ */
.footer-container {
    display: flex;
    align-items: flex-start;
    /* 上揃え */
    justify-content: center;
    /* 中央寄せ */
    width: 100%;
    max-width: none;
    margin: 5 auto 20 auto;
    padding: 0 10px;
    box-sizing: border-box;
    margin-bottom: 20px;
}

/* 左右のテキストエリア */
.side-text-area {
    flex: 1;
    padding: 10px;
    display: flex;
    align-items: center;
    /* 入力欄を上下中央に配置 */
    box-sizing: border-box;
    margin-bottom: 20px;
}

.side-text-area input[type="text"] {
    width: 100%;
    height: 40px;
    /* qr-containerより少し控えめな高さ */
    padding: 0 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 16px;
    /* スマホ等でズームしないよう16px推奨 */
    color: #333;
    background-color: #fff;
    box-sizing: border-box;
    outline: none;
}

/* 入力欄にフォーカスが当たった時の演出 */
.side-text-area input[type="text"]:focus {
    border-color: #aaa;
    box-shadow: 0 0 5px rgba(0, 0, 0, 0.05);
}

/* qr-wrapperの修正（中央配置のためのmarginを調整） */
#qr-wrapper {
    width: 52%;
    margin: 0;
    padding: 10px;
    display: flex;
    flex-direction: row;
    gap: 10px;
    box-sizing: border-box;
    border-top: none;
}

/* リンクが設定されているアイコンにマウスを乗せたとき */
.grid-item a[href] img {
    cursor: pointer;
    transition: transform 0.2s;
}

.grid-item a[href] img:hover {
    transform: scale(1.1);
    /* 少し大きくする */
    filter: brightness(1.2);
    /* 少し明るくする */
}

/* 左側 (2/3) - index.htmlの内容 */
.left-pane {
    flex: 3;
    overflow-y: auto;
    background-color: #f9f9f9;
    border-right: 2px solid #1a73e8;
    padding: 10px;
    box-sizing: border-box;
}

/* 右側 (1/3) - ise.htmlの内容 */
.right-pane {
    flex: 1;
    overflow-y: auto;
    background-color: #f4f4f4;
    padding: 15px;
    box-sizing: border-box;
}

.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal-content {
    background: white;
    padding: 30px;
    border-radius: 12px;
    width: 320px;
}

.radio-item {
    display: block;
    margin-bottom: 15px;
    cursor: pointer;
    font-size: 18px;
}

.actions {
    text-align: center;
    margin-top: 20px;
    border-top: 1px solid #eee;
    padding-top: 20px;
}

.submit-btn {
    background-color: #007BFF;
    color: white;
    border: none;
    padding: 12px 40px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 16px;
    width: 100%;
}

/* 「今後表示しない」のスタイル */
.skip-option {
    margin-top: 15px;
    font-size: 13px;
    color: #666;
    display: block;
    cursor: pointer;
}

.reopen-btn {
    display: inline-block;
    margin-top: 20px;
    font-size: 14px;
    color: #1a73e8;
    text-decoration: none;
    border: 1px solid #1a73e8;
    padding: 5px 15px;
    border-radius: 20px;
    background-color: transparent;
    /* 背景を透明に */
    cursor: pointer;
    /* マウスホバーで指マークにする */
    outline: none;
    /* クリック時の青い枠線を消す */
    appearance: none;
    /* ブラウザ標準のボタン見た目を解除 */
}