/* style.css */

/* 全域樣式 */
body {
    font-family: 'Arial', sans-serif;
    margin: 0;
    padding: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background-color: #f4f4f4; /* 亮色背景 */
    color: #333; /* 亮色文字顏色 */
    transition: background-color 0.3s, color 0.3s; /* 主題切換平滑過渡 */
}

.dark-mode body {
    background-color: #121212; /* 暗色背景 */
    color: #eee; /* 暗色文字顏色 */
}

.container {
    width: 90%;
    max-width: 800px;
    padding: 30px;
    background-color: #fff; /* 亮色容器背景 */
    border-radius: 8px;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.1); /* 亮色陰影 */
    text-align: center;
    transition: background-color 0.3s, box-shadow 0.3s; /* 主題切換平滑過渡 */
}

.dark-mode .container {
    background-color: #333; /* 暗色容器背景 */
    box-shadow: 0 0 20px rgba(255, 255, 255, 0.1); /* 暗色陰影 */
}

h1, h2, h3 {
    color: #0056b3; /* 亮色標題顏色 */
    transition: color 0.3s; /* 主題切換平滑過渡 */
}

.dark-mode h1, .dark-mode h2, .dark-mode h3 {
    color: #66b3ff; /* 暗色標題顏色 */
}

/* 主題切換按鈕樣式 */
.theme-switch {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    margin-bottom: 20px;
}

.theme-label {
    margin-left: 10px;
    font-size: 14px;
    color: #777; /* 亮色主題標籤顏色 */
    transition: color 0.3s; /* 主題切換平滑過渡 */
}

.dark-mode .theme-label {
    color: #bbb; /* 暗色主題標籤顏色 */
}

.switch {
    position: relative;
    display: inline-block;
    width: 60px;
    height: 34px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    -webkit-transition: .4s;
    transition: .4s;
}

.slider:before {
    position: absolute;
    content: "";
    height: 26px;
    width: 26px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    -webkit-transition: .4s;
    transition: .4s;
}

input:checked + .slider {
    background-color: #2196F3;
}

input:focus + .slider {
    box-shadow: 0 0 1px #2196F3;
}

input:checked + .slider:before {
    -webkit-transform: translateX(26px);
    -ms-transform: translateX(26px);
    transform: translateX(26px);
}

.slider.round {
    border-radius: 34px;
}

.slider.round:before {
    border-radius: 50%;
}


/* 輸入區塊樣式 */
.input-section, .result-section {
    margin-bottom: 30px;
    padding: 20px;
    background-color: #f9f9f9; /* 亮色區塊背景 */
    border-radius: 5px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.05); /* 亮色區塊陰影 */
    transition: background-color 0.3s, box-shadow 0.3s; /* 主題切換平滑過渡 */
}

.dark-mode .input-section, .dark-mode .result-section {
    background-color: #444; /* 暗色區塊背景 */
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.05); /* 暗色區塊陰影 */
}


.form-group {
    margin-bottom: 15px;
    text-align: left;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: bold;
    color: #555; /* 亮色表單標籤顏色 */
    transition: color 0.3s; /* 主題切換平滑過渡 */
}

.dark-mode .form-group label {
    color: #ddd; /* 暗色表單標籤顏色 */
}

.form-group input[type="text"],
.form-group input[type="number"],
.form-group select {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd; /* 亮色輸入框邊框 */
    border-radius: 4px;
    font-size: 16px;
    color: #333; /* 亮色輸入框文字顏色 */
    background-color: #fff; /* 亮色輸入框背景 */
    transition: border-color 0.3s, background-color 0.3s, color 0.3s; /* 主題切換平滑過渡 */
}

.dark-mode .form-group input[type="text"],
.dark-mode .form-group input[type="number"],
.dark-mode .form-group select {
    border-color: #777; /* 暗色輸入框邊框 */
    background-color: #555; /* 暗色輸入框背景 */
    color: #eee; /* 暗色輸入框文字顏色 */
}


.calculate-btn {
    padding: 12px 25px;
    background-color: #007bff; /* 亮色按鈕背景 */
    color: white; /* 按鈕文字顏色 */
    border: none;
    border-radius: 5px;
    font-size: 18px;
    cursor: pointer;
    transition: background-color 0.3s; /* 主題切換平滑過渡 */
}

.calculate-btn:hover {
    background-color: #0056b3; /* 亮色按鈕 hover 背景 */
}

.dark-mode .calculate-btn {
    background-color: #66b3ff; /* 暗色按鈕背景 */
}

.dark-mode .calculate-btn:hover {
    background-color: #007bff; /* 暗色按鈕 hover 背景 */
}


/* 結果區塊樣式 */
.result-item, .advice-section {
    margin-bottom: 20px;
    padding: 15px;
    border: 1px solid #eee; /* 亮色結果項目邊框 */
    border-radius: 4px;
    background-color: #fff; /* 亮色結果項目背景 */
    box-shadow: inset 0 0 5px rgba(0, 0, 0, 0.03); /* 亮色結果項目內陰影 */
    transition: border-color 0.3s, background-color 0.3s, box-shadow 0.3s; /* 主題切換平滑過渡 */
    text-align: left; /* 結果文字靠左對齊 */
}

.dark-mode .result-item, .dark-mode .advice-section {
    border-color: #666; /* 暗色結果項目邊框 */
    background-color: #444; /* 暗色結果項目背景 */
    box-shadow: inset 0 0 5px rgba(255, 255, 255, 0.03); /* 暗色結果項目內陰影 */
}


.result-item h3 {
    margin-top: 0;
    color: #007bff; /* 亮色結果項目標題顏色 */
    transition: color 0.3s; /* 主題切換平滑過渡 */
}

.dark-mode .result-item h3 {
    color: #66b3ff; /* 暗色結果項目標題顏色 */
}


/* 健康建議樣式 */
.advice-section p {
    line-height: 1.6;
    color: #666; /* 亮色建議文字顏色 */
    transition: color 0.3s; /* 主題切換平滑過渡 */
}

.dark-mode .advice-section p {
    color: #ccc; /* 暗色建議文字顏色 */
}


/* 響應式設計 */
@media (max-width: 768px) {
    .container {
        padding: 20px;
    }

    .form-group label {
        font-size: 16px;
    }

    .form-group input[type="text"],
    .form-group input[type="number"],
    .form-group select,
    .calculate-btn {
        font-size: 16px;
    }
}