body {
  font-family: "Poppins", sans-serif;
  margin: 0;
  padding: 0;
  background: #f4f7fb;
  color: #333;
}

/* .header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #4caf50;
  color: white;
  padding: 15px 40px;
  box-shadow: 0px 4px 8px rgba(0,0,0,0.1);
}
.header .logo {
  font-weight: 600;
  font-size: 20px;
}
.header nav a {
  margin-left: 20px;
  text-decoration: none;
  color: white;
  font-weight: 500;
} */
.header nav a:hover {
  text-decoration: underline;
}

/* Main container */
.calculator-container {
  background: white;
  max-width: 400px;
  margin: 40px auto;
  padding: 30px;
  border-radius: 12px;
  box-shadow: 0px 6px 20px rgba(0,0,0,0.1);
}

.title {
  text-align: center;
  margin-bottom: 20px;
  color: #222;
}

.tabs {
  display: flex;
  justify-content: center;
  margin-bottom: 20px;
}
.tab-btn {
  padding: 8px 20px;
  border: none;
  margin: 0 5px;
  cursor: pointer;
  border-radius: 8px;
  background: #ddd;
  font-weight: 600;
  transition: all 0.3s ease;
}
.tab-btn.active {
  background: #4caf50;
  color: white;
}

.form-group {
  margin-bottom: 15px;
}
.form-group label {
  display: block;
  font-weight: 600;
  margin-bottom: 6px;
}
.form-group input,
.form-group select {
  width: 100%;
  padding: 10px;
  border: 1px solid #ccc;
  border-radius: 6px;
}

.radio-group {
  display: flex;
  gap: 20px;
}

.submit-btn {
  width: 100%;
  padding: 12px;
  border: none;
  background: #4caf50;
  color: white;
  font-size: 16px;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 600;
  transition: all 0.3s ease;
}
.submit-btn:hover {
  background: #43a047;
}
.results {
  max-width: 700px;
  margin: 40px auto;
  background: white;
  padding: 25px;
  border-radius: 12px;
  box-shadow: 0px 6px 20px rgba(0,0,0,0.1);
  text-align: center;
}
.hidden { display: none; }

.result-box, .meal-box {
  background: #f9fafc;
  padding: 15px;
  border-radius: 10px;
  margin-bottom: 20px;
  text-align: left;
}

.chart-box {
  max-width: 400px;
  margin: 20px auto;
}

.back-btn {
  padding: 10px 18px;
  background: #4caf50;
  color: white;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 600;
}
.back-btn:hover {
  background: #43a047;
}

/* Animations */
.animate {
  animation: fadeUp 0.7s ease forwards;
  opacity: 0;
}
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}
.input-with-unit {
  display: flex;
  align-items: center;
}
.input-with-unit input {
  flex: 1;
}
.input-with-unit span {
  margin-left: 8px;
  font-weight: 600;
}
body.dark {
  background: #121212;
  color: #eee;
}
body.dark .calculator-container,
body.dark .results {
  background: #1e1e1e;
  color: #eee;
}
body.dark .form-group input,
body.dark .form-group select {
  background: #2a2a2a;
  color: #fff;
  border: 1px solid #555;
}

/* result page */
.results h2, 
.results p, 
.results strong, 
.results span, 
.results div {
  color: #000; /* black text for result box */
}

body.dark-mode .results h2,
body.dark-mode .results p,
body.dark-mode .results strong,
body.dark-mode .results span,
body.dark-mode .results div {
  color: #fff; /* white text in dark mode */
}

@media (max-width: 600px) {
  .calculator-container, .results {
    margin: 20px;
    padding: 20px;
    max-width: 100%;
  }

  .tabs {
    flex-direction: column;
    gap: 10px;
  }

  .tab-btn {
    width: 100%;
  }

  .form-group input,
  .form-group select {
    font-size: 14px;
    padding: 8px;
  }

  .submit-btn,
  .back-btn {
    font-size: 14px;
    padding: 10px;
  }

  .chart-box {
    max-width: 100%;
  }

  .header {
    flex-direction: column;
    text-align: center;
  }
  .header nav {
    margin-top: 10px;
  }
  .theme-toggle {
    margin-top: 10px;
  }
}
body.dark .title,
body.dark h1,
body.dark h2,
body.dark h3 {
  color: #fff !important;
}
