@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

html,body{height:100%;margin:0;font-family: 'Inter', sans-serif; color: #333;}
#app{
  display:grid;
  grid-template-rows: auto 1fr;
  grid-template-columns:320px 1fr;
  height:100%;
  position:relative;
  /* Moderní gradientové pozadí */
  background: linear-gradient(to bottom right, #f0f4f8, #e7edf3);
}
#app.sidebar-collapsed{grid-template-columns:0 1fr}

#sidebar{
  padding:15px; /* Více vnitřního prostoru */
  border-right:1px solid #e0e0e0;
  overflow-y:auto; /* Ponecháno overflow-y pro skrolování */
  font-size:14px;
  line-height:1.6;
  background-color: #ffffff;
  box-shadow: 2px 0 10px rgba(0,0,0,0.05); /* Jemný stín */
  border-radius: 0 8px 8px 0; /* Zaoblení rohů */
}

#map{height:100%; border-radius: 8px; overflow: hidden; margin: 10px; box-shadow: 0 4px 15px rgba(0,0,0,0.1);}

fieldset{
  border:1px solid #e0e0e0;
  border-radius:8px; /* Zaoblené rohy */
  margin:15px 0; /* Více mezery */
  padding:12px 15px; /* Více vnitřního prostoru */
  background-color: #fcfcfc;
  box-shadow: 0 1px 5px rgba(0,0,0,0.03); /* Velmi jemný stín */
}
fieldset legend {
  font-weight: 600;
  color: #0050b5; /* Barva legendy */
  padding: 0 8px;
}

.range-row{display:flex;align-items:center;gap:10px; margin-top: 8px;}
.small{color:#666;font-size:12px}

.btn{
  display:inline-block;
  padding:8px 15px; /* Větší padding */
  background:#007bff; /* Modřejší barva */
  color:#fff;
  border-radius:6px; /* Jemnější zaoblení */
  cursor:pointer;
  border:none;
  font-weight: 500;
  transition: background-color 0.2s ease, transform 0.1s ease;
  text-decoration: none;
}
.btn:hover {
  background-color: #0056b3;
  transform: translateY(-1px);
}
.btn:active {
  transform: translateY(0);
}

/* Styly pro inputy a selecty */
select, input[type="range"] {
  border: 1px solid #ccc;
  border-radius: 4px;
  padding: 5px 8px;
  font-size: 14px;
  background-color: #fff;
}
select {
  width: calc(100% - 70px); /* Přizpůsobení šířky */
  margin-left: 5px;
}
input[type="checkbox"], input[type="radio"] {
  margin-right: 5px;
}

/* Right attribute panel */
#attrPanel{
  position:absolute;
  top:10px;
  right:10px;
  width:400px; /* Širší panel */
  max-width:45vw;
  max-height:85vh;
  background:#ffffff;
  border:1px solid #e0e0e0;
  border-radius:10px; /* Více zaoblené */
  box-shadow:0 5px 20px rgba(0,0,0,.1); /* Výraznější stín */
  display:none;
  flex-direction:column;
  overflow:hidden;
  z-index:500;
}
#attrPanel header{
  display:flex;
  align-items:center;
  justify-content:space-between;
  padding:10px 15px; /* Více paddingu */
  background:#f0f4f8; /* Světlejší pozadí záhlaví */
  border-bottom:1px solid #e5e5e5;
  font-weight:700;
  color: #333;
}
#attrBody{padding:15px;overflow:auto}
#attrBody table { width: 100%; border-collapse: collapse; }
#attrBody td { padding: 6px 0; border-bottom: 1px solid #eee; }
#attrBody tr:last-child td { border-bottom: none; }
#attrBody td:first-child { font-weight: 500; width: 40%; }
#attrClose{background:transparent;border:none;font-size:24px;line-height:1;cursor:pointer; color: #666; transition: color 0.2s ease;}
#attrClose:hover { color: #333; }

/* === STYLY PRO HORNÍ PRUH === */
#header-bar {
  grid-column: 1 / -1;
  grid-row: 1;
  display: flex;
  align-items: center;
  gap: 15px; /* Větší mezera mezi elementy */
  padding: 10px 20px; /* Větší padding */
  background-color: #2c3e50; /* Tmavší, elegantnější barva */
  color: #ecf0f1; /* Světlejší text */
  box-shadow: 0 2px 8px rgba(0,0,0,0.2); /* Jemný stín pod pruhem */
  z-index: 1000;
}

#header-bar .btn {
  background-color: #3498db; /* Výraznější modré tlačítko */
  padding: 6px 12px;
  font-size: 1rem;
  box-shadow: none; /* Odstranění stínu z tlačítka v hlavičce */
}
#header-bar .btn:hover {
  background-color: #2980b9;
}

.header-title {
  font-size: 1.3rem; /* Větší nadpis */
  font-weight: 700;
  margin: 0;
  letter-spacing: 0.5px; /* Jemné protažení písmen */
}

.header-logo {
  height: 35px; /* Velikost loga */
  width: auto;
}

/* === STYLY PRO STATICKÉ VRSTVY === */
.table-toggle-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 5px;
}
.btn.btn-small {
  padding: 2px 8px;
  font-size: 12px;
}

/* === NOVÉ STYLY PRO SPODNÍ ATRIBUTOVOU TABULKU === */
#table-container {
  position: absolute;
  bottom: 0;
  left: 0; /* Začíná na levém okraji gridu */
  right: 0; /* Končí na pravém okraji gridu */
  width: 100%;
  height: 33vh; /* 1/3 výšky obrazovky */
  background-color: #ffffff;
  border-top: 2px solid #007bff;
  box-shadow: 0 -4px 15px rgba(0,0,0,0.15);
  z-index: 1001; /* Nad mapou, ale pod levou/pravou lištou */
  display: none; /* Skryto ve výchozím stavu */
  flex-direction: column;
  /* Přesah gridu - pozicováno relativně k #app */
  grid-column: 1 / -1; 
  grid-row: 2; /* V řádku s mapou/sidebarem */
  align-self: end; /* Zarovnání na spodek gridu */
}

/* Hlavička tabulky */
#table-header-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 15px;
  background-color: #f8f9fa;
  border-bottom: 1px solid #e0e0e0;
}
#table-toolbar {
  display: flex;
  gap: 10px;
}
#table-toolbar .btn {
  background-color: #6c757d;
}
#table-toolbar .btn:hover {
  background-color: #5a6268;
}
#table-toolbar #table-filter {
  border: 1px solid #ccc;
  border-radius: 4px;
  padding: 5px 8px;
}
#table-info {
  text-align: center;
}
#table-title {
  font-size: 1.1rem;
  font-weight: 600;
  color: #333;
  margin-right: 10px;
}
#table-count {
  font-size: 0.9rem;
  color: #555;
}
#table-close {
  background: transparent;
  border: none;
  font-size: 28px;
  font-weight: bold;
  line-height: 1;
  color: #666;
  cursor: pointer;
  padding: 0 5px;
}
#table-close:hover {
  color: #000;
}

/* Kontejner tabulky (pro skrolování) */
#table-wrapper {
  overflow: auto; /* Zajištění skrolování tabulky */
  height: 100%;
}
#attribute-table {
  width: 100%;
  border-collapse: collapse;
}
#attribute-table thead {
  position: sticky; /* Přichycená hlavička */
  top: 0;
  background-color: #e9ecef;
  z-index: 10;
}
#attribute-table th, 
#attribute-table td {
  padding: 8px 12px;
  border: 1px solid #dee2e6;
  text-align: left;
  font-size: 13px;
  white-space: nowrap; /* Zabrání zalamování textu v buňkách */
}
#attribute-table th {
  font-weight: 600;
}
#attribute-table tbody tr {
  cursor: pointer;
  transition: background-color 0.1s ease;
}
#attribute-table tbody tr:hover {
  background-color: #f0f8ff;
}
/* Styl pro vybraný řádek */
#attribute-table tbody tr.selected-row {
  background-color: #007bff;
  color: #ffffff;
  font-weight: bold;
}