/* ========================================
   Progress Tracker — Отслеживание прогресса обучения
   Design tokens, blue progress bars, card system
   ======================================== */

/* ---------- Progress bar in sidebar ---------- */
.potok-progress-bar {
  margin: 0.4rem 0.8rem 0.6rem;
  padding: 0.8rem 0.6rem;
  border-radius: 12px;
  background-color: var(--bg-card);
  border: 1px solid var(--border-subtle);
  font-size: 0.8rem;
  line-height: 1.4;
  transition: background-color 0.3s ease, border-color 0.3s ease;
}

.potok-progress-bar__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
}

.potok-progress-bar__title {
  font-weight: 700;
  font-size: 0.78rem;
  color: var(--text-heading);
  letter-spacing: 0.02em;
}

.potok-progress-bar__stat {
  font-weight: 600;
  font-size: 0.75rem;
  color: var(--accent-orange);
  font-variant-numeric: tabular-nums;
}

.potok-progress-bar__track {
  position: relative;
  width: 100%;
  height: 8px;
  border-radius: 4px;
  background-color: var(--bg-hover);
  overflow: hidden;
}

/* Accent-orange gradient progress fill */
.potok-progress-bar__fill {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  width: 0%;
  border-radius: 4px;
  background: linear-gradient(90deg, var(--accent-orange), #F59E0B);
  transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 0 6px rgba(249, 115, 22, 0.3);
}

.potok-progress-bar__percent {
  text-align: center;
  margin-top: 0.35rem;
  font-weight: 700;
  font-size: 0.85rem;
  color: var(--accent-orange);
  font-variant-numeric: tabular-nums;
  transition: color 0.3s ease;
}

/* Reset button */
.potok-progress-reset {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  margin-top: 0.5rem;
  padding: 0.3rem 0.6rem;
  border: 1px solid var(--border-subtle);
  border-radius: 6px;
  background: transparent;
  color: var(--text-secondary);
  font-size: 0.72rem;
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: inherit;
}

.potok-progress-reset:hover {
  background-color: var(--bg-hover);
  color: var(--text-main);
  border-color: var(--border-default);
}

.potok-progress-reset:focus-visible {
  outline: 2px solid var(--accent-orange);
  outline-offset: 1px;
}

/* ---------- Lesson checkboxes in content ---------- */
.potok-lesson-wrapper {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  padding: 0.35rem 0.5rem;
  margin: 0.15rem 0;
  border-radius: 8px;
  transition: background-color 0.2s ease;
}

.potok-lesson-wrapper:hover {
  background-color: var(--bg-hover);
}

.potok-lesson-wrapper:has(.potok-lesson:checked) {
  background-color: rgba(249, 115, 22, 0.06);
  box-shadow: inset 0 0 12px rgba(249, 115, 22, 0.08);
}

.potok-lesson-wrapper:has(.potok-lesson:checked):hover {
  background-color: rgba(249, 115, 22, 0.1);
  box-shadow: inset 0 0 16px rgba(249, 115, 22, 0.12);
}

.potok-lesson {
  flex-shrink: 0;
  margin-top: 0.25rem;
  width: 18px;
  height: 18px;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  background-color: var(--bg-hover);
  border: 2px solid var(--border-subtle);
  border-radius: 4px;
  transition: background-color 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease, transform 0.15s ease;
  position: relative;
}

.potok-lesson:hover {
  border-color: var(--accent-orange);
}

.potok-lesson:checked {
  background-color: var(--accent-orange);
  border-color: var(--accent-orange);
  box-shadow: 0 0 8px rgba(249, 115, 22, 0.5), 0 0 16px rgba(249, 115, 22, 0.3);
  transform: scale(1.15);
}

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

.potok-lesson-label {
  flex: 1;
  cursor: pointer;
  font-size: 0.92em;
  line-height: 1.5;
  color: var(--text-main);
  transition: color 0.2s ease;
}

.potok-lesson-label.done {
  text-decoration: line-through;
  opacity: 0.5;
  color: var(--text-secondary);
}

/* ---------- Fade-in animation ---------- */
@keyframes potok-fade-in {
  from {
    opacity: 0;
    transform: translateY(-6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.potok-progress-bar {
  animation: potok-fade-in 0.4s ease both;
}

/* ---------- Mobile ---------- */
@media screen and (max-width: 59.9375em) {
  .potok-progress-bar {
    margin: 0.3rem 0.5rem 0.4rem;
    padding: 0.6rem 0.5rem;
  }

  .potok-progress-bar__track {
    height: 6px;
  }

  .potok-progress-bar__percent {
    font-size: 0.78rem;
  }
}

/* ---------- Toast notification ---------- */
.potok-toast {
  position: fixed;
  bottom: 1.5rem;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  padding: 0.6rem 1.2rem;
  border-radius: 10px;
  background-color: var(--accent-orange);
  color: #fff;
  font-size: 0.82rem;
  font-weight: 600;
  opacity: 0;
  pointer-events: none;
  z-index: 100;
  transition: opacity 0.3s ease, transform 0.3s ease;
  box-shadow: 0 4px 20px rgba(249, 115, 22, 0.3);
}

.potok-toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}
