/* === Globální reset === */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* === Stránka jako neprohýbající rám === */
html, body {
  height: 100vh;
  width: 100vw;
  max-width: 100%;
  overflow: hidden;
  font-family: sans-serif;
  background-color: #ffeecf;
  color: #333;
}

/* === Záhlaví === */
.page-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 6em;
  width: 100%;
  background-color: #F8962C;
  border-bottom: 1px solid rgba(0,0,0,0.1);
  z-index: 10;
  overflow-x: hidden;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.30);
}

.page-header .header-content {
  max-width: 100%;
  padding: 0 1em;
  text-align: center;
  color: white;
  word-break: break-word;
}

.page-header .title-line {
  font-size: 1.4em;
  font-weight: bold;
}

.search-row {
  margin: 1em 0;
  text-align: center;
}

#search {
  width: 100%;
  max-width: 400px;
  padding: 0.7em 1.2em;
  font-size: 1em;
  border: 1px solid #ccc;
  border-radius: 2em; /* 🎯 silné zaoblení */
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.1); /* 🌫️ jemný stín */
  transition: box-shadow 0.3s ease, border 0.3s ease;
}

#search:focus {
  outline: none;
  border: 1px solid #F8962C;
  box-shadow: 0 0 12px rgba(248, 150, 44, 0.4); /* ✨ zvýraznění při psaní */
}

/* === Navigační zápatí === */
.page-footer {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 3em;
  background-color: #F8962C;
  border-top: 1px solid rgba(0,0,0,0.1);
  overflow: hidden;
  width: 100%;
  z-index: 10;
  box-shadow: 0 -4px 10px rgba(0, 0, 0, 0.30);
}

.footer-scroll {
  display: flex;
  align-items: center;             /* vertikální střed */
  justify-content: center;         /* vodorovný střed */
  overflow-x: auto;
  white-space: nowrap;
  padding: 0 1em;
  gap: 0.6em;
  height: 100%;
  scroll-snap-type: x mandatory;
}

.footer-scroll::after {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: 2.5em;
  background: linear-gradient(to left, rgba(248, 150, 44, 1), rgba(248, 150, 44, 0));
  pointer-events: none;
  z-index: 11;
}

.footer-scroll::-webkit-scrollbar {
  display: none;
}

/* === Tlačítka === */
.search-button {
  flex-shrink: 0;
  scroll-snap-align: start;
  white-space: nowrap;
  background-color: #d76e14;
  color: white;
  border: none;
  border-radius: 6px;
  padding: 0.5em 1em;
  font-size: 1em;
  font-weight: bold;
  cursor: pointer;
  transition: background-color 0.2s ease, transform 0.2s ease;
}

.search-button:hover {
  background-color: #c2590f; /* tmavší než normální */
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2); /* jemný stín pod tlačítkem */
  transform: translateY(-1px); /* lehký pohyb nahoru */
}

.search-button.active {
  background-color: #F8962C;
  box-shadow: inset 0 0 0 2px white;
  color: white;
}

/* 🧼 Prevence přetékání — ale bez tabulek */
img, p, div, section {
  max-width: 100%;
  overflow-wrap: break-word;
  word-break: break-word;
}

/* === Hlavní obsah mezi headerem a footerem === */
#main-content {
  position: relative;
  padding: 7em 1em 3em; /* respektuje výšku záhlaví a zápatí */
  overflow: visible;
}
.table-heading {
  color: #F8962C;               /* barva záhlaví tabulek */
  font-size: 1.3rem;
  font-weight: bold;
  text-align: left;
  margin: 1.2em 0 0.8em;
}

/* === Wrapper pro horizontální scroll (mobil) === */
.table-scroll-container {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

/* === Wrapper pro vertikální scroll (desktop) === */
.table-wrapper {
  max-height: calc(100vh - 6em - 3em);
  overflow-y: auto;
  padding: 0;
  background-color: white;
  min-width: 700px;
  overflow-y: auto;
}
/* === Tabulka === */
#directory {
  width: 100%;
  min-width: 700px;
  border-collapse: collapse;
  table-layout: fixed;
  font-size: 0.95rem;
  background-color: transparent;
}

/* === Sticky záhlaví === */
#directory th {
  position: sticky;
  top: 0;
  background-color: #F8962C;
  color: white;
  font-weight: bold;
  text-align: left;
  padding: 0.6rem 0.8rem;
  border-bottom: 1px solid #ffeecf; /* tenká linka mezi záhlavím a řádky */
  z-index: 2;
  transition: background-color 0.2s ease;
}

#directory th:hover {
  background-color: #e98227;
  cursor: pointer;
}

/* === Řádky tabulky === */
#directory td {
  padding: 0.6rem 0.8rem;
  border-bottom: 1px solid #ffeecf;  /* tenká linka mezi řádky */
  background-color: white;
  text-align: left;
  vertical-align: middle;
}

#directory tbody tr:hover td {
  background-color: #fff2e0;
  transition: background-color 0.2s ease;
}

/* === 📱 Responzivní úpravy === */
@media (max-width: 600px) {
  .search-row {
    flex-direction: column;
    align-items: stretch;
  }

  input[type="text"] {
    width: 100%;
  }

  .page-header {
    font-size: 0.5em;
    padding: 0.1em 0;
  }

  .page-header .title-line {
    font-size: 1em;
  }

  .page-header .header-content {
    padding: 0 0.5em;
  }

  .footer-scroll {
    justify-content: flex-start;
  }

  .search-button {
    font-size: 0.9em;
    padding: 0.4em 0.8em;
  }

  body {
    touch-action: pan-y;
  }

  /* 📲 Horizontální scroll */
  @media (max-width: 600px) {
  .table-scroll-container {
    display: block;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .table-wrapper {
    min-width: 700px;
    overflow-y: auto;
  }

  #directory {
    min-width: 700px;
    width: 100%;
    font-size: 0.9rem;
  }

  #directory th,
  #directory td {
    white-space: normal !important;
    word-break: break-word !important;
    overflow-wrap: anywhere !important;
  }

  #directory th {
    font-size: 0.9em;
    white-space: nowrap;
  }

  #directory td {
    font-size: 0.85rem;
	line-height: 1.3;
    white-space: normal;
  }
  
  #directory td:nth-child(2),
  #directory td:nth-child(3) {
    max-width: 120px;
  }
}

@media (max-width: 1024px) {
  .table-scroll-container {
    display: block;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    position: relative; /* důležité pro ::after gradient */
  }

  .table-wrapper {
    width: max-content;
    min-width: 700px;
    overflow-y: auto;
  }

  #directory {
    width: 100%;
    min-width: 700px;
    font-size: 0.9rem;
    border-collapse: collapse;
    table-layout: fixed;
  }

  #directory th,
  #directory td {
    padding: 0.5em 0.6em;
    white-space: nowrap;
    word-break: keep-all;
  }
}


.scroll-hint-right {
  position: absolute;
  bottom: 0;
  right: 0;
  top: 0;
  width: 2.5em;
  background: linear-gradient(to left, rgba(255, 238, 207, 1), rgba(255, 238, 207, 0));
  pointer-events: none; /* neblokuje kliknutí */
  z-index: 11;
}
