/* 基本スタイル */
.subtitle {
    text-align: center;
    color: #64748b;
    font-size: 1.2rem;
    margin-bottom: 3rem;
}

/* 入力セクション */
.input-section {
    background: white;
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    margin-bottom: 2rem;
}

.input-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.input-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.input-group label {
    font-weight: 600;
    color: #374151;
    font-size: 0.95rem;
}

.input-field {
    padding: 0.75rem;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.3s;
    background: white;
}

.input-field:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.input-with-unit {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.input-with-unit .input-field {
    flex: 1;
}

.unit-label {
    color: #6b7280;
    font-size: 0.9rem;
    font-weight: 500;
    min-width: 24px;
    text-align: left;
}

/* 計算ボタン */
.calculate-section {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

.calculate-button {
    padding: 1rem 2rem;
    background: linear-gradient(135deg, #10b981, #059669);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 4px 15px rgba(16, 185, 129, 0.3);
    min-width: 150px;
}

.calculate-button:hover {
    background: linear-gradient(135deg, #059669, #047857);
    transform: translateY(-2px);
}

.clear-button {
    padding: 1rem 2rem;
    background: white;
    color: #6b7280;
    border: 2px solid #e5e7eb;
    border-radius: 10px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    min-width: 120px;
}

.clear-button:hover {
    border-color: #9ca3af;
    color: #374151;
}

/* 結果セクション */
.results-section {
    display: grid;
    gap: 2rem;
}

.result-card {
    background: white;
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    border-left: 5px solid;
}

.bmi-card {
    border-left-color: #3b82f6;
}

.bodyfat-card {
    border-left-color: #10b981;
}

.weight-card {
    border-left-color: #f59e0b;
}

.result-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.result-header h3 {
    font-size: 1.3rem;
    font-weight: 600;
    color: #374151;
    margin: 0;
}

.bmi-value,
.bodyfat-value {
    display: flex;
    align-items: baseline;
    gap: 0.5rem;
    font-size: 2.5rem;
    font-weight: 700;
    color: #1f2937;
}

.unit {
    font-size: 1.2rem;
    font-weight: 500;
    color: #6b7280;
}

/* BMI・体脂肪率ステータス */
.bmi-status,
.bodyfat-status {
    text-align: center;
    margin-bottom: 1.5rem;
}

.status-label {
    display: inline-block;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-weight: 600;
    font-size: 1rem;
    margin-bottom: 0.5rem;
}

.status-description {
    color: #6b7280;
    font-size: 0.9rem;
}

/* BMIチャート */
.bmi-chart {
    margin-top: 1rem;
}

.chart-bar {
    position: relative;
    height: 20px;
    background: linear-gradient(to right, 
        #7c3aed 0% 10%,
        #2563eb 10% 15%,
        #0284c7 15% 25%,
        #16a34a 25% 60%,
        #d97706 60% 75%,
        #dc2626 75% 85%,
        #be185d 85% 95%,
        #9333ea 95% 100%);
    border-radius: 10px;
    margin-bottom: 0.5rem;
}

.chart-indicator {
    position: absolute;
    width: 3px;
    height: 30px;
    background: #1f2937;
    top: -5px;
    border-radius: 2px;
    transition: left 0.3s ease;
}

.chart-labels {
    display: flex;
    justify-content: space-between;
    font-size: 0.7rem;
    color: #6b7280;
    margin-top: 0.5rem;
    flex-wrap: wrap;
    gap: 0.25rem;
}

/* 体重情報グリッド */
.weight-info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

.weight-info-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    background: #f8fafc;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
}

.weight-label {
    font-weight: 500;
    color: #374151;
    font-size: 0.9rem;
}

.weight-value {
    font-weight: 600;
    color: #1f2937;
    font-size: 1rem;
}

.bodyfat-info {
    margin-top: 1rem;
    text-align: center;
}

.bodyfat-info small {
    color: #6b7280;
    font-size: 0.85rem;
}

/* 基準表 */
.reference-section {
    background: white;
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    margin-bottom: 2rem;
}

.reference-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.reference-card {
    padding: 1.5rem;
    background: #f8fafc;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
}

.reference-card h3 {
    font-size: 1.1rem;
    font-weight: 600;
    color: #374151;
    margin-bottom: 1rem;
    text-align: center;
}

.reference-table {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.reference-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem;
    background: white;
    border-radius: 6px;
    border: 1px solid #e5e7eb;
}

.range {
    font-weight: 500;
    color: #374151;
    font-size: 0.9rem;
}

.category {
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 600;
    text-align: center;
    min-width: 70px;
}

/* カテゴリ別の色 */
.severely-underweight { background: #ede9fe; color: #7c3aed; }
.underweight { background: #dbeafe; color: #2563eb; }
.mildly-underweight { background: #e0f2fe; color: #0284c7; }
.normal { background: #dcfce7; color: #16a34a; }
.pre-obese { background: #fef3c7; color: #d97706; }
.obese1 { background: #fed7d7; color: #dc2626; }
.obese2 { background: #fce7f3; color: #be185d; }
.obese3 { background: #f3e8ff; color: #9333ea; }

.athlete { background: #f0f9ff; color: #0284c7; }
.excellent { background: #ecfdf5; color: #059669; }
.good { background: #f7fee7; color: #65a30d; }
.fair { background: #fffbeb; color: #d97706; }
.poor { background: #fef2f2; color: #dc2626; }

/* 体脂肪率基準 */
.bodyfat-reference {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
}

.bodyfat-gender h4 {
    font-size: 1rem;
    font-weight: 600;
    color: #374151;
    margin-bottom: 1rem;
    text-align: center;
}

/* 説明セクション */
.action-section {
    background: white;
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    margin-bottom: 2rem;
}

/* ステータス色の動的適用 */
.status-underweight { background: #dbeafe; color: #2563eb; }
.status-normal { background: #dcfce7; color: #16a34a; }
.status-overweight { background: #fef3c7; color: #d97706; }
.status-obese { background: #fed7d7; color: #dc2626; }

/* レスポンシブ対応 */
@media (max-width: 768px) {
    .input-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .calculate-section {
        flex-direction: column;
        align-items: center;
    }
    
    .result-header {
        flex-direction: column;
        text-align: center;
    }
    
    .bmi-value,
    .bodyfat-value {
        justify-content: center;
    }
    
    .weight-info-grid {
        grid-template-columns: 1fr;
    }
    
    .reference-grid {
        grid-template-columns: 1fr;
    }
    
    .bodyfat-reference {
        grid-template-columns: 1fr;
    }
    
    .chart-labels {
        font-size: 0.7rem;
    }
}

@media (max-width: 480px) {
    .input-section,
    .reference-section,
    .action-section {
        padding: 1.5rem;
    }
    
    .result-card {
        padding: 1.5rem;
    }
    
    .reference-card {
        padding: 1rem;
    }
    
    .bmi-value,
    .bodyfat-value {
        font-size: 2rem;
    }
    
    .unit {
        font-size: 1rem;
    }
    
    .weight-info-item {
        flex-direction: column;
        gap: 0.5rem;
        text-align: center;
    }
}