/* Контейнер инструкций */
#instruction_app {
  position: relative;
  width: 100%;
  flex: 1;
  background-color: #e0e0e0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  margin-bottom: 15px;
}

#app_display {
  flex: 1;
  width: 100%;
}

#instruction_app svg {
  width: 100%;
  height: 100%;
  display: block;
}

/* Контейнер панели управления */
#instruction-panel {
  display: flex;
  flex-wrap: wrap; /* добавлено, чтобы кнопки переносились на новую строку */
  justify-content: space-between;
  align-items: center;
  padding: 6px 12px;
  background: #ffeb00;
  color: #523f09;
  border-top: 1px solid #ccc;
  font-family: sans-serif;
}

#left-controls, #right-controls {
  display: flex;
  align-items: center;
  gap: 10px;
}

#right-controls button {
  margin-left: 6px;
}

#step-counter {
  margin: 0 6px;
  font-weight: bold;
}

/* Прогресс */
#progress-bar-container {
  width: 100%;
  height: 6px;
  background: #ddd;
  margin-bottom: 4px;
  border-radius: 3px;
  overflow: hidden;
}

#progress-bar {
  width: 0%; 
  height: 100%;
  background: #4caf50;
  transition: width 0.3s ease;
}

#instruction-panel button {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 7px 12px;
  font-size: 14px;
  background: transparent;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.2s ease;
  color: light-dark(var(--tpl-dark-800),var(--tpl-dark-300));
  font: var(--tpl-font-text-r2);
  flex: 1 1 auto; /* добавлено, чтобы кнопки растягивались */
  min-width: 40px;
  margin: 4px;
}

span#step-counter {
  color: light-dark(var(--tpl-dark-800),var(--tpl-dark-300));
  font: var(--tpl-font-text-r2);
}

#instruction-panel button:hover {
  background-color: #e5d51b;
}

#instruction-panel button.only-icon,
#instruction-panel button:empty,
#fullscreen-btn,
#toggle-sidebar,
#restart-btn,
#share-instruction,
#info-instruction {
  padding: 7px 16px;
}

#instruction-panel i {
  font-size: 16px;
}

#step-counter {
  font-weight: bold;
  margin: 0 5px;
}

/* Галочка */
#checkmark {
  display: none;
  pointer-events: none;
}

#checkmark-path {
  transition: stroke-dashoffset 1s ease;
}

/* Стили для уникальной инструкции */
.instruction-sidebar {
  background: #f9f9f9;
  border: 1px solid #ddd;
  margin-bottom: 20px;
}

.instruction-sidebar .inner ol {
  list-style: none;
  padding-left: 0;
}

.instruction-sidebar .inner li {
  margin: 5px 0;
  position: relative;
  cursor: default;
}

/* Выполненные шаги */
.instruction-sidebar .inner li.completed {
  color: black;
}

/* Активный шаг */
.instruction-sidebar .inner li.active {
  color: black;
  font-weight: bold;
}

/* Невыполненные шаги */
.instruction-sidebar .inner li.pending {
  color: gray;
}

/* Список материалов */
.material-card {
  width: 100%;
  max-width: 600px; /* можно убрать или увеличить */
  margin: 20px auto;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 5px 5px rgba(0,0,0,0.1);
  background: #fff;
  font-family: Arial, sans-serif;
}

.material-image {
  width: 100%;
  display: block;
  object-fit: cover;
}

.material-info {
  padding: 12px 16px;
}

.material-title {
  font-size: 18px;
  font-weight: bold;
  margin: 0 0 8px 0;
  color: #222;
}

.material-meta {
  display: flex;
  justify-content: space-between;
  font-size: 14px;
  color: #555;
}

/* Адаптивность панели для маленьких экранов */
@media (max-width: 900px) {
  #instruction-panel {
    flex-direction: column;
    align-items: stretch;
  }
  
  #left-controls,
  #right-controls {
    width: 100%;
    justify-content: space-around;
    margin-bottom: 4px;
    flex-wrap: wrap;
  }
  
  #instruction-panel button {
    font-size: 12px;
    padding: 6px 8px;
  }
  
  #step-counter {
    margin: 4px 0;
    font-size: 14px;
    text-align: center;
  }
}





/* блок списка справа */
.sidebar-block.instruction-sidebar {
  background: #f5f5f6;
  border-radius: 5px;
  box-shadow: 0 3px 10px rgba(0,0,0,0.08);
  font-family: "Inter", sans-serif;
  transition: all 0.3s ease;
}

.sidebar-block .inner h3 {
  text-align: center;
  color: #444;
  font-weight: 600;
  margin-bottom: 12px;
}

.sidebar-block .inner ol {
  list-style: none;
  padding-left: 0;
}

.sidebar-block .inner li {
  background: #ffffff;
  margin-bottom: 10px;
  padding: 10px 12px 10px 40px;
  border-radius: 5px;
  position: relative;
  color: #333;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

/* Галочка вместо номера */
.sidebar-block .inner li.completed::before {
  content: "✔";
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  width: 22px;
  height: 22px;
  background: #ffeb00;
  color: #333;
  font-weight: bold;
  border-radius: 50%;
  text-align: center;
  line-height: 22px;
  z-index: 1;
}

/* Незавершённые шаги — пустой кружок */
.sidebar-block .inner li:not(.completed)::before {
  content: "";
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  width: 22px;
  height: 22px;
  border: 2px solid #b7b7b7;
  border-radius: 50%;
}

/* Адаптация под мобильные */
@media (max-width: 600px) {
  .sidebar-block.instruction-sidebar {
    width: 100%;
    padding: 14px;
    border-radius: 14px;
  }
  .sidebar-block .inner h3 {
    font-size: 15px;
  }
  .sidebar-block .inner li {
    padding: 8px 10px 8px 36px;
    font-size: 14px;
  }
  .sidebar-block .inner li.completed::before,
  .sidebar-block .inner li:not(.completed)::before {
    width: 20px;
    height: 20px;
    line-height: 20px;
    font-size: 13px;
  }
}




/* HTML обертка */
.instruction-block {
  display: inline-block;
  padding: 15px 15px;
  margin: 15px 5px;
  border-radius: 6px;
  background: #f5f5f69e;
}

.toggle {
  position: relative;
  display: inline-block;
  width: 46px;
  height: 26px;
}
.toggle input { display:none; }
.slider {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background-color: #ccc;
  border-radius: 26px;
  transition: 0.4s;
}
.slider:before {
  content: "";
  position: absolute;
  width: 20px; height: 20px;
  left: 3px; bottom: 3px;
  background-color: white;
  border-radius: 50%;
  transition: 0.4s;
}
input:checked + .slider {
  background-color: rgba(255, 235, 0, 0.5);
}
input:checked + .slider:before {
  transform: translateX(20px);
}
.toggle-label-text {
  font-weight: bold;
  font-size: 14px;
}

.instruction-block ol {
  margin: 6px 0 0 20px;
  padding: 0;
}
.instruction-block li {
  margin: 4px 0;
}
label.toggle-container {
    cursor: pointer;
}