/* === RETRO MAC DESKTOP === */

.desktop-body {
  margin: 0;
  padding: 0;
  overflow: hidden;
  height: 100vh;
  background:
    radial-gradient(ellipse at 30% 20%, rgba(217, 119, 87, 0.06) 0%, transparent 60%),
    radial-gradient(ellipse at 70% 80%, rgba(106, 155, 204, 0.04) 0%, transparent 50%),
    var(--bg);
}

:root.light .desktop-body {
  background:
    radial-gradient(ellipse at 30% 20%, rgba(217, 119, 87, 0.08) 0%, transparent 60%),
    radial-gradient(ellipse at 70% 80%, rgba(106, 155, 204, 0.06) 0%, transparent 50%),
    var(--bg);
}

/* === MENU BAR === */
.menubar {
  height: 28px;
  background: var(--bg-titlebar);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 12px;
  gap: 16px;
  font-size: 0.72rem;
  color: var(--cream);
  user-select: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 500;
}

.menubar-logo { color: var(--orange); font-size: 0.9rem; }
.menubar-item { cursor: default; }
.menubar-item:hover { color: var(--orange); }
.menubar-spacer { flex: 1; }
.menubar-stat { color: var(--text-dim); font-size: 0.65rem; }
.menubar-time { color: var(--text-muted); font-size: 0.7rem; font-weight: 500; }

/* === DESKTOP LAYOUT: sidebar + main === */
.desktop {
  position: fixed;
  top: 28px;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
}

/* === SIDEBAR === */
.sidebar {
  width: 280px;
  background: var(--bg-window);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  flex-shrink: 0;
}

.sidebar-header {
  padding: 16px 16px 12px;
  border-bottom: 1px solid var(--border);
}

.sidebar-title {
  font-family: 'Hanken Grotesk', system-ui, sans-serif;
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--orange);
  margin: 0 0 4px;
}

.sidebar-subtitle {
  font-size: 0.6rem;
  color: var(--text-dim);
}

.sidebar-progress {
  margin-top: 10px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.sidebar-progress-bar {
  flex: 1;
  height: 4px;
  background: var(--border);
  border-radius: 2px;
  overflow: hidden;
}

.sidebar-progress-fill {
  height: 100%;
  background: var(--orange);
  border-radius: 2px;
  transition: width 0.5s;
}

.sidebar-progress-text {
  font-size: 0.6rem;
  color: var(--text-dim);
  white-space: nowrap;
}

.sidebar-modules {
  flex: 1;
  overflow-y: auto;
  padding: 8px 0;
}

/* Module toggle */
.sidebar-module {
  border-bottom: 1px solid rgba(58, 58, 53, 0.5);
}

.sidebar-module-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  cursor: pointer;
  transition: background 0.1s;
  width: 100%;
  background: none;
  border: none;
  color: inherit;
  font-family: inherit;
  font-size: inherit;
  text-align: left;
}

.sidebar-module-toggle:hover {
  background: rgba(217, 119, 87, 0.06);
}

.sidebar-module-arrow {
  font-size: 0.55rem;
  color: var(--text-dim);
  transition: transform 0.2s;
  width: 12px;
}

.sidebar-module.open .sidebar-module-arrow {
  transform: rotate(90deg);
}

.sidebar-module-icon {
  font-size: 1rem;
}

.sidebar-module-info {
  flex: 1;
  min-width: 0;
}

.sidebar-module-name {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--cream);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-module-meta {
  font-size: 0.55rem;
  color: var(--text-dim);
}

.sidebar-module-badge {
  font-size: 0.6rem;
  color: var(--text-dim);
  padding: 1px 6px;
  border: 1px solid var(--border);
  border-radius: 4px;
  flex-shrink: 0;
}

.sidebar-module-badge.complete {
  border-color: var(--green-dim);
  color: var(--green);
  background: rgba(120, 140, 93, 0.1);
}

/* Lesson list (collapsible) */
.sidebar-lessons {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease;
}

.sidebar-module.open .sidebar-lessons {
  max-height: 300px;
}

.sidebar-lesson {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 16px 5px 40px;
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.7rem;
  transition: all 0.1s;
}

.sidebar-lesson:hover {
  background: rgba(217, 119, 87, 0.06);
  color: var(--orange);
  text-decoration: none;
}

.sidebar-lesson-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  border: 1px solid var(--border);
  flex-shrink: 0;
}

.sidebar-lesson-dot.done {
  background: var(--green);
  border-color: var(--green);
}

.sidebar-lesson-name {
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-lesson-type {
  font-size: 0.5rem;
  color: var(--text-dim);
  text-transform: uppercase;
}

/* === MAIN CONTENT === */
.main-content {
  flex: 1;
  overflow-y: auto;
  padding: 32px 40px;
}

/* Welcome area */
.welcome-section {
  margin-bottom: 32px;
}

.welcome-section h1 {
  font-family: 'Hanken Grotesk', system-ui, sans-serif;
  font-size: 1.8rem;
  color: var(--orange);
  margin: 0 0 6px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.welcome-section p {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin: 0;
}

/* Stats row */
.home-stats {
  display: flex;
  gap: 12px;
  margin-bottom: 32px;
}

.home-stat {
  background: var(--bg-window);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px 20px;
  min-width: 100px;
}

.home-stat-value {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--orange);
}

.home-stat-label {
  font-size: 0.6rem;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  margin-top: 2px;
}

/* Continue button */
.continue-section {
  background: var(--bg-window);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 16px 20px;
  margin-bottom: 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.continue-info h3 {
  font-size: 0.8rem;
  color: var(--cream);
  margin: 0 0 4px;
  font-weight: 600;
}

.continue-info p {
  font-size: 0.65rem;
  color: var(--text-dim);
  margin: 0;
}

.continue-btn-home {
  padding: 8px 20px;
  background: var(--orange-dim);
  border: 1px solid var(--orange);
  border-radius: 8px;
  color: var(--cream);
  font-family: inherit;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.15s;
}

.continue-btn-home:hover {
  background: var(--orange);
  color: var(--bg);
  text-decoration: none;
}

/* === PRACTICE SECTION === */
.practice-section {
  margin-top: 32px;
}

.practice-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.practice-header h2 {
  font-family: 'Hanken Grotesk', system-ui, sans-serif;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--cream);
  margin: 0;
  border: none;
  padding: 0;
}

.practice-header span {
  font-size: 0.6rem;
  color: var(--text-dim);
}

.practice-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 12px;
}

.practice-card {
  background: var(--bg-window);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 16px;
  cursor: pointer;
  transition: all 0.15s;
}

.practice-card:hover {
  border-color: var(--orange-dim);
  background: rgba(217, 119, 87, 0.04);
}

.practice-card-icon {
  font-size: 1.5rem;
  margin-bottom: 8px;
}

.practice-card-title {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--cream);
  margin-bottom: 4px;
}

.practice-card-desc {
  font-size: 0.65rem;
  color: var(--text-dim);
  line-height: 1.4;
}

.practice-card-module {
  font-size: 0.55rem;
  color: var(--orange);
  margin-top: 8px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.practice-empty {
  text-align: center;
  padding: 24px;
  color: var(--text-dim);
  font-size: 0.75rem;
  border: 1px dashed var(--border);
  border-radius: 10px;
  grid-column: 1 / -1;
}

/* === HIGHLIGHTS === */
.highlights-section { margin-top: 32px; }

.highlight-card {
  background: var(--bg-window);
  border: 1px solid var(--border);
  border-left: 3px solid var(--orange);
  border-radius: 0 8px 8px 0;
  padding: 12px 14px;
  margin-bottom: 8px;
  transition: all 0.12s;
}

.highlight-card:hover { border-left-color: var(--orange-dim); }

.highlight-card-text {
  font-size: 0.8rem;
  color: var(--cream-dim);
  line-height: 1.5;
  margin-bottom: 8px;
}

.highlight-card-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.6rem;
}

.highlight-card-lesson {
  color: var(--orange);
  text-decoration: none;
  font-weight: 500;
}

.highlight-card-lesson:hover { text-decoration: underline; }

.highlight-card-date {
  color: var(--text-dim);
  flex: 1;
}

.highlight-card-remove {
  background: none;
  border: none;
  color: var(--text-dim);
  cursor: pointer;
  font-size: 0.7rem;
  padding: 0 2px;
  opacity: 0;
  transition: all 0.12s;
}

.highlight-card:hover .highlight-card-remove { opacity: 1; }
.highlight-card-remove:hover { color: var(--red); }

/* Reset button */
.reset-btn {
  background: none;
  border: 1px solid var(--border);
  color: var(--text-dim);
  padding: 4px 10px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.6rem;
  font-family: inherit;
  transition: all 0.15s;
}

.reset-btn:hover { border-color: var(--red); color: var(--red); }

/* === RESPONSIVE === */
@media (max-width: 768px) {
  .sidebar { width: 220px; }
  .main-content { padding: 20px; }
  .welcome-section h1 { font-size: 1.4rem; }
  .home-stats { flex-wrap: wrap; }
}

@media (max-width: 640px) {
  .desktop { flex-direction: column; }
  .sidebar {
    width: 100%;
    max-height: 40vh;
    border-right: none;
    border-bottom: 1px solid var(--border);
  }
}
