/* ═══════════════════════════════════════════════════════
   Electricity — Clay Design System Extensions
   Only page-specific overrides. Everything else comes from
   clay-system.css + content.css.
   ═══════════════════════════════════════════════════════ */

/* ── Sidebar Toggle Button ── */
.sidebar-toggle {
  display: none;
  position: fixed;
  top: 72px;
  left: 12px;
  z-index: 200;
  align-items: center;
  gap: 6px;
  background: rgba(255,255,255,0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(160,150,180,0.15);
  border-radius: 20px;
  padding: 8px 14px;
  font-family: var(--font-heading);
  font-size: 13px;
  font-weight: 700;
  color: var(--text-primary);
  cursor: pointer;
  transition: all var(--dur-fast) var(--ease-smooth);
  box-shadow: var(--shadow-card);
}
.sidebar-toggle:hover {
  background: rgba(255,255,255,1);
  border-color: var(--accent);
  color: var(--accent);
}
.sidebar-toggle i { font-size: 14px; }

/* ── Content Sidebar ── */
.content-sidebar {
  position: fixed;
  top: 64px;
  left: 0;
  bottom: 0;
  z-index: 150;
  width: 220px;
  background: rgba(255,255,255,0.80);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border-right: 1px solid rgba(160,150,180,0.12);
  overflow-y: auto;
  padding: 20px 0;
  transition: transform 0.35s var(--ease-smooth);
  display: flex;
  flex-direction: column;
  scrollbar-width: thin;
  scrollbar-color: rgba(160,150,180,0.2) transparent;
}
.content-sidebar::-webkit-scrollbar { width: 4px; }
.content-sidebar::-webkit-scrollbar-thumb { background: rgba(160,150,180,0.2); border-radius: 4px; }

.content-sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 20px 16px;
  border-bottom: 1px solid rgba(160,150,180,0.08);
  margin-bottom: 12px;
}
.content-sidebar-brand {
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: 15px;
  background: linear-gradient(135deg, var(--accent), var(--accent-alt));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1.2;
}
.sidebar-close {
  display: none;
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 18px;
  cursor: pointer;
  padding: 4px;
  border-radius: 8px;
  transition: all var(--dur-fast);
}
.sidebar-close:hover {
  background: rgba(160,150,180,0.1);
  color: var(--text-primary);
}

.content-sidebar-links {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 0 12px;
}
.content-sidebar-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 12px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  text-decoration: none;
  transition: all var(--dur-fast) var(--ease-smooth);
  font-family: var(--font-heading);
}
.content-sidebar-link:hover {
  background: rgba(124,58,237,0.06);
  color: var(--text-primary);
}
.content-sidebar-link.active {
  background: rgba(124,58,237,0.1);
  color: var(--accent);
}
.sidebar-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 8px;
  background: rgba(160,150,180,0.1);
  font-size: 11px;
  font-weight: 800;
  color: var(--text-muted);
  flex-shrink: 0;
  transition: all var(--dur-fast);
}
.content-sidebar-link.active .sidebar-num {
  background: rgba(124,58,237,0.15);
  color: var(--accent);
}
.sidebar-label { line-height: 1.2; }

/* ── Content Main (wrapper) ── */
.content-main {
  max-width: 960px;
  margin: 0 auto;
  padding: 0 24px 0 260px;
  transition: all 0.35s var(--ease-smooth);
  position: relative;
  z-index: 1;
}

/* ── Page Header ── */
.page-header {
  text-align: center;
  padding: 32px 20px 8px;
}
.page-header h1 {
  font-family: var(--font-heading);
  font-weight: 900;
  font-size: clamp(2rem, 4vw, 3rem);
  background: linear-gradient(135deg, var(--accent), var(--accent-alt));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 8px;
  line-height: 1.1;
  letter-spacing: -0.02em;
}
.page-subtitle {
  color: var(--text-muted);
  font-size: 1.05rem;
  max-width: 600px;
  margin: 0 auto 24px;
  font-family: var(--font-body);
}

/* ── Section Header ── */
.section-header {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 20px;
}
.section-icon {
  width: 44px; height: 44px;
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  flex-shrink: 0;
}
.section-header h2 {
  font-family: var(--font-heading);
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.2;
}

/* ── Card Adjustments ── */
.card { margin-bottom: 28px; }
.card h3 {
  font-family: var(--font-heading);
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-primary);
  margin: 24px 0 12px;
}
.card h4 {
  font-family: var(--font-heading);
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-primary);
  margin: 16px 0 10px;
}
.card p { margin-bottom: 10px; }

/* ── Formula Box ── */
.formula-box {
  background: linear-gradient(135deg, rgba(124,58,237,0.05), rgba(219,39,119,0.04));
  border-radius: 20px;
  padding: 20px 24px;
  margin: 16px 0;
  text-align: center;
  font-family: var(--font-heading);
}
.formula-box p:first-child {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--accent);
}
.formula-box .sub {
  font-size: 0.85rem;
  font-weight: 400;
  color: var(--text-muted);
  margin-top: 4px;
}

/* ── Sim Card ── */
.sim-card {
  background: linear-gradient(135deg, rgba(16,185,129,0.04), rgba(14,165,233,0.03));
  border: 1px solid rgba(160,150,180,0.1);
  border-radius: 24px;
  padding: 24px;
  margin: 20px 0;
  transition: all var(--dur-med) var(--ease-smooth);
}
.sim-card:hover { border-color: rgba(124,58,237,0.25); }

.sim-canvas-wrap {
  background: #f8f7fc;
  border: 1px solid rgba(160,150,180,0.08);
  border-radius: 16px;
  overflow: hidden;
  padding: 8px;
  margin-bottom: 12px;
}
.sim-canvas-wrap canvas { display: block; width: 100%; height: auto; border-radius: 4px; }

/* ── Sim Controls ── */
.sim-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin: 12px 0;
}
.slider-group { flex: 1; min-width: 160px; }
.slider-group label {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 4px;
  font-family: var(--font-heading);
}
.slider-group label span { color: var(--accent); font-weight: 700; }
.slider-group input[type="range"] { width: 100%; accent-color: var(--accent); }

/* ── Sim Readout ── */
.sim-readout {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 10px;
  margin-top: 12px;
}
.readout-item {
  background: rgba(255,255,255,0.5);
  border: 1px solid rgba(160,150,180,0.1);
  border-radius: 16px;
  padding: 10px 14px;
  text-align: center;
}
.readout-label {
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-family: var(--font-heading);
}
.readout-value {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--accent);
  margin-top: 2px;
  font-family: var(--font-heading);
}

/* ── Form Grid ── */
.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 12px;
}
.form-group { display: flex; flex-direction: column; gap: 6px; }
.form-group label {
  font-weight: 600;
  color: var(--text-muted);
  font-size: 13px;
}
.form-group input,
.form-group select {
  padding: 10px 14px;
  border: 2px solid rgba(160,150,180,0.15);
  border-radius: 16px;
  font-size: 14px;
  background: #EFEBF5;
  color: var(--text-primary);
  font-family: var(--font-body);
  transition: all var(--dur-fast);
}
.form-group input:focus,
.form-group select:focus {
  outline: none;
  background: #fff;
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(124,58,237,0.12);
}

/* ── Controls ── */
.controls {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

/* ── Result Box ── */
.result-box {
  background: rgba(16,185,129,0.06);
  border: 1px solid rgba(16,185,129,0.2);
  border-radius: 20px;
  padding: 16px 20px;
  margin-top: 16px;
  text-align: center;
  font-weight: 700;
  color: var(--accent-emerald);
  display: none;
}

/* ── Grid 2 ── */
.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
@media (max-width: 600px) { .grid-2 { grid-template-columns: 1fr; } }

/* ── Diagram Wrap ── */
.diagram-wrap {
  background: rgba(255,255,255,0.5);
  border-radius: 20px;
  padding: 16px;
  margin: 16px 0;
  border: 1px solid rgba(160,150,180,0.1);
  text-align: center;
}
.diagram-wrap svg { max-width: 100%; height: auto; border-radius: 12px; }
.diagram-wrap h4 { margin-bottom: 8px; font-family: var(--font-heading); font-size: 0.95rem; color: var(--text-primary); }

/* ── Info Box ── */
.info-box {
  background: rgba(14,165,233,0.04);
  border-left: 4px solid var(--accent-blue);
  border-radius: 16px;
  padding: 14px 18px;
  margin: 16px 0;
  font-size: 14px;
  color: var(--text-muted);
}

/* ── Tip ── */
.tip {
  background: rgba(245,158,11,0.04);
  border-left: 4px solid var(--accent-amber);
  border-radius: 16px;
  padding: 14px 18px;
  margin: 16px 0;
  font-size: 14px;
  color: var(--text-muted);
}
.tip strong { color: var(--text-primary); }

/* ── Warning ── */
.warning {
  background: rgba(244,63,94,0.04);
  border-left: 4px solid var(--accent-rose);
  border-radius: 16px;
  padding: 14px 18px;
  margin: 16px 0;
  font-size: 14px;
  color: var(--text-muted);
}

/* ── Outcomes ── */
.outcomes {
  background: rgba(124,58,237,0.04);
  border-left: 4px solid var(--accent);
  border-radius: 16px;
  padding: 16px 20px;
  margin-bottom: 20px;
}
.outcomes h4 {
  font-family: var(--font-heading);
  font-size: 14px;
  color: var(--accent);
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.outcomes ul { list-style: none; padding: 0; }
.outcomes li {
  font-size: 14px;
  color: var(--text-muted);
  padding: 4px 0 4px 20px;
  position: relative;
}
.outcomes li::before {
  content: "✓";
  position: absolute;
  left: 0;
  color: var(--accent-emerald);
  font-weight: 700;
}

/* ── Quiz Grid ── */
.quiz-grid {
  display: grid;
  gap: 16px;
  margin: 16px 0;
}
.quiz-card {
  background: rgba(255,255,255,0.5);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(160,150,180,0.1);
  border-radius: 20px;
  padding: 20px;
}
.quiz-card .q-text {
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 12px;
  font-family: var(--font-heading);
}
.quiz-card label {
  display: block;
  padding: 8px 14px;
  margin: 4px 0;
  border-radius: 14px;
  font-size: 14px;
  color: var(--text-muted);
  cursor: pointer;
  transition: background var(--dur-fast);
}
.quiz-card label:hover { background: rgba(124,58,237,0.05); }
.quiz-card input[type="radio"] { margin-right: 10px; accent-color: var(--accent); }

.quiz-feedback {
  margin-top: 8px;
  padding: 8px 14px;
  border-radius: 12px;
  font-size: 13px;
  font-weight: 600;
  display: none;
}
.quiz-feedback.show { display: block; }
.quiz-feedback.correct { background: rgba(16,185,129,0.1); color: var(--accent-emerald); }
.quiz-feedback.incorrect { background: rgba(244,63,94,0.1); color: var(--accent-rose); }

/* ── Quiz Actions ── */
.quiz-actions { display: flex; gap: 12px; margin-top: 16px; flex-wrap: wrap; }

/* ── Quiz Score ── */
.quiz-score-section { text-align: center; padding: 20px; margin-top: 20px; background: linear-gradient(135deg, var(--accent-light), var(--accent)); border-radius: 20px; color: #fff; }
.quiz-score-bar { height: 8px; background: rgba(255,255,255,0.3); border-radius: 4px; overflow: hidden; margin-bottom: 8px; }
.quiz-score-fill { height: 100%; background: #fff; border-radius: 4px; transition: width 0.5s; }
.quiz-score-text { font-size: 1.2rem; font-weight: 700; }

/* ── Working Out ── */
.working-out {
  background: rgba(255,255,255,0.5);
  border-radius: 12px;
  padding: 14px;
  margin-bottom: 12px;
  border-left: 4px solid var(--accent-blue);
  text-align: left;
}
.working-out h5 {
  color: var(--accent-blue);
  margin-bottom: 8px;
  font-size: 13px;
  font-family: var(--font-heading);
}
.working-out .step {
  font-family: var(--font-heading);
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 4px;
}
.final-answer {
  background: linear-gradient(135deg, var(--accent-light), var(--accent));
  color: #fff;
  padding: 12px 20px;
  border-radius: 16px;
  font-weight: 700;
  text-align: center;
  font-size: 1.05rem;
  font-family: var(--font-heading);
}

/* ── Data Table ── */
.data-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  border-radius: 16px;
  overflow: hidden;
  margin: 16px 0;
  font-size: 14px;
}
.data-table th {
  background: rgba(124,58,237,0.06);
  color: var(--accent);
  font-weight: 700;
  padding: 10px 16px;
  text-align: left;
  font-family: var(--font-heading);
}
.data-table td { padding: 8px 16px; border-bottom: 1px solid rgba(160,150,180,0.1); color: var(--text-muted); }
.data-table tr:last-child td { border-bottom: none; }

/* ── Keyframe ── */
@keyframes slideIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ── Mobile ── */
@media (max-width: 900px) {
  .sidebar-toggle { display: flex; }
  .sidebar-close { display: flex; }
  .content-sidebar {
    transform: translateX(-100%);
  }
  .content-sidebar.open {
    transform: translateX(0);
  }
  .content-main {
    padding: 0 16px;
  }
  .sim-card { padding: 16px; }
  .quiz-card { padding: 16px; }
  .quiz-card label { padding: 8px 14px; }
}