/* Glossi Learn - Shared Styles */

@font-face { font-family: 'PP Mori'; src: url('../fonts/PPMori-Regular.otf') format('opentype'); font-weight: 400; }
@font-face { font-family: 'PP Mori'; src: url('../fonts/PPMori-SemiBold.otf') format('opentype'); font-weight: 600; }

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  -webkit-font-smoothing: antialiased;
  background: #ffffff;
  color: #171717;
  font-size: 15px;
  line-height: 1.6;
}

/* Navigation */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 60px;
  background: rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(16px) saturate(180%);
  -webkit-backdrop-filter: blur(16px) saturate(180%);
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
  z-index: 1000;
  display: flex;
  justify-content: center;
  padding: 0 24px;
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  max-width: 1200px;
}

.nav-left {
  display: flex;
  align-items: center;
  gap: 24px;
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: #171717;
  transition: opacity 0.15s ease;
}

.nav-logo:hover { opacity: 0.7; }

.nav-logo-mark {
  width: 24px;
  height: 28px;
}

.nav-logo-mark svg {
  width: 100%;
  height: 100%;
}

.nav-logo-text {
  font-family: 'PP Mori', sans-serif;
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -0.025em;
}

.nav-breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: #737373;
}

.nav-breadcrumb a {
  color: #737373;
  text-decoration: none;
}

.nav-breadcrumb a:hover { color: #171717; }
.nav-breadcrumb span { color: #d4d4d4; }
.nav-breadcrumb-current { color: #171717; font-weight: 500; }

.nav-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.nav-request-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.nav-request-btn svg {
  width: 14px;
  height: 14px;
}

@media (max-width: 600px) {
  .nav-request-btn span,
  .nav-request-btn:not(:has(svg)) {
    display: none;
  }
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  text-decoration: none;
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-sm {
  padding: 6px 14px;
  font-size: 12px;
  border-radius: 100px;
}

.btn-ghost {
  background: transparent;
  color: #525252;
}

.btn-ghost:hover {
  color: #171717;
  background: rgba(0, 0, 0, 0.04);
}

.btn-primary {
  background: #171717;
  color: #fff;
  border-color: #171717;
}

.btn-primary:hover {
  background: #262626;
}

/* Layout */
.page-container {
  display: grid;
  grid-template-columns: 260px 1fr;
  min-height: 100vh;
  padding-top: 60px;
}

@media (max-width: 900px) {
  .page-container { grid-template-columns: 1fr; }
  .sidebar { display: none; }
  .nav-breadcrumb { display: none; }
}

/* Sidebar */
.sidebar {
  border-right: 1px solid rgba(0, 0, 0, 0.06);
  padding: 32px 24px;
  position: sticky;
  top: 60px;
  height: calc(100vh - 60px);
  overflow-y: auto;
  overscroll-behavior: contain;
  /* No scroll-behavior: smooth - causes jumpiness on page load */
}

/* Subtle scrollbar */
.sidebar::-webkit-scrollbar { width: 6px; }
.sidebar::-webkit-scrollbar-track { background: transparent; }
.sidebar::-webkit-scrollbar-thumb { 
  background: transparent; 
  border-radius: 3px;
  transition: background 0.2s;
}
.sidebar:hover::-webkit-scrollbar-thumb { background: rgba(0,0,0,0.1); }
.sidebar::-webkit-scrollbar-thumb:hover { background: rgba(0,0,0,0.2); }

.sidebar-section { margin-bottom: 24px; }

.sidebar-section:first-child {
  padding-bottom: 20px;
  margin-bottom: 20px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

.sidebar-section:first-child .sidebar-nav-list {
  gap: 6px;
}

.sidebar-title {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #a3a3a3;
  margin-bottom: 8px;
  padding-left: 12px;
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 12px;
  font-size: 13px;
  color: #525252;
  text-decoration: none;
  border-radius: 6px;
  transition: background 0.1s ease, color 0.1s ease;
  /* Prevent layout shift on font-weight change */
  text-shadow: 0 0 0 transparent;
}

.sidebar-link:hover {
  background: rgba(0, 0, 0, 0.04);
  color: #171717;
}

.sidebar-link.active {
  background: rgba(0, 0, 0, 0.06);
  color: #171717;
  font-weight: 500;
}

/* Removed activeHighlight animation - causes visual jumpiness */

.sidebar-link svg {
  width: 16px;
  height: 16px;
  opacity: 0.6;
  flex-shrink: 0;
}

.sidebar-link.active svg { opacity: 1; }

/* Collapsible sidebar section */
.sidebar-collapse {
  margin-top: 1px;
}

.sidebar-collapse-trigger {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 7px 12px;
  background: none;
  border: none;
  border-radius: 6px;
  font-family: inherit;
  font-size: 13px;
  color: #525252;
  cursor: pointer;
  transition: background 0.1s ease, color 0.1s ease;
  text-align: left;
}

.sidebar-collapse-trigger:hover {
  background: rgba(0, 0, 0, 0.04);
  color: #171717;
}

.sidebar-collapse-trigger > svg:first-child {
  width: 16px;
  height: 16px;
  opacity: 0.6;
  flex-shrink: 0;
}

.sidebar-collapse-arrow {
  width: 12px;
  height: 12px;
  margin-left: auto;
  opacity: 0.4;
  transition: transform 0.15s ease;
  flex-shrink: 0;
}

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

.sidebar-collapse-content {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 0.15s ease-out;
  padding-left: 26px;
}

.sidebar-collapse-inner {
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.sidebar-collapse.open .sidebar-collapse-content {
  grid-template-rows: 1fr;
}

.sidebar-link-child {
  font-size: 13px;
  padding: 6px 12px;
}

/* Featured navigation links (top of sidebar) */
.sidebar-featured {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  font-family: 'PP Mori', -apple-system, sans-serif;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: -0.005em;
  text-decoration: none;
  border-radius: 6px;
  cursor: pointer;
  background: transparent;
  color: #525252;
  transition: background 0.1s ease, color 0.1s ease;
}

.sidebar-featured:hover {
  background: rgba(0, 0, 0, 0.04);
  color: #171717;
}

.sidebar-featured.active {
  background: rgba(0, 0, 0, 0.06);
  color: #171717;
  font-weight: 600;
}

.sidebar-featured svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  opacity: 0.6;
  transition: opacity 0.1s ease;
}

.sidebar-featured:hover svg {
  opacity: 0.8;
}

.sidebar-featured.active svg {
  opacity: 1;
}

/* Content */
.content {
  padding: 48px 64px;
  max-width: 800px;
  animation: contentFadeIn 0.15s ease-out;
}

@keyframes contentFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@media (max-width: 600px) {
  .content { padding: 24px; }
}

.content-header { margin-bottom: 40px; }

.content-badge {
  display: inline-flex;
  padding: 4px 10px;
  background: rgba(0, 0, 0, 0.04);
  border-radius: 100px;
  font-size: 11px;
  font-weight: 500;
  color: #737373;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  margin-bottom: 16px;
}

.content-title {
  font-family: 'PP Mori', sans-serif;
  font-size: clamp(32px, 5vw, 42px);
  font-weight: 600;
  letter-spacing: -0.035em;
  line-height: 1.15;
  margin-bottom: 16px;
}

.content-description {
  font-size: 17px;
  color: #525252;
  line-height: 1.6;
  max-width: 600px;
}

/* Video */
.video-container {
  position: relative;
  width: 100%;
  padding-bottom: 56.25%;
  background: #0a0a0a;
  border-radius: 12px;
  overflow: hidden;
  margin-bottom: 48px;
}

.video-placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: #fff;
  gap: 12px;
}

.video-play-btn {
  width: 64px;
  height: 64px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
}

.video-play-btn:hover {
  background: rgba(255, 255, 255, 0.15);
  transform: scale(1.05);
}

.video-play-btn svg {
  width: 24px;
  height: 24px;
  margin-left: 3px;
}

.video-label {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.5);
}

/* Prose (Markdown content) */
.prose {
  font-size: 15px;
  line-height: 1.7;
  color: #404040;
}

.prose h2 {
  font-family: 'PP Mori', sans-serif;
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: #171717;
  margin: 40px 0 16px;
}

.prose h2:first-child { margin-top: 0; }

.prose h3 {
  font-size: 16px;
  font-weight: 600;
  color: #171717;
  margin: 32px 0 12px;
}

.prose p { margin-bottom: 16px; }

.prose p.lead {
  font-size: 18px;
  line-height: 1.6;
  color: #525252;
  margin-bottom: 32px;
}

.prose ul, .prose ol {
  margin-bottom: 16px;
  padding-left: 24px;
}

.prose li { margin-bottom: 8px; }

.prose strong {
  color: #171717;
  font-weight: 600;
}

.prose a {
  color: #171717;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.prose a:hover { color: #525252; }

.prose code {
  font-family: 'SF Mono', Monaco, Consolas, monospace;
  font-size: 13px;
  background: rgba(0, 0, 0, 0.04);
  padding: 2px 6px;
  border-radius: 4px;
}

.prose pre {
  background: #0a0a0a;
  color: #e5e5e5;
  padding: 16px 20px;
  border-radius: 8px;
  overflow-x: auto;
  margin: 24px 0;
}

.prose pre code {
  background: none;
  padding: 0;
  font-size: 13px;
}

.prose blockquote {
  border-left: 3px solid #e5e5e5;
  padding-left: 20px;
  margin: 24px 0;
  color: #737373;
  font-style: italic;
}

.prose img {
  max-width: 100%;
  border-radius: 8px;
  margin: 24px 0;
}

.prose table {
  width: 100%;
  border-collapse: collapse;
  margin: 24px 0;
  font-size: 14px;
}

.prose th, .prose td {
  padding: 12px 16px;
  text-align: left;
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

.prose th {
  font-weight: 600;
  color: #171717;
  background: #fafafa;
}

.prose hr {
  border: none;
  border-top: 1px solid rgba(0, 0, 0, 0.06);
  margin: 40px 0;
}

/* Loading */
.loading {
  text-align: center;
  padding: 40px;
  color: #737373;
}

/* Lesson navigation */
.lesson-nav {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-top: 64px;
  padding-top: 32px;
  border-top: 1px solid rgba(0, 0, 0, 0.06);
}

@media (max-width: 500px) {
  .lesson-nav { grid-template-columns: 1fr; }
}

.lesson-nav-item {
  padding: 20px;
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 12px;
  text-decoration: none;
  color: inherit;
  transition: all 0.15s ease;
}

.lesson-nav-item:hover {
  background: #fafafa;
  border-color: rgba(0, 0, 0, 0.12);
}

.lesson-nav-item.prev { text-align: left; }
.lesson-nav-item.next { text-align: right; }

.lesson-nav-label {
  font-size: 11px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #a3a3a3;
  margin-bottom: 6px;
}

.lesson-nav-title {
  font-size: 14px;
  font-weight: 600;
  color: #171717;
}

/* Sidebar - Dynamic Content */
.sidebar-nav-list {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.sidebar-category {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #a3a3a3;
  padding: 12px 12px 4px;
  margin-top: 4px;
}

.sidebar-category:first-child {
  margin-top: 8px;
}

.sidebar-badge {
  display: inline-flex;
  padding: 2px 6px;
  background: #e5e5e5;
  color: #737373;
  font-size: 9px;
  font-weight: 600;
  border-radius: 4px;
  margin-left: auto;
  vertical-align: middle;
}

.sidebar-link.coming-soon {
  color: #a3a3a3;
  pointer-events: none;
}

.sidebar-cta {
  padding-top: 24px;
  border-top: 1px solid rgba(0, 0, 0, 0.06);
}

.sidebar-request-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 10px 16px;
  background: transparent;
  border: 1px dashed rgba(0, 0, 0, 0.15);
  border-radius: 8px;
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  color: #737373;
  cursor: pointer;
  transition: all 0.15s ease;
}

.sidebar-request-btn:hover {
  border-color: #ec5f3f;
  color: #ec5f3f;
  background: rgba(236, 95, 63, 0.04);
}

.sidebar-request-btn svg {
  width: 16px;
  height: 16px;
}

.sidebar-duration-badge {
  margin-left: auto;
  padding: 2px 6px;
  background: rgba(236, 95, 63, 0.1);
  color: #ec5f3f;
  font-size: 10px;
  font-weight: 600;
  border-radius: 4px;
}

/* Modal */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 2000;
  align-items: center;
  justify-content: center;
  padding: 24px;
  animation: modalOverlayIn 0.2s ease-out;
}

@keyframes modalOverlayIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes modalIn {
  from { opacity: 0; transform: scale(0.95) translateY(10px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

.modal-overlay.active {
  display: flex;
}

.modal {
  background: #fff;
  border-radius: 20px;
  width: 100%;
  max-width: 400px;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.25), 0 0 0 1px rgba(0, 0, 0, 0.05);
  overflow: hidden;
  animation: modalIn 0.25s ease-out;
}

.modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 24px 24px 0;
}

.modal-header h3 {
  font-family: 'PP Mori', -apple-system, sans-serif;
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.02em;
  margin: 0;
  color: #171717;
}

.modal-close {
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f5f5f5;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  color: #737373;
  transition: all 0.15s ease;
  margin: -4px -4px 0 0;
}

.modal-close:hover {
  background: #e5e5e5;
  color: #171717;
}

.modal-close svg {
  width: 14px;
  height: 14px;
}

.modal-body {
  padding: 20px 24px 24px;
}

.modal-body > p:first-child {
  margin: 0 0 20px;
  color: #737373;
  font-size: 14px;
  line-height: 1.5;
}

.form-group {
  margin-bottom: 16px;
}

.form-group:last-child {
  margin-bottom: 0;
}

.form-group label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: #171717;
  margin-bottom: 8px;
}

.form-group input,
.form-group textarea {
  width: 100%;
  padding: 12px 14px;
  font-family: inherit;
  font-size: 14px;
  border: 1px solid #e5e5e5;
  border-radius: 10px;
  background: #fafafa;
  transition: all 0.15s ease;
}

.form-group input::placeholder,
.form-group textarea::placeholder {
  color: #a3a3a3;
}

.form-group input:focus,
.form-group textarea:focus {
  outline: none;
  border-color: #171717;
  background: #fff;
  box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.08);
}

.form-group textarea {
  resize: vertical;
  min-height: 80px;
}

.modal-footer {
  display: flex;
  gap: 10px;
  padding: 0 24px 24px;
}

.modal-footer .btn {
  flex: 1;
  padding: 12px 20px;
  font-size: 14px;
  font-weight: 500;
  border-radius: 10px;
  justify-content: center;
}

.modal-footer .btn-ghost {
  background: #f5f5f5;
  color: #525252;
  border: none;
}

.modal-footer .btn-ghost:hover {
  background: #e5e5e5;
  color: #171717;
}

.modal-footer .btn-primary {
  background: #171717;
  color: #fff;
  border: none;
}

.modal-footer .btn-primary:hover {
  background: #262626;
}

