/* === ZÁKLADNÍ NASTAVENÍ STRÁNKY === */
html, body {
  height: 100%;
  margin: 0;
  padding: 0;
  font-family: 'Poppins', sans-serif;
  background: #f4f4f4;
  color: #222;
  display: flex;
  flex-direction: column; /* zajistí, že footer zůstane dole */
}

/* === HLAVIČKA === */
header {
  display: flex;
  align-items: center;
 
  gap: 20px;
  width: 100%;
  max-width: 1000px;
  margin: 50px auto 30px auto;
  flex-wrap: wrap; /* na menších displejích se zarovná pod sebe */
}

/* logo vlevo */
.header-left img.logo {
  height: 50px;
  width: auto;
  display: block;
}

/* textová část vpravo */
.header-right {
  display: flex;
  flex-direction: column;
  justify-content: center;
  text-align: left;
 
}

/* hlavní nadpis */
.header-right h1 {
  font-size: 1.6rem;
  color: rgb(9, 16, 75);
  margin: 0;
  padding: 0;
  line-height: 1.2;
}

/* podnadpis */
.header-right h2.subtitle {
  font-size: 1rem;
  font-weight: 400;
  color: #555;
  margin-top: 5px;
  line-height: 1.4;
}

/* === HLAVNÍ OBSAH === */
main {
  flex: 1; /* zabere zbytek prostoru mezi headerem a footerem */
  width: 100%;
  max-width: 1000px;
  margin: 0 auto;
  background: #fff;
  padding: 20px 30px 30px 30px;
  border-radius: 15px;
  box-shadow: 0 0 10px rgba(49, 0, 82, 0.05);
  box-sizing: border-box;
}

/* --- POPIS A VYSVĚTLENÍ --- */
.explanation {
  margin-top: 50px;
  font-size: 0.95rem;
  color: #333;
  line-height: 1.6;
}

.explanation h3 {
  margin-top: 0;
  color: rgb(9, 16, 75);
  font-size: 1.1rem;
  border-bottom: 1px solid #ccc;
  padding-bottom: 4px;
}

.explanation p {
  margin-bottom: 1em;
  font-size: 0.8rem;
}

.explanation a {
  color: rgb(9, 16, 75);
  text-decoration: none;
  border-bottom: 1px dotted rgb(9, 16, 75);
}

.explanation a:hover {
  color: rgb(20, 30, 120);
  border-bottom: 1px solid rgb(20, 30, 120);
}

/* === OVLÁDACÍ PANEL === */
.controls {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 1em;
  margin-bottom: 20px;
}

.controls label {
  font-weight: bold;
  color: #333;
}

.controls select,
.controls button {
  padding: 6px 10px;
  border-radius: 6px;
  border: 1px solid #ccc;
  background: #fafafa;
  cursor: pointer;
  font-size: 0.95rem;
}

.controls button {
  background: rgb(9, 16, 75);
  color: white;
  border: none;
  transition: background 0.2s ease;
}

.controls button:hover {
  background: rgb(20, 30, 120);
}

/* === GRAF === */
.chart-container {
  width: 100%;
  margin: 0;
}

/* === POSUVNÍK (Zoom) === */
.range-control {
  text-align: center;
  margin-top: 15px;
}

#rangeX {
  width: 150px;
  margin-left: 8px;
  vertical-align: middle;
}

#rangeX-value {
  display: inline-block;
  min-width: 40px;
  text-align: right;
  color: #333;
  font-weight: 500;
}

/* === Tlačítko aktualizace měřených dat === */
#refresh-measured {
  background-color: #0077cc;
  color: white;
  border: none;
  border-radius: 6px;
  padding: 6px 12px;
  font-size: 0.9rem;
  cursor: pointer;
  transition: background-color 0.2s ease;
  margin-left: 10px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

#refresh-measured:hover {
  background-color: #005fa3;
}

#refresh-measured:disabled {
  background-color: #ccc;
  cursor: not-allowed;
}


/* === PATIČKA === */
footer {
  background: #f4f4f4;
  color: #424242;
  text-align: center;
  padding: 10px 0;
  font-size: 0.6rem;
  width: 100%;
  box-sizing: border-box;
}

/* === RESPONSIVITA === */

/* ✅ iPhone 12 Pro – viewport 375 × 812 px */
@media only screen 
  and (min-device-width: 370px) 
  and (max-device-width: 390px)
  and (orientation: portrait) {

  body {
    font-size: 16px;
    padding: 0;
  }

  header {
    flex-direction: column;
    margin: 10px auto;
    text-align: center;
    gap: 5px;
  }

  .header-left img.logo {
    height: 40px;
    margin-top: 25px;
    margin-bottom: 6px;
  }

  .header-right {
    text-align: center;
  }

  .header-right h1 {
    font-size: 1.3rem;
  }

  .header-right h2.subtitle {
    font-size: 0.6rem;
  }

  main {
    width: 94%;
    padding: 15px 15px 25px 15px;
    border-radius: 12px;
  }

  .controls {
    flex-direction: column;
    align-items: stretch;
    gap: 0.8em;
  }

  .controls select,
  .controls button {
    width: 100%;
    font-size: 1rem;
  }

  .range-control {
    margin-top: 12px;
  }

  #rangeX {
    width: 100%;
    margin: 10px 0;
  }

  footer {
    font-size: 0.45rem;
    padding: 8px 0;
  }
}

/* ✅ Obecná responsivita pro tablety a menší notebooky */
@media (max-width: 768px) {
  main {
    padding: 15px 20px 25px 20px;
  }

  header {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }

  .header-left img.logo {
    height: 45px;
    margin-bottom: 8px;
  }

  .header-right h1 {
    font-size: 1.4rem;
  }

  .header-right h2.subtitle {
    font-size: 0.95rem;
  }

  .controls {
    flex-direction: column;
    gap: 0.8em;
  }

  .controls label {
    width: 100%;
  }

  .controls select, 
  .controls button {
    width: 100%;
  }
}
