/* ===== FONTS ===== */
@font-face {
  font-family: 'Ubuntu';
  src: url('ttf/Ubuntu-Regular.ttf') format('truetype');
  font-weight: normal;
  font-style: normal;
}

@font-face {
  font-family: 'Ubuntu';
  src: url('ttf/Ubuntu-Italic.ttf') format('truetype');
  font-weight: normal;
  font-style: italic;
}

@font-face {
  font-family: 'Ubuntu';
  src: url('ttf/Ubuntu-Bold.ttf') format('truetype');
  font-weight: bold;
  font-style: normal;
}

@font-face {
  font-family: 'Ubuntu';
  src: url('ttf/Ubuntu-BoldItalic.ttf') format('truetype');
  font-weight: bold;
  font-style: italic;
}

@font-face {
  font-family: 'Ubuntu';
  src: url('ttf/Ubuntu-Light.ttf') format('truetype');
  font-weight: 300;
  font-style: normal;
}

@font-face {
  font-family: 'Ubuntu';
  src: url('ttf/Ubuntu-LightItalic.ttf') format('truetype');
  font-weight: 300;
  font-style: italic;
}

@font-face {
  font-family: 'Ubuntu';
  src: url('ttf/Ubuntu-Medium.ttf') format('truetype');
  font-weight: 500;
  font-style: normal;
}

@font-face {
  font-family: 'Ubuntu';
  src: url('ttf/Ubuntu-MediumItalic.ttf') format('truetype');
  font-weight: 500;
  font-style: italic;
}

/* ===== BASE ===== */
html,
body {
  font-family: 'Ubuntu', sans-serif;
  font-size: 14px;
  display: flex;
  flex-direction: column;
  margin: 0;
  padding: 0;
  height: 100%;
  box-sizing: border-box;
  overflow-x: hidden;
  overflow-y: auto;
}

body input {
  font-family: 'Ubuntu';
}

body::-webkit-scrollbar {
  width: 0px;
}

input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus,
input:-webkit-autofill:active {
  -webkit-box-shadow: 0 0 0 30px white inset !important;
  -webkit-text-fill-color: inherit !important;
  transition: background-color 5000s ease-in-out 0s;
}

/* ===== HEADER ===== */
header {
  display: flex;
  flex-direction: column;
  align-items: center;
  position: fixed;
  top: 0;
  width: 100%;
  z-index: 1000;
  background-color: transparent;
  padding: 0;
}

header h1 {
  margin: 0;
  padding: 0;
  font-size: 14px;
  font-weight: bold;
  color: #426888;
  text-align: center;
}

/* ===== LOGO ===== */
#logo_container {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 10px 0;
  background-color: #eef7ff;
  width: 100%;
}

#logo_container img {
  max-width: 200px;
  height: auto;
}

/* ===== NAV ===== */
nav {
  display: flex;
  gap: 12px;
  justify-content: center;
  background-color: #daeeff;
  width: 100%;
  padding: 10px 0;
}

nav button {
  background-color: #4f98d8;
  border: 0;
  border-radius: 35%;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

nav button:hover {
  background-color: #4186c3;
  scale: 1.1;
}

nav img {
  width: 18px;
  height: 18px;
  filter: brightness(0) invert(1);
}

/* ===== MAIN ===== */
main {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-top: 130px;
  margin-bottom: 60px;
}

main h1 {
  position: fixed;
  top: 122px;
  width: 100%;
  margin: 0;
  padding: 10px 0;
  font-size: 16px;
  color: #426888;
  text-align: center;
  background-color: #eef7ff;
  z-index: 500;
}

/* ===== SECTION ===== */
section {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin: 50px 0;
  width: 100%;
}

section h1 {
  font-size: 16px;
}

h3 {
  font-size: 13px;
  font-weight: 600;
  margin: 0px 0;
  padding: 8px;
  text-align: center;
  color: #2a5175;
  /* background: #eef7ff; */
  /* border-radius: 4px; */
  /* width: 100%; */
}

/* ===== FOOTER ===== */
footer {
  display: flex;
  position: fixed;
  flex-direction: column;
  bottom: 0;
  align-items: center;
  width: 100%;
  background-color: #daeeff;
  color: #426888;
  z-index: 9999;
}

footer p {
  margin: 0;
  padding: 6px;
  font-size: 10px;
  color: #426888;
  text-align: center;
  font-weight: bold;
}

/* ===== LOADING OVERLAY ===== */
/* Fullscreen overlay s točícím kolečkem při zpracování požadavků
   - Transparentní pozadí (neruší zobrazení)
   - pointer-events: all - blokuje celou obrazovku, zabraňuje dvojkliku
   - cursor: wait - indikuje zpracování
   - Nezobrazuje se pro rychlé akce (nápověda, infobox) */
#loading-overlay {
  position: fixed;
  inset: 0;
  background: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 99999;
  pointer-events: all;
  cursor: wait;
}

.loading-spinner {
  width: 30px;
  height: 30px;
  border: 8px solid rgba(60, 135, 231, 0.3);
  border-top-color: #3c87e7;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  box-shadow: 0 0 0px 4px #fff;
  background: #fff;
  opacity: 0.8;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* ===== INFOBOX ===== */
#infobox {
  display: block;
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  max-width: 300px;
  max-height: 300px;
  padding: 10px;
  font-size: 14px;
  font-weight: bold;
  text-align: center;
  opacity: 0.9;
  color: #ffffff;
  z-index: 10000;
  box-shadow: 0 0 10px 0 rgba(0, 0, 0, 0.5);
  border-radius: 3px;
  cursor: pointer;
  line-height: 20px;
}

#infobox.info {
  background-color: rgb(57, 110, 57);
  border: 3px solid #204222;
}

#infobox.chyba {
  background-color: rgb(183, 36, 36);
  border: 3px solid #791819;
}

/* ===== FORMULAR ===== */
fieldset {
  border: 0px solid #eef7ff;
  border-radius: 4px;
  padding: 0px 0;
  margin: 5px auto;
  width: 90%;
  text-align: center;
  box-sizing: border-box;
}

legend {
  color: #2a567b;
  font-weight: bold;
  font-size: 12px;
  padding: 2px 5px;
  background: #f9fcff;
  border-radius: 3px;
  /* width: 100px; */
}

.formular_title {
  color: #3b5f7c;
  font-size: 15px;
  /* font-weight: bold; */
  margin: 5px 0;
  /* text-align: center; */
}

.formular {
  display: flex;
  flex-direction: column;
  align-items: center;
  background-color: #f9fcff;
  border-radius: 4px;
  padding: 5px 5px;
  width: 280px;
}

.formular input {
  color: #3b5f7c;
  text-align: center;
  border: 3px solid #e9f3fe;
  width: 270px;
  padding: 8px;
  margin: 0px;
  box-sizing: border-box;
  border-radius: 3px;
}

.formular input:focus {
  outline: none;
  border: 3px solid #b9d1e9;
  background-color: #ffffde;
}

.formular_element_pair input {
  width: 80%;
  min-width: 0;
}

.formular_element_pair input:focus {
  width: 80%;
}

.required-empty {
  border: 3px solid #ebc0c5 !important;
  box-shadow: 0 0 5px 1px rgba(170, 65, 75, 0.1) !important;
}

.formular_element {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.formular_element_checkbox {
  flex-direction: row;
  align-items: flex-start;
  margin: 10px 0;
}

.formular_element_checkbox label {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  user-select: none;
}

.formular_element_checkbox input[type="checkbox"] {
  /* display: flex; */
  width: 20px;
  height: 20px;
  cursor: pointer;
  margin: 0;
}

.formular_element_checkbox span {
  font-size: 14px;
  color: #2a567b;
}

.formular_element_checkbox span a {
  color: #3c87e7;
  text-decoration: underline;
}

.formular_element_checkbox span a:hover {
  color: #2a6bbf;
}

/* Password pole s okem pro zobrazení/skrytí */
.formular_element_password {
  position: relative;
}

.password-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.password-toggle {
  position: absolute;
  right: 8px;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 5px;
  line-height: 1;
  user-select: none;
  display: flex;
  align-items: center;
  justify-content: center;
}

.password-toggle img {
  width: 20px;
  height: 20px;
  display: block;
  opacity: 0.3;
  /* filter: invert(35%) sepia(70%) saturate(400%) hue-rotate(170deg); */
}

.password-toggle:hover img {
  opacity: 0.4;
}

/* Červený rámeček pro nevyplněná povinná pole */
input.required-empty,
input[type="checkbox"].required-empty {
  outline: 2px solid #b72727;
  outline-offset: 2px;
}

.formular_element_pair {
  width: 290px;
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 5px;
}

.formular_element_pair .formular_element {
  width: auto;
  flex: 1;
}

.formular_separator {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  font-size: 18px;
  font-weight: bold;
  color: #2a567b;
  margin: 0 5px;
  height: 40px;
}

/* ===== BUTTONS ===== */
.btn_primary {
  font-family: 'Ubuntu', sans-serif;
  background-color: #4f98d8;
  border: 3px solid #5281a8;
  border-radius: 3px;
  cursor: pointer;
  padding: 10px 15px;
  color: white;
  font-weight: bold;
  margin: 10px 0 15px 0;
  /* max-width: 262px; */
  text-decoration: none;
}

.btn_primary:hover {
  background-color: #4186c3;
}

.btn_danger {
  font-family: 'Ubuntu', sans-serif;
  background-color: #d84f4f;
  border: 3px solid #954343;
  border-radius: 3px;
  cursor: pointer;
  padding: 10px;
  color: white;
  font-weight: bold;
  margin: 15px 0 5px 0;
  /* width: 290px; */
}

.btn_danger:hover {
  background-color: #c03030;
}

.formular_buttons {
  display: flex;
  flex-direction: column;
  align-items: center;
  /* gap: 10px; */
  /* width: 280px; */
  /* margin-top: 10px; */
}

.btn_zapomenute_heslo {
  font-family: 'Ubuntu', sans-serif;
  margin: 20px;
  border: 0px solid #8abce6;
  padding: 5px 10px;
  background-color: #4f98d8;
  color: #ffffff;
  font-size: 12px;
  font-weight: bold;
  cursor: pointer;
  border-radius: 3px;
}

.btn_zapomenute_heslo:hover {
  background-color: #4186c3;
}

/* ===== NAPOVEDA ===== */
.napoveda {
  display: flex;
  align-items: center;
  flex-direction: column;
  background-color: #f9fcff;
  /* padding: 5px; */
  border-radius: 5px 5px 0 0;
}

.napoveda_vystup {
  flex-direction: column;
  z-index: 500;
  max-height: 200px;
  border: 5px solid #ffffff;
  border-radius: 0 0 4px 4px;
  box-shadow: 0 5px 30px 1px rgba(100, 100, 100, 0.15);
  overflow-y: scroll;
  scrollbar-width: none;
  box-sizing: border-box;
  background-color: #ffffff;
}

.napoveda_vystup::-webkit-scrollbar {
  display: none;
}

.napoveda_vystup button {
  font-family: 'Ubuntu';
  font-weight: bold;
  width: 100%;
  border: none;
  color: #444;
  font-size: 12px;
  cursor: pointer;
  padding: 10px;
}

.napoveda_vystup button:nth-child(odd) {
  background-color: #f9f9f9;
}

.napoveda_vystup button:nth-child(even) {
  background-color: #e9f4ff;
}

.napoveda_vystup button:hover {
  background-color: #c6e5ff;
}

.napoveda_infobox {
  background-color: #eef7ff;
  font-weight: 500;
  color: #3d5988;
  padding: 10px;
  border-radius: 4px 4px 0 0;
  width: 250px;
  text-align: center;
  position: relative;
}

.napoveda_infobox_close {
  position: absolute;
  top: 4px;
  right: 4px;
  background: #bd5656;
  color: #fff;
  border: 3px solid #ffffff;
  font-size: 19px;
  border-radius: 50%;
  font-weight: bold;
  cursor: pointer;
  padding: 0;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

.napoveda_infobox_close:hover {
  background-color: #954848;
}

/* ===== MEDIA ===== */
.media_file_input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.media_uploader {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  width: 100%;
  margin: 10px 0;
}

.media_dropzone {
  max-width: 200px;
  border: 3px dashed #dfedf9;
  border-radius: 4px;
  padding: 10px;
  text-align: center;
  color: #3d5988;
  cursor: pointer;
  background-color: #e8f4ff;
}

.media_dropzone.dragover {
  border-color: #bbd2e9;
  background: #e8f4ff;
}

.media_grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 12px;
}

.media_item {
  position: relative;
  border: 3px solid #BDD4EA;
  border-radius: 7px;
  overflow: hidden;
  background: #fff;
}

.media_thumb {
  display: block;
  width: 100%;
  height: 120px;
  object-fit: cover;
}

.media_filename {
  display: block;
  font-size: 11px;
  padding: 8px 6px;
  white-space: nowrap;
  text-overflow: ellipsis;
  overflow: hidden;
}

.media_add_tile {
  display: flex;
  align-items: center;
  justify-content: center;
  border: 3px dashed #bdd4e9;
  border-radius: 4px;
  height: 150px;
  background: #ffffff;
  color: #3d5988;
  cursor: pointer;
}

.media_add_tile:hover {
  border-color: #999;
  color: #666;
}

.media_add_icon {
  border: 3px solid #bdd4e9;
  font-size: 20px;
  font-weight: bold;
  background: #4f98d8;
  border-radius: 50%;
  color: #fff;
  width: 35px;
  height: 35px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.media_actions {
  position: absolute;
  top: -6px;
  right: -6px;
  display: flex;
}

.media_actions button {
  border: 3px solid rgb(255, 255, 255);
  background: rgb(186 47 47);
  color: #fff;
  font-weight: bold;
  font-size: 20px;
  border-radius: 50%;
  width: 35px;
  height: 35px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  position: absolute;
  top: 15px;
  right: 15px;
  z-index: 1050;
}

.media_actions button:hover {
  background: rgb(186 47 47 / 100%);
  scale: 1.1;
}

.media_actions button:active {
  scale: 0.9;
}

/* ===== POLOZKY ===== */
.polozky-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 12px;
  /* margin-top: 16px; */
}

.polozka-karta {
  position: relative;
  display: flex;
  gap: 5px;
  align-items: flex-start;
  padding: 5px;
  border: 3px solid #eef7ff;
  border-radius: 4px;
  background: #fff;
  cursor: pointer;
  transition: box-shadow .15s ease;
}

.polozka-karta:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.polozka-thumb {
  width: 100px;
  height: 100px;
  flex: 0 0 100px;
  background: #f9fcff;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  /* border-radius: 4px; */
  padding: 5px;
  border: 2px solid #f0f8ff;
}

.polozka-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  border-radius: 3px;
}

.polozka-body {
  flex: 1 1 auto;
  min-width: 0;
}

.polozka-nadpis {
  text-align: center;
  background: #ffffff;
  padding: 4px;
  border-radius: 2px;
  font-size: 14px;
  font-weight: bold;
  color: #ffffff;
  background: #4f98d8;
}

.polozka-id {
  position: absolute;
  bottom: 0px;
  right: 0px;
  background-color: #eef7ff;
  color: #3f4f5d;
  padding: 4px 8px;
  /* border-radius: 3px; */
  font-size: 10px;
  z-index: 1;
  /* border: 3px solid #fff; */
}

.polozka-info-riadok {
  text-align: right;
  margin: 4px 0;
  font-size: 0.95em;
}

.polozka-label {
  color: #666;
  margin-right: 4px;
}

.polozka-hodnota {
  color: #333;
  font-weight: 500;
}

.polozka-atry {
  color: #555;
  font-size: .95em;
  text-align: right;
}

/* ===== POPUP ===== */
.popup {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, .45);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.popup-content {
  background: #fff;
  width: 300px;
  max-width: 92vw;
  max-height: 80vh;
  overflow-y: auto;
  overflow-x: hidden;
  border-radius: 4px;
  padding: 0px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, .2);
  position: relative;
}

.popup-content h3 {
  margin-top: 0;
}

.polozka-header-fixed {
  position: sticky;
  top: 0;
  background: #fff;
  margin: 0 0 16px 0;
  z-index: 10;
  display: flex;
  height: 40px;
}

.polozka-nadpis-fixed {
  position: absolute;
  border-bottom: 3px solid #fff;
  top: 0px;
}

.polozka-zavrit {
  position: absolute;
  right: 4px;
  top: 4px;
  background: #953f39;
  color: white;
  border: 3px solid #fff;
  border-radius: 50%;
  width: 30px;
  height: 30px;
  font-size: 18px;
  font-weight: bold;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.2s ease;
  flex-shrink: 0;
  z-index: 1010;
}

.polozka-zavrit:hover {
  background: #d32f2f;
}

.polozka-obsah {
  margin-top: 40px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.polozka-hodnota-display {
  text-align: center;
  width: 85%;
  padding: 10px;
  border-radius: 4px;
  background-color: #f2f9ff;
  color: #1e67a7;
}

.polozka-fotografie {
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: center;
}

.polozka-fotografie-full {
  display: flex;
  flex-direction: column;
  width: 100%;
  align-self: stretch;
}

.polozka-foto-full {
  width: 100%;
  height: auto;
  cursor: pointer;
}


.editace-fotografie-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 10px;
  justify-content: center;
}

.editace-fotografie-item {
  position: relative;
  display: inline-block;
  border: 2px solid #d0e8ff;
  padding: 4px;
  background-color: #f9fcff;
}

.editace-foto-thumb {
  width: 80px;
  height: 80px;
  object-fit: cover;
  display: block;
  border-radius: 3px;
}

.btn-smazat-foto {
  position: absolute;
  top: -5px;
  right: -5px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background-color: #d84f4f;
  color: white;
  border: 2px solid white;
  cursor: pointer;
  font-size: 16px;
  font-weight: bold;
  line-height: 1;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.btn-smazat-foto:hover {
  background-color: #c03030;
}

/* ===== UCET ===== */
#prihlaseni_container,
#registrace_container,
#zapomenute_heslo_container {
  display: flex;
  flex-direction: column;
  align-items: center;
  border-radius: 4px;
}

#prihlaseni_container {
  background-color: #f9fcff;
}

#registrace_container {
  background-color: #ecf6ff;
}

#zapomenute_heslo_container {
  background-color: #f9fcff;
}

.polozka-obsah fieldset {
  border: 2px solid #eef7ff;
  padding: 10px 0;
}

.vysledky-prazdne {
  text-align: center;
  font-size: 12px;
  font-weight: bold;
  color: #2a567b;
  margin: 10px 0;
  padding: 20px;
  /* background: #f9fcff; */
  border-radius: 4px;
}

.link {
  color: #4f98d8;
  text-decoration: underline;
  cursor: pointer;
  font-weight: bold;
  text-decoration: none;
}

.link:hover {
  color: #4186c3;
}