/* 全体のリセットとベース設定 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: "Helvetica Neue", Arial, "Hiragino Kaku Gothic ProN",
        "Hiragino Sans", Meiryo, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f9f9f9;
}

/* メインコンテナ */
.container {
    width: 100%;
    max-width: 600px;
    margin: 0 auto;
    padding: 0 16px;
}

/* ヘッダー */
.site-header {
    padding: 20px 0;
    text-align: center;
}

.header-image {
    width: 100%;
    height: auto;
    object-fit: contain;
}

/* 診断セクション */
.diagnosis {
    position: relative;
    background: white;
    border-radius: 16px;
    padding: 24px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    overflow: hidden;
    width: 100%;
}

/* 質問コンテナ */
.questions-container {
    position: relative;
    width: 100%;
    height: 500px;
    overflow: hidden;
}

/* 結果表示時は高さ制限を解除 */
.diagnosis.has-result .questions-container {
    height: auto;
    min-height: 500px;
}

/* 質問スタイル */
.question {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    text-align: center;
    opacity: 0;
    visibility: hidden;
    transform: translateX(100%); /* デフォルト：右側 */
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: none;
    display: flex;
    flex-direction: column;
    padding-top: 0;
}

/* 表示中の質問 */
.question.active {
    opacity: 1;
    visibility: visible;
    transform: translateX(0); /* 中央 */
    z-index: 1;
    pointer-events: auto;
}

/* 回答後に表示する質問（右から中央へ） */
.question.next-show {
    transform: translateX(100%); /* 右側から */
}

/* 「前に戻る」で表示する質問（左から中央へ） */
.question.prev-show {
    transform: translateX(-100%); /* 左側から */
}

/* 非表示（右側） */
.question.hidden-right {
    transform: translateX(100%);
}

/* 非表示（左側） */
.question.hidden-left {
    transform: translateX(-100%);
}

/* 結果画像のサイズ調整 */
.result-image-container {
    margin: 20px auto;
    max-width: 600px;
}

/* プログレスバー */
.progress-bar {
    height: 4px;
    background: #e8eaf6;
    border-radius: 2px;
    margin: 0 auto 10px;
    position: relative;
}

.progress {
    height: 100%;
    background: #3d5afe;
    border-radius: 2px;
    width: 20%;
    transition: width 0.4s ease;
}

.progress-text {
    position: absolute;
    top: -24px;
    right: 0;
    font-size: 0.85rem;
    color: #666;
}

/* 質問文のスタイル */
.question h3 {
    font-size: 19px;
    font-family: Arial, sans-serif;
    margin-bottom: 15px;
    color: #ae8f29;
    line-height: 1.5;
    font-weight: bold;
}

/* 前に戻るボタン */
.btn-prev {
    font-size: 24px;
    font-family: Arial, sans-serif;
    color: #333333;
    background: #eeeeee;
    padding: 8px 16px;
    margin-top: 20px;
    border: none;
    border-radius: 100px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-block;
    width: fit-content;
    white-space: nowrap;
    align-self: center;
}

.btn-prev:hover {
    opacity: 0.8;
}

/* 選択肢スタイル */
.options {
    display: flex;
    flex-direction: column;
    gap: 16px;
    position: relative;
    z-index: 2;
}

.option {
    padding: 20px;
    margin: 0 auto;
    width: 100%;
    max-width: 500px;
    font-size: 1.2rem;
    font-family: Arial, sans-serif;
    color: #333333;
    background: #f8f1cc;
    border: none;
    border-radius: 100px;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    display: block;
    text-align: center;
    -webkit-tap-highlight-color: transparent;
    outline: none;
}

.option:hover,
.option:focus {
    border-color: #3d5afe;
    background: rgba(61, 90, 254, 0.05);
    transform: translateY(-2px);
    box-shadow: 0 2px 8px rgba(61, 90, 254, 0.2);
}

.option:active {
    transform: translateY(0);
    background: rgba(61, 90, 254, 0.1);
}

/* 結果表示画面 */
.result-screen {
    text-align: center;
    position: relative !important; /* absoluteを上書き */
    height: auto !important;
    min-height: 100%;
    padding-bottom: 20px; /* ボタンの下部に余白を確保 */
}

.result-screen h2 {
    font-size: 2rem;
    color: #333;
    margin-bottom: 5px;
}

/* 結果画面表示時 */
.diagnosis.has-result {
    padding: 0;
}

.diagnosis.has-result .progress-bar {
    display: none;
}

.diagnosis.has-result .questions-container {
    display: none;
}

.result-image-container {
    margin: 0;
    width: 100%;
}

.result-image {
    width: 100%;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.result-text {
    font-size: 1.2rem;
    line-height: 1.8;
    color: #444;
    margin: 10px 0;
    text-align: left;
    padding: 0 16px;
}

.btn-restart {
    display: inline-block;
    padding: 12px 24px;
    font-size: 1.2rem;
    color: white;
    background: #3d5afe;
    border: none;
    border-radius: 100px;
    cursor: pointer;
    transition: all 0.3s ease;
    margin: 0;
    width: fit-content;
    white-space: nowrap;
    align-self: center;
}

.btn-restart:hover {
    background: #536dfe;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(61, 90, 254, 0.2);
}

/* LINEに戻るボタン */
.btn-line {
    display: inline-block;
    padding: 12px 24px;
    font-size: 1.2rem;
    color: white;
    background: #06C755; /* LINEのブランドカラー */
    border: none;
    border-radius: 100px;
    cursor: pointer;
    transition: all 0.3s ease;
    margin: 16px 0 0;
    width: fit-content;
    white-space: nowrap;
    align-self: center;
    text-decoration: none;
}

.btn-line:hover {
    background: #05b54c;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(6, 199, 85, 0.2);
}
