/* Reset a základní nastavení */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
  background-color: #f5f9ff;
  color: #333;
  line-height: 1.6;
}

/* Hlavička a menu */
header {
  background-color: #4a90e2;
  color: white;
  padding: 1rem 0;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  display: flex;
  justify-content: center;
}

nav {
  max-width: 1200px;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 2rem;
}

.logo {
  font-weight: 700;
  font-size: 1.5rem;
  letter-spacing: 1px;
}

ul.menu {
  list-style: none;
  display: flex;
  gap: 1.5rem;
}

ul.menu li a {
  color: white;
  text-decoration: none;
  font-weight: 600;
  padding: 0.5rem 0;
  transition: border-bottom 0.3s ease;
  border-bottom: 3px solid transparent;
}

ul.menu li a:hover,
ul.menu li a:focus {
  border-bottom: 3px solid #dbe9ff;
}

ul.menu li a.active {
  border-bottom: 3px solid #fff;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 3px;
}

/* Hlavní obsah */
main {
  max-width: 1000px;
  margin: 2rem auto;
  padding: 0 1rem;
}

.recepty-boxx {
  padding: 1.5em 2em;
  margin-bottom: 2rem;
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 4px 18px #eaeef2;
  transition: box-shadow 0.18s, transform 0.18s;
}

.recepty-boxx a {
  word-wrap: break-word;
}

/* Paticka */
footer {
  text-align: center;
  padding: 1rem;
  font-size: 0.9rem;
  color: #777;
  border-top: 1px solid #ddd;
  margin-top: 3rem;
}

/* Formuláře, tabulky, tlačítka – základ */
form {
  background: white;
  padding: 1rem 1.5rem;
  border-radius: 8px;
  box-shadow: 0 3px 8px rgba(74, 144, 226, 0.3);
  max-width: 500px;
  margin-bottom: 2rem;
}

label {
  font-weight: 600;
  display: block;
  margin-bottom: 0.3rem;
  color: #1f3b7f;
}

input[type='text'] {
  width: 100%;
  padding: 0.5rem;
  border-radius: 5px;
  border: 1px solid #4a90e2;
  font-size: 1rem;
  margin-bottom: 1rem;
  transition: border-color 0.3s ease;
}

input[type='text']:focus {
  border-color: #2c67d1;
  outline: none;
}

button {
  background-color: #4a90e2;
  color: white;
  border: none;
  font-weight: 600;
  padding: 0.5rem 1.3rem;
  border-radius: 5px;
  cursor: pointer;
  transition: background-color 0.3s ease;
  margin-right: 1rem;
}

button:hover {
  background-color: #2c67d1;
}

a {
  color: #4a90e2;
  text-decoration: none;
  font-weight: 600;
}

a:hover {
  text-decoration: underline;
}

table {
  width: 100%;
  border-collapse: collapse;
  background: white;
  border-radius: 8px;
  box-shadow: 0 3px 8px rgba(74, 144, 226, 0.3);
  overflow: hidden;
}

th,
td {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid #ddd;
  text-align: left;
}

th {
  background-color: #4a90e2;
  color: white;
  font-weight: 600;
}

tr:hover {
  background-color: #e9f0ff;
}

/* Stylování pro filtrování receptů podle ingrediencí */
fieldset {
  border: 1px solid #4a90e2;
  border-radius: 8px;
  padding: 1rem;
  margin-bottom: 1rem;
  max-height: 250px;
  overflow-y: auto;
  background: #f5f9ff;
}

legend {
  font-weight: 700;
  color: #2c67d1;
  margin-bottom: 0.5rem;
}

input[type='checkbox'] {
  margin-right: 0.4rem;
  cursor: pointer;
}

select {
  margin-left: 0.5rem;
  margin-bottom: 1rem;
  padding: 0.3rem 0.5rem;
  border-radius: 5px;
  border: 1px solid #4a90e2;
  font-size: 1rem;
}

ul {
  list-style-type: none;
  padding: 0;
}

ul li {
  padding: 0.25rem 0;
}

ul li a {
  color: #4a90e2;
  font-weight: 600;
  text-decoration: none;
  margin-right: 0.5rem;
}

ul li a:hover {
  text-decoration: underline;
}

main > hr {
  border: 1px solid #4a90e2;
  margin: 1rem 0 2rem 0;
}

.kategorie-list {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 1rem;
}

.kategorie-item {
  background: #e8f1fa;
  padding: 0.5em 0.9em;
  border-radius: 18px;
  box-shadow: 0 1px 2px #eee;
  font-weight: 500;
}

.kategorie-item input[type='checkbox'] {
  margin-right: 0.5em;
}

.add-new {
  margin-left: 1rem;
  color: #4a90e2;
  font-weight: 700;
}

.postup-text,
.ingredience_text-text {
  width: 100%;
  border-radius: 8px;
  border: 1.5px solid #4a90e2;
  padding: 1em;
  font-size: 1.05em;
  background: #fafdff;
}

.recepty-list {
  list-style: none;
  padding: 0;
}

.recept-box {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  background: #fff;
  margin-bottom: 1.1rem;
  border-radius: 8px;
  box-shadow: 0 2px 7px #eaeef2;
  padding: 1em 1.2em;
}

.recept-photo {
  width: 100px;
  height: 75px;
  object-fit: cover;
  border-radius: 6px;
}

.recept-title {
  color: #1f3b7f;
  font-weight: 700;
  font-size: 1.09em;
}

.recept-popis {
  color: #666;
  margin-top: 0.4em;
  font-size: 0.97em;
}

.flex-row {
  display: flex;
  gap: 0.7em;
  align-items: center;
  margin-bottom: 1em;
}

.flex-row input[type='text'],
.flex-row button {
  height: 2.7em !important; /* přesně stejná výška */
  font-size: 1em !important; /* stejný font */
  padding: 0 1em !important; /* stejný vnitřní okraj */
  outline: none;
  box-sizing: border-box;
  margin-bottom: 0 !important;
}

.flex-row input[type='text'] {
  border: 1px solid #4a90e2;
  border-radius: 5px;
}

.flex-row button {
  border: 1px solid #4a90e2;
  border-radius: 5px;
  background: #4a90e2;
  color: white;
  cursor: pointer;
  transition: background 0.18s;
  font-weight: 600;
  display: inline-block;
  vertical-align: middle;
}

.flex-row button:hover {
  background: #357ae8;
}

#foto-btn {
  height: 2.3em;
  background: #4a90e2;
  border: 1px solid #357ae8;
  color: #fff;
  font-weight: 600;
  border-radius: 5px;
  cursor: pointer;
  padding: 0 1.1em;
}

#foto-btn:hover {
  background: #357ae8;
}

#foto-nazev {
  min-width: 120px;
  display: inline-block;
}

/* --- Responsivní styl pro mobilní zařízení --- */
@media (max-width: 600px) {
  /* Nastavení šířky a marginu pro formuláře a tabulky */
  form,
  table {
    width: 100%;
    margin: 0;
  }

  /* Tlačítka v rámci formuláře zabírají celý řádek */
  button {
    margin-top: 0.5rem;
    width: 100%;
    margin-right: 0;
  }

  /* Flex kontejnery původních .flex-row přepneme na sloupcové */
  .flex-row {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 0.5em;
    margin-bottom: 1em;
  }

  /* Vstupní pole a tlačítka v .flex-row šířka 100% */
  .flex-row input[type='text'],
  .flex-row button,
  #foto-btn {
    width: 100% !important;
    box-sizing: border-box;
  }

  /* Vyšší výška pro lepší ovládání prstem */
  .flex-row input[type='text'],
  .flex-row button,
  #foto-btn {
    height: 2.8em !important;
    font-size: 1.1em !important;
  }

  /* Upravené menu přepnout na sloupcový seznam */
  ul.menu {
    flex-direction: column;
    gap: 0.8rem;
  }

  /* Menší logo */
  .logo {
    font-size: 1.2rem;
  }

  /* Méně paddingu v navigaci na mobilu */
  header nav {
    padding: 0 1rem;
  }

  /* Uprava recept-box pro mobily: sloupcové rozložení */
  .recept-box {
    flex-direction: column !important;
    align-items: flex-start !important;
  }

  /* Zvětšení obrázku receptu na celou šířku kontejneru v mobilech */
  .recept-photo {
    width: 100% !important;
    height: auto !important;
  }

  /* Upravte font velikosti recept názvu a popisu pro lepší čitelnost */
  .recept-title {
    font-size: 1.2em !important;
  }
  .recept-popis {
    font-size: 1.05em !important;
  }
}

.logo {
  display: flex;
  align-items: center;
  font-weight: 700;
  font-size: 1.5rem;
  letter-spacing: 1px;
  gap: 0.7em;
  user-select: none;
}
.logo-img {
  height: 2.3em;
  width: auto;
  display: block;
}

.recept-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.recept-box {
  padding: 1.5em 2em;
  margin-bottom: 2rem;
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 4px 18px #eaeef2;
  transition: box-shadow 0.18s, transform 0.18s;
}

.recept-link {
  display: flex;
  gap: 2.2rem;
  text-decoration: none;
  color: inherit;
  align-items: center;
  min-height: 110px;
}

.recept-link:hover,
.recept-link:focus {
  background-color: #f0f6ff;
  border-radius: 16px;
  box-shadow: 0 8px 32px #d6e9ff;
  transform: translateY(-2px) scale(1.01);
  cursor: pointer;
  text-decoration: none;
  outline: none;
}

.recept-photo {
  width: 160px;
  height: 120px;
  object-fit: cover;
  border-radius: 10px;
  flex-shrink: 0;
  box-shadow: 0 2px 12px #eaeef2;
}

.recept-info {
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  gap: 0.7em;
  justify-content: center;
}

.recept-title {
  margin: 0 0 0.2em 0;
  font-weight: 700;
  color: #1f3b7f;
  font-size: 1.22em;
  line-height: 1.3;
}

.recept-kategorie {
  font-size: 0.96em;
  color: #555;
  margin-top: 0.25em;
}

.recept-popis {
  color: #444;
  margin-top: 0.4em;
  font-size: 1em;
  font-style: italic;
}

.recept-step-preview {
  color: #2c67d1;
  font-size: 0.98em;
  margin-top: 0.3em;
  background: #f4fafd;
  border-left: 4px solid #4a90e2;
  padding: 0.33em 0.7em;
  border-radius: 6px;
}
.step-label {
  font-weight: bold;
  color: #397acc;
}

@media (max-width: 900px) {
  .recept-link {
    gap: 1rem;
  }
  .recept-photo {
    width: 120px;
    height: 90px;
  }
  .recept-box {
    padding: 1em 0.6em;
  }
}
@media (max-width: 600px) {
  .recept-link {
    flex-direction: column;
    gap: 0.8rem;
  }
  .recept-photo {
    width: 100%;
    height: auto;
    min-height: unset;
    max-width: 320px;
    margin: 0 auto;
  }
  .recept-title {
    font-size: 1.13em;
  }
  .recept-box {
    border-radius: 8px;
    padding: 0.7em 0.3em;
  }
}
