/* diagnosis.css */

#diagnosis-container {
    padding: 20px;
}

/* ヘッダーの高さ分だけコンテンツを下げ、上下の余白を調整 */
.container {
    margin-top: 0; /* style.cssのmargin-topを上書き */
    padding: 70px 20px 20px 20px; /* 上(ヘッダー分+余白)・左右・下 */
}

.question {
    margin-bottom: 40px;
}

.question p {
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: 15px;
}

.question-image {
    width: 100%;
    max-width: 350px;
    height: 200px;
    object-fit: cover; /* 画像をトリミングしてサイズを統一 */
    border-radius: 8px;
    margin: 15px auto;
    display: block;
}

label.option-label {
    display: flex;
    align-items: center;
    background-color: #f5f5f5;
    border: 2px solid #eee;
    border-radius: 10px;
    padding: 15px;
    margin-bottom: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: left;
}

label.option-label:hover {
    border-color: #c5b3a9;
}

/* ラジオボタン・チェックボックス本体を非表示にする */
.options-container input[type="radio"],
.options-container input[type="checkbox"] {
    display: none;
}

/* 選択されたラベルのスタイル */
.option-label.selected {
    background-color: #8d6e63;
    color: #fff;
    border-color: #8d6e63;
}

#result-container {
    padding: 20px;
}

#result-type {
    font-size: 2rem;
    font-weight: 700;
    color: #8d6e63;
    margin-bottom: 10px;
}

#result-description {
    font-size: 1.1rem;
    color: #555;
    line-height: 1.6;
}

.primary-skin-type {
    font-size: 1.5rem;
    font-weight: bold;
    color: #333;
    margin: 20px 0 10px 0;
    text-align: center;
}

.skin-type-character {
    width: 180px;
    height: 180px;
    margin: 10px auto 20px auto;
    display: block;
    border-radius: 8px;
}

.advice-container {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #eee;
    text-align: left;
}

.advice-container h3 {
    font-size: 1.2rem;
    font-weight: bold;
    color: #333;
    margin-bottom: 15px;
}

.advice-container .advice-section {
    margin-bottom: 15px;
    background-color: #f9f9f9;
    padding: 15px;
    border-radius: 8px;
    border: 1px solid #f0f0f0;
}

.advice-container .advice-section h4 {
    font-size: 1.1rem;
    color: #000000;
    margin-top: 0;
    margin-bottom: 10px;
}

.advice-container .advice-section p {
    font-size: 1rem;
    line-height: 1.7;
    color: #555;
    margin: 0;
}

.skin-type-description-item h4 {
    font-size: 1.4rem; /* 文字を大きく */
    color: #8d6e63;
    font-weight: bold;
    margin-top: 0;
    margin-bottom: 10px;
}

.skin-type-description-item p {
    font-size: 1rem;
    line-height: 1.7;
    color: #000; /* 文字色を黒に */
    text-align: left;
}

#skin-type-description-container h4 {
    font-size: 1.5rem; /* 文字サイズを大きく */
}

#skin-type-description-container p {
    color: #000; /* 文字色を黒に */
}

.hidden {
    display: none;
}

#next-btn, #restart-btn {
    display: block;
    width: 80%;
    max-width: 400px;
    margin: 40px auto 20px;
    padding: 15px 20px;
    font-size: 1.2rem;
    font-weight: bold;
    color: #fff;
    background: linear-gradient(135deg, #a1887f, #8d6e63);
    border: none;
    border-radius: 50px;
    cursor: pointer;
    text-align: center;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
}

#next-btn:hover, #restart-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
    background: linear-gradient(135deg, #b59f96, #a1887f);
}

#next-btn:active, #restart-btn:active {
    transform: translateY(1px);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

.progress-bar-container {
    margin-bottom: 20px;
}

.progress-bar-container h4 {
    margin-bottom: 8px;
    font-size: 1rem;
    font-weight: bold;
    color: #333;
}

.progress-bar-wrapper {
    display: flex;
    align-items: center;
    gap: 10px;
}

.progress-min-label,
.progress-max-label {
    font-size: 0.8rem;
    color: #666;
    flex-shrink: 0;
}

.progress-bar {
    flex-grow: 1;
    height: 28px;
    background-color: #e0e0e0;
    border-radius: 14px;
    overflow: hidden;
    position: relative; /* 中央配置の基準にする */
}

.progress-bar-fill {
    width: 0%; /* 初期値は0 */
    height: 100%;
    border-radius: 14px;
    transition: width 1s ease-out;
}

.progress-current-value {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #333; /* 背景色にかかわらず見えるように濃い色に変更 */
    font-weight: bold;
    font-size: 0.9rem;
}

/* --- Tab Styles --- */
.tab-buttons {
    display: flex;
}

.tab-button {
    flex-grow: 1;
    padding: 12px 15px;
    cursor: pointer;
    background-color: #f0f0f0;
    border: 1px solid #ccc;
    border-bottom: none;
    border-radius: 8px 8px 0 0;
    font-size: 1rem;
    font-weight: bold;
    color: #555;
    transition: all 0.3s ease;
    text-align: center;
}

.tab-button.active {
    background-color: #8d6e63; /* Theme color */
    color: #fff;
    border-color: #8d6e63;
}

.tab-button:hover:not(.active) {
    background-color: #e2e2e2;
}

.tab-content-panels {
    border: 1px solid #ccc;
    padding: 20px;
    border-radius: 0 0 8px 8px;
    background-color: #fff;
}

.tab-panel {
    display: none;
}

.tab-panel.active {
    display: block;
}

/* --- Product Tab Styles --- */
.product-tabs-container {
    margin-top: 20px;
}

.product-tab-buttons {
    display: flex;
    justify-content: space-around; /* 中央揃え・均等配置 */
    border-bottom: 2px solid #eee;
}

.product-tab-button {
    padding: 10px 15px;
    cursor: pointer;
    background: none;
    border: none;
    font-weight: bold;
    color: #777;
    border-bottom: 3px solid transparent;
    margin-bottom: -2px; /* Align with the container's border */
    transition: all 0.3s ease;
}

.product-tab-button.active {
    background-color: #8d6e63; /* 背景をテーマカラーに */
    color: #fff; /* 文字色を白に */
    border-bottom-color: #8d6e63; /* 下線も同色に */
    border-radius: 5px 5px 0 0; /* 少し角を丸める */
}

.product-tab-button:hover:not(.active) {
    color: #333;
}

.product-tab-content-panels {
    padding-top: 20px;
    border: none; /* Override main tab panel border */
}

.product-tab-panel {
    display: none;
}

.product-tab-panel.active {
    display: block;
}

/* --- Product Recommendation Styles --- */
.product-recommendation {
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 15px;
    background-color: #fafafa;
    margin-bottom: 15px; /* Add space between cards */
}

.product-header {
    display: flex;
    align-items: center;
    gap: 15px;
    border-bottom: 1px solid #e0e0e0;
    padding-bottom: 15px;
    margin-bottom: 15px;
}

.product-image-container {
    flex-shrink: 0;
    text-align: center;
}

.product-image {
    width: 100px;
    height: 100px;
    object-fit: cover;
    border-radius: 8px;
}

.product-info {
    flex-grow: 1;
}

.product-name {
    font-size: 1.2rem;
    font-weight: bold;
    margin: 0 0 5px 0;
}

.product-price {
    font-size: 1rem;
    color: #333;
    margin: 0 0 10px 0;
}

.product-url {
    display: inline-block;
    padding: 8px 15px;
    background-color: #8d6e63;
    color: #fff;
    text-decoration: none;
    border-radius: 5px;
    font-weight: bold;
    font-size: 0.9rem;
    transition: background-color 0.3s ease;
}

.product-url:hover {
    background-color: #a1887f;
}

.product-recommendation-grade {
    text-align: center;
    margin-top: 5px; /* Space between image and grade */
}

.product-recommendation-grade span {
    font-size: 0.8rem;
    color: #666;
}

.grade-badge {
    font-size: 2rem;
    font-weight: bold;
    color: #8d6e63;
    line-height: 1;
}

.product-stats {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.product-stat-bar-container {
    display: flex;
    align-items: center;
    gap: 10px;
}

.product-stat-bar-container label {
    flex-basis: 140px; /* Fixed width for labels */
    flex-shrink: 0;
    font-size: 0.85rem;
    text-align: right;
    color: #555;
}

.product-stat-bar-container .progress-bar {
    height: 22px;
    background-color: #f5f0e9; /* 肌色に変更 */
    position: relative; /* 中央配置の基準 */
}

.product-stat-bar-container .progress-bar-fill {
    background-color: #a1887f;
    height: 100%;
    border-radius: 11px;
}

.product-stat-value {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #333; /* 黒色に変更 */
    font-size: 0.8rem;
    font-weight: bold;
}

@media (max-width: 480px) {
    .product-header {
        flex-direction: column;
        align-items: center;
        gap: 10px;
    }
    .product-info {
        text-align: center;
    }
}

.expectations-container {
    margin-bottom: 20px;
    padding: 15px;
    border: 1px solid #eee;
    border-radius: 8px;
    background-color: #fafafa;
}
.expectations-container h4 {
    margin-top: 0;
    margin-bottom: 10px;
    font-size: 1.1rem;
}
.expectations-container p {
    font-size: 0.9rem;
    color: #666;
    margin-top: 0;
    margin-bottom: 15px;
}

/* Custom Select Dropdown */
.custom-select-container {
    position: relative;
}

.custom-select-trigger {
    width: 100%;
    padding: 12px 40px 12px 15px;
    font-size: 1rem;
    border: 2px solid #eee;
    border-radius: 10px;
    background-color: #fff;
    cursor: pointer;
    user-select: none;
    position: relative;
    box-sizing: border-box;
}

.custom-select-trigger::after {
    content: '▼';
    font-size: 12px;
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    transition: transform 0.3s;
}

.custom-select-panel {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background-color: #fff;
    border: 1px solid #ddd;
    border-radius: 0 0 10px 10px;
    z-index: 10;
    max-height: 250px;
    overflow-y: auto;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    opacity: 1;
    transform: translateY(5px);
    transition: opacity 0.2s, transform 0.2s;
}

.custom-select-panel.hidden {
    opacity: 0;
    pointer-events: none;
    transform: translateY(-5px);
    display: none; /* Add display: none to ensure it is hidden */
}

.custom-select-option {
    display: block;
    padding: 12px 15px;
    cursor: pointer;
    transition: background-color 0.2s;
}

.custom-select-option:hover {
    background-color: #f5f5f5;
}

.custom-select-option input[type="checkbox"] {
    margin-right: 10px;
    cursor: pointer;
}

#detailed-skincare-advice {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #eee;
    text-align: left;
}

#detailed-skincare-advice h2 { /* 大見出し */
    font-size: 1.5rem;
    font-weight: bold;
    color: #8d6e63;
    margin-top: 30px;
    margin-bottom: 20px;
    padding-bottom: 8px;
    border-bottom: 2px solid #f0e9e4;
}

#detailed-skincare-advice h3 { /* 肌タイプ名など */
    font-size: 1.3rem;
    font-weight: bold;
    color: #333;
    margin-top: 20px;
    margin-bottom: 15px;
}

#detailed-skincare-advice p {
    font-size: 1rem;
    line-height: 1.8;
    color: #555;
    margin-bottom: 1em;
}

/* テキスト内の強調 **text** を太字にする */
#detailed-skincare-advice strong {
    font-weight: bold;
    color: #d35400; /* 少し目立つ色に */
}

/* ===== Detailed Skincare Advice Accordion ===== */
.advice-accordion {
    margin-top: 30px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    overflow: hidden;
}

.advice-accordion-item {
    border-bottom: 1px solid #e0e0e0;
}

.advice-accordion-item:last-child {
    border-bottom: none;
}

.advice-accordion-header {
    background-color: #f8f9fa;
    padding: 15px 20px;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: bold;
    font-size: 1.1em;
    transition: background-color 0.3s ease;
}

.advice-accordion-header:hover {
    background-color: #f1f3f5;
}

.advice-accordion-header::after {
    content: '+';
    font-size: 1.5em;
    color: #868e96;
    transition: transform 0.3s ease;
}

.advice-accordion-item.active .advice-accordion-header::after {
    transform: rotate(45deg);
}

.advice-accordion-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s ease-out, padding 0.4s ease-out;
    background-color: #fff;
    padding: 0 20px;
}

.advice-accordion-content-inner {
    padding: 20px 0;
}

.advice-accordion-content-inner h4 {
    font-size: 1.1rem;
    color: #343a40;
    margin-top: 15px;
    margin-bottom: 10px;
    padding-bottom: 5px;
    border-bottom: 2px solid #a1887f; /* テーマカラーに合わせる */
}

.advice-accordion-content-inner h4:first-child {
    margin-top: 0;
}

.advice-accordion-content-inner p {
    font-size: 1rem;
    line-height: 1.7;
    color: #495057;
    margin-bottom: 1em;
}

.advice-accordion-content-inner strong {
    color: #8d6e63; /* テーマカラーに合わせる */
    font-weight: bold;
}

.advice-accordion-content-inner ul {
    list-style-type: none;
    padding-left: 0;
}

.advice-accordion-content-inner li {
    position: relative;
    padding-left: 25px;
    margin-bottom: 10px;
}

.advice-accordion-content-inner li::before {
    content: '✔';
    position: absolute;
    left: 0;
    top: 0;
    color: #8d6e63; /* テーマカラー */
    font-weight: bold;
}

.product-description {
    margin-top: 15px;
    padding: 10px;
    background-color: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 5px;
}
.product-description p {
    font-size: 0.95em;
    line-height: 1.6;
    margin: 0;
    color: #333;
}
