/* ===== RESET & BASE ===== */
* {
  box-sizing: border-box;
}
body {
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  line-height: 1.6;
  margin: 0;
  padding: 0;
  background-color: #f9f9f9;
  color: #333;
}
h1, h2, h3 {
  color: #ff5419;
  margin-top: 1rem;
}
p {
  margin-bottom: 1rem;
  font-size: 1.1rem;
}
ul {
  padding-left: 1.2em;
  max-width: 100%;
  word-wrap: break-word;
}
li code, code {
  background: #f5f5f5;
  padding: 0 4px;
  border-radius: 3px;
  white-space: normal;
  word-break: break-word;
  display: inline-block;
  max-width: 100%;
  overflow-wrap: break-word;
}

/* ===== HEADER ===== */
.matrix-box {
  position: relative;
  background-color: #000;
  color: #00ff00;
  font-family: "Courier New", monospace;
  box-shadow: 0 0 15px #00ff00;
  padding: 20px 60px;
  height: 80px;
}
.matrix-box .logo {
  position: absolute;
  left: 20px;
  top: 50%;
  transform: translateY(-50%);
  height: 60px;
  object-fit: contain;
}
.text-center {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
}
.text-center h1 {
  margin: 0;
  font-size: 1.8rem;
  color: #00ff00;
}
.text-center p {
  margin: 5px 0 0 0;
  font-size: 1rem;
  text-shadow: 0 0 4px #00ff00;
}
.html-anim {
  color: #00ff00;
  animation: pulse-glow 1.8s infinite ease-in-out;
  font-weight: bold;
  text-shadow: 0 0 5px #00ff00;
}
@keyframes pulse-glow {
  0%, 100% { text-shadow: 0 0 5px #00ff00; }
  50% { text-shadow: 0 0 15px #00ff00, 0 0 25px #00ff00; }
}

/* ===== NAVIGATION ===== */
nav {
  background: linear-gradient(135deg, #0693e3 0%, #003366 100%, #9851e0 100%);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.5rem 1rem;
  top: 80px;
  z-index: 999;
}
.nav-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}
nav a {
  color: #ddd;
  text-decoration: none;
  font-weight: 600;
  padding: 0.4rem 0.8rem;
  border-radius: 4px;
  transition: background-color 0.3s ease;
  font-size: 0.9rem;
  white-space: nowrap;
}
nav a:hover,
nav a.active {
  background-color: black;
  color: #00ff00;
}
nav .home-link:hover {
  transform: scale(1.1);
  box-shadow: 0 0 10px #00ff00;
}
.nav-toggle {
  display: none;
  background: none;
  border: none;
  font-size: 1.5rem;
  color: #fff;
  cursor: pointer;
  margin-left: auto;
}

/* ===== MAIN CONTENT ===== */
main {
  max-width: 900px;
  margin: 2rem auto 3rem;
  padding: 1rem 2rem;
  background: white;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.1);
  border-radius: 8px;
  min-height: 500px;
}
section.chapter { margin-bottom: 2rem; }
article { margin-bottom: 1.5rem; }

/* ===== CODE BLOCKS ===== */
pre, pre code, .language-html {
  background-color: #f4f4f4;
  padding: 1rem;
  border-radius: 6px;
  font-family: monospace;
  white-space: pre-wrap;
  word-break: break-word;
  display: block;
  overflow-x: auto;
  border-left: 4px solid #ccc;
}

/* ===== TABLES ===== */
.table-wrapper {
  width: 100%;
  overflow-x: auto;
  margin: 1rem 0;
  border-radius: 8px;
}
table.html-explained {
  width: 100%;
  min-width: 320px;
  border-collapse: collapse;
  font-size: 1rem;
}
table.html-explained th,
table.html-explained td {
  padding: 0.75rem 1rem;
  border: 1px solid #ddd;
  text-align: left;
  word-break: break-word;
}
table.html-explained thead { background-color: #f0f0f0; }

/* ===== QUIZ & EDITORS ===== */
.quiz-block,
.editor-block {
  background: #f7f7f7;
  border-radius: 8px;
  padding: 1rem;
  margin: 1.5rem 0;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}
.quiz-block button,
.quiz-block select {
  background-color: #4caf50;
  color: white;
  border: none;
  padding: 0.6rem 1.2rem;
  border-radius: 4px;
  cursor: pointer;
  transition: background 0.3s ease;
  margin-top: 0.5rem;
}
.quiz-block button:hover { background-color: #388e3c; }
#quizFeedback, #formatQuizResult { font-weight: bold; margin-top: 0.5rem; }

textarea#tagInput,
#formatInput,
textarea#attributeEditor {
  width: 100%;
  padding: 1rem;
  font-family: monospace;
  border-radius: 6px;
  border: 1px solid #ccc;
  box-sizing: border-box;
  resize: vertical;
}
textarea#tagInput { height: 100px; }
#formatInput { height: 200px; }
textarea#attributeEditor { min-height: 120px; border-radius: 8px; }

.editor-preview-label { margin-top: 0.5rem; font-weight: bold; }
.editor-preview {
  margin-top: 0.5rem;
  padding: 1rem;
  border: 1px dashed #aaa;
  border-radius: 8px;
  background-color: #f9f9f9;
  min-height: 60px;
}
.editor-preview mark { background-color: #fff9a1; padding: 0 0.2rem; }

/* ===== HTML EDITOR ===== */
.html-editor {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 20px;
  background-color: #121212;
  color: #ffffff;
  border-radius: 8px;
}
.html-editor textarea {
  width: 100%;
  height: 200px;
  font-family: monospace;
  font-size: 14px;
  padding: 10px;
  border-radius: 5px;
  border: 1px solid #444;
  background-color: #1e1e1e;
  color: #f8f8f2;
  resize: vertical;
}
.html-editor button {
  padding: 10px 20px;
  font-size: 14px;
  cursor: pointer;
  background-color: #333;
  color: #fff;
  border: 1px solid #555;
  border-radius: 5px;
  transition: background-color 0.3s;
}
.html-editor button:hover { background-color: #444; }
.html-editor iframe {
  width: 100%;
  height: 200px;
  border: 1px solid #444;
  border-radius: 5px;
  background-color: white;
}
.editor-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.4);
  color: white;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  font-size: 1.1rem;
  border-radius: 8px;
  z-index: 10;
  pointer-events: auto;
  animation: fadeIn 1s ease;
  cursor: not-allowed;
  padding: 1rem;
}
.overlay-text {
  flex-basis: 100%;
  font-size: 1rem;
  font-weight: 400;
  color: rgba(255,255,255,0.6);
  margin-bottom: 0.5rem;
  font-style: italic;
  letter-spacing: 0.2px;
  text-shadow: 0 1px 2px rgba(0,0,0,0.5);
}
@keyframes fadeIn { from{opacity:0;} to{opacity:1;} }
.html-editor .upgrade-btn {
  margin-left: 10px;
  padding: 8px 30px;
  background: #ff5419 !important;
  border: none;
  color: white;
  border-radius: 5px;
  font-weight: bold;
  cursor: pointer;
  transition: background 0.3s;
}
.html-editor .upgrade-btn:hover { background: #e64a19 !important; }

/* ===== QUIZ MINI ===== */
#minikviz form {
  background-color: #f9f9f9;
  padding: 1rem;
  border-radius: 8px;
  max-width: 600px;
}
#minikviz ol { padding-left: 1.2rem; }
#minikviz li { margin-bottom: 1.5rem; }
#minikviz input[type="radio"],
#minikviz input[type="checkbox"] { margin-right: 0.5rem; }
#minikviz label.correct { background-color: #d4edda; padding: 0.3rem; border-radius: 4px; }
#minikviz label.incorrect { background-color: #f8d7da; padding: 0.3rem; border-radius: 4px; }
#minikviz #vysledek { font-weight: bold; margin-top: 1rem; }
#minikviz button {
  padding: 0.5rem 1rem;
  font-size: 1rem;
  background-color: #0077cc;
  color: white;
  border: none;
  border-radius: 5px;
  cursor: pointer;
}
#minikviz button:hover { background-color: #005fa3; }

/* ===== FINAL QUIZ ===== */
#finalQuizBlock {
  background-color: #000;
  border: 2px solid #00ff00;
  padding: 1rem 2rem;
  border-radius: 10px;
  max-width: 800px;
  margin: 2rem auto;
  font-family: 'Courier New', Courier, monospace;
  color: #00ff00;
  box-shadow: 0 0 10px #00ff00;
}
#finalQuizBlock h2 {
  font-weight: 700;
  font-size: 1.7rem;
  margin-bottom: 1rem;
  text-shadow: 0 0 10px #00ff00;
  letter-spacing: 2px;
}
#finalQuizBlock #startQuizBtn,
#finalQuizBlock button[type="button"] {
  background-color: #004400;
  color: #00ff00;
  border: 2px solid #00ff00;
  padding: 0.7rem 1.2rem;
  font-size: 1.1rem;
  cursor: pointer;
  border-radius: 5px;
  transition: background-color 0.3s ease, box-shadow 0.3s ease;
  box-shadow: 0 0 5px #00ff00;
  margin-bottom: 1.5rem;
  display: inline-block;
}
#finalQuizBlock #startQuizBtn:hover,
#finalQuizBlock button[type="button"]:hover {
  background-color: #007700;
  box-shadow: 0 0 15px #00ff00;
}
#finalQuizBlock #countdown {
  font-weight: 700;
  font-size: 1.3rem;
  margin-bottom: 1rem;
  text-align: center;
  text-shadow: 0 0 5px #00ff00;
  color: #00ff00;
}
#finalQuizBlock form p {
  font-weight: 700;
  margin-top: 1rem;
  margin-bottom: 0.5rem;
  letter-spacing: 1.2px;
  color: #ff5419;
}
#finalQuizBlock label {
  cursor: pointer;
  user-select: none;
  display: block;
  margin-bottom: 0.3rem;
  transition: color 0.3s ease;
}
#finalQuizBlock label:hover { color: #00ff00; }
#finalQuizBlock #finalQuizResult {
  font-weight: 700;
  margin-top: 1.5rem;
  font-size: 1.2rem;
  text-align: center;
  color: #00ff00;
  text-shadow: 0 0 7px #00ff00;
}

/* ===== OTHER ELEMENTS ===== */
.vsc-icon { height: 1em; vertical-align: middle; margin-right: 6px; transition: transform 0.3s ease; }
summary:hover .vsc-icon { transform: scale(1.2); }
.screenshot {
  transition: transform 0.6s ease-in-out, box-shadow 0.3s ease;
  border-radius: 8px;
  border: 2px solid #ff5419;
  max-width: 100%;
  height: auto;
}
.screenshot:hover {
  transform: scale(1.1);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
  z-index: 2;
}
.responsive-img { max-width: 100%; height: auto; display: block; }
#scrollToTopBtn {
  display: none;
  position: fixed;
  bottom: 20px;
  right: 30px;
  z-index: 99;
  color: #ff5419;
  cursor: pointer;
  font-size: 60px;
  border: none;
  background: none;
}
#scrollToTopBtn:hover { color: var(--primary-red-hover); }
#countdown {
  font-size: 1.5rem;
  font-weight: bold;
  color: #e63946;
  background-color: #011400;
  padding: 10px 20px;
  border-radius: 10px;
  text-align: center;
  width: fit-content;
  margin: 1rem auto;
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
  transition: color 0.3s ease;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
  .matrix-box {
    height: auto;
    padding: 20px;
  }
  .matrix-box .logo {
    position: relative;
    left: auto;
    top: auto;
    transform: none;
    display: block;
    margin: 0 auto 15px auto;
  }
  .text-center {
    position: relative;
    left: auto;
    top: auto;
    transform: none;
  }
  body { font-size: 16px; }
  main { margin: 1rem; padding: 1rem; }
  .nav-links {
    display: none;
    flex-direction: column;
    width: 100%;
    margin-top: 0.5rem;
  }
  .nav-links.show { display: flex; }
  .nav-toggle { display: block; }
  nav { flex-wrap: wrap; }
  table.html-explained { font-size: 0.9rem; }
  table.html-explained th, table.html-explained td { padding: 0.6rem 0.8rem; }
  .quiz-block, .editor-block { padding: 0.75rem; }
  textarea#tagInput { font-size: 0.95rem; }
  .quiz-block button { width: 100%; }
}



