/* Анимации */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

body {
  margin: 0;
  font-family: 'Segoe UI', Tahoma, sans-serif;
  display: flex;
  background: #F0F4F8;
}

pre {overflow-x: auto;}

/* Стилизация скролла */
nav::-webkit-scrollbar, pre::-webkit-scrollbar { width: 6px; }
nav::-webkit-scrollbar-track, pre::-webkit-scrollbar-track { background: transparent; }
nav::-webkit-scrollbar-thumb, pre::-webkit-scrollbar-thumb { background: #66FCF1; border-radius: 3px; }

nav {
  width: 220px;
  background: #1F2833;
  color: #C5C6C7;
  display: flex;
  flex-direction: column;
  transition: width 0.3s;
  height: 100vh;
  overflow-y: auto;
}

nav h2 {
  margin: 20px;
  font-size: 16px;
  text-transform: uppercase;
  letter-spacing: 1px;
}

#needSub {
    padding: 10px 20px;
    background: #07090c;
    color: #fff;
}

#needSub a.sub_link {color: #c4c4c4;}
#needSub a.sub_link:hover {color: #b4b4b4;text-decoration: none}

.back-btn { margin: 20px; padding: 6px 12px; text-align: center; text-decoration: none; font-size: 14px; border: none; border-radius: 4px; background: #66FCF1; color: #0B0C10; cursor: pointer; transition: background 0.3s; }
.back-btn:hover { background: #45A29E; }

.languages, .questions {
  list-style: none;
  padding: 0;
  margin: 0 20px;
}

.languages li, .questions li {
  padding: 10px;
  margin-bottom: 8px;
  border-radius: 4px;
  cursor: pointer;
  transition: background 0.3s, transform 0.3s;
  opacity: 0.8;
  animation: fadeInUp 0.4s ease forwards;
}

.languages li:nth-child(n) { animation-delay: calc(0.05s * var(--i)); }
.questions li:nth-child(n) { animation-delay: calc(0.03s * var(--i)); }

.languages li:hover, .languages li.active {
  background: #C5C6C7;
  color: #1F2833;
  transform: translateX(5px);
  opacity: 1;
}

.questions li:hover, .questions li.active {
  background: rgba(197,198,199,0.3);
  color: #1F2833;
  transform: translateX(5px);
  opacity: 1;
}

.questions {
  flex: 1;
  margin-bottom: 20px;
}

main {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.question-area {
  width: 100%;
  max-width: 600px;
  background: #FFFFFF;
  border-radius: 10px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
  padding: 20px;
  animation: fadeInUp 0.5s ease;
  position: relative;
}

#question-title {
  margin: 0 0 10px;
  font-size: 20px;
  color: #0B0C10;
}

#question-text {
  font-size: 16px;
  color: #0B0C10;
  line-height: 1.5;
}

#answer-btn {
  margin-top: 20px;
  padding: 12px 30px;
  font-size: 16px;
  border: none;
  border-radius: 6px;
  background: #66FCF1;
  color: #0B0C10;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
}

#answer-btn:hover {
  transform: scale(1.05);
  box-shadow: 0 6px 18px rgba(102,252,241,0.4);
}

.answer {
  margin-top: 20px;
  font-size: 16px;
  color: #0B0C10;
  opacity: 0;
  animation: fadeInUp 0.4s ease forwards;
  animation-delay: 0.2s;
}

@media(max-width: 700px) {
    body {flex-direction: column;}
    nav {width: 100%; height: 300px; border-bottom: 5px solid #07090c}
}