/* ============ RESET & BASE ============ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: #0d1117; color: #e6edf3; min-height: 100vh; overflow: hidden;
}

/* ============ FALLBACK ============ */
.fallback-message {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  position: fixed; inset: 0; background: #0d1117; z-index: 9999;
  font-size: 1.2rem; color: #8b949e; text-align: center; gap: 12px;
}
.fallback-message a { color: #58a6ff; }
.impress-supported .fallback-message { display: none; }

/* ============ NAV BAR ============ */
#pres-nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 1000;
  display: flex; align-items: center; gap: 12px;
  padding: 8px 16px;
  background: rgba(13,17,23,0.88); backdrop-filter: blur(12px);
  border-bottom: 1px solid #21262d;
}
.pres-nav-link { display: flex; align-items: center; color: #8b949e; text-decoration: none; transition: color 0.2s; }
.pres-nav-link:hover { color: #58a6ff; }
.pres-nav-title { font-size: 0.82rem; font-weight: 700; color: #e6edf3; white-space: nowrap; }

/* Learner search */
.learner-search { display: flex; align-items: center; gap: 6px; margin-left: 8px; }
.learner-input {
  width: 150px; padding: 4px 10px; border-radius: 6px; border: 1px solid #30363d;
  background: rgba(255,255,255,0.04); color: #e6edf3; font-size: 0.75rem;
  outline: none; transition: border-color 0.2s;
}
.learner-input:focus { border-color: #58a6ff; }
.learner-btn {
  padding: 4px 10px; border-radius: 6px; border: 1px solid #30363d;
  background: rgba(88,166,255,0.1); color: #58a6ff; font-size: 0.72rem; font-weight: 600;
  cursor: pointer; transition: all 0.2s;
}
.learner-btn:hover { background: rgba(88,166,255,0.2); }
.learner-status { font-size: 0.7rem; color: #8b949e; white-space: nowrap; }
.learner-ok { color: #3fb950; }
.learner-err { color: #f85149; }

/* Nav category buttons */
.pres-nav-cats { display: flex; gap: 5px; flex-wrap: nowrap; overflow-x: auto; margin-left: auto; }
.pres-nav-cat-btn {
  padding: 3px 10px; border-radius: 14px; font-size: 0.68rem; font-weight: 600;
  border: 1px solid #30363d; background: rgba(255,255,255,0.04);
  color: #8b949e; cursor: pointer; white-space: nowrap; transition: all 0.2s;
}
.pres-nav-cat-btn:hover { background: rgba(88,166,255,0.12); color: #58a6ff; border-color: #58a6ff; }
.pres-nav-cat-btn.active { background: rgba(88,166,255,0.2); color: #58a6ff; border-color: #58a6ff; }
.pres-nav-cat-btn.nav-completed { background: rgba(63,185,80,0.15); color: #3fb950; border-color: rgba(63,185,80,0.4); }

.compact-overview-panel {
  position: fixed;
  top: 48px;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 998;
  padding: 18px 18px 16px;
  display: none;
  background:
    radial-gradient(circle at top left, rgba(88,166,255,0.08), transparent 28%),
    radial-gradient(circle at top right, rgba(63,185,80,0.06), transparent 24%),
    rgba(13,17,23,0.92);
  backdrop-filter: blur(10px);
}
body.presentation-overview-mode .compact-overview-panel { display: block; }
.compact-overview-inner {
  height: 100%;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.compact-overview-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 12px;
  padding: 0 4px;
}
.compact-overview-head h2 {
  font-size: 1.08rem;
  font-weight: 800;
  color: #e6edf3;
}
.compact-overview-head p {
  font-size: 0.74rem;
  color: #8b949e;
}
.compact-overview-grid {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 10px;
}
.compact-overview-cat {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 10px;
  border-radius: 16px;
  background: rgba(255,255,255,0.028);
  border: 1px solid rgba(255,255,255,0.06);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.03);
}
.compact-overview-cat.compact-completed {
  background: rgba(63,185,80,0.08);
  border-color: rgba(63,185,80,0.26);
}
.compact-overview-cat.compact-started {
  background: rgba(210,153,34,0.08);
  border-color: rgba(210,153,34,0.24);
}
.compact-overview-cat.compact-not-started {
  border-color: rgba(255,255,255,0.08);
}
.compact-overview-cat-head {
  display: flex;
  flex-direction: column;
  gap: 8px;
  text-decoration: none;
  color: inherit;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}
.compact-cat-title-row {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}
.compact-cat-icon { font-size: 1rem; }
.compact-cat-title {
  font-size: 0.82rem;
  font-weight: 800;
  color: var(--cat-color, #e6edf3);
  line-height: 1.2;
}
.compact-cat-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.compact-cat-status,
.compact-cat-progress {
  font-size: 0.68rem;
  font-weight: 700;
  color: #8b949e;
}
.compact-overview-list {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.compact-overview-item {
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  padding: 7px 8px;
  border-radius: 10px;
  text-decoration: none;
  color: #c9d1d9;
  background: rgba(255,255,255,0.02);
  border: 1px solid transparent;
}
.compact-overview-item:hover {
  background: rgba(88,166,255,0.08);
  border-color: rgba(88,166,255,0.18);
}
.compact-item-index {
  font-size: 0.66rem;
  font-weight: 800;
  color: #6e7681;
  text-align: center;
}
.compact-item-text {
  min-width: 0;
  font-size: 0.72rem;
  font-weight: 600;
  line-height: 1.22;
}
.compact-item-time {
  font-size: 0.64rem;
  color: #6e7681;
  white-space: nowrap;
}
.compact-overview-item.is-completed {
  background: rgba(63,185,80,0.08);
  border-color: rgba(63,185,80,0.18);
}
.compact-overview-item.is-started {
  background: rgba(210,153,34,0.08);
  border-color: rgba(210,153,34,0.18);
}
.compact-overview-item.is-not-started {
  opacity: 0.86;
}
.presentation-overview-mode #impress {
  opacity: 0.12;
  filter: saturate(0.9);
}

body.presentation-touch #pres-nav {
  gap: 8px;
  padding: 8px 10px;
}

body.presentation-touch .pres-nav-title {
  font-size: 0.78rem;
}

body.presentation-touch .learner-search {
  margin-left: 0;
  min-width: 0;
}

body.presentation-touch .learner-input {
  width: 112px;
  font-size: 0.7rem;
}

body.presentation-touch .learner-btn,
body.presentation-touch .pres-nav-cat-btn {
  font-size: 0.62rem;
  padding: 3px 8px;
}

body.presentation-touch .learner-status {
  font-size: 0.62rem;
}

body.presentation-touch .step {
  padding: 24px 28px;
  border-radius: 18px;
}

body.presentation-touch.presentation-overview-mode #impress {
  opacity: 0.08;
}

body.presentation-touch .compact-overview-panel {
  top: 52px;
  padding: 12px 12px 14px;
}

body.presentation-touch .compact-overview-inner {
  gap: 10px;
}

body.presentation-touch .compact-overview-head {
  padding: 0 2px;
}

body.presentation-touch .compact-overview-head h2 {
  font-size: 0.92rem;
}

body.presentation-touch .compact-overview-head p {
  font-size: 0.66rem;
}

body.presentation-touch .compact-overview-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

body.presentation-touch .compact-overview-cat {
  padding: 8px;
  border-radius: 14px;
}

body.presentation-touch .compact-overview-cat-head {
  gap: 6px;
  padding-bottom: 6px;
}

body.presentation-touch .compact-cat-title {
  font-size: 0.74rem;
}

body.presentation-touch .compact-cat-status,
body.presentation-touch .compact-cat-progress {
  font-size: 0.62rem;
}

body.presentation-touch .compact-overview-list {
  gap: 4px;
}

body.presentation-touch .compact-overview-item {
  grid-template-columns: 16px minmax(0, 1fr) auto;
  gap: 6px;
  padding: 6px 7px;
  border-radius: 8px;
}

body.presentation-touch .compact-item-index,
body.presentation-touch .compact-item-time {
  font-size: 0.58rem;
}

body.presentation-touch .compact-item-text {
  font-size: 0.64rem;
  line-height: 1.18;
}

body.presentation-touch .slide-overview {
  width: 980px;
}

body.presentation-touch .slide-overview h1 {
  font-size: 2rem;
}

body.presentation-touch .slide-overview .overview-sub {
  margin-bottom: 24px;
  font-size: 0.9rem;
}

body.presentation-touch .overview-cats {
  gap: 12px;
}

body.presentation-touch .overview-cat-card {
  min-width: 140px;
  padding: 16px 18px;
  border-radius: 14px;
}

body.presentation-touch .overview-cat-icon {
  font-size: 1.7rem;
}

body.presentation-touch .overview-cat-title {
  font-size: 0.82rem;
}

body.presentation-touch .overview-cat-count,
body.presentation-touch .overview-cat-progress,
body.presentation-touch .overview-cat-status-badge {
  font-size: 0.62rem;
}

body.presentation-touch .slide-category {
  width: 960px;
}

body.presentation-touch .slide-category .cat-icon {
  font-size: 2.4rem;
}

body.presentation-touch .slide-category h2 {
  font-size: 1.45rem;
}

body.presentation-touch .slide-category .cat-subtitle,
body.presentation-touch .slide-category .cat-desc {
  font-size: 0.8rem;
}

body.presentation-touch .cat-mod-list,
body.presentation-touch .cat-mod-list-grid {
  max-width: 100%;
  gap: 8px;
}

body.presentation-touch .cat-mod-item {
  padding: 10px 12px;
  font-size: 0.76rem;
}

body.presentation-touch .slide-module {
  width: 940px;
}

body.presentation-touch .slide-module h3 {
  font-size: 1.25rem;
}

body.presentation-touch .slide-module .mod-skill,
body.presentation-touch .slide-module .mod-learn {
  font-size: 0.82rem;
}

body.presentation-touch .mod-badge,
body.presentation-touch .mod-link,
body.presentation-touch .mod-num,
body.presentation-touch .mod-status-badge,
body.presentation-touch .mod-cat-badge {
  font-size: 0.62rem;
}

/* ============ HINT ============ */
.hint {
  position: fixed; bottom: 16px; left: 50%; transform: translateX(-50%);
  z-index: 999; pointer-events: none; opacity: 0; transition: opacity 1s;
}
.impress-on-overview .hint { opacity: 1; }
.hint p {
  font-size: 0.75rem; color: #484f58;
  background: rgba(13,17,23,0.8); padding: 5px 14px; border-radius: 16px;
  border: 1px solid #21262d;
}

/* ============ PROGRESS BAR ============ */
#pres-progress {
  position: fixed; bottom: 0; left: 0; height: 3px;
  background: linear-gradient(90deg, #58a6ff, #3fb950);
  z-index: 1001; transition: width 0.4s; width: 0;
}

/* ============ STEP COMMONS ============ */
.step {
  width: 1200px; padding: 40px 48px; border-radius: 16px;
  font-size: 1rem; transition: opacity 0.5s, visibility 0.5s;
  opacity: 0; visibility: hidden;
}
.step.active { opacity: 1; visibility: visible; }
.impress-on-overview .step { opacity: 0.6; visibility: visible; }
.impress-overview .step { opacity: 0.42 !important; visibility: visible !important; }
.impress-overview .step.active { opacity: 0.42 !important; }
.step-overview-auto {
  width: 1px;
  height: 1px;
  padding: 0;
  border: none;
  background: none;
}
.impress-overview .step-overview-auto {
  opacity: 0 !important;
  visibility: hidden !important;
}

@media (max-width: 1500px) {
  .compact-overview-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

/* ============ OVERVIEW ============ */
.slide-overview { text-align: center; background: transparent; width: 1380px; }
.slide-overview h1 {
  font-size: 2.4rem; font-weight: 800;
  background: linear-gradient(135deg, #58a6ff, #3fb950, #d29922);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
  margin-bottom: 12px;
}
.slide-overview .overview-sub { font-size: 1.05rem; color: #8b949e; margin-bottom: 42px; }
.overview-cats { display: flex; flex-wrap: wrap; gap: 20px; justify-content: center; }
.overview-cat-card {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  padding: 22px 26px; border-radius: 16px;
  background: rgba(255,255,255,0.03); border: 1px solid #21262d;
  cursor: pointer; transition: all 0.3s; min-width: 170px;
  text-decoration: none; color: inherit;
  position: relative;
}
.overview-cat-card:hover { background: rgba(88,166,255,0.08); border-color: var(--cat-color, #58a6ff); transform: scale(1.05); }
.overview-cat-card.card-completed { background: rgba(63,185,80,0.15); border-color: rgba(63,185,80,0.5); border-width: 2px; }
.overview-cat-card.card-in-progress { background: rgba(210,153,34,0.1); border-color: rgba(210,153,34,0.5); border-width: 2px; }
.overview-cat-card.card-not-started { opacity: 0.45; }
.overview-cat-status-badge {
  min-height: 24px;
  padding: 0 10px;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 700;
  line-height: 24px;
  color: transparent;
}
.overview-cat-status-badge.badge-completed {
  background: rgba(63,185,80,0.16);
  border: 1px solid rgba(63,185,80,0.28);
  color: #3fb950;
}
.overview-cat-status-badge.badge-started {
  background: rgba(210,153,34,0.16);
  border: 1px solid rgba(210,153,34,0.28);
  color: #d29922;
}
.overview-cat-icon { font-size: 2.1rem; }
.overview-cat-title { font-size: 0.95rem; font-weight: 700; }
.overview-cat-count { font-size: 0.76rem; color: #8b949e; }
.overview-cat-progress { font-size: 0.7rem; min-height: 14px; }
.overview-cat-progress.prog-done { color: #3fb950; }
.overview-cat-progress.prog-partial { color: #d29922; }
.overview-cat-progress.prog-none { color: #484f58; }

/* ============ CATEGORY SLIDE ============ */
.slide-category {
  text-align: center; background: rgba(13,17,23,0.6); border: 1px solid #21262d;
  transition: opacity 0.6s, background 0.6s, border-color 0.6s;
  width: 1240px;
}
.slide-category .cat-icon { font-size: 3rem; margin-bottom: 6px; }
.slide-category h2 { font-size: 1.8rem; font-weight: 800; margin-bottom: 4px; }
.slide-category .cat-subtitle { font-size: 0.9rem; color: #8b949e; margin-bottom: 8px; }
.slide-category .cat-desc { font-size: 0.9rem; color: #8b949e; line-height: 1.5; max-width: 920px; margin: 0 auto 18px; }
.slide-category.cat-dense { padding-top: 28px; padding-bottom: 30px; }
.slide-category.cat-dense .cat-icon { font-size: 2.5rem; margin-bottom: 2px; }
.slide-category.cat-dense h2 { font-size: 1.55rem; }
.slide-category.cat-dense .cat-subtitle { font-size: 0.82rem; margin-bottom: 6px; }
.slide-category.cat-dense .cat-desc { font-size: 0.8rem; line-height: 1.38; max-width: 940px; margin-bottom: 14px; }
.slide-category.cat-very-dense { padding-top: 24px; padding-bottom: 24px; }
.slide-category.cat-very-dense .cat-icon { font-size: 2.2rem; }
.slide-category.cat-very-dense h2 { font-size: 1.4rem; margin-bottom: 2px; }
.slide-category.cat-very-dense .cat-subtitle { font-size: 0.76rem; margin-bottom: 4px; }
.slide-category.cat-very-dense .cat-desc { font-size: 0.74rem; line-height: 1.32; margin-bottom: 10px; }
/* Category color accents */
.cat-first_day h2 { color: #f0883e; } .cat-first_day { border-color: rgba(240,136,62,0.3); }
.cat-first_week h2 { color: #58a6ff; } .cat-first_week { border-color: rgba(88,166,255,0.3); }
.cat-copilot h2 { color: #a371f7; } .cat-copilot { border-color: rgba(163,113,247,0.3); }
.cat-actions h2 { color: #3fb950; } .cat-actions { border-color: rgba(63,185,80,0.3); }
.cat-security h2 { color: #f85149; } .cat-security { border-color: rgba(248,81,73,0.3); }
.cat-switch h2 { color: #d29922; } .cat-switch { border-color: rgba(210,153,34,0.3); }
/* Completion states */
.cat-all-completed { background: rgba(63,185,80,0.08) !important; border-color: rgba(63,185,80,0.4) !important; }
.cat-in-progress { border-color: rgba(210,153,34,0.4) !important; }

/* Module list inside category slide */
 .cat-mod-list { display: flex; flex-direction: column; gap: 8px; max-width: 980px; margin: 0 auto; text-align: left; }
.cat-mod-list-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px 14px;
  max-width: 1080px;
  align-items: stretch;
}
.cat-mod-item {
  display: flex; align-items: center; gap: 12px; padding: 12px 18px; border-radius: 12px;
  text-decoration: none; color: #c9d1d9; font-size: 0.88rem;
  background: rgba(255,255,255,0.02); border: 1px solid transparent;
  transition: all 0.2s;
}
.slide-category.cat-dense .cat-mod-item { padding: 10px 14px; border-radius: 10px; font-size: 0.8rem; }
.slide-category.cat-dense .cat-mod-num { min-width: 18px; }
.slide-category.cat-dense .cat-mod-time { font-size: 0.76rem; }
.slide-category.cat-very-dense .cat-mod-list-grid { gap: 8px 12px; }
.slide-category.cat-very-dense .cat-mod-item { padding: 8px 12px; font-size: 0.74rem; }
.slide-category.cat-very-dense .cat-mod-time { font-size: 0.7rem; }
.cat-mod-item:hover { background: rgba(88,166,255,0.08); border-color: rgba(88,166,255,0.2); }
.cat-mod-num { font-weight: 700; color: #484f58; min-width: 22px; text-align: center; }
.cat-mod-title { flex: 1; }
.cat-mod-time { color: #484f58; font-size: 0.84rem; }

/* ============ MODULE SLIDE ============ */
.slide-module {
  background: rgba(13,17,23,0.75); border: 1px solid #21262d;
  transition: opacity 0.6s, border-color 0.4s, background 0.4s;
}
.slide-module.status-completed { border-color: rgba(63,185,80,0.4); background: rgba(63,185,80,0.04); }
.slide-module.status-started { border-color: rgba(210,153,34,0.4); }
.slide-module.status-not-started.active { opacity: 0.6; }

.mod-top-row { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; }
.mod-num {
  font-size: 0.72rem; font-weight: 700; color: #484f58;
  background: rgba(255,255,255,0.05); padding: 2px 8px; border-radius: 8px;
}
.mod-cat-badge {
  font-size: 0.62rem; font-weight: 600; padding: 2px 8px; border-radius: 8px;
  background: rgba(255,255,255,0.03); margin-left: auto;
}
.mod-status-badge {
  font-size: 0.65rem; font-weight: 700; padding: 2px 8px; border-radius: 8px;
}
.mod-status-completed { background: rgba(63,185,80,0.15); color: #3fb950; }
.mod-status-started { background: rgba(210,153,34,0.15); color: #d29922; }
.mod-status-not-started { background: rgba(255,255,255,0.03); color: #484f58; }

.slide-module h3 { font-size: 1.6rem; font-weight: 700; margin: 10px 0 6px; }
.slide-module .mod-skill { font-size: 0.85rem; color: #8b949e; margin-bottom: 14px; }
.slide-module .mod-learn {
  font-size: 0.95rem; color: #c9d1d9; line-height: 1.6;
  margin-bottom: 18px; padding: 12px 16px; border-radius: 8px;
  background: rgba(88,166,255,0.04); border-left: 3px solid #58a6ff;
}

.mod-footer { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.mod-badge {
  padding: 3px 10px; border-radius: 10px; font-size: 0.72rem; font-weight: 700; white-space: nowrap;
}
.mod-badge-free { background: rgba(35,134,54,0.15); color: #3fb950; border: 1px solid rgba(35,134,54,0.3); }
.mod-badge-copilot-pro { background: rgba(137,87,229,0.15); color: #a371f7; border: 1px solid rgba(137,87,229,0.3); }
.mod-badge-copilot-proplus { background: rgba(210,153,34,0.15); color: #d29922; border: 1px solid rgba(210,153,34,0.3); }
.mod-badge-time { background: rgba(88,166,255,0.12); color: #58a6ff; border: 1px solid rgba(88,166,255,0.25); }
.mod-link {
  display: inline-flex; align-items: center; gap: 3px;
  padding: 3px 12px; border-radius: 10px; font-size: 0.72rem; font-weight: 700;
  background: rgba(63,185,80,0.15); color: #3fb950; border: 1px solid rgba(63,185,80,0.3);
  text-decoration: none; transition: all 0.2s;
}
.mod-link:hover { background: rgba(63,185,80,0.25); }
.mod-link-theory { background: rgba(210,153,34,0.15); color: #d29922; border: 1px solid rgba(210,153,34,0.3); }
.mod-link-theory:hover { background: rgba(210,153,34,0.3); }
