:root {
  --bg: #0e0f12;
  --bg-elev: #16181d;
  --bg-hover: #1f222a;
  --border: #262932;
  --text: #e8e9ec;
  --text-dim: #9297a3;
  --accent: #c9a24b;
  --accent-dim: #4a3f22;
  --done: #4caf7d;
  --sidebar-w: 340px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  height: 100%;
}

#app {
  display: flex;
  height: 100vh;
  overflow: hidden;
}

#menuToggle {
  display: none;
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 50;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  color: var(--text);
  font-size: 20px;
  width: 42px;
  height: 42px;
  border-radius: 8px;
  cursor: pointer;
}

#sidebar {
  width: var(--sidebar-w);
  min-width: var(--sidebar-w);
  background: var(--bg-elev);
  border-right: 1px solid var(--border);
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}

.sidebar-header {
  padding: 20px 18px 14px;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  background: var(--bg-elev);
  z-index: 2;
}

.sidebar-header h1 {
  margin: 0;
  font-size: 18px;
  letter-spacing: 0.08em;
  color: var(--accent);
  font-weight: 600;
}

#nav {
  padding: 8px 0 40px;
}

.fase-block { border-bottom: 1px solid var(--border); }

.fase-title {
  padding: 14px 18px;
  cursor: pointer;
  font-weight: 600;
  font-size: 14px;
  color: var(--text);
  display: flex;
  justify-content: space-between;
  align-items: center;
  user-select: none;
}
.fase-title:hover { background: var(--bg-hover); }
.fase-title .arrow { transition: transform 0.15s; color: var(--text-dim); font-size: 12px; }
.fase-block.open .fase-title .arrow { transform: rotate(90deg); }

.fase-body { display: none; padding-bottom: 6px; }
.fase-block.open .fase-body { display: block; }

.passo-title {
  padding: 10px 18px 10px 30px;
  cursor: pointer;
  font-size: 13px;
  color: var(--text-dim);
  display: flex;
  justify-content: space-between;
  align-items: center;
  user-select: none;
}
.passo-title:hover { background: var(--bg-hover); color: var(--text); }
.passo-title .arrow { transition: transform 0.15s; font-size: 11px; }
.passo-block.open .passo-title .arrow { transform: rotate(90deg); }

.passo-body { display: none; }
.passo-block.open .passo-body { display: block; }

.modulo-label {
  padding: 6px 18px 4px 42px;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-dim);
  opacity: 0.7;
}

.video-item {
  padding: 8px 18px 8px 42px;
  font-size: 13px;
  cursor: pointer;
  color: var(--text-dim);
  display: flex;
  align-items: center;
  gap: 8px;
  line-height: 1.4;
}
.video-item:hover { background: var(--bg-hover); color: var(--text); }
.video-item.active { background: var(--accent-dim); color: var(--accent); font-weight: 600; }

.check {
  flex-shrink: 0;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 1.5px solid var(--text-dim);
  display: inline-block;
}
.video-item.watched .check {
  background: var(--done);
  border-color: var(--done);
}
.video-item.active .check { border-color: var(--accent); }

#main {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  background: var(--bg);
}

.player-wrap {
  width: 100%;
  background: #000;
  display: flex;
  justify-content: center;
}

#player {
  width: 100%;
  max-width: 1200px;
  max-height: 80vh;
  aspect-ratio: 16/9;
  background: #000;
}

.player-info {
  padding: 24px 32px 40px;
  max-width: 1200px;
  margin: 0 auto;
  width: 100%;
}

#videoTitle {
  font-size: 20px;
  margin: 0 0 4px;
  font-weight: 600;
}

#videoPath {
  color: var(--text-dim);
  font-size: 13px;
  margin: 0 0 20px;
}

.nav-buttons {
  display: flex;
  gap: 10px;
}

.nav-buttons button {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 10px 18px;
  border-radius: 8px;
  font-size: 13px;
  cursor: pointer;
}
.nav-buttons button:hover { background: var(--bg-hover); }
.nav-buttons button:disabled { opacity: 0.4; cursor: default; }

@media (max-width: 860px) {
  #menuToggle { display: block; }
  #sidebar {
    position: fixed;
    top: 0;
    left: 0;
    height: 100%;
    z-index: 40;
    transform: translateX(-100%);
    transition: transform 0.2s ease;
    box-shadow: 4px 0 20px rgba(0,0,0,0.4);
  }
  #sidebar.open { transform: translateX(0); }
  .player-info { padding: 20px 16px 32px; }
  #player { max-height: 50vh; }
}
