/* brain.css */

.brainTop {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.brainTopRight {
  display: flex;
  align-items: center;
  gap: 12px;
}
.brainProfileLink {
  color: var(--muted);
  text-decoration: none;
  font-size: 14px;
  padding: 6px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  transition: color .15s, border-color .15s;
}
.brainProfileLink:hover {
  color: var(--text);
  border-color: var(--text);
}

/* Hero */
.brainHero {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 24px;
  margin: 20px 0 16px;
}
.brainDate {
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 4px;
}
.brainHeroTitle {
  font-size: 22px;
  margin: 0 0 4px;
}
.brainHeroSub {
  font-size: 14px;
}
.brainStreakBadge {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  border: 3px solid #ff7882;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.brainStreakNum {
  font-size: 26px;
  font-weight: 800;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  line-height: 1;
}
.brainStreakLabel {
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: .5px;
  color: var(--muted);
  margin-top: 2px;
}

@media (max-width: 520px) {
  .brainHero { padding: 16px; }
  .brainHeroTitle { font-size: 18px; }
  .brainStreakBadge { width: 58px; height: 58px; }
  .brainStreakNum { font-size: 22px; }
}

/* Weekly dots */
.brainWeek {
  text-align: center;
  margin: 0 0 24px;
}
.brainWeekDots {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-bottom: 6px;
}
.brainDot {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--card);
  border: 2px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  color: var(--muted);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  transition: all .2s;
}
.brainDot.done {
  border-color: #2ec88c;
  background: rgba(46, 200, 140, .12);
  color: #2ec88c;
}
.brainDot.today {
  border-color: #4aa0ff;
  box-shadow: 0 0 0 3px rgba(74, 160, 255, .15);
}
.brainWeekLabel {
  font-size: 12px;
}

/* Modules */
.brainModules {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin: 0 0 28px;
}
.brainModule {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 20px;
  transition: border-color .2s;
}
.brainModule.complete {
  border-color: rgba(46, 200, 140, .3);
}
.brainModule.complete::before {
  content: "";
  display: block;
  height: 2px;
  background: linear-gradient(90deg, #2ec88c, #4aa0ff);
  border-radius: 1px;
  margin: -20px -20px 16px;
  border-radius: 14px 14px 0 0;
}
.brainModHeader {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
}
.brainModLeft {
  display: flex;
  align-items: center;
  gap: 12px;
}
.brainModIcon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: rgba(var(--modColor), .12);
  color: rgb(var(--modColor));
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 16px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}
.brainModTitle {
  font-size: 16px;
  font-weight: 700;
  margin: 0;
}
.brainModSub {
  font-size: 12px;
}
.brainModBadge {
  font-size: 12px;
  padding: 4px 10px;
  border-radius: 20px;
  background: rgba(255,255,255,.05);
  border: 1px solid var(--line);
  color: var(--muted);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}
.brainModBadge.done {
  background: rgba(46, 200, 140, .12);
  border-color: rgba(46, 200, 140, .3);
  color: #2ec88c;
}

/* Steps list */
.brainSteps {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.brainStep {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  background: rgba(255,255,255,.02);
  border: 1px solid rgba(255,255,255,.05);
  border-radius: 10px;
  transition: background .15s;
}
.brainStep:hover {
  background: rgba(255,255,255,.04);
}
.brainStepCheck {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 2px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  flex-shrink: 0;
  transition: all .2s;
}
.brainStepCheck.done {
  border-color: #2ec88c;
  color: #2ec88c;
  background: rgba(46, 200, 140, .1);
}
.brainStepInfo {
  flex: 1;
  min-width: 0;
}
.brainStepName {
  font-weight: 600;
  font-size: 14px;
}
.brainStepHint {
  font-size: 12px;
  color: var(--muted);
  margin-top: 2px;
}
.brainStepPlay {
  padding: 6px 14px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: all .15s;
  flex-shrink: 0;
}
.brainStepPlay:hover {
  background: rgba(74, 160, 255, .1);
  border-color: #4aa0ff;
  color: #4aa0ff;
}

.brainModActions {
  margin-top: 12px;
  display: flex;
  gap: 10px;
}
.brainStartBtn {
  padding: 10px 20px;
  border-radius: 10px;
  border: none;
  background: linear-gradient(135deg, #4aa0ff, #6d8fff);
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
  transition: opacity .15s;
}
.brainStartBtn:hover {
  opacity: .85;
}

/* Skill bars */
.brainSkills {
  margin: 0 0 28px;
}
.brainSectionTitle {
  font-size: 18px;
  margin: 0 0 14px;
}
.brainSkillBars {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.brainSkillRow {
  display: flex;
  align-items: center;
  gap: 12px;
}
.brainSkillName {
  width: 80px;
  font-size: 13px;
  font-weight: 600;
  flex-shrink: 0;
}
.brainSkillBar {
  flex: 1;
  height: 8px;
  background: var(--line);
  border-radius: 4px;
  overflow: hidden;
}
.brainSkillFill {
  height: 100%;
  border-radius: 4px;
  transition: width .5s ease;
}
.brainSkillRow:nth-child(1) .brainSkillFill { background: #a078ff; }
.brainSkillRow:nth-child(2) .brainSkillFill { background: #ff7882; }
.brainSkillRow:nth-child(3) .brainSkillFill { background: #4aa0ff; }
.brainSkillRow:nth-child(4) .brainSkillFill { background: #2ec88c; }
.brainSkillRow:nth-child(5) .brainSkillFill { background: #ffb84a; }

.brainSkillVal {
  width: 28px;
  text-align: right;
  font-size: 13px;
  color: var(--muted);
}

/* Training log */
.brainHistory { margin: 0 0 28px; }
.brainLog {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.brainLogItem {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 14px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 10px;
  font-size: 14px;
}
.brainLogPath { font-weight: 600; }
.brainLogDate { font-size: 12px; color: var(--muted); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.brainLogXP { color: #4aa0ff; font-weight: 700; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.brainEmpty {
  text-align: center;
  padding: 24px;
  font-size: 14px;
}

/* Entrance animations */
@keyframes brainFadeUp {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}
.brainHero { animation: brainFadeUp .4s ease both; }
.brainWeek { animation: brainFadeUp .4s .05s ease both; }
.brainModule:nth-child(1) { animation: brainFadeUp .4s .1s ease both; }
.brainModule:nth-child(2) { animation: brainFadeUp .4s .15s ease both; }
.brainModule:nth-child(3) { animation: brainFadeUp .4s .2s ease both; }
.brainSkills { animation: brainFadeUp .4s .25s ease both; }
.brainHistory { animation: brainFadeUp .4s .3s ease both; }
@media (prefers-reduced-motion: reduce) {
  .brainHero, .brainWeek, .brainModule, .brainSkills, .brainHistory { animation: none; }
}

/* Completed module celebration pulse */
@keyframes brainPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(46, 200, 140, 0); }
  50% { box-shadow: 0 0 0 6px rgba(46, 200, 140, .15); }
}
.brainModule.complete {
  animation: brainPulse 2s ease-in-out 1;
}

/* All-done state */
.brainAllDone {
  text-align: center;
  padding: 20px;
  margin: -8px 0 20px;
  background: linear-gradient(135deg, rgba(46,200,140,.08), rgba(74,160,255,.08));
  border: 1px solid rgba(46,200,140,.2);
  border-radius: 14px;
}
.brainAllDoneTitle {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 4px;
}
.brainAllDoneDesc {
  font-size: 14px;
  color: var(--muted);
}

/* Streak badge glow when active */
.brainStreakBadge.active {
  box-shadow: 0 0 0 4px rgba(255, 120, 130, .15);
}

/* Light theme overrides */
:root[data-theme="light"] .brainStep {
  background: rgba(0,0,0,.02);
  border-color: rgba(0,0,0,.06);
}
:root[data-theme="light"] .brainStep:hover {
  background: rgba(0,0,0,.04);
}
:root[data-theme="light"] .brainAllDone {
  background: linear-gradient(135deg, rgba(46,200,140,.05), rgba(74,160,255,.05));
}

/* Footer */
.footer { margin-top: 40px; }
.footlinks { text-align: center; margin-bottom: 8px; }
.footlinks a { color: var(--muted); text-decoration: none; font-size: 13px; }
.footlinks a:hover { color: var(--text); }
.sep { color: var(--muted); margin: 0 6px; font-size: 12px; }
.fineprint { text-align: center; font-size: 12px; color: var(--muted); }
