*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #f3f4f6;
  color: #111827;
}

/* Header */

.app-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem 1.25rem;
  background: #111827;
  color: #f9fafb;
}

.app-header h1 {
  margin: 0;
  font-size: 1.25rem;
}

.tagline {
  display: block;
  font-size: 0.8rem;
  color: #9ca3af;
}

.app-layout {
  display: flex;
  min-height: calc(100vh - 60px);
}

/* Sidebar */

.sidebar {
  width: 260px;
  background: #1f2937;
  color: #e5e7eb;
  padding: 0.75rem;
  display: flex;
  flex-direction: column;
}

.sidebar-section {
  margin-bottom: 0.75rem;
}

.sidebar input[type="text"] {
  width: 100%;
  padding: 0.5rem;
  border-radius: 0.375rem;
  border: 1px solid #374151;
  background: #111827;
  color: #e5e7eb;
}

.sidebar-nav {
  flex: 1;
  overflow-y: auto;
}

.module {
  margin-bottom: 0.75rem;
}

.module-title {
  font-size: 0.9rem;
  font-weight: 600;
  text-transform: uppercase;
  color: #9ca3af;
  margin-bottom: 0.25rem;
}

.lesson-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.lesson-item {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.35rem 0.45rem;
  margin-bottom: 0.15rem;
  border-radius: 0.375rem;
  cursor: pointer;
  font-size: 0.9rem;
}

.lesson-item:hover {
  background: #111827;
}

.lesson-item.active {
  background: #fbbf24;
  color: #111827;
}

.lesson-title {
  flex: 1;
}

/* Badges */

.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.1rem 0.4rem;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 500;
}

.badge-neutral {
  background: #e5e7eb;
  color: #374151;
}

.badge-complete {
  background: #22c55e;
  color: #064e3b;
}

.badge-inprogress {
  background: #fbbf24;
  color: #78350f;
}

/* Main panel */

.main-panel {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 0.75rem;
  gap: 0.75rem;
}

.lesson-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.lesson-header h2 {
  margin: 0;
  font-size: 1.1rem;
}

.lesson-content {
  flex: 1;
  background: #ffffff;
  border-radius: 0.5rem;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
  overflow: hidden;
}

#lessonFrame {
  width: 100%;
  height: 100%;
  border: none;
}

/* Footer */

.app-footer {
  padding: 0.5rem 1.25rem;
  font-size: 0.75rem;
  color: #6b7280;
  background: #f9fafb;
}

/* Buttons */

button.btn-outline {
  border-radius: 999px;
  border: 1px solid #9ca3af;
  background: transparent;
  color: #e5e7eb;
  padding: 0.25rem 0.75rem;
  font-size: 0.8rem;
  cursor: pointer;
}

button.btn-outline:hover {
  border-color: #fbbf24;
}

/* Responsive */

@media (max-width: 768px) {
  .app-layout {
    flex-direction: column;
  }

  .sidebar {
    width: 100%;
    flex-direction: column;
    max-height: 220px;
  }

  .main-panel {
    min-height: calc(100vh - 220px - 60px);
  }
}
