:root {
  --primary-color: #2a9d8f;
  --secondary-color: #264653;
  --accent-color: #e9c46a;
  --background-light: #f8f9fa;
  --overlay-color: rgba(38, 70, 83, 0.8);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

main {
  padding: 1rem;
}
.hero{
  text-align: center;
  padding: 1rem;
}

.header-container {
  background: var(--secondary-color);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  width: 100%;
  top: 0;
  z-index: 1000;
}

nav {
  max-width: 1000px;
  margin: 0 auto;
  padding: 1rem 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo {
  /* color: var(--secondary-color); */
  font-weight: 700;
  font-size: 1.5rem;
  text-decoration: none;
  color: var(--background-light);
}

.nav-menu {
  display: flex;
  gap: 2rem;
  list-style: none;
}

.nav-link {
  /* color: var(--secondary-color); */
  text-decoration: none;
  font-weight: 500;
  transition: color 0.3s ease;
  color: var(--background-light);
}

.nav-link:hover,
.nav-link:focus {
  color: var(--primary-color);
}

.calculate-btn {
  font-size: 1rem;
  background: #1d7a6f;
  color: white;
  padding: 0.75rem 1.5rem;
  width: 100%;
  border: none;
  border-radius: 5px;
  text-decoration: none;
  transition: background 0.3s ease;
}

.calculate-btn:hover {
  background: #16665c;
}

.hamburger {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
}

.hamburger span {
  display: block;
  width: 25px;
  height: 3px;
  background: var(--background-light);
  margin: 5px 0;
  transition: all 0.3s ease;
}

.overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: var(--overlay-color);
  z-index: 999;
}

@media (max-width: 768px) {
  .hamburger {
    display: block;
    z-index: 1001;
  }

  .hamburger.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
  }

  .hamburger.active span:nth-child(2) {
    opacity: 0;
  }

  .hamburger.active span:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -6px);
  }

  .nav-menu {
    position: fixed;
    top: 0;
    left: -100%;
    width: 80%;
    height: 100%;
    background: var(--secondary-color);
    flex-direction: column;
    padding: 6rem 2rem;
    transition: left 0.3s ease;
    z-index: 1000;
  }

  .nav-menu.active {
    left: 0;
  }

  .overlay.active {
    display: block;
  }
}

/* calculation  */
.container,
.calculator-container {
  max-width: 1000px;
  margin: 1rem auto;
}

.container li {
  margin-left: 2rem;
}

.calculator {
  max-width: 600px;
  margin: 0 auto;
}

.calculator-heading {
  text-align: center;
  margin-bottom: 1rem;
  font-weight: 600;
  font-size: 1.5rem;
}

.calculator-form {
  background: white;
  padding: 2rem;
  border: 1px solid #ddd;
  border-radius: 10px;
}

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

label {
  font-size: 1.1rem;
  font-weight: 500;
  color: var(--secondary-color);
}

input:focus,
select:focus {
  outline: none;
  box-shadow: 0 0 5px rgba(42, 157, 143, 0.5);
}

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

.unit-toggle {
  display: flex;
  gap: 0.5rem;
}

.unit-toggle select {
  flex: 0 0 100px;
}

.unit-toggle-group {
  display: flex;
  /* gap: 1rem; */
  margin-bottom: 0.5rem;
}

.unit-toggle-btn {
  flex: 1;
  padding: 0.5rem;
  border: 1px solid #ddd;
  /* border-radius: 5px; */
  background: white;
  cursor: pointer;
  transition: all 0.3s ease;
  font-size: 0.9rem;
}

.unit-toggle-btn.active {
  border-color: #1d7a6f;
  background: #1d7a6f;
  color: white;
}

.height-input-group {
  display: grid;
  gap: 0.5rem;
}

.height-metric,
.height-imperial {
  display: none;
  gap: 0.5rem;
}

.height-metric.active {
  display: grid;
  grid-template-columns: 1fr;
}

.height-imperial.active {
  display: grid;
  grid-template-columns: 1fr 1fr;
}

.input-group input,
.input-group select {
  padding: 0.75rem;
  border: 1px solid #ddd;
  border-radius: 5px;
  font-size: 1rem;
  width: 100%;
  height: 3rem;
}

@media (max-width: 768px) {
  .calculator-form {
    padding: 1rem;
  }

  .form-grid {
    grid-template-columns: 1fr;
  }

  .height-imperial {
    grid-template-columns: 1fr;
  }
}

.hidden {
  display: none;
}

.results-container {
  margin-top: 2rem;
}

.result-heading {
  color: var(--secondary-color);
  font-size: 1.5rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.result-item {
  margin-bottom: 1.5rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid #eee;
}

.result-item a {
  color: inherit;
}

.result-item ul {
  margin-left: 2rem;
}

.result-value {
  color: var(--primary-color);
  font-size: 1.2rem;
  font-weight: 700;
  margin: 0.5rem 0;
}

.macronutrient-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 1rem;
  margin: 1rem 0;
}

.macro-card {
  background: var(--background-light);
  padding: 1rem;
  border-radius: 8px;
  text-align: center;
}

/* footer  */
.site-footer {
  background: var(--secondary-color);
  color: white;
  padding: 1rem 0;
  font-size: 0.9rem;
}

.footer-container {
  max-width: 1000px;
  margin: 0 auto;
  padding: 0 1rem;
}

.footer-links {
  display: flex;
  justify-content: center;
  align-items: center;
  margin: 1rem 0;
}

.footer-links ul {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 1rem;
  list-style: none;
  flex-wrap: wrap;
}

footer a {
  color: white;
  text-decoration: none;
  padding: 0 1rem;
}

.footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding-top: 1rem;
  text-align: center;
}

.content h2 {
  color: var(--primary-color);
  font-size: 1.5rem;
  margin-top: 1rem;
}

.author {
  background-color: var(--background-light);
  font-size: 0.9rem;
  color: var(--secondary-color);
  margin-top: 1rem;
  padding: 1rem;
}

/* Go to Top Button */
#goTopBtn {
  display: none;
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  z-index: 1500;
  background: var(--primary-color);
  color: var(--background-light);
  border: none;
  outline: none;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  box-shadow: 0 2px 8px rgba(42, 157, 143, 0.2);
  font-size: 1.5rem;
  cursor: pointer;
  transition: background 0.3s, color 0.3s;
}

#goTopBtn:hover,
#goTopBtn:focus {
  background: var(--secondary-color);
  color: var(--accent-color);
  border: 1px solid var(--accent-color);
}