/* ============================================================
   What's for Dinner? — styled to match the original site:
   photo background + white overlay, indigo/red accents,
   sticky header, hover-lift cards, circular numbered list.
   ============================================================ */
:root {
  --primary-color: #4a5568;
  --secondary-color: #667eea;
  --accent-color: #f56565;
  --text-color: #2d3748;
  --bg-color: #f7fafc;
  --card-bg: #ffffff;
  --border-color: #e2e8f0;
  --shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.15);
  --radius: 12px;
}
* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  line-height: 1.6;
  color: var(--text-color);
  background-image: url("./assets/images/background.jpg");
  background-size: cover;
  background-position: center;
  background-attachment: fixed;
  min-height: 100vh;
  position: relative;
}
body::before {
  content: "";
  position: fixed; inset: 0;
  background: rgba(255, 255, 255, 0.88);
  z-index: -1;
}

.hidden { display: none !important; }
.muted { color: var(--primary-color); opacity: .8; }
.center { text-align: center; }
a { color: var(--secondary-color); }
h1 { color: var(--primary-color); font-size: 2rem; text-align: center; margin-bottom: .75rem; }
h2 { font-size: 1.2rem; }
h3 { color: var(--primary-color); font-size: 1.05rem; margin: 0 0 .5em; }

.view { max-width: 780px; margin: 0 auto; padding: 1.5rem 1rem; }
.card {
  background: var(--card-bg); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 1.75rem;
}
.card.narrow { max-width: 440px; margin: 6vh auto; }

label { display: block; font-size: .85rem; color: var(--primary-color); margin: 1rem 0 .3rem; font-weight: 500; }
input, select, textarea {
  width: 100%; padding: .7rem .8rem; font-size: 1rem;
  border: 1px solid var(--border-color); border-radius: 8px; background: #fff; color: var(--text-color);
}
input:focus, select:focus, textarea:focus { outline: 2px solid var(--secondary-color); outline-offset: 1px; }

button {
  cursor: pointer; font-size: .95rem; padding: .7rem 1.1rem; border-radius: 8px;
  border: 1px solid var(--border-color); background: #fff; color: var(--primary-color); font-weight: 600;
  transition: all .2s ease;
}
button.primary { background: var(--secondary-color); color: #fff; border-color: var(--secondary-color); }
button.primary:hover { background: var(--accent-color); border-color: var(--accent-color); }
button.ghost { background: transparent; border-color: transparent; }
button.wide { width: 100%; margin-top: .75rem; }
button:active { transform: translateY(1px); }

.split { display: grid; grid-template-columns: 1fr auto 1fr; gap: 1.2rem; align-items: start; margin-top: 1.2rem; }
.split .or { align-self: center; color: var(--primary-color); opacity: .6; }
.split button { width: 100%; margin-top: .5rem; }
@media (max-width: 520px){ .split { grid-template-columns: 1fr; } .split .or { text-align:center; } }

/* Sticky header, like the original */
.topbar {
  background: var(--card-bg); box-shadow: var(--shadow);
  padding: 1rem 1.5rem; margin: -1.5rem -1rem 1.5rem; position: sticky; top: 0; z-index: 100;
  display: flex; justify-content: space-between; align-items: center;
}
.topbar-actions { display: flex; gap: 1rem; align-items: center; }
.who { margin-left: .5rem; font-size: .85rem; }
.tabs { display: flex; gap: .4rem; border-bottom: 2px solid var(--border-color); margin-bottom: 1.2rem; justify-content: center; flex-wrap: wrap; }
.tab { border: none; background: none; padding: .6rem .9rem; color: var(--primary-color); border-bottom: 3px solid transparent; border-radius: 0; }
.tab.active { color: var(--secondary-color); border-bottom-color: var(--secondary-color); }

/* Week — card grid with hover-lift, like .meal-day */
.week-head { display: flex; justify-content: center; align-items: center; gap: 1rem; margin-bottom: 1rem; font-weight: 600; color: var(--primary-color); }
.week-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 1.2rem; }
.day {
  background: var(--card-bg); border-radius: var(--radius); padding: 1.2rem;
  box-shadow: var(--shadow); transition: transform .3s ease, box-shadow .3s ease;
  display: flex; flex-direction: column; gap: .5rem;
}
.day:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.day.today { border: 2px solid var(--secondary-color); }
.day .daylabel { font-weight: 700; color: var(--secondary-color); font-size: 1.1rem; display: flex; justify-content: space-between; align-items: baseline; }
.day .daylabel small { color: var(--primary-color); opacity: .6; font-weight: 400; }
.day .meal { flex: 1; display: flex; justify-content: space-between; align-items: center; gap: .5rem; }
.day .meal a { text-decoration: none; font-weight: 500; }
.day .meal a:hover { color: var(--accent-color); text-decoration: underline; }
.day .add { color: var(--primary-color); opacity: .55; font-style: italic; cursor: pointer; }
.chip-x { color: var(--primary-color); opacity: .5; border: none; background: none; padding: .2rem .4rem; }

.meal-row { display: flex; align-items: center; gap: .6rem; }
.meal-type {
  font-size: .68rem; text-transform: uppercase; letter-spacing: .03em; font-weight: 700;
  color: var(--secondary-color); opacity: .75; min-width: 4.2rem; flex: none;
}
.add-more-meal {
  align-self: flex-start; border: none; background: none; padding: .3rem 0 0;
  color: var(--secondary-color); opacity: .7; font-size: .8rem; font-weight: 600;
}
.add-more-meal:hover { opacity: 1; text-decoration: underline; }
.chip-x:hover { opacity: 1; color: var(--accent-color); }

/* Shopping list */
.add-row { display: flex; gap: .5rem; margin-bottom: .5rem; }
.add-row input { flex: 1; }
.cat-head { margin: 1.2rem 0 .4rem; font-size: .78rem; text-transform: uppercase; letter-spacing: .04em; color: var(--secondary-color); font-weight: 700; }
.item { display: flex; align-items: center; gap: .8rem; padding: .6rem .3rem; border-bottom: 1px solid var(--border-color); background: rgba(255,255,255,.5); border-radius: 6px; }
.item input[type=checkbox]{ width: 20px; height: 20px; flex: none; accent-color: var(--secondary-color); }
.item .txt { flex: 1; }
.item.bought .txt { text-decoration: line-through; color: var(--primary-color); opacity: .5; }
.item .by { font-size: .75rem; color: var(--secondary-color); font-weight: 600; }
.item .src { font-size: .7rem; color: var(--primary-color); opacity: .5; }

/* Recipes — circular numbered list like .recipe-list */
.recipe-section-inner { counter-reset: recipe-counter; }
.recipe-card {
  background: var(--card-bg); border-radius: var(--radius); padding: 1rem 1.2rem; margin-top: .8rem;
  box-shadow: var(--shadow); counter-increment: recipe-counter;
  display: flex; align-items: flex-start; gap: .9rem; transition: transform .2s ease;
}
.recipe-card:hover { transform: translateX(4px); }
.recipe-card::before {
  content: counter(recipe-counter);
  background: var(--secondary-color); color: #fff; width: 2rem; height: 2rem; flex: none;
  border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-weight: 700;
}
.recipe-card h3 { margin: 0 0 .2rem; }
.recipe-card h3 a { text-decoration: none; }
.recipe-card h3 a:hover { color: var(--accent-color); text-decoration: underline; }
.recipe-card .ings { color: var(--primary-color); opacity: .75; font-size: .85rem; }

/* Modals */
.modal-backdrop { position: fixed; inset: 0; background: rgba(45,55,72,.45); display: flex; align-items: center; justify-content: center; padding: 1rem; z-index: 200; }
.modal { background: var(--card-bg); border-radius: var(--radius); padding: 1.6rem; width: 100%; max-width: 460px; max-height: 90vh; overflow: auto; box-shadow: var(--shadow-lg); }
.modal-actions { display: flex; justify-content: flex-end; gap: .6rem; margin-top: 1.2rem; }
.invite-code {
  font-size: 2.2rem; letter-spacing: .3em; text-align: center; font-weight: 800;
  color: var(--secondary-color); background: var(--bg-color); border-radius: 10px; padding: 1rem; margin-top: .5rem;
}
.invite-share-row { display: flex; gap: .6rem; margin-top: .8rem; }
.invite-share-row button, .invite-share-row a {
  flex: 1; text-align: center; text-decoration: none; color: var(--primary-color);
}
