/* ================================================= */
/* 1. 基本スタイルとアニメーション設定 */
/* ================================================= */
body {
    font-family: 'Noto Sans JP', sans-serif;
    background-color: #f0f4f8;
    color: #333;
    margin: 0;
    padding: 40px 20px;
    scroll-behavior: smooth;
    overflow-x: hidden;
}
.container {
    max-width: 900px;
    margin: 0 auto;
    background-color: #ffffff;
    padding: 40px 50px;
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    opacity: 0;
    transform: translateY(20px);
    animation: fadeIn 0.8s forwards;
    animation-delay: 0.2s;
}
@keyframes fadeIn {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 2. ヘッダーとタイトル */
h1 {
    color: #0b6cb5;
    text-align: center;
    font-weight: 900;
    font-size: 2.8em;
    margin-bottom: 5px;
    text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.1);
}
.subtitle {
    text-align: center;
    color: #5d6d7e;
    font-size: 1.1em;
    margin-bottom: 40px;
    padding-bottom: 15px;
    border-bottom: 2px solid #0b6cb5;
    display: inline-block;
    width: 100%;
}

/* 3. 開始画面 */
#start-screen {
    text-align: center;
    padding: 80px 20px;
    transition: opacity 0.5s ease-out;
}
#start-screen h2 {
    color: #34495e;
    font-size: 1.8em;
    margin-bottom: 30px;
}
#start-button {
    display: inline-block;
    padding: 20px 40px;
    background-color: #2ecc71; 
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 1.5em;
    font-weight: 700;
    cursor: pointer;
    transition: background-color 0.3s, transform 0.1s;
    box-shadow: 0 6px 15px rgba(46, 204, 113, 0.4);
}
#start-button:hover {
    background-color: #27ae60;
    transform: translateY(-3px);
}

/* 4. 質問フォーム */
#ecl-form {
    display: none;
    opacity: 0;
    transition: opacity 1.0s ease-in;
}
#ecl-form.show {
    display: block;
    opacity: 1;
}

/* 5. 質問グループと質問文 */
h2 {
    color: #1a5276;
    font-size: 1.6em;
    font-weight: 700;
    margin-top: 40px;
    margin-bottom: 20px;
    padding: 5px 10px;
    background-color: #eaf2f8;
    border-left: 6px solid #0b6cb5;
    border-radius: 4px;
}
.question-group {
    position: relative;
    overflow: hidden;
    min-height: 250px;
}
.question {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    padding: 15px 0;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.5s ease, transform 0.5s ease;
}
.question.active {
    opacity: 1;
    visibility: visible;
    position: relative;
    transform: translateY(0);
}
.statement {
    font-weight: 500;
    margin-bottom: 15px;
    color: #34495e;
    font-size: 1.1em;
    line-height: 1.6;
}

/* 5-1. 💡 追加: ボタン選択肢のスタイル */
.button-options {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 15px;
}
.button-options button {
    padding: 12px 20px;
    font-size: 1em;
    font-weight: 500;
    border: 2px solid #bdc3c7;
    background-color: #f7f9fb;
    color: #34495e;
    cursor: pointer;
    border-radius: 8px;
    transition: background-color 0.2s, border-color 0.2s, transform 0.1s;
}
.button-options button:hover {
    background-color: #ecf0f1;
    border-color: #7f8c8d;
}
.button-options button.selected {
    background-color: #0b6cb5; /* D軸の色 */
    color: white;
    border-color: #0b6cb5;
    font-weight: 700;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(11, 108, 181, 0.3);
}

/* 6. カスタムスライダーデザイン */
.slider-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 10px;
    font-size: 0.85em;
    background-color: #ffffff;
    border-radius: 8px;
    padding: 10px 15px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}
input[type="range"] {
    flex-grow: 1;
    margin: 0 15px;
    -webkit-appearance: none;
    width: 100%;
    height: 10px;
    background: linear-gradient(to right, #e74c3c, #f1c40f, #2ecc71);
    border-radius: 5px;
    cursor: pointer;
    outline: none;
    transition: transform 0.1s;
}
input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 24px;
    height: 24px;
    background: #0b6cb5;
    border: 4px solid #ffffff;
    border-radius: 50%;
    box-shadow: 0 0 8px rgba(0, 0, 0, 0.4);
    transition: background 0.3s;
}
.score-label {
    width: 35px;
    text-align: center;
    font-weight: 700;
    color: #0b6cb5;
    background-color: #eaf2f8;
    border-radius: 4px;
    padding: 3px 0;
    transition: color 0.3s, background-color 0.3s;
}
.min-max-label {
    color: #777;
    font-weight: 500;
    width: 150px;
    text-align: center;
}

/* 7. 診断ボタン */
.navigation-buttons {
    display: flex;
    justify-content: space-between;
    margin-top: 20px;
}
.navigation-buttons button {
    flex-grow: 1;
    padding: 15px 20px;
    background-color: #1a5276;
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 1.1em;
    font-weight: 700;
    cursor: pointer;
    transition: background-color 0.3s, transform 0.1s;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
    margin: 0 5px;
}
.navigation-buttons button:hover {
    background-color: #2e86c1;
    transform: translateY(-2px);
}
.navigation-buttons #next-btn,
#submit-btn {
    background-color: #0b6cb5;
}

/* 8. 結果表示エリア */
#results {
    margin-top: 60px;
    padding-top: 30px;
    border-top: 4px solid #0b6cb5;
    display: none; 
    text-align: center;
    opacity: 0;
    transform: scale(0.95);
    transition: opacity 0.8s ease-out, transform 0.5s ease-out;
}
#results.show {
    opacity: 1;
    transform: scale(1);
}
.result-header {
    font-size: 1.8em;
    color: #e74c3c; 
    font-weight: 700;
    margin-bottom: 20px;
}
#type-result {
    font-size: 2.8em;
    font-weight: 900;
    color: #0b6cb5;
    margin-bottom: 15px;
    text-shadow: 2px 2px 5px rgba(0, 0, 0, 0.15);
}
#type-description {
    font-size: 1.15em;
    color: #4a4a4a;
    line-height: 1.8;
    margin-bottom: 30px;
    padding: 20px;
    border: 1px solid #f0f0f0;
    border-radius: 10px;
    background-color: #fcfcfc;
}

/* 9. スコアサマリーボックス */
.score-summary {
    display: flex;
    justify-content: space-around;
    gap: 10px; /* ボックス間のスペースを少し減らす */
    flex-wrap: wrap; /* 4つを横並びにするため折り返しを許可 */
    margin-top: 30px;
}
.score-box {
    padding: 25px;
    border-radius: 15px;
    width: 22%; /* 4つが並ぶように調整 */
    min-width: 150px;
    font-weight: 700;
    text-align: left;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.5s ease-out, transform 0.5s ease-out;
}
.score-box.show {
    opacity: 1;
    transform: translateY(0);
}
.score-box h3 {
    margin: 0;
    font-size: 1.0em; /* 少し小さくする */
    color: #fff;
    opacity: 0.9;
    font-weight: 500;
    margin-bottom: 5px;
}
.score-value {
    font-size: 2.0em; /* 少し小さくする */
    color: #fff;
    display: inline-block;
    margin-top: 5px;
    font-weight: 900;
}
/* 各軸のテーマカラー */
#e-score { background-color: #e74c3c; transition-delay: 0.1s; } 
#c-score { background-color: #3498db; transition-delay: 0.2s; } 
#l-score { background-color: #2ecc71; transition-delay: 0.3s; } 
#d-score { background-color: #9b59b6; transition-delay: 0.4s; } /* 💡 D軸の色を追加 */

/* 9-1. 安定性指標のスタイル */
.stability-indicator {
    display: block;
    font-size: 0.75em;
    font-weight: 900;
    padding: 3px 8px;
    border-radius: 5px;
    margin-top: 10px;
    width: fit-content;
    text-transform: uppercase;
}
.stability-indicator.Stable {
    background-color: #f1c40f; 
    color: #484848;
}
.stability-indicator.Intermediate {
    background-color: #e67e22; 
    color: white;
}
.stability-indicator.Unstable {
    background-color: #c0392b; 
    color: white;
}

/* 10. 相性結果セクション */
#compatibility-results {
    margin-top: 40px;
    text-align: left;
    padding: 25px;
    background-color: #eaf2f8;
    border-radius: 15px;
    box-shadow: inset 0 2px 5px rgba(0, 0, 0, 0.05);
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.5s ease-out, transform 0.5s ease-out;
    transition-delay: 0.5s; /* D軸表示の後に遅延させる */
}
#compatibility-results.show {
    opacity: 1;
    transform: translateY(0);
}
#compatibility-results h3 {
    color: #0b6cb5;
    font-size: 1.4em;
    border-bottom: 2px solid #0b6cb5;
    padding-bottom: 5px;
    margin-bottom: 15px;
}
#compatibility-results p {
    font-size: 1.0em;
    line-height: 1.7;
    margin-bottom: 10px;
}
.good-match {
    color: #e74c3c;
    font-weight: 700;
}
.good-match-description {
    color: #5d6d7e;
    font-size: 0.95em;
}

/* 11. レスポンシブデザイン */
@media (max-width: 768px) {
    body { padding: 20px 10px; }
    .container { padding: 20px 20px; border-radius: 12px; }
    h1 { font-size: 2.0em; }
    .subtitle { font-size: 1.0em; margin-bottom: 30px; }
    #start-screen { padding: 40px 10px; }
    #start-button { font-size: 1.3em; padding: 15px 30px; }
    h2 { font-size: 1.3em; }
    .statement { font-size: 1.0em; }
    .slider-container { flex-wrap: wrap; padding: 5px 0; }
    .min-max-label { width: 45%; font-size: 0.75em; margin-top: 5px; order: 2; }
    .min-max-label:first-child { text-align: left; }
    .min-max-label:last-child { text-align: right; }
    input[type="range"] { width: 100%; margin: 0 0 10px 0; order: 1; }
    .score-label { order: 3; width: 100%; margin-top: 5px; font-size: 0.9em; }
    .score-summary { flex-direction: column; gap: 15px; }
    .score-box { width: 100%; }
    #type-result { font-size: 1.8em; }
    .navigation-buttons button { font-size: 1.0em; }
}
