/* BMI計算機額外樣式調整 - 主色碼 #e8f6e9 */

/* BMI計算機外框容器 */
.grid-page__allot--context>section>div:first-of-type {
    background: linear-gradient(to top, #e8f6e9, rgba(232, 246, 233, 0));
    border-radius: 20px;
    padding: 2.5rem;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
    margin-bottom: 2rem;
    border: 1px solid rgba(232, 246, 233, 0.5);
}

/* BMI計算機標題區域 */
.bmi-calculator-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

/* BMI計算機標題 */
.bmi-calculator-header h4 {
    font-size: 26px;
    font-weight: 400;
    line-height: 2;
    padding-left: 21px;
    color: #218431;
    margin: 0;
}

/* 清除按鈕 */
.reset-btn {
    padding: 0.625rem;
    background: transparent;
    color: #666;
    border: none;
    border-radius: 8px;
    font-size: 1.125rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    flex-shrink: 0;
}

.reset-btn:hover {
    background: #f5f5f5;
    color: #4caf50;
}

.reset-btn:active {
    transform: scale(0.95);
}

.reset-btn i {
    font-size: 1.25rem;
}

/* 輸入區域容器 */
.grid-page__allot--context>section>div:first-of-type>div:last-of-type>div:first-of-type {
    margin-bottom: 2rem;
}

.grid-page__allot--context>section>div:first-of-type>div:last-of-type>div:first-of-type>div {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    align-items: flex-end;
    justify-content: center;
}

/* 輸入框容器 */
.grid-page__allot--context>section>div:first-of-type>div:last-of-type>div:first-of-type>div>div {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    flex: 1;
    min-width: 150px;
    max-width: 200px;
}

/* 輸入框樣式 */
#userHeight,
#userWeight {
    padding: 0.875rem 1rem;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    font-size: 1rem;
    transition: all 0.3s ease;
    background: #ffffff;
    color: #333;
    outline: none;
}

#userHeight:focus,
#userWeight:focus {
    border-color: #4caf50;
    box-shadow: 0 0 0 3px rgba(76, 175, 80, 0.1);
    background: #fafafa;
}

#userHeight:hover,
#userWeight:hover {
    border-color: #bdbdbd;
}

/* 標籤樣式 */
#userHeight+label,
#userWeight+label {
    color: #666;
    font-size: 0.875rem;
    font-weight: 500;
    margin-top: 0.25rem;
}

/* 計算按鈕 */
#calculateBtn {
    padding: 0.875rem ;
    background: linear-gradient(135deg, #4caf50 0%, #66bb6a 100%);
    color: #ffffff;
    border: none;
    border-radius: 12px;
    font-size: 18px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(76, 175, 80, 0.3);
    min-width: 140px;
    flex: 0 0 auto;
}

#calculateBtn:hover {
    background: linear-gradient(135deg, #43a047 0%, #5cb660 100%);
    box-shadow: 0 6px 16px rgba(76, 175, 80, 0.4);
    transform: translateY(-2px);
}

#calculateBtn:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(76, 175, 80, 0.3);
}

/* 結果區域 */
#bmiResult {
    background: linear-gradient(135deg, #e8f6e9 0%, #f1f8f4 100%);
    border-radius: 16px;
    padding: 0;
    margin-top: 0;
    border: 2px solid transparent;
    opacity: 0;
    max-height: 0;
    overflow: hidden;
    transform: translateY(-20px);
    transition: all 0.5s ease;
}

#bmiResult.result--show {
    opacity: 1;
    max-height: 1000px;
    padding: 2.5rem 2rem;
    margin-top: 2rem;
    border-color: rgba(76, 175, 80, 0.2);
    transform: translateY(0);
}

#bmiResult.result--disappear {
    opacity: 0;
    max-height: 0;
    padding: 0;
    margin-top: 0;
    border-color: transparent;
    transform: translateY(-20px);
}

/* 結果答案區域 */
#bmiResult>div:first-of-type {
    text-align: center;
    padding: 1.5rem 0;
    margin: 0 auto;
}

#bmiResult>div:first-of-type>p:first-of-type {
    margin-bottom: 1rem;
}

#bmiResult>div:first-of-type>p:first-of-type>i {
    font-size: 3rem;
    color: #4caf50;
}

#bmiResult>div:first-of-type>p:nth-of-type(2) {
    margin: 1rem 0;
}

#bmiValue {
    font-size: 3.5rem;
    font-weight: 700;
    color: #2e7d32;
    display: inline-block;
    background: linear-gradient(135deg, #4caf50, #66bb6a);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

#bmiCategory {
    font-size: 1.25rem;
    color: #555;
    font-weight: 600;
    margin-top: 0.5rem;
}

/* BMI 說明區塊 */
.bmi-explanation {
    margin-top: 2.5rem;
    padding: 2rem;
    background: #ffffff;
    border-radius: 16px;
    border: 2px solid rgba(76, 175, 80, 0.15);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.bmi-explanation h5 {
    font-size: 1.25rem;
    color: #2e7d32;
    margin: 1.5rem 0 0.75rem 0;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid rgba(76, 175, 80, 0.2);
}

.bmi-explanation h5:first-child {
    margin-top: 0;
}

.bmi-explanation p {
    font-size: 1rem;
    line-height: 1.8;
    color: #555;
    margin-bottom: 1rem;
}

.bmi-explanation ul {
    list-style: none;
    padding: 0;
    margin: 0.5rem 0 1.5rem 0;
}

.bmi-explanation ul li {
    padding: 0.5rem 0;
    padding-left: 1.5rem;
    position: relative;
    font-size: 1rem;
    line-height: 1.8;
    color: #555;
}

.bmi-explanation ul li::before {
    content: '•';
    position: absolute;
    left: 0;
    color: #4caf50;
    font-weight: bold;
    font-size: 1.25rem;
}

.bmi-explanation ul li strong {
    color: #2e7d32;
}

/* 結果詳細資訊列表 */
#bmiResult>ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
}

#bmiResult>ul>li {
    background: #ffffff;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
    border: 1px solid rgba(232, 246, 233, 0.8);
}

#bmiResult>ul>li:hover {
    transform: translateY(-4px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    border-color: #4caf50;
}

#bmiResult>ul>li>p:first-of-type {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
    font-size: 1rem;
    font-weight: 600;
    color: #2e7d32;
}

#bmiResult>ul>li>p:first-of-type>i {
    font-size: 1.25rem;
    color: #4caf50;
}

#bmiStatus {
    font-size: 1.125rem;
}

#bmiResult>ul>li>p:nth-of-type(2) {
    margin-bottom: 0.5rem;
}

#bmiRange,
#idealWeight {
    font-size: 1.5rem;
    font-weight: 700;
    color: #4caf50;
}

#bmiResult>ul>li>p:last-of-type {
    font-size: 0.875rem;
    color: #666;
    margin-top: 0.5rem;
}

/* 響應式設計 */
@media (max-width: 768px) {
    .grid-page__allot--context>section>div:first-of-type {
        padding: 1.5rem;
    }

    .grid-page__allot--context>section>div:first-of-type>div:last-of-type>div:first-of-type>div {
        flex-direction: column;
    }

    .grid-page__allot--context>section>div:first-of-type>div:last-of-type>div:first-of-type>div>div {
        max-width: 100%;
        min-width: 100%;
        width: 100%;
    }

    #userHeight,
    #userWeight {
        width: 100%;
        box-sizing: border-box;
    }

    #calculateBtn {
        width: 100%;
    }

    #bmiValue {
        font-size: 2.5rem;
    }

    #bmiResult>ul {
        grid-template-columns: 1fr;
    }

    .bmi-explanation {
        margin-top: 1.5rem;
        padding: 1.5rem;
    }

    .bmi-explanation h5 {
        font-size: 1.125rem;
    }

    .bmi-explanation p {
        font-size: 0.9375rem;
    }

    .bmi-calculator-header {
        margin-bottom: 1.5rem;
    }

    .bmi-calculator-header h4 {
        font-size: 22px;
        padding-left: 0;
    }

    .reset-btn {
        width: 36px;
        height: 36px;
        padding: 0.5rem;
    }
}

/* 輸入驗證錯誤樣式 */
#userHeight[style*="border-color: rgb(244, 67, 54)"],
#userWeight[style*="border-color: rgb(244, 67, 54)"] {
    border-color: #f44336 !important;
    background: #ffebee;
    animation: shake 0.3s;
}

@keyframes shake {
    0%,
    100% {
        transform: translateX(0);
    }

    25% {
        transform: translateX(-5px);
    }

    75% {
        transform: translateX(5px);
    }
}

