/* CSS reset */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Základní stylování */
body {
    font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    margin: 0;
    padding: 0;
    background-color: #f4f4f4;
}

#menu {
    max-width: min(1440px, calc(100% - 32px));
    margin: 28px auto 0 auto;
}

#menu .public-status-slot { display: inline-flex; align-items: center; min-width: 0; }
#menu .public-status-fallback {
    display: inline-flex; align-items: center; min-height: 34px;
    border: 1px solid rgba(37, 99, 235, .20); border-radius: 999px;
    padding: 6px 10px; background: #eff6ff; color: #1f2937;
    font-size: 13px; font-weight: 700; line-height: 1.25; text-decoration: none;
}
#menu .public-status-fallback:hover { background: #dbeafe; color: #1d4ed8; }

/* Progress */
.progress-row{
    max-width: min(1200px, calc(100% - 24px));
    margin: 10px auto 8px auto;
    padding: 10px 12px;
    border-radius: 14px;
    background: #fff;
    border: 1px solid rgba(0,0,0,0.08);
}
.progress-text{font-weight:700; margin-bottom:8px;}
.progress-track{height:10px; background: rgba(0,0,0,0.08); border-radius:999px; overflow:hidden;}
.progress-fill{height:100%; background: rgba(0,0,0,0.35);}

.test-title{
    max-width: min(1200px, calc(100% - 24px));
    margin: 0 auto 8px auto;
}

/* Result bar (fixed, does not move layout) */
.result-bar{
    position: fixed;
    top: 72px;
    left: 50%;
    transform: translateX(-50%);
    width: min(980px, calc(100% - 24px));
    background: rgba(255,255,255,0.98);
    border: 1px solid rgba(0,0,0,0.14);
    border-radius: 14px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.16);
    z-index: 4500;
    padding: 10px 12px;
    display: flex;
    gap: 10px;
    align-items: center;
    justify-content: space-between;
}
.result-title{font-weight:800;}
.result-sub{opacity:0.9; font-size: 14px; margin-top:2px;}
.result-bar__right{display:flex; gap:8px; flex-wrap:wrap; justify-content:flex-end;}
.result-btn{padding: 10px 12px; border-radius: 12px; border: 1px solid rgba(0,0,0,0.18); background:#fff; cursor:pointer; min-height:44px;}
.result-btn:hover{background: rgba(0,0,0,0.04);}

@media (max-width: 520px){
    .result-bar{top: 64px;}
    .result-sub{font-size: 13px;}
}

/* Toast */
.toast{
    position: fixed;
    left: 50%;
    transform: translateX(-50%);
    bottom: 16px;
    width: min(720px, calc(100% - 24px));
    background: rgba(0,0,0,0.82);
    color: #fff;
    border-radius: 14px;
    padding: 12px 14px;
    z-index: 4800;
    box-shadow: 0 10px 28px rgba(0,0,0,0.28);
    font-size: 15px;
}

h1, h2 {
    text-align: center;
    color: #333;
}

#game-container {
    text-align: center;
    margin: auto;
    max-width: 800px;
    padding: 20px;
    background-color: #f9f9f9;
    border-radius: 10px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.image-container {
    position: relative;
    width: 100%;
    max-width: 800px;
    margin: auto;
}

img {
    width: 100%;
    height: auto;
}

/* Stylování menu */
.header {
    background-color: #4CAF50;
    padding: 15px;
    text-align: center;
}

.main-title a {
    color: white;
    text-decoration: none;
}

.navbar {
    margin-top: 10px;
}

.navbar .nav-link {
    color: white;
    text-decoration: none;
    margin: 0 10px;
    font-weight: bold;
}

.navbar .nav-link:hover {
    text-decoration: underline;
}

.navbar .nav-link.is-active {
    text-decoration: underline;
    text-decoration-thickness: 2px;
    text-underline-offset: 4px;
}

/* legacy overlay-message (nepoužívá se, necháno kvůli kompatibilitě) */
.overlay-message{display:none;}
/* Vysvětlení - modal */
.explanation-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
    z-index: 5000;
    padding: 16px;
}

.explanation-panel {
    max-width: 860px;
    margin: 6vh auto 0 auto;
    background: #fff;
    color: #111;
    border-radius: 14px;
    overflow: hidden;
    box-shadow: 0 18px 60px rgba(0,0,0,0.35);
}

.explanation-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 14px;
    border-bottom: 1px solid rgba(0,0,0,0.08);
}

.explanation-title {
    font-weight: 700;
}

.explanation-close {
    border: none;
    background: transparent;
    font-size: 18px;
    cursor: pointer;
    padding: 6px 10px;
    border-radius: 10px;
}

.explanation-close:hover {
    background: rgba(0,0,0,0.06);
}

.explanation-text {
    padding: 14px;
    font-size: 16px;
    line-height: 1.45;
    white-space: pre-line;
    max-height: 70vh;
    overflow: auto;
}

#overlay-text {
    margin: 0;
    font-size: 16px;
}

/* Overlay pro oblasti s chybou */
.overlay {
    position: absolute;
    background-color: transparent;
    border: none;
    cursor: pointer;
}

/* Rámeček pro správné označení */
.overlay.highlighted {
    border: 2px solid green;
    background-color: rgba(0, 255, 0, 0.3);
}


.overlay.missed {
    border: 2px dashed #ff9800;
    background-color: rgba(255, 152, 0, 0.18);
}

/* Rámeček pro nápovědu */
.overlay.hint {
    border: 1px dashed red;
    background-color: rgba(255, 0, 0, 0.1);
}

/* Tooltip pro náhled URL zobrazovaný na hover */
.tooltip-url {
    /* URL se teď zobrazuje přímo v tooltipu (aby se nepřekrývaly 2 bubliny) */
    display: none;
}

/* Error Tooltip (Trvalý) */
.error-tooltip {
    visibility: visible;
    position: absolute;
    background-color: #ffcccc;
    color: #333;
    padding: 5px;
    border-radius: 4px;
    font-size: 12px;
    white-space: nowrap;
    z-index: 11;
    top: -30px;
    left: 50%;
    transform: translateX(-50%);
}

/* Preview Tooltip (Zobrazí se při najetí myší) */
.preview-tooltip {
    visibility: visible;
    position: absolute;
    background-color: #333;
    color: #fff;
    padding: 7px 9px;
    border-radius: 4px;
    font-size: 13px;
    white-space: normal;
    min-width: 220px;
    max-width: min(92vw, 720px);
    overflow-wrap: anywhere;
    word-break: break-word;
    z-index: 11;
    top: -36px;
    left: 50%;
    transform: translateX(-50%);
}

/* řádky v tooltipu */
.preview-tooltip .tt-line { font-weight: 600; margin-bottom: 2px; }
.preview-tooltip .tt-url { font-weight: 400; opacity: 0.95; }

/* Stylování tlačítek pro rozhodnutí o pravosti */
.button-container {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin: 20px 0;
}

.button-container button {
    background-color: #007BFF;
    color: white;
    border: none;
    padding: 10px 15px;
    font-size: 16px;
    font-weight: bold;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.button-container button:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  filter: grayscale(15%);
}

.button-container button:hover {
    background-color: #0056b3;
}

/* Stylování společných tlačítek (menší a jemnější barva) */
.zoom-controls {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 10px;
}

.zoom-controls button {
    background-color: #f0f0f0;
    color: #333;
    border: 1px solid #ccc;
    padding: 8px 12px;
    font-size: 14px;
    border-radius: 4px;
    cursor: pointer;
}

/* === ORDER STEPS (praktické řazení kroků) === */
.order-steps-container {
    max-width: 900px;
    margin: 0 auto;
    padding: 12px;
}

.order-steps-prompt {
    font-size: 18px;
    line-height: 1.4;
    margin: 10px 0 14px;
}

.order-steps-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
}

@media (min-width: 700px) {
    .order-steps-grid {
        grid-template-columns: 1fr 1fr;
    }
}

.order-step-card {
    display: flex;
    align-items: center;
    gap: 10px;
    text-align: left;
    padding: 12px 12px;
    border: 2px solid #ddd;
    border-radius: 10px;
    background: #fff;
    cursor: pointer;
    font-size: 16px;
}

.order-step-card:hover {
    border-color: #aaa;
}

.order-step-card.selected {
    border-color: #2e7d32;
}

.order-step-badge {
    width: 28px;
    height: 28px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    background: #f4f4f4;
    flex: 0 0 auto;
}

.order-step-card.selected .order-step-badge {
    background: #2e7d32;
    color: #fff;
}

.order-steps-hint {
    margin-top: 10px;
    font-size: 14px;
    color: #555;
}

/* Choose option (výběr nejlepší možnosti) */
.choose-option-container {
    max-width: 980px;
    margin: 18px auto;
    padding: 10px;
}

.choose-option-prompt {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 12px;
}

.choose-option-list {
    display: grid;
    gap: 10px;
}

.choose-option-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 12px;
    border: 1px solid rgba(0,0,0,0.12);
    border-radius: 12px;
    background: #fff;
    cursor: pointer;
}

.choose-option-item:hover {
    border-color: rgba(0,0,0,0.25);
}

.choose-option-item input {
    margin-top: 3px;
}

.zoom-controls button:hover {
    background-color: #e0e0e0;
}



/* Výsledková stránka */
#results-container {
    max-width: 800px;
    margin: 20px auto;
    padding: 20px;
    background-color: #fff;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
}

#results-container ul {
    list-style-type: none;
    padding: 0;
}

#results-container li {
    font-size: 18px;
    margin: 10px 0;
}

/* Zakázání výběru textu a ochrana */
body, button, h1, h2, p {
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

/* Styl pro centrální kontejner formuláře */
.form-container {
    max-width: 400px;
    margin: 40px auto;
    padding: 20px;
    background-color: #fff;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
    text-align: center;
}

.form-container label {
    display: block;
    font-size: 1.2em;
    margin: 10px 0 5px;
    color: #333;
}

/* Styl pro centrální kontejner formuláře HLP */
.formhlp-container {
    max-width: 800px;
    margin: 40px auto;
    padding: 20px;
    background-color: #fff;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
    text-align: center;
}

.formhlp-container label {
    display: block;
    font-size: 1.2em;
    margin: 10px 0 5px;
    color: #333;
}


  /*
.form-container select {
    width: 100%;
}


   */



/* Styl pro centrální kontejner formuláře */


.form-container select {
    width: 100%;
    padding: 10px;
    font-size: 1.1em;
    margin-bottom: 15px;
    border: 1px solid #ccc;
    border-radius: 5px;
}

/* Styl pro zvětšené tlačítko start */
.start-button {
    display: block;
    width: 100%;
    padding: 15px;
    font-size: 1.2em;
    font-weight: bold;
    color: white;
    background-color: #4CAF50;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.start-button:hover {
    background-color: #45a049;
}




.task-instruction-box {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: #f0f0f0;
    border: 1px solid #ccc;
    padding: 10px;
    border-radius: 5px;
    margin: 10px 0;
    font-size: 1.1em;
    color: #333;
}

.task-instruction, #answerCount {
    margin: 0;
}

/* Styl pro počet správných odpovědí 
#answerCount {
    font-size: 16px;
    color: #333;
    text-align: center;
    margin-top: 15px;
}

*/


.result-icon.success {
    color: #4CAF50;
    font-size: 1.2em;
}

.result-icon.fail {
    color: #F44336;
    font-size: 1.2em;
}

.test-id {
    font-size: 0.9em;
    color: #666;
}

.test-number {
    font-weight: bold;
    color: #555;
}

.results-list li.fail {
    border-left: 5px solid #F44336;
}

.results-list li.success {
    border-left: 5px solid #4CAF50;
}

.results-list li {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 15px;
    margin: 10px 0;
    border-radius: 8px;
    background-color: #fff;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    font-size: 1em;
    color: #333;
}

.results-list {
    list-style-type: none;
    padding: 0;
    margin: 20px 0;
}


/* Styl pro kontejner nápovědy */
.help-container {
    max-width: 800px; /* Zvětšení maximální šířky */
    margin: 20px auto; /* Vycentrování a odsazení od horního okraje */
    padding: 20px; /* Vnitřní odsazení pro lepší čitelnost */
    background-color: #ffffff; /* Světlé pozadí */
    border-radius: 10px; /* Zaoblené rohy */
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1); /* Lehké stínování */
    font-size: 1.1em; /* Větší písmo pro lepší čitelnost */
    color: #333; /* Barva textu */
    line-height: 1.6; /* Lepší čitelnost textu */
}

.help-container h1,
.help-container h2,
.help-container p {
    text-align: left; /* Zarovnání textu doleva */
    margin-bottom: 15px; /* Odsazení mezi bloky textu */
}

.help-container ul {
    margin-left: 20px; /* Odsazení seznamů od levého okraje */
    list-style-type: disc; /* Použití tečky jako odrážky */
}


/* Přizpůsobení pro mobilní zařízení */
@media (max-width: 600px) {
    .form-container {
        width: 90%;
    }

    .form-container label, .form-container select, .start-button {
        font-size: 1.1em;
    }

    .start-button {
        padding: 12px;
    }
}



/* --- Responsive improvements (v5) --- */
.button-container{
  display:flex;
  flex-wrap:wrap;
  gap:10px;
  justify-content:center;
  margin: 10px auto 0 auto;
  max-width: 980px;
  padding: 0 10px;
}
.button-container button{
  min-height: 44px;
  padding: 10px 14px;
  border-radius: 12px;
  font-size: 16px;
}
.zoom-controls{
  display:flex;
  flex-wrap:wrap;
  gap:10px;
  justify-content:center;
  margin: 12px auto 0 auto;
  max-width: 980px;
  padding: 0 10px;
}
.zoom-controls button{min-height:44px;border-radius:12px;}
@media (max-width: 640px){
  .button-container button, .zoom-controls button{flex:1 1 45%;}
  .choose-option-item{padding: 12px;}
  .choose-option-prompt, .order-steps-prompt{font-size:16px;}
}

/* Index quick-start cards */
.quick-start{
  max-width: 980px;
  margin: 10px auto;
  padding: 0 12px;
}
.quick-grid{
  display:grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
@media (max-width: 640px){
  .quick-grid{grid-template-columns: 1fr;}
}
.quick-card{
  border: 1px solid rgba(0,0,0,0.14);
  border-radius: 14px;
  padding: 14px;
  background: #fff;
  box-shadow: 0 6px 18px rgba(0,0,0,0.06);
  cursor:pointer;
  text-align:left;
}
.quick-card h3{margin:0 0 6px 0;font-size:18px;}
.quick-card p{margin:0;color:#444;font-size:14px;line-height:1.35;}
.quick-card:active{transform: translateY(1px);}

.advanced-toggle{
  margin: 14px auto 0 auto;
  max-width: 980px;
  padding: 0 12px;
  text-align:center;
}
.advanced-panel{
  max-width: 980px;
  margin: 8px auto 0 auto;
  padding: 12px;
  border: 1px solid rgba(0,0,0,0.12);
  border-radius: 14px;
  background: rgba(255,255,255,0.95);
}
.advanced-panel label{display:block;margin-top:10px;font-weight:600;}
.advanced-panel select{width:100%;min-height:44px;border-radius:12px;padding:8px;font-size:16px;}

.choose-option-item.is-selected{border-color: rgba(0,0,0,0.45); box-shadow: 0 0 0 2px rgba(0,0,0,0.08) inset;}


/* simuWEB floating tooltip (no layout shift) */
.browser-content{ position: relative; }
.floating-tip{
  position:absolute;
  z-index: 50;
  max-width: 360px;
  background: rgba(0,0,0,.78);
  color: #fff;
  padding: 8px 10px;
  border-radius: 10px;
  font-size: 14px;
  line-height: 1.25;
  box-shadow: 0 8px 24px rgba(0,0,0,.18);
}
.floating-tip strong{ color:#fff; }


/* simuWEB marking bar */
.markbar { padding: 12px 16px; border: 1px solid #e6e6e6; border-radius: 12px; background: #fff; }
.markbar.complete { border-color: #2ecc71; }
.markbar .markcount { font-weight: 600; }
