* { margin: 0; padding: 0; box-sizing: border-box; }
body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background-color: #f0f2f5; color: #1c1e21;
    min-height: 100vh; padding: 20px; transition: background-color 0.3s, color 0.3s;
}
body.dark-mode { background-color: #18191a; color: #e4e6eb; }

.main-container { max-width: 1000px; margin: 0 auto; display: grid; grid-template-columns: 1.2fr 1fr; gap: 30px; align-items: start; }
.column .container {
    background: white; border-radius: 20px; padding: 30px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.07); transition: background-color 0.3s;
}
body.dark-mode .column .container { background-color: #242526; border: 1px solid #3a3b3c; }

.header { text-align: center; margin-bottom: 25px; }
.header h1 { font-size: 2.2rem; margin-bottom: 8px; background: linear-gradient(45deg, #667eea, #764ba2); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }
.header p { color: #606770; font-size: 1rem; }
body.dark-mode .header p { color: #b0b3b8; }

.form-group { margin-bottom: 20px; }
label { display: block; margin-bottom: 8px; font-weight: 500; }
.input-group { display: flex; gap: 10px; align-items: center; }
input[type="number"], select {
    padding: 12px; border: 1px solid #ccd0d5; border-radius: 8px; font-size: 1rem;
    background-color: #f5f6f7; color: #1c1e21; transition: border-color 0.2s;
}
body.dark-mode input[type="number"], body.dark-mode select { background-color: #3a3b3c; border-color: #4a4b4c; color: #e4e6eb; }
.input-group input { flex: 3; }
.input-group select { flex: 1; cursor: pointer; }
.input-group input:focus { outline: none; border-color: #1877f2; }
.calculate-btn {
    width: 100%; padding: 16px; background: linear-gradient(45deg, #667eea, #764ba2); color: white;
    border: none; border-radius: 10px; font-size: 1.1rem; font-weight: 600; cursor: pointer; transition: all 0.3s ease;
}
.calculate-btn:hover { transform: translateY(-2px); box-shadow: 0 8px 20px rgba(102, 126, 234, 0.4); }
.calculate-btn:disabled { background: #9dbef2; cursor: not-allowed; box-shadow: none; transform: none; }

.result { margin-top: 25px; padding: 20px; border-radius: 12px; text-align: center; color: white; min-height: 90px; transition: all 0.3s; }
.bmi-value { font-size: 2.2rem; font-weight: 700; }
.bmi-interpretation { font-size: 1.1rem; }
.result.underweight { background: linear-gradient(45deg, #43e97b, #38f9d7); }
.result.normal { background: linear-gradient(45deg, #4facfe, #00f2fe); }
.result.overweight { background: linear-gradient(45deg, #fa709a, #fee140); }
.result.obese { background: linear-gradient(45deg, #f093fb, #f5576c); }
.result.error { background: #e74c3c; }

.bmi-scale h3, .unit-converter h4, .export-section h4 { text-align: center; margin-bottom: 15px; font-size: 1.2rem; }
.scale-item { display: flex; justify-content: space-between; padding: 12px; margin-bottom: 8px; color: white; border-radius: 8px; font-weight: 500; font-size: 0.9rem; }
.scale-underweight { background: linear-gradient(45deg, #43e97b, #38f9d7); }
.scale-normal { background: linear-gradient(45deg, #4facfe, #00f2fe); }
.scale-overweight { background: linear-gradient(45deg, #fa709a, #fee140); }
.scale-obese { background: linear-gradient(45deg, #f093fb, #f5576c); }

.unit-converter, .export-section { margin-top: 30px; }
.converter-item { margin-bottom: 15px; }

.additional-features { margin-top: 30px; }
.feature-tabs { display: flex; border-bottom: 1px solid #dddfe2; margin-bottom: 15px; }
body.dark-mode .feature-tabs { border-bottom-color: #3a3b3c; }
.tab-btn { background: none; border: none; padding: 10px 15px; cursor: pointer; color: #606770; font-size: 0.9rem; border-bottom: 3px solid transparent; }
body.dark-mode .tab-btn { color: #b0b3b8; }
.tab-btn.active { color: #1877f2; border-bottom-color: #1877f2; font-weight: 600; }
.tab-content { padding-top: 10px; }
.history-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.clear-btn { background: none; border: none; color: #e02c4f; cursor: pointer; font-size: 0.8rem; }
.history-list { max-height: 180px; overflow-y: auto; padding-right: 5px; }
.history-item { display: flex; justify-content: space-between; padding: 8px 0; border-bottom: 1px solid #f0f2f5; font-size: 0.9rem; }
body.dark-mode .history-item { border-bottom-color: #3a3b3c; }
.goal-setting { display: flex; gap: 10px; margin-bottom: 15px; }
.goal-btn { padding: 0 15px; background: #36a420; color: white; border: none; border-radius: 8px; cursor: pointer; }
#weight-chart { max-height: 150px; margin-top: 15px; }
.tip-card { padding: 10px; background-color: #f5f6f7; border-radius: 8px; margin-bottom: 8px; font-size: 0.9rem; }
body.dark-mode .tip-card { background-color: #3a3b3c; }

.dark-mode-toggle { position: fixed; top: 15px; right: 15px; width: 40px; height: 40px; border-radius: 50%; border: none; background-color: white; cursor: pointer; font-size: 1.2rem; box-shadow: 0 2px 5px rgba(0,0,0,0.2); }
body.dark-mode .dark-mode-toggle { background-color: #242526; color: #e4e6eb; }

.hidden { display: none !important; }
@media (max-width: 850px) { .main-container { grid-template-columns: 1fr; } }