/* Reset és alapok */
* {
  box-sizing: border-box;
}

body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  margin: 0;
  padding: 0;
  background: #f9fafb;
  color: #333;
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

header {
  background-color: #27ae60;
  padding: 1.25rem 1.5rem;
  color: #fff;
  box-shadow: 0 4px 6px rgb(39 174 96 / 0.4);
  position: sticky;
  top: 0;
  z-index: 100;
}

nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
}

nav ul {
  display: flex;
  gap: 1.25rem;
  list-style: none;
  padding: 0;
  margin: 0;
  flex-wrap: wrap;
}

nav a {
  color: #fff;
  text-decoration: none;
  font-weight: 600;
  transition: color 0.3s ease;
}

nav a:hover,
nav a:focus {
  color: #d4f5e9;
  outline: none;
}

.buttons button,
.cook-btn {
  margin-left: 0.75rem;
  padding: 0.5rem 1.25rem;
  background-color: #2ecc71;
  border: none;
  border-radius: 5px;
  color: #fff;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.3s ease;
  box-shadow: 0 2px 5px rgb(46 139 87 / 0.3);
}

.buttons button:hover,
.buttons button:focus,
.cook-btn:hover,
.cook-btn:focus {
  background-color: #27ae60;
  outline: none;
  box-shadow: 0 4px 8px rgb(39 174 96 / 0.6);
}

.cook-btn {
  white-space: nowrap;
  display: none;
  align-self: center;
  justify-content: center;
  padding: 0;
}

.cook-btn a {
  color: white;
  text-decoration: none;
  width: 100%;
  height: 100%;
  padding: 0.5rem 1.25rem;
}

main {
  flex: 1;
  padding: 1.5rem 1.75rem;
  max-width: 900px;
  margin: 0 auto;
  width: 100%;
}

section {
  margin-bottom: 3rem;
  background: #fff;
  padding: 1.75rem 2rem;
  border-radius: 10px;
  box-shadow: 0 6px 15px rgb(0 0 0 / 0.05);
  transition: box-shadow 0.3s ease;
}

section:hover {
  box-shadow: 0 8px 20px rgb(0 0 0 / 0.1);
}

h2,
h3 {
  color: #2c3e50;
  margin-bottom: 1rem;
  font-weight: 700;
}

form {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

textarea,
select,
input[type="date"] {
  padding: 0.75rem 1rem;
  font-size: 1rem;
  border: 2px solid #ddd;
  border-radius: 8px;
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
  max-width: 100%;
  background: #fafafa;
  font-family: inherit;
  resize: vertical;
}

textarea:focus,
select:focus,
input[type="date"]:focus {
  outline: none;
  border-color: #27ae60;
  box-shadow: 0 0 8px rgba(39, 174, 96, 0.5);
  background: #fff;
}

button {
  padding: 0.75rem 1.75rem;
  background-color: #27ae60;
  color: white;
  border-radius: 8px;
  border: none;
  font-weight: 700;
  font-size: 1.1rem;
  cursor: pointer;
  box-shadow: 0 6px 15px rgb(39 174 96 / 0.4);
  transition: background-color 0.3s ease, box-shadow 0.3s ease;
  align-self: flex-start;
}

button:hover,
button:focus {
  background-color: #219150;
  box-shadow: 0 8px 20px rgb(33 145 80 / 0.7);
  outline: none;
}

table {
  border-collapse: separate;
  border-spacing: 0 12px;
  width: 100%;
  margin-bottom: 1.5rem;
  font-size: 1rem;
}

th,
td {
  padding: 0.85rem 1rem;
  text-align: left;
  background: #fff;
  border-bottom: 1px solid #e1e4e8;
  color: #444;
  vertical-align: middle;
  /* border-radius: 5px; */
}

th {
  background: #27ae60;
  color: #fff;
  font-weight: 700;
  box-shadow: 0 3px 5px rgb(39 174 96 / 0.4);
}

select {
  width: 100%;
  box-sizing: border-box;
  cursor: pointer;
  appearance: none;
  padding-right: 2rem;
}

/* Mobil nézet */
@media (max-width: 768px) {
  nav {
    flex-direction: column;
    align-items: flex-start;
  }

  nav ul {
    flex-direction: column;
    gap: 0.75rem;
    width: 100%;
  }

  .buttons {
    margin-top: 0.75rem;
    width: 100%;
    display: flex;
    justify-content: flex-start;
  }

  main {
    padding: 1rem 1rem;
  }

  section {
    padding: 1.25rem 1rem;
  }

  button {
    width: 100%;
    text-align: center;
  }

  textarea,
  select,
  input[type="date"] {
    font-size: 1rem;
  }

  table,
  th,
  td {
    font-size: 0.9rem;
  }
}

/* Egységes design inputokra és textarea-ra */
input[type="text"],
input[type="number"],
input[type="date"],
textarea {
  padding: 0.75rem 1rem;
  font-size: 1rem;
  border: 2px solid #ddd;
  border-radius: 8px;
  background: #fafafa;
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
  font-family: inherit;
  color: #333;
  resize: vertical;
  /* csak textarea-nál értelmes */
  appearance: none;
  /* hogy ne legyen natív stílus */
  box-shadow: none;
  outline-offset: 2px;
}

/* Ha fókuszban vannak, mint a select */
input[type="text"]:focus,
input[type="date"]:focus,
textarea:focus {
  outline: none;
  border-color: #27ae60;
  box-shadow: 0 0 8px rgba(39, 174, 96, 0.5);
  background: #fff;
}

/* Ha szeretnéd, hogy a textarea ne legyen túl magas alapból */
textarea {
  min-height: 100px;
  max-height: 250px;
}

/* Ez a custom nyíl csak a select-re kell, nem inputra/textarea-ra! */
select {
  cursor: pointer;
  appearance: none;
  padding-right: 2rem;
}


/* Checkbox alapok elrejtése */
input[type="checkbox"] {
  /* elrejtjük az alap checkboxot */
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  width: 28px;
  height: 28px;
  border: 2.5px solid #27ae60;
  /* zöld keret */
  border-radius: 6px;
  cursor: pointer;
  position: relative;
  background-color: #fff;
  transition: background-color 0.3s, border-color 0.3s;
}

/* Hover állapot */
input[type="checkbox"]:hover {
  border-color: #219150;
}

/* Checked állapot - zöld kitöltés és pipa megjelenítése */
input[type="checkbox"]:checked {
  background-color: #27ae60;
  border-color: #27ae60;
}

/* Pipa megjelenítése */
input[type="checkbox"]:checked::after {
  content: "";
  position: absolute;
  top: 0px;
  left: 9px;
  width: 6px;
  height: 14px;
  border: solid white;
  border-width: 0 3px 3px 0;
  transform: rotate(45deg);
}

/* Fókusz állapot - kör árnyék */
input[type="checkbox"]:focus {
  outline: none;
  box-shadow: 0 0 6px 2px rgba(39, 174, 96, 0.7);
}

#toggleRawMenu {
  padding: 0.5rem 1.25rem;
}

#rawWeeklyMenuForm {
  margin-top: 20px;
}

#dropdownPlanner label {
  display: flex;
  gap: 0.5rem;
}

@media (max-width: 767px) {
  #dropdownPlanner label {
    flex-direction: column;
    align-items: flex-start;
  }

  .cook-btn {
    margin-left: 0;
  }
}

@media (min-width: 768px) {
  #dropdownPlanner label {
    flex-direction: row;
    align-items: center;
  }

}

#ingredientSummary ul, #extraItemList ul {
  padding-left: 0;
}

#ingredientSummary li,
#extraItemList li {
  display: flex;
  align-items: center;
}

#ingredientSummary label, #extraItemList span {
  padding-left: 10px;
}

#qtyMultiplier {
  max-width: 80px;
  margin-bottom: 1rem;
}

.recipe-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  padding: 1rem;
}

.recipe-card {
  display: block;
  background-color: #fff;
  border-radius: 10px;
  padding: 1rem;
  text-align: center;
  font-weight: bold;
  text-decoration: none;
  color: #333;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.recipe-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
  background-color: #f9f9f9;
}

#search {
  width: 100%;
  margin: 0 0 20px;
}

/* Alap: rejtett checkbox */
#menu-toggle {
  display: none;
}

/* A pöcök - kis vízszintes vonal */
.menu-toggle-label {
  display: none;
  /* alapban rejtett desktopon */
  cursor: pointer;
  width: 40px;
  height: 4px;
  background: white;
  margin: 10px auto;
  border-radius: 2px;
  position: relative;
  transition: background 0.3s ease;
}

/* Menü alapból mutatva desktopon */
.menu-list {
  max-height: 1000px;
  /* desktopon simán mutatjuk */
  overflow: visible;
  transition: max-height 0.3s ease;

  width: 100%;
  padding: 0;
  margin: 0;
  list-style: none;

  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem;
  justify-content: flex-start;
  position: relative;
  /* kell a buttons pozicionálásához */
}

.menu-list li {
  padding: 0.5rem 1rem;
}

/* A buttons <div> az ul-ben van, ezt így kezeljük: */
.menu-list>.buttons {
  margin-left: auto;
  /* jobbra tolja a buttons konténert desktopon */
  display: flex;
  gap: 0.5rem;
}

/* Mobil nézet */
@media (max-width: 768px) {

  /* Pöcök megjelenítése */
  .menu-toggle-label {
    display: block;
  }

  /* Menü alapból elrejtve */
  .menu-list {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s ease;
    flex-direction: column;
    align-items: flex-start;
  }

  /* Toggle hatás: ha be van pipálva, mutatjuk a menüt */
  #menu-toggle:checked+.menu-toggle-label+.menu-list {
    max-height: 500px;
    /* elég magas, hogy minden tartalom kiférjen */
  }

  /* Gombok mobilon alul, margóval */
  .menu-list>.buttons {
    margin-left: 0;
    margin-top: 1rem;
  }
}

/* Desktop nézet (min-width: 769px) - alap viselkedés fent már */