/* General Body and Layout */
body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";
    background-color: #f4f7f6;
    color: #333;
    margin: 0;
    padding: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

#agreement-screen {
    background-color: #ffffff;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    padding: 20px;
    width: 100%;
    max-width: 500px;
    margin-bottom: 20px;
    box-sizing: border-box;
    text-align: center;
}

.agreement-text {
    line-height: 1.6;
    margin-bottom: 20px;
}

.agreement-check {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    margin: 20px 0;
}

.agreement-check input[type="checkbox"] {
    width: auto; /* 全体に適応されている width: 100% を上書き */
    min-height: unset; /* 全体に適応されている min-height をリセット */
    margin: 0; /* 余白をリセット */
    flex-shrink: 0; /* flexコンテナ内で縮まないように設定 */
    transform: scale(1.5); /* チェックボックスを1.5倍に拡大 */
}

.agreement-check label {
    font-weight: bold;
    cursor: pointer;
    font-size: 1.1em; /* ラベルの文字サイズを少し大きくする */
}

#start-simulation-btn {
    background-color: #0a9396;
    color: white;
    border: none;
    padding: 15px 20px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1em;
    font-weight: bold;
    width: 100%;
    transition: background-color 0.3s ease;
}

#start-simulation-btn:disabled {
    background-color: #ccc;
    cursor: not-allowed;
}

header .main-ttl{
    text-align: center;
    font-size: 24px;
    margin: 0 0 20px;
}
#simulator-container, #summary-container, #result-container {
    background-color: #ffffff;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    padding: 20px;
    width: 100%;
    max-width: 500px;
    margin-bottom: 20px;
    box-sizing: border-box;
    position: relative; /* オーバーレイの基準点として必要 */
}

#result-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.75);
    color: white;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.5em;
    font-weight: bold;
    border-radius: 8px; /* 親要素の角丸に合わせる */
    z-index: 10;
}

/* Typography */
h2, h4 {
    color: #005f73;
    border-bottom: 2px solid #94d2bd;
    padding-bottom: 10px;
}

.question-text {
    font-size: 1.2em;
    font-weight: bold;
    color: #001219;
    margin-bottom: 20px;
}

/* Question Blocks */
.question-block {
    display: none;
    text-align: center;
}

.question-block.active {
    display: block;
}

/* Answer Options & Controls */
.answer-options {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
    align-items: center;
}

/* Buttons */
.navigation-buttons {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

.answer-btn, .prev-btn {
    background-color: #0a9396;
    color: white;
    border: none;
    padding: 15px 20px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1em;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: background-color 0.3s ease, transform 0.1s ease;
    flex-grow: 2; /* 「決定」ボタンの幅を広げる */
}

.prev-btn {
    background-color: #6c757d;
    flex-grow: 1; /* 「戻る」ボタンの幅を狭める */
}

.answer-btn:hover, .prev-btn:hover {
    opacity: 0.9;
}

.answer-btn:active, .prev-btn:active {
    transform: translateY(1px);
}

.result-buttons {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

#return-to-top-btn {
    background-color: #6c757d;
    color: white;
    border: none;
    padding: 15px 20px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1em;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: background-color 0.3s ease, transform 0.1s ease;
    flex-grow: 1; /* 残りの幅をすべて使用 */
    box-sizing: border-box;
}

#return-to-top-btn:hover {
    opacity: 0.9;
}

#return-to-top-btn:active {
    transform: translateY(1px);
}

#reset-btn {
    background-color: #adb5bd;
    color: white;
    border: none;
    padding: 15px 20px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1em;
    font-weight: bold;
    text-transform: uppercase;
    transition: background-color 0.3s ease;
    flex-basis: 25%; /* 横幅の割合を指定 */
    box-sizing: border-box;
}

#reset-btn:hover {
    opacity: 0.9;
}

/* Inputs & Selects */
input[type="number"], input[type="date"], select {
    padding: 15px;
    height: 50px;
    border: 1px solid #ccc;
    border-radius: 5px;
    font-size: 1em;
    width: 100%;
    box-sizing: border-box;
    margin-bottom: 10px;
}

/* Specific layout for inputs next to buttons */
#question3 .answer-options {
    flex-direction: column;
}

#question3 select {
    width: 100%;
}

.time-selection {
    display: flex; /* flexを明示的に指定 */
    flex-direction: row;
    align-items: center;
    gap: 8px;
    width: 100%; /* コンテナの幅を100%に */
}

.time-selection select {
    flex-grow: 1;
    margin-bottom: 0; /* selectタグのデフォルトマージンをリセット */
    width: auto; /* 幅を自動調整 */
}

.time-selection span {
    font-weight: bold;
}

#total-hours-display {
    margin-top: 20px;
    padding: 10px 15px;
    background-color: #e9f5f4;
    border-radius: 5px;
    font-weight: bold;
    color: #005f73;
    text-align: center;
    font-size: 1.1em;
}

#question3 .answer-btn, #question3 .prev-btn,
#question4 .answer-btn, #question4 .prev-btn {
    width: auto; /* width: 100% を解除 */
}

#question5 .answer-options {
    display: grid;
    grid-template-columns: 1fr; /* 1列に変更 */
    gap: 10px;
    align-items: center;
}

/* --- ここから修正・追加 --- */

/* すべてのブラウザで日付入力のデフォルトスタイルをリセット */
input[type="date"] {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background-color: #fff; /* 背景色を白に指定 */
    position: relative; /* 透明なボタンを重ねるための基準点 */
}

/* カレンダーアイコンを背景画像として追加 */
input[type="date"] {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%23555' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='4' width='18' height='18' rx='2' ry='2'%3E%3C/rect%3E%3Cline x1='16' y1='2' x2='16' y2='6'%3E%3C/line%3E%3Cline x1='8' y1='2' x2='8' y2='6'%3E%3C/line%3E%3Cline x1='3' y1='10' x2='21' y2='10'%3E%3C/line%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 20px 20px;
}

/* Chrome/Edgeのデフォルトアイコンを非表示にするのではなく、透明にして上に重ねる */
input[type="date"]::-webkit-calendar-picker-indicator {
    position: absolute;
    right: 0;
    top: 0;
    width: 100%;
    height: 100%;
    margin: 0;
    padding: 0;
    cursor: pointer;
    opacity: 0;
}

/* --- ここまで修正・追加 --- */

#question5 input[type="date"] {
    margin-bottom: 0;
}

.notice-text {
    font-size: 0.85em;
    color: #d9534f; /* 少し赤みがかった色 */
    text-align: left;
    margin-top: 15px;
    padding: 10px;
    background-color: #fdf7f7;
    border-left: 3px solid #d9534f;
}

.notice-text p {
    margin: 5px 0;
}

/* Summary & Result */
#summary-container {
    background-color: #e9f5f4;
    border-left: 5px solid #0a9396;
}

#summary-container p {
    margin: 10px 0;
    font-size: 1.1em;
}

.reservation-notice {
    color: #d9534f;
    font-weight: bold;
    text-align: center;
    font-size: 1.1em;
    margin: 15px 0;
    padding: 10px;
    background-color: #fdf7f7;
    border: 1px solid #f5c6cb;
    border-radius: 5px;
}

.holiday-date {
    color: #d9534f; /* 赤色 */
    font-weight: bold;
}

.holiday-notice {
    font-size: 0.8em;
    font-weight: normal;
    margin-left: 5px;
}

.pack-notice-inline {
    color: #d9534f; /* 赤色 */
    font-weight: bold;
}

/* Small text for notes */
small {
    color: #555;
}

/* Responsive adjustments for tablets */
@media (max-width: 768px) {
    #reset-btn {
        flex-basis: 35%;
    }
}

/* Responsive adjustments for small screens */
@media (max-width: 480px) {
    body {
        padding: 10px;
    }

    #simulator-container, #summary-container, #result-container {
        padding: 15px;
    }

    .answer-options {
        flex-direction: column;
    }

    /* 時間選択の箇所だけは横並びを維持する */
    .time-selection {
        flex-direction: row;
    }

    .answer-btn, .prev-btn, input, select {
        width: 100%;
    }

    /* 時間選択内のセレクトボックスは幅を自動調整する */
    .time-selection select {
        width: auto;
        flex-grow: 1; /* 幅の比率を再設定 */
    }

    .navigation-buttons {
        flex-direction: row; /* スマホでも横並びを維持 */
    }

    #question5 .answer-options {
        grid-template-columns: 1fr; /* Stack everything vertically */
    }
}

.personal-practice-message .caution {
    font-size: 0.9em;
    color: #555;
    margin-top: 10px;
}
.result-caution small{
    display:flex;
    flex-direction: column;
    gap:10px;
}
.result-caution em{
    display:flex;
}
.result-caution em:before{
    content:"※";
}
#result-container hr {
    border: 0;
    border-top: 1px solid #ddd;
    margin: 20px 0;
}

.total-price {
    font-size: 1.5em;
    font-weight: bold;
    color: #ae2012;
    text-align: center;
    margin-top: 15px;
    margin-bottom: 5px;
}

.per-person-price {
    text-align: center;
    font-size: 1.1em;
}