/* Training Page Layout */
.training-page {
  padding: 4px 0 32px;
  min-height: 70vh;
}
.training-layout {
  display: grid;
  grid-template-columns: 155px 1fr;
  gap: 12px;
  align-items: start;
}
@media (max-width: 768px) {
  .training-layout {
    grid-template-columns: 1fr;
  }
  .training-sidebar {
    display: none;
  }
}

/* Sidebar - Compact */
.training-sidebar {
  position: sticky;
  top: 70px;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 8px 6px;
  max-height: calc(100vh - 80px);
  overflow-y: auto;
}
.training-sidebar h4 {
  font-size: .68rem;
  font-weight: 700;
  color: #1d4ed8;
  margin: 0 0 4px;
  text-align: center;
}
.sidebar-topics {
  list-style: none;
  padding: 0;
  margin: 0;
}
.sidebar-topics li {
  margin-bottom: 0;
}
.sidebar-topics a {
  display: block;
  padding: 3px 6px;
  border-radius: 4px;
  font-size: .62rem;
  color: #334155;
  text-decoration: none;
  transition: all .15s;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sidebar-topics a:hover {
  background: #eff6ff;
  color: #1d4ed8;
}
.sidebar-topics a.active {
  background: #1d4ed8;
  color: #fff;
  font-weight: 600;
}

/* Main Content */
.training-main {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 12px 16px;
}
.training-breadcrumb {
  font-size: .72rem;
  color: #64748b;
  margin-bottom: 6px;
}
.training-breadcrumb a {
  color: #1d4ed8;
  text-decoration: none;
}
.training-title {
  font-size: .92rem;
  font-weight: 800;
  color: #0f172a;
  margin: 0 0 4px;
}
.training-info {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 10px;
  font-size: .72rem;
  color: #475569;
}
.training-info span {
  background: #f1f5f9;
  padding: 4px 10px;
  border-radius: 999px;
}

/* Intro Content */
.intro-content {
  margin-bottom: 12px;
  font-size: .76rem;
  line-height: 1.5;
  color: #334155;
}
.intro-content h2 {
  font-size: .95rem;
  font-weight: 700;
  color: #0f172a;
  margin: 0 0 4px;
}
.intro-content h3 {
  font-size: .8rem;
  font-weight: 700;
  color: #1e40af;
  margin: 8px 0 4px;
}
.intro-content p {
  margin: 4px 0;
}
.intro-content ul {
  padding-inline-start: 18px;
  margin: 4px 0;
}
.intro-content li {
  margin-bottom: 2px;
}
.intro-content code {
  background: #1e293b;
  color: #e2e8f0;
  padding: 8px 12px;
  border-radius: 6px;
  font-size: .75rem;
  display: block;
  overflow-x: auto;
  margin: 6px 0;
  direction: ltr;
  text-align: left;
  white-space: pre-wrap;
  font-family: 'Courier New', monospace;
}
.intro-footer {
  background: #f8fafc;
  border-radius: 8px;
  padding: 10px 14px;
  font-size: .78rem;
  color: #475569;
  margin-top: 10px;
}
.intro-footer p {
  margin: 2px 0;
}

/* Mode Selection - Compact */
.mode-selection {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 10px 12px;
  margin-bottom: 10px;
  text-align: center;
}
.mode-selection h3 {
  font-size: .75rem;
  margin: 0 0 8px;
  color: #0f172a;
}
.mode-buttons {
  display: flex;
  gap: 6px;
  justify-content: center;
  flex-wrap: wrap;
}
.btn-mode {
  padding: 6px 12px;
  border: 1.5px solid #e2e8f0;
  border-radius: 6px;
  background: #fff;
  cursor: pointer;
  font-weight: 600;
  font-size: .7rem;
  color: #475569;
  transition: all .2s;
  font-family: inherit;
}
.btn-mode:hover {
  border-color: #1d4ed8;
  color: #1d4ed8;
}
.btn-mode.selected {
  background: #1d4ed8;
  color: #fff;
  border-color: #1d4ed8;
}

/* Start Button - Compact */
.start-button-container {
  text-align: center;
  margin-top: 12px;
}
.btn-start {
  padding: 8px 22px;
  background: linear-gradient(135deg, #1d4ed8, #7c3aed);
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: .8rem;
  font-weight: 700;
  cursor: pointer;
  transition: transform .2s, box-shadow .2s;
  font-family: inherit;
}
.btn-start:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(29,78,216,.2);
}

/* Quiz Area - Compact to fit in one screen */
.quizTitle {
  font-size: .78rem;
  font-weight: 700;
  color: #1d4ed8;
  margin: 0 0 6px;
  padding-bottom: 4px;
  border-bottom: 1px solid #e2e8f0;
}
.questions-scroll-container {
  padding-inline-end: 4px;
}
.question {
  display: none;
  animation: fadeIn .3s ease;
}
.question.active {
  display: block;
}
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}
.question h4 {
  font-size: .76rem;
  font-weight: 700;
  color: #0f172a;
  margin: 0 0 6px;
  line-height: 1.4;
}

/* Learning Content Section - Compact */
.learning-section {
  background: #f0f9ff;
  border: 1px solid #bae6fd;
  border-radius: 6px;
  padding: 8px 10px;
  margin-bottom: 8px;
}
.learning-section h3 {
  font-size: .7rem;
  color: #0369a1;
  margin: 0 0 4px;
}
.learning-content {
  font-size: .7rem;
  line-height: 1.4;
  color: #334155;
}
.learning-content ul {
  padding-inline-start: 16px;
  margin: 4px 0;
}
.learning-content li {
  margin-bottom: 2px;
}
.learning-content code,
.learning-content pre {
  background: #1e293b;
  color: #e2e8f0;
  padding: 2px 4px;
  border-radius: 3px;
  font-size: .72rem;
}
.learning-content pre {
  padding: 8px 10px;
  overflow-x: auto;
  margin: 6px 0;
  border-radius: 6px;
}
.learning-content table {
  width: 100%;
  border-collapse: collapse;
  font-size: .65rem;
  margin: 4px 0;
}
.learning-content table th,
.learning-content table td {
  border: 1px solid #e2e8f0;
  padding: 3px 6px;
  text-align: right;
}
.learning-content table th {
  background: #f1f5f9;
  font-weight: 600;
}
.ready-to-answer {
  margin-top: 4px;
  padding-top: 4px;
  border-top: 1px dashed #bae6fd;
  color: #0369a1;
  font-weight: 600;
  font-size: .68rem;
}

/* Options - Compact */
.options {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 6px;
}
.option-item label {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 5px 8px;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  cursor: pointer;
  transition: all .15s;
  font-size: .7rem;
  line-height: 1.3;
}
.option-item label:hover {
  border-color: #93c5fd;
  background: #eff6ff;
}
.option-item input[type="radio"] {
  width: 13px;
  height: 13px;
  accent-color: #1d4ed8;
  flex-shrink: 0;
}

/* Confirm Button */
.confirm-wrap {
  margin-bottom: 10px;
}
.btn.confirm {
  padding: 5px 14px;
  background: #e2e8f0;
  color: #64748b;
  border: none;
  border-radius: 6px;
  font-weight: 600;
  font-size: .7rem;
  cursor: not-allowed;
  opacity: .6;
  transition: all .2s;
  font-family: inherit;
}
.btn.confirm.active {
  background: #1d4ed8;
  color: #fff;
  cursor: pointer;
  opacity: 1;
}
.btn.confirm.active:hover {
  background: #1e40af;
}

/* Feedback */
.feedback {
  display: none;
  padding: 10px 14px;
  border-radius: 8px;
  margin-top: 8px;
}
.feedback.show {
  display: block;
  animation: fadeIn .3s ease;
}
.feedback.correct {
  background: #f0fdf4;
  border: 1px solid #86efac;
}
.feedback.wrong {
  background: #fef2f2;
  border: 1px solid #fca5a5;
}
.feedback .title {
  font-weight: 700;
  font-size: .85rem;
  margin-bottom: 4px;
}
.feedback.correct .title { color: #166534; }
.feedback.wrong .title { color: #991b1b; }
.feedback .explain {
  font-size: .78rem;
  color: #334155;
  line-height: 1.5;
}

/* Next Button */
.btn.next {
  margin-top: 8px;
  padding: 7px 22px;
  background: #1d4ed8;
  color: #fff;
  border: none;
  border-radius: 8px;
  font-weight: 600;
  font-size: .78rem;
  cursor: pointer;
  font-family: inherit;
  transition: background .2s;
}
.btn.next:hover {
  background: #1e40af;
}
.btn.next:disabled {
  opacity: .4;
  cursor: not-allowed;
}

/* End Screen */
#endScreen {
  display: none;
  text-align: center;
  padding: 28px 16px;
}
#endScreen h3 {
  font-size: 1.2rem;
  color: #0f172a;
  margin-bottom: 8px;
}
#endScreen p {
  font-size: .9rem;
  color: #475569;
  margin-bottom: 16px;
}
#endScreen .btn {
  margin: 4px 6px;
  padding: 8px 16px;
  border: 2px solid #1d4ed8;
  background: #1d4ed8;
  color: #fff;
  border-radius: 8px;
  font-weight: 600;
  font-size: .78rem;
  cursor: pointer;
  font-family: inherit;
  transition: all .2s;
}
#endScreen .btn:hover {
  background: #1e40af;
}
#endScreen .btn.secondary {
  background: #fff;
  color: #1d4ed8;
}
#endScreen .btn.secondary:hover {
  background: #eff6ff;
}

/* Coming Soon */
.coming-soon {
  text-align: center;
  padding: 40px 16px;
}
.coming-soon-icon {
  font-size: 3rem;
  margin-bottom: 14px;
}
.coming-soon h1 {
  font-size: 1.2rem;
  color: #0f172a;
  margin-bottom: 8px;
}
.coming-soon-text {
  font-size: .85rem;
  color: #64748b;
  margin-bottom: 20px;
  max-width: 360px;
  margin-inline: auto;
}
.coming-soon .btn {
  display: inline-block;
  text-decoration: none;
}

/* Code blocks in questions */
.code-block {
  background: #1e293b;
  color: #e2e8f0;
  padding: 8px 12px;
  border-radius: 6px;
  font-family: 'Courier New', monospace;
  font-size: .75rem;
  overflow-x: auto;
  margin: 6px 0;
  direction: ltr;
  text-align: left;
}
.code-keyword { color: #c084fc; }
.code-function { color: #67e8f9; }
.code-number { color: #fbbf24; }
.code-string { color: #86efac; }
.code-comment { color: #64748b; }
