/* Power Lines & Substations Magnetic Field Lesson CSS */
#powerline-lesson {
  margin-top: 1.5rem;
}

.lesson-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
  border-bottom: 1px solid var(--line);
  padding-bottom: 0.75rem;
}

.tab-btn {
  background: var(--paper);
  border: 1px solid var(--line);
  padding: 0.5rem 0.9rem;
  border-radius: 6px;
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--ink);
  cursor: pointer;
  transition: all 0.2s ease;
}

.tab-btn:hover {
  background: #e8ecf2;
}

.tab-btn.active {
  background: var(--blue);
  color: #fff;
  border-color: var(--blue);
}

.lesson-panel {
  display: none;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 1.75rem;
  margin-bottom: 1.5rem;
  box-shadow: 0 2px 8px rgba(21, 34, 57, 0.04);
}

.lesson-panel.active {
  display: block;
}

.lesson-panel h2 {
  font-size: 1.4rem;
  margin-top: 0;
  margin-bottom: 0.5rem;
  color: var(--ink);
}

.panel-subtitle {
  color: #556987;
  font-size: 0.95rem;
  margin-bottom: 1.5rem;
  line-height: 1.5;
}

/* Chapter 1: Line Selector Cards */
.line-types-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.line-card {
  border: 2px solid var(--line);
  border-radius: 8px;
  padding: 1.25rem;
  background: var(--paper);
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: left;
}

.line-card:hover {
  border-color: #a0aec0;
}

.line-card.active {
  border-color: var(--blue);
  background: #f0f5ff;
}

.line-card-icon {
  font-size: 2rem;
  margin-bottom: 0.5rem;
  display: block;
}

.line-card h3 {
  margin: 0.2rem 0 0.4rem 0;
  font-size: 1.05rem;
  color: var(--ink);
}

.line-tag {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  background: #e2e8f0;
  color: #4a5568;
}

.line-detail-box {
  background: #0b1320;
  border-radius: 8px;
  padding: 1.5rem;
  color: #fff;
  margin-bottom: 1.5rem;
}

.line-detail-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  margin-top: 1rem;
}

.line-stat-card {
  background: #152239;
  border: 1px solid #23395d;
  padding: 0.85rem;
  border-radius: 6px;
}

/* Chapter 2: Interactive Simulator */
.calc-container {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  margin-bottom: 1.5rem;
}

@media (max-width: 768px) {
  .calc-container {
    grid-template-columns: 1fr;
  }
}

.calc-controls {
  background: var(--paper);
  padding: 1.25rem;
  border-radius: 8px;
  border: 1px solid var(--line);
}

.form-group {
  margin-bottom: 1.25rem;
}

.form-group label {
  display: block;
  font-size: 0.9rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
  color: var(--ink);
}

.slider-container {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.slider-container input[type="range"] {
  flex: 1;
}

.slider-val {
  font-weight: 700;
  color: var(--blue);
  min-width: 75px;
}

.calc-visualizer {
  background: #0f172a;
  border-radius: 8px;
  padding: 1.25rem;
  color: #fff;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.viz-chart {
  height: 160px;
  background: #1e293b;
  border-radius: 6px;
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: flex-end;
  padding: 10px 15px;
}

.chart-svg {
  width: 100%;
  height: 100%;
}

.readout-box {
  background: #152239;
  border: 1px solid #23395d;
  padding: 0.85rem;
  border-radius: 6px;
}

.readout-label {
  font-size: 0.75rem;
  color: #8da4c4;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.readout-value {
  font-size: 1.35rem;
  font-weight: 700;
  color: #a8f074;
  margin-top: 0.2rem;
}

/* Chapter 3: Shielding Penetration Visual */
.material-compare-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.material-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 1.25rem;
  background: var(--paper);
}

.material-card h3 {
  margin: 0 0 0.5rem 0;
  font-size: 1rem;
  color: var(--ink);
}

.penetration-bar {
  height: 10px;
  background: #e2e8f0;
  border-radius: 5px;
  overflow: hidden;
  margin: 0.75rem 0;
}

.penetration-fill {
  height: 100%;
  border-radius: 5px;
}

/* Chapter 4: Ground Currents */
.ground-loop-box {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 1.5rem;
  margin-bottom: 1.5rem;
}

.loop-diagram {
  background: #0b1320;
  border-radius: 8px;
  padding: 1.25rem;
  color: #fff;
  margin-bottom: 1rem;
  position: relative;
}

/* Chapter 5: Quiz */
.quiz-item {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 1.25rem;
  margin-bottom: 1.25rem;
}

.quiz-question {
  font-weight: 600;
  font-size: 1rem;
  margin-bottom: 0.75rem;
  color: var(--ink);
}

.quiz-options {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.quiz-opt-btn {
  background: #fff;
  border: 1px solid var(--line);
  padding: 0.75rem 1rem;
  border-radius: 6px;
  text-align: left;
  font-family: inherit;
  font-size: 0.9rem;
  color: var(--ink);
  cursor: pointer;
  transition: all 0.2s ease;
}

.quiz-opt-btn:hover {
  background: #f1f5f9;
  border-color: #94a3b8;
}

.quiz-opt-btn.correct {
  background: #dcfce7;
  border-color: #16a34a;
  color: #15803d;
  font-weight: 600;
}

.quiz-opt-btn.incorrect {
  background: #fee2e2;
  border-color: #dc2626;
  color: #991b1b;
}

.quiz-feedback {
  margin-top: 0.75rem;
  padding: 0.75rem;
  border-radius: 6px;
  font-size: 0.88rem;
  line-height: 1.4;
  display: none;
}

.quiz-feedback.show {
  display: block;
}

.feedback-correct {
  background: #dcfce7;
  color: #166534;
}

.feedback-incorrect {
  background: #fee2e2;
  color: #991b1b;
}

/* Nav Controls */
.lesson-nav-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 2rem;
  padding-top: 1rem;
  border-top: 1px solid var(--line);
}

.callout-box {
  background: #f8fafc;
  border-left: 4px solid var(--blue);
  padding: 1rem 1.25rem;
  border-radius: 0 6px 6px 0;
  margin: 1.25rem 0;
  font-size: 0.92rem;
}
