@import url("https://fonts.googleapis.com/css2?family=Montserrat:ital,wght@0,100..900;1,100..900&display=swap");

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  display: flex;
  min-height: 100vh;
  font-family: "Montserrat", sans-serif;
  font-optical-sizing: auto;
  font-style: normal;
  background: #f2f3f5;
  color: #1f2937;
}

button {
  font-family: inherit;
}

/* Global nav */

.global-nav {
  width: 100px;
  background: #06172d;
  color: white;
  padding: 16px 10px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  align-items: center;
  position: fixed;
  left: 0;
  top: 0;
  bottom: 0;
}

.logo-box {
  width: 52px;
  height: 52px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  overflow: hidden;
}

.logo-box img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.global-nav a {
  color: white;
  text-decoration: none;
  font-size: 13px;
  text-align: center;
  font-weight: 600;
  padding: 8px 4px;
  border-radius: 6px;
  width: 100%;
}

.global-nav a:hover,
.global-nav a.active-nav {
  background: #004198;
}

/* Course nav: hidden until inside a course */

.course-nav {
  display: none;
  width: 250px;
  background: #ffffff;
  border-right: 1px solid #d7dce3;
  padding: 26px 16px;
  position: fixed;
  left: 100px;
  top: 0;
  bottom: 0;
  overflow-y: auto;
}

body.course-open .course-nav {
  display: block;
}

.course-nav h2 {
  margin: 0 0 24px;
  color: #0b1f3a;
  font-size: 22px;
  border-bottom: 1px solid #ddd;
  padding-bottom: 18px;
}

.course-nav button {
  display: block;
  width: 100%;
  text-align: left;
  padding: 12px 14px;
  margin-bottom: 8px;
  border: none;
  background: transparent;
  border-radius: 4px;
  cursor: pointer;
  color: #1f2937;
  font-size: 15px;
  border-left: 4px solid transparent;
}

.course-nav button:hover,
.course-nav button.active-nav {
  background: #edf2ff;
  color: #004198;
  border-left-color: #004198;
  font-weight: 700;
}

/* Main content */

.content {
  margin-left: 100px;
  padding: 34px;
  width: calc(100% - 100px);
  background: #f2f3f5;
}

body.course-open .content {
  margin-left: 336px;
  width: calc(100% - 336px);
}

.auth-bar {
  background: white;
  border: 1px solid #d7dce3;
  padding: 14px 18px;
  border-radius: 10px;
  margin-bottom: 24px;
  display: flex;
  gap: 14px;
  align-items: center;
  justify-content: space-between;
}

.auth-bar a {
  background: #004198;
  color: white;
  padding: 9px 14px;
  border-radius: 8px;
  text-decoration: none;
}

.page {
  display: none;
}

.page.active {
  display: block;
}

.page h1 {
  font-size: 32px;
  font-weight: 700;
  margin-top: 0;
  color: #0b1f3a;
}

.subtitle {
  color: #6b7280;
  font-size: 18px;
  margin-top: -6px;
}

/* Canvas-style blocks */

.canvas-header {
  background: white;
  border: 1px solid #d7dce3;
  border-left: 5px solid #004198;
  padding: 24px;
  margin-bottom: 22px;
  border-radius: 4px;
}

.canvas-header h1 {
  margin: 0;
}

.locked-header {
  border-left-color: #6b7280;
}

.canvas-grid {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 24px;
}

.canvas-sidebar-card,
.card,
.owned-courses-box,
.course-progress-card,
.lesson-viewer,
.module {
  background: white;
  border: 1px solid #d7dce3;
  border-radius: 4px;
  padding: 22px;
  margin-bottom: 18px;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 320px));
  gap: 18px;
  margin-top: 24px;
}

.card h3,
.owned-courses-box h3 {
  margin-top: 0;
  color: #0b1f3a;
}

.card button,
.complete-btn,
.next-btn,
.progress-item button {
  background: #004198;
  color: white;
  border: none;
  padding: 11px 16px;
  border-radius: 4px;
  cursor: pointer;
}

.card button:hover,
.complete-btn:hover,
.next-btn:hover,
.progress-item button:hover {
  background: #003070;
}

/* Badges */

.course-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.role-badge {
  display: inline-block;
  padding: 8px 12px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 600;
  background: #e5e7eb;
  color: #111827;
}

.role-badge.blue {
  background: #dbeafe;
  color: #1e40af;
}

.role-badge.purple {
  background: #ede9fe;
  color: #5b21b6;
}

.role-badge.green {
  background: #dcfce7;
  color: #166534;
}

.role-badge.orange {
  background: #ffedd5;
  color: #9a3412;
}

.role-badge.teal {
  background: #ccfbf1;
  color: #115e59;
}

.role-badge.locked {
  background: #f3f4f6;
  color: #6b7280;
}

/* Course cards */

.course-tile {
  background: white;
  border: 1px solid #cfd4dc;
  border-radius: 4px;
  overflow: hidden;
}

.course-tile.unlocked {
  border-color: #004198;
}

.course-tile.locked-preview {
  opacity: 0.94;
}

.course-tile-image {
  height: 120px;
  background: #004198;
  position: relative;
  overflow: hidden;
}

.course-tile-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.course-tile-image.blue {
  background: #004198;
}

.course-tile-image.purple {
  background: #6d28d9;
}

.course-tile-image.green {
  background: #15803d;
}

.course-tile-image.orange {
  background: #c2410c;
}

.course-tile-image.teal {
  background: #0f766e;
}

.course-lock-pill {
  position: absolute;
  top: 12px;
  left: 12px;
  background: rgba(255, 255, 255, 0.5);
  color: #111827;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
}

.course-tile-body {
  padding: 18px;
}

.course-tile h3 {
  margin-top: 0;
  color: #0b1f3a;
}

.course-code {
  color: #6b7280;
  font-size: 13px;
  margin-bottom: 8px;
}

.course-role-line {
  font-size: 14px;
  color: #4b5563;
  margin: 14px 0;
}

.course-tile button {
  background: #004198;
  color: white;
  border: none;
  padding: 10px 14px;
  border-radius: 4px;
  cursor: pointer;
}

.course-tile.locked-preview button {
  background: #6b7280;
}

.course-tile button:hover {
  filter: brightness(0.9);
}

/* Progress */

.mini-progress {
  margin-bottom: 14px;
}

.mini-progress-text {
  font-size: 13px;
  color: #6b7280;
  margin-bottom: 6px;
}

.progress-bar-wrap {
  width: 100%;
  background: #d7dce3;
  border-radius: 999px;
  overflow: hidden;
  height: 18px;
  margin: 12px 0 8px;
}

.progress-bar-wrap.small {
  height: 9px;
  margin: 8px 0;
}

.progress-bar {
  height: 100%;
  width: 0%;
  background: #004198;
  transition: width 0.25s ease;
}

/* Modules */

.module-header {
  width: 100%;
  background: #004198;
  color: white;
  border: none;
  padding: 16px;
  border-radius: 4px;
  text-align: left;
  font-size: 17px;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
}

.module-progress {
  margin: 10px 0;
}

.module-content {
  display: none;
  margin-top: 12px;
}

.module-content.open {
  display: block;
}

.inline-lesson {
  margin-bottom: 10px;
}

.inline-lesson-body {
  background: #ffffff;
  border: 1px solid #d7dce3;
  border-top: none;
  padding: 18px;
  margin-top: -8px;
  margin-bottom: 14px;
  display: none;
}

.lesson-inline-content {
  padding-top: 4px;
}

.lesson-button {
  display: flex;
  justify-content: space-between;
  width: 100%;
  padding: 13px;
  margin: 8px 0;
  border: 1px solid #d7dce3;
  background: #f9fafb;
  border-radius: 4px;
  cursor: pointer;
  text-align: left;
}

.lesson-button:hover {
  background: #edf2ff;
}

.lesson-viewer {
  margin-top: 26px;
}

.lesson-viewer h2 {
  color: #004198;
}

.lesson-step {
  border-left: 4px solid #004198;
  padding-left: 16px;
  margin: 22px 0;
}

/* Code blocks */

pre {
  background: #0b1f3a;
  color: white;
  padding: 16px;
  border-radius: 4px;
  overflow-x: auto;
  line-height: 1.5;
}

code {
  background: #edf2ff;
  color: #004198;
  padding: 2px 6px;
  border-radius: 4px;
}

/* Lesson actions */

.lesson-actions {
  display: flex;
  gap: 10px;
  margin-top: 22px;
}

.discord-btn {
  display: inline-block;
  background: #004198;
  color: white;
  border: none;
  padding: 12px 18px;
  border-radius: 4px;
  text-decoration: none;
}

/* Progress page */

.progress-item {
  background: white;
  border: 1px solid #d7dce3;
  padding: 14px;
  border-radius: 4px;
  margin-bottom: 10px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

/* Locked preview */

.locked-preview-layout {
  display: grid;
  grid-template-columns: 380px 1fr;
  gap: 24px;
}

.locked-preview-image {
  background: white;
  border: 1px solid #d7dce3;
  border-radius: 4px;
  overflow: hidden;
  height: 240px;
}

.locked-preview-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Mobile */

@media (max-width: 850px) {
  body,
  body.course-open {
    display: block;
  }

  .global-nav {
    position: static;
    width: 100%;
    height: auto;
    flex-direction: row;
    justify-content: center;
  }

  .course-nav,
  body.course-open .course-nav {
    position: static;
    width: 100%;
    border-right: none;
    border-bottom: 1px solid #d7dce3;
  }

  .content,
  body.course-open .content {
    margin-left: 0;
    width: 100%;
    padding: 20px;
  }

  .canvas-grid,
  .locked-preview-layout {
    grid-template-columns: 1fr;
  }

  .auth-bar {
    flex-direction: column;
    align-items: flex-start;
  }

  .dashboard-grid {
    grid-template-columns: 1fr;
  }
}
