/* ===== RESET ===== */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: Inter, system-ui, sans-serif;
}

/* ===== COLORS ===== */
:root {
  --bg: #0f1220;
  --card: #181c34;
  --accent: #6c63ff;
  --accent-soft: #2d2a5e;
  --danger: #ff4b4b;
  --text: #f2f2f2;
  --muted: #9ca3af;
}

/* ===== BODY ===== */
body {
  background: radial-gradient(circle at top, #14162b, var(--bg));
  color: var(--text);
  min-height: 100vh;
}

/* ===== NAVBAR ===== */
.navbar {
  width: 100%;
  background: #0c0c0c;
  border-bottom: 1px solid #1f1f1f;
}

/* MAIN BAR */
.navbar-grid {
  max-width: 1200px;
  margin: 0 auto;
  padding: 16px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* LOGO */
.logo {
  font-size: 20px;
  font-weight: 700;
  color: #fff;
}

/* DESKTOP LINKS */
.nav-links {
  display: flex;
  gap: 22px;
}

.nav-links a {
  color: #cfcfcf;
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
}

.nav-links a:hover,
.nav-links a.active {
  color: #fff;
}

/* HAMBURGER */
.nav-toggle {
  display: none;
  font-size: 22px;
  background: none;
  border: none;
  color: #fff;
  cursor: pointer;
}

/* MOBILE MENU */
.mobile-menu {
  display: none;
  flex-direction: column;
  background: #0c0c0c;
  border-top: 1px solid #1f1f1f;
}

.mobile-menu a {
  padding: 14px 24px;
  color: #cfcfcf;
  text-decoration: none;
  border-bottom: 1px solid #1a1a1a;
}

.mobile-menu a:hover {
  background: #141414;
  color: #fff;
}

/* ===== CENTER FIX ===== */
.page-wrapper {
  display: flex;
  justify-content: center;
  padding: 40px 16px;
}

.diet-container {
  width: 100%;
  max-width: 820px;
}

/* ===== HEADINGS ===== */
h1 {
  text-align: center;
  margin-bottom: 10px;
}
.subtitle {
  text-align: center;
  color: var(--muted);
  margin-bottom: 28px;
}

/* ===== CARD ===== */
.card {
  background: var(--card);
  border-radius: 14px;
  padding: 22px;
  margin-bottom: 28px;
}

/* ===== TABLE ===== */
.table-wrap {
  overflow-x: auto;
}
table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 14px;
}
th, td {
  padding: 10px;
  font-size: 14px;
  border-bottom: 1px solid #2b2f55;
}
th {
  text-align: left;
  color: var(--muted);
}

/* ===== BUTTONS ===== */
.primary-btn {
  background: var(--accent);
  border: none;
  padding: 12px 16px;
  border-radius: 10px;
  color: #fff;
  cursor: pointer;
}
.primary-btn:hover {
  background: #584eff;
}

.ghost-btn {
  background: transparent;
  border: 1px solid var(--accent-soft);
  color: var(--accent);
  padding: 10px;
  border-radius: 10px;
  cursor: pointer;
}

.danger-btn {
  background: var(--danger);
  border: none;
  padding: 12px;
  border-radius: 10px;
  width: 100%;
  color: #fff;
  margin-top: 18px;
}

/* ===== CALCULATOR ===== */
.calculator {
  display: flex;
  gap: 10px;
  margin-bottom: 16px;
}
select, input {
  flex: 1;
  padding: 12px;
  border-radius: 10px;
  border: none;
  background: #0f1220;
  color: #fff;
}

/* ===== SELECTED ===== */
.selected-list div {
  font-size: 14px;
  margin-bottom: 6px;
  color: var(--muted);
}

/* ===== TOTALS ===== */
.totals {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
  margin-top: 16px;
}
.totals div {
  background: #0f1220;
  padding: 12px;
  border-radius: 10px;
  text-align: center;
}
.totals span {
  font-size: 12px;
  color: var(--muted);
}
/* =========================
   RESPONSIVE ADDON
========================= */

/* GLOBAL SAFETY */
body {
  overflow-x: hidden;
}

/* CENTER PAGE PROPERLY */
.container {
  margin: 0 auto;
  padding: 20px;
}

/* =========================
   TABLE RESPONSIVENESS
========================= */
.table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border-radius: 12px;
}

table {
  min-width: 600px; /* allows horizontal scroll on mobile */
}

/* =========================
   CALCULATOR RESPONSIVE
========================= */
.calculator {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.calculator select,
.calculator input,
.calculator button {
  flex: 1 1 160px;
  min-height: 44px; /* mobile tap size */
}

/* =========================
   SELECTED FOOD LIST
========================= */
#selectedFoods {
  margin-top: 16px;
}

.selected-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}

/* =========================
   TOTALS GRID
========================= */
.totals {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

/* =========================
   BUTTONS
========================= */
button {
  min-height: 44px;
  touch-action: manipulation;
}


/* =========================
   MOBILE INPUT SIZE FIX
========================= */
@media (max-width: 600px) {

  .calculator {
    gap: 8px;
  }

  .calculator select,
  .calculator input {
    min-height: 36px;
    font-size: 14px;
    padding: 6px 10px;
  }

  .calculator button {
    min-height: 38px;
    font-size: 14px;
    padding: 8px 12px;
  }
}


/* =========================
   TABLET (601px – 900px)
========================= */
@media (min-width: 601px) and (max-width: 900px) {

  .container {
    max-width: 720px;
  }

  .totals {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* =========================
   DESKTOP (901px+)
========================= */
@media (min-width: 901px) {

  .container {
    max-width: 900px;
  }

  .calculator select,
  .calculator input {
    max-width: 240px;
  }

  .calculator button {
    max-width: 180px;
  }
}
@media (max-width: 768px) {
  .nav-links {
    display: none;
  }

  .nav-toggle {
    display: block;
  }

  .mobile-menu.show {
    display: flex;
  }
}