/* =========================================================
   STIILIFAIL — Arvutiõpetuse tundide leht
   Teema: terminal / käsurida, sest tegemist on
   informaatikatunniga
   ========================================================= */

:root {
  --bg: #0b0e14;
  --bg-panel: #11151c;
  --bg-panel-2: #161b24;
  --border: #232b38;
  --text: #e6edf3;
  --muted: #7d8a9c;
  --accent: #39d98a;
  --accent-dim: #1c5c3d;
  --amber: #ffb454;
  --red: #ff6b6b;
  --font-mono: "JetBrains Mono", "Consolas", monospace;
  --font-body: "Inter", "Segoe UI", sans-serif;
  --radius: 10px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  line-height: 1.5;
  position: relative;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* Kerge triibuline kate, mis annab "vana ekraani" tunde */
.scanlines {
  pointer-events: none;
  position: fixed;
  inset: 0;
  background: repeating-linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.015) 0px,
    rgba(255, 255, 255, 0.015) 1px,
    transparent 1px,
    transparent 3px
  );
  z-index: 50;
}

/* ============ PÄIS / TERMINAL ============ */

.terminal {
  border-bottom: 1px solid var(--border);
  background:
    radial-gradient(ellipse 900px 400px at 20% -10%, rgba(57, 217, 138, 0.10), transparent 60%),
    var(--bg-panel);
}

.terminal-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 20px;
  border-bottom: 1px solid var(--border);
}

.dot {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  display: inline-block;
}
.dot-red { background: #ff5f56; }
.dot-yellow { background: #ffbd2e; }
.dot-green { background: #27c93f; }

.terminal-title {
  margin-left: 8px;
  font-family: var(--font-mono);
  font-size: 12.5px;
  color: var(--muted);
}

.terminal-body {
  max-width: 780px;
  margin: 0 auto;
  padding: 40px 24px 56px;
}

.line {
  font-family: var(--font-mono);
  font-size: 14px;
  color: var(--muted);
  margin: 0 0 24px;
}

.prompt { color: var(--accent); }
.colon { color: var(--muted); }
.path { color: #7fb4ff; }
.dollar { color: var(--muted); margin-right: 8px; }

#typed {
  color: var(--text);
}

.cursor {
  display: inline-block;
  color: var(--accent);
  animation: blink 1s steps(1) infinite;
}

@keyframes blink {
  50% { opacity: 0; }
}

.welcome {
  font-family: var(--font-mono);
  font-size: clamp(28px, 5vw, 42px);
  font-weight: 700;
  margin: 0 0 12px;
  letter-spacing: -0.5px;
}

.accent {
  color: var(--accent);
}

.subtitle {
  color: var(--muted);
  font-size: 16px;
  margin: 0;
}

/* ============ SISU ============ */

.wrap {
  max-width: 780px;
  margin: 0 auto;
  padding: 40px 24px 60px;
}

/* Edenemise paneel */

.progress-panel {
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
  margin-bottom: 24px;
}

.progress-info {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 10px;
  font-family: var(--font-mono);
  font-size: 13px;
}

.progress-label {
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 1px;
  font-size: 11px;
}

.progress-count {
  color: var(--text);
}

.progress-track {
  height: 8px;
  border-radius: 999px;
  background: var(--bg);
  border: 1px solid var(--border);
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--accent-dim), var(--accent));
  transition: width 0.4s ease;
}

/* Otsing */

.search-row {
  position: relative;
  margin-bottom: 32px;
}

.search-icon {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--accent);
  font-family: var(--font-mono);
  font-weight: 700;
  pointer-events: none;
}

#search {
  width: 100%;
  padding: 13px 16px 13px 36px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--bg-panel);
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 14px;
}

#search::placeholder {
  color: var(--muted);
}

#search:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

.section-heading {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--muted);
  text-transform: none;
  letter-spacing: 0.5px;
  margin: 0 0 14px;
}

/* Tundide nimekiri */

.lessons {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.lesson details {
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.lesson details[open] {
  border-color: var(--accent-dim);
}

.lesson summary {
  list-style: none;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 18px;
  cursor: pointer;
}

.lesson summary::-webkit-details-marker {
  display: none;
}

.lesson summary:hover {
  background: var(--bg-panel-2);
}

.lesson summary:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: -2px;
}

.lesson-num {
  font-family: var(--font-mono);
  color: var(--muted);
  font-size: 13px;
  width: 24px;
  flex-shrink: 0;
}

.lesson-main {
  flex: 1;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 12px;
  min-width: 0;
}

.lesson-title {
  font-weight: 600;
  font-size: 15.5px;
}

.lesson-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--muted);
}

.tag {
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.3px;
}

.tag-easy { background: rgba(57, 217, 138, 0.15); color: var(--accent); }
.tag-mid { background: rgba(255, 180, 84, 0.15); color: var(--amber); }
.tag-hard { background: rgba(255, 107, 107, 0.15); color: var(--red); }

.done-toggle {
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--muted);
  cursor: pointer;
  flex-shrink: 0;
  padding: 4px 8px;
  border-radius: 6px;
}

.done-toggle:hover {
  background: var(--bg);
}

.done-check {
  accent-color: var(--accent);
  width: 15px;
  height: 15px;
}

.lesson-content {
  padding: 0 18px 20px 58px;
  color: var(--muted);
  font-size: 14.5px;
}

.lesson-content p {
  margin: 0 0 14px;
}

.open-link {
  color: var(--accent);
  text-decoration: none;
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 600;
}

.open-link:hover,
.open-link:focus-visible {
  text-decoration: underline;
}

.lesson.done .lesson-title {
  color: var(--muted);
  text-decoration: line-through;
  text-decoration-color: var(--accent-dim);
}

.no-results {
  text-align: center;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 14px;
  padding: 40px 0;
}

/* Jalus */

.site-footer {
  text-align: center;
  padding: 30px 20px 40px;
  color: var(--muted);
  font-size: 12.5px;
  font-family: var(--font-mono);
  border-top: 1px solid var(--border);
}

/* ============ MOBIILNE ============ */

@media (max-width: 560px) {
  .lesson summary {
    flex-wrap: wrap;
  }
  .lesson-content {
    padding-left: 18px;
  }
  .done-toggle {
    order: 3;
    width: 100%;
    padding-left: 40px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  .cursor {
    animation: none;
  }
  .progress-fill {
    transition: none;
  }
}
