/* 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"] {
    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;
    }
}
