/* ========== SME RN Prototype Shell — Shared Styles ========== */
/* Import into prototypes that need the full RN page chrome.    */
/* Requires: Plus Jakarta Sans 400/500/700 via Google Fonts     */

/* ========== RESET & BASE ========== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-family: 'Plus Jakarta Sans', sans-serif; color: #323232; background: #fbfafa; -webkit-font-smoothing: antialiased; }
body { min-width: 1440px; }
ul, ol { list-style: disc; }
a { color: inherit; }

/* ========== DESIGN TOKENS ========== */
:root {
  --blue-100: #eef2fe;
  --blue-200: #93adfb;
  --blue-300: #5c84f8;
  --blue-400: #265bf6;
  --blue-500: #0620ed;
  --blue-600: #110176;
  --neutral-100: #fdfdfd;
  --neutral-200: #fbfafa;
  --neutral-300: #f3f0f0;
  --neutral-400: #e2e2e2;
  --neutral-500: #c5c5c5;
  --neutral-600: #6e6e6e;
  --neutral-700: #5a5a5a;
  --neutral-800: #464646;
  --neutral-900: #323232;
  --green-100: #e5faed;
  --green-400: #7de7a6;
  --green-500: #42b163;
  --green-600: #178838;
  --orange-100: #fceee9;
  --orange-300: #eb794e;
  --orange-400: #e65722;
  --red-100: #fff0f0;
  --red-300: #ff8b8b;
  --red-400: #ff6464;
  --red-500: #c63232;
  --yellow-100: #fffbea;
  --yellow-400: #f4c325;
  --purple-100: #f4eeff;
  --purple-300: #c0a2fd;
  --purple-400: #663fbf;
  --white: #ffffff;
  --black: #000000;
  --radius-lg: 12px;
  --radius-xl: 24px;
  --radius-pill: 800px;
  --shadow-1: 0 0 30px 0 rgba(59,68,89,0.06), 0 4px 12px 0 rgba(59,68,89,0.06);
}

/* ========== PROTOTYPE CONTROLS ========== */
.proto-bar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 1000;
  background: #1a1a2e; color: #fff; display: flex; align-items: center;
  gap: 24px; padding: 8px 24px; font-size: 13px; font-weight: 500;
  box-shadow: 0 2px 12px rgba(0,0,0,.25);
}
.proto-bar label { display: flex; align-items: center; gap: 8px; cursor: pointer; }
.proto-bar select {
  background: #2a2a4a; color: #fff; border: 1px solid #444; border-radius: 6px;
  padding: 4px 8px; font-family: inherit; font-size: 13px;
}
.proto-bar .proto-label {
  background: #e0ff64; color: #1a1a2e; padding: 2px 10px; border-radius: 4px;
  font-weight: 700; font-size: 11px; text-transform: uppercase; letter-spacing: .5px;
}
.proto-bar .idea-tag {
  background: var(--blue-400); color: #fff; padding: 2px 10px; border-radius: 4px;
  font-weight: 600; font-size: 11px;
}
.proto-toggle {
  position: relative; width: 40px; height: 22px; background: #555; border-radius: 11px;
  cursor: pointer; transition: background .2s;
}
.proto-toggle.active { background: #265bf6; }
.proto-toggle::after {
  content: ''; position: absolute; top: 2px; left: 2px; width: 18px; height: 18px;
  background: #fff; border-radius: 50%; transition: transform .2s;
}
.proto-toggle.active::after { transform: translateX(18px); }
.toggle-pills {
  display: flex; background: rgba(255,255,255,0.1); border-radius: var(--radius-pill);
  padding: 2px; gap: 2px;
}
.toggle-pill {
  padding: 5px 18px; border-radius: var(--radius-pill); font-size: 12px;
  font-weight: 600; cursor: pointer; border: none; background: transparent;
  color: rgba(255,255,255,0.6); font-family: inherit; transition: all 0.2s;
}
.toggle-pill[data-active="true"] {
  background: rgba(255,255,255,0.15); color: #fff;
}

/* ========== TOP NAV ========== */
.top-nav {
  position: fixed; top: 38px; left: 0; right: 0; z-index: 100;
  background: #fff; border-bottom: 1px solid #e2e2e2;
  display: flex; align-items: center; gap: 8px; padding: 16px 24px; height: 80px;
}
.logo { height: 42px; flex-shrink: 0; }
.logo svg { height: 100%; width: auto; }
.nav-item {
  display: flex; align-items: center; gap: 4px; padding: 12px 4px 12px 12px;
  font-size: 16px; font-weight: 500; white-space: nowrap; cursor: pointer;
}
.nav-item .chevron { width: 24px; height: 24px; opacity: .6; }
.search-bar {
  flex: 1; display: flex; align-items: center; gap: 8px;
  border: 1px solid #e2e2e2; border-radius: 800px; padding: 12px 16px; height: 48px;
}
.search-bar span { flex: 1; color: #6e6e6e; font-size: 16px; font-weight: 500; }

/* ========== SIDEBAR: RESOURCE NAV ========== */
.sidebar-resource {
  position: fixed; top: 118px; left: 0; bottom: 0; z-index: 90;
  width: 64px; background: #fff; border-right: 1px solid #e2e2e2;
  display: flex; flex-direction: column; gap: 16px; padding: 16px 12px 24px;
  box-shadow: 0 4px 16px rgba(59,68,89,.08); transition: width .25s;
  overflow: hidden;
}
.sidebar-resource.expanded { width: 235px; }
.sidebar-resource .toggle-btn {
  width: 40px; height: 40px; display: flex; align-items: center; justify-content: center;
  cursor: pointer; border-radius: 8px; flex-shrink: 0;
}
.sidebar-resource .toggle-btn:hover { background: #f3f0f0; }
.sidebar-resource .divider { height: 2px; background: #e2e2e2; margin: 4px 0 0; }
.sidebar-resource .nav-group { display: flex; flex-direction: column; gap: 8px; }
.sidebar-resource .group-label {
  font-size: 12px; font-weight: 500; color: #6e6e6e; padding-left: 8px;
  white-space: nowrap; overflow: hidden; opacity: 0; transition: opacity .2s;
}
.sidebar-resource.expanded .group-label { opacity: 1; }
.sidebar-resource .nav-icon {
  height: 40px; display: flex; align-items: center; gap: 4px;
  border-radius: 8px; cursor: pointer; flex-shrink: 0; position: relative;
  padding: 8px; white-space: nowrap; overflow: hidden;
}
.sidebar-resource .nav-icon:hover { background: #f3f0f0; }
.sidebar-resource .nav-icon.active { background: #eef2fe; }
.sidebar-resource .nav-icon .icon-wrap {
  width: 24px; height: 24px; flex-shrink: 0; position: relative;
}
.sidebar-resource .nav-icon .icon-wrap img { position: absolute; display: block; }
.sidebar-resource .nav-icon .icon-label {
  font-size: 14px; font-weight: 500; color: #464646;
  opacity: 0; transition: opacity .2s; overflow: hidden;
}
.sidebar-resource .nav-icon.active .icon-label { color: #265bf6; }
.sidebar-resource.expanded .nav-icon .icon-label { opacity: 1; }

/* ========== COURSE NAV COLLAPSED STRIP ========== */
.course-collapsed-strip {
  position: fixed; top: 118px; bottom: 0; z-index: 85;
  left: 64px; width: 24px; background: #fff;
  border: 1px solid #e2e2e2; border-left: none;
  transition: left .25s; display: flex; flex-direction: column;
}
.sidebar-resource.expanded ~ .course-collapsed-strip { left: 235px; }
.course-collapsed-strip .circle-btn {
  position: absolute; left: 5px; top: 18px;
  width: 40px; height: 40px; border-radius: 100px; background: #fff;
  border: 1px solid #e2e2e2; display: flex; align-items: center; justify-content: center;
  cursor: pointer; z-index: 5;
}
.course-collapsed-strip .circle-btn:hover { background: #f3f0f0; }
.course-collapsed-strip .circle-btn svg { width: 20px; height: 20px; }
.course-collapsed-strip.hidden { display: none; }

/* ========== SIDEBAR: COURSE NAV ========== */
.sidebar-course-wrap {
  position: fixed; top: 118px; bottom: 0; z-index: 80;
  left: 88px; width: calc(310px + 21px);
  transition: left .25s, width .25s; pointer-events: none;
}
.sidebar-resource.expanded ~ .sidebar-course-wrap { left: 259px; }
.sidebar-course-wrap.collapsed { width: 21px; }
.sidebar-course-wrap .course-toggle {
  position: absolute; right: 0; top: 17px; z-index: 5;
  width: 40px; height: 40px; border-radius: 100px; background: #fff;
  border: 1px solid #e2e2e2; display: flex; align-items: center; justify-content: center;
  cursor: pointer; pointer-events: auto;
}
.sidebar-course-wrap .course-toggle:hover { background: #f3f0f0; }
.sidebar-course-wrap .course-toggle svg { width: 20px; height: 20px; }
.sidebar-course {
  position: absolute; top: 0; bottom: 0; left: 0;
  width: 310px; background: #fff; border-right: 1px solid #e2e2e2;
  display: flex; flex-direction: column; overflow-y: auto; overflow-x: hidden;
  transition: width .25s, opacity .25s; opacity: 1; pointer-events: auto;
}
.sidebar-course.collapsed { width: 0; opacity: 0; overflow: hidden; pointer-events: none; }
.sidebar-course .panel-header { padding: 24px 12px 8px; border-bottom: 1px solid #e2e2e2; }
.sidebar-course .panel-title { font-size: 18px; font-weight: 700; padding: 0 4px 8px; }
.sidebar-course .view-all {
  display: flex; align-items: center; justify-content: space-between;
  border: 1px solid #e2e2e2; border-radius: 8px; padding: 16px 12px;
  font-size: 14px; font-weight: 700; cursor: pointer; margin-bottom: 16px;
}
.sidebar-course .view-all:hover { background: #f9f9f9; }
.sidebar-course .sections-list { padding: 16px 12px; display: flex; flex-direction: column; gap: 12px; flex: 1; }
.section-item { border: 1px solid #e2e2e2; border-radius: 8px; background: #fff; overflow: hidden; }
.section-header {
  display: flex; align-items: center; gap: 4px; padding: 12px 12px 12px 8px; cursor: pointer;
}
.section-header:hover { background: #f9f9f9; }
.section-info { flex: 1; display: flex; align-items: center; gap: 4px; min-width: 0; }
.section-status { width: 32px; height: 42px; display: flex; align-items: center; justify-content: center; padding: 6px; flex-shrink: 0; }
.section-status .progress-ring { width: 20px; height: 20px; }
.section-text { flex: 1; min-width: 0; }
.section-text .section-name { font-size: 14px; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.section-text .section-meta { font-size: 12px; color: #6e6e6e; }
.section-expand {
  width: 34px; height: 34px; border: 1px solid #e2e2e2; border-radius: 800px;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0; cursor: pointer;
}
.section-expand:hover { background: #f3f0f0; }
.section-expand.open { background: #eef2fe; border-color: #eef2fe; }
.section-expand svg { width: 24px; height: 24px; transition: transform .2s; }
.section-expand.open svg { transform: rotate(180deg); }
.section-topics { background: #fbfafa; border-top: 1px solid #e2e2e2; }
.topic-item {
  display: flex; align-items: center; gap: 4px; padding: 12px 12px 12px 8px; cursor: pointer;
}
.topic-item:hover { background: #f3f0f0; }
.topic-item.active { background: #eef2fe; }
.topic-status { width: 32px; height: 42px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.topic-check { width: 20px; height: 20px; border-radius: 50%; border: 2px solid #c5c5c5; }
.topic-check.done { background: #42b163; border-color: #42b163; display: flex; align-items: center; justify-content: center; }
.topic-check.done svg { width: 12px; height: 12px; }
.topic-name { flex: 1; font-size: 14px; min-width: 0; }

/* ========== MAIN CONTENT ========== */
.main-content {
  padding-top: 118px; transition: margin-left .25s;
  display: flex; flex-direction: column; align-items: center; min-height: 100vh;
}
.content-wrapper { width: 900px; max-width: 100%; padding: 48px 0 80px; }

/* Breadcrumb + exam info */
.top-row { display: flex; align-items: center; justify-content: space-between; margin-bottom: 32px; }
.breadcrumb { display: flex; align-items: center; gap: 12px; font-size: 14px; font-weight: 500; }
.breadcrumb .sep { color: #c5c5c5; }
.breadcrumb .crumb { display: flex; align-items: center; gap: 4px; }
.exam-info {
  display: flex; align-items: center; gap: 12px; background: #f3f0f0;
  padding: 8px 12px; border-radius: 12px; font-size: 14px; font-weight: 500;
}
.exam-info .pipe { color: #c5c5c5; }
.topic-title { font-size: 48px; font-weight: 700; letter-spacing: -0.96px; line-height: 1.2; margin-bottom: 32px; }

/* Author bar */
.author-bar { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.author-info { display: flex; align-items: center; gap: 16px; }
.author-avatars { position: relative; width: 88px; height: 52px; flex-shrink: 0; }
.author-avatars .avatar {
  width: 48px; height: 48px; border-radius: 50%; border: 2px solid #fbfafa;
  background: #ddd; position: absolute; top: 2px; object-fit: cover;
}
.author-avatars .avatar:first-child { left: 0; z-index: 1; }
.author-avatars .avatar:last-child { left: 40px; }
.author-avatars .verified {
  position: absolute; left: 72px; top: 34px; width: 16px; height: 16px;
  background: #42b163; border: 1px solid #fbfafa; border-radius: 50%;
  display: flex; align-items: center; justify-content: center; z-index: 2;
}
.author-avatars .verified svg { width: 10px; height: 10px; }
.author-text { font-size: 16px; line-height: 1.5; }
.author-text strong { font-weight: 700; }
.author-text a { text-decoration: underline; font-weight: 500; }
.author-text .date { font-size: 13px; color: #6e6e6e; }
.download-btn {
  display: flex; align-items: center; gap: 8px; background: #eef2fe; color: #265bf6;
  padding: 0 24px; height: 48px; border-radius: 56px; font-size: 16px; font-weight: 500;
  border: none; cursor: pointer; font-family: inherit;
}
.download-btn:hover { background: #dce6fd; }

/* RN Body */
.rn-body { background: #fff; border-radius: 12px; padding: 32px 24px; }
.rn-body h2 { font-size: 28px; font-weight: 700; letter-spacing: -0.56px; line-height: 1.2; margin: 0 0 24px; color: #323232; }
.rn-body h3 { font-size: 24px; font-weight: 700; letter-spacing: -0.48px; line-height: 1.2; margin: 24px 0 16px; color: #323232; }
.rn-body h4 { font-size: 20px; font-weight: 700; line-height: 1.3; margin: 20px 0 12px; }
.rn-body ul, .rn-body ol { margin: 0 0 8px 24px; }
.rn-body ul ul { margin: 0 0 0 24px; }
.rn-body li { font-size: 16px; line-height: 1.5; margin-bottom: 2px; }
.rn-body p { font-size: 16px; line-height: 1.5; margin-bottom: 16px; }
.rn-body .exam-tip {
  background: #eef2fe; border-left: 4px solid #265bf6; padding: 16px 20px;
  border-radius: 0 8px 8px 0; margin: 16px 0;
}
.rn-body .exam-tip strong { font-weight: 700; }
.rn-body .rn-img { width: 100%; border-radius: 8px; margin: 16px 0; display: block; }
.rn-body .rn-img-caption { font-size: 14px; color: #6e6e6e; text-align: center; margin: -8px 0 16px; font-style: italic; }
.rn-body table { width: 100%; border-collapse: collapse; margin: 16px 0; }
.rn-body th, .rn-body td { border: 1px solid #e2e2e2; padding: 10px 14px; text-align: left; font-size: 14px; line-height: 1.5; }
.rn-body th { background: #f3f0f0; font-weight: 700; }

/* Paywall */
.paywall-overlay { display: none; position: relative; margin-top: -200px; z-index: 10; }
.paywall-overlay.visible { display: block; }
.paywall-gradient { height: 376px; background: linear-gradient(to bottom, rgba(251,250,250,0) 8%, #fbfafa 62%); pointer-events: none; }
.paywall-solid { background: #fbfafa; height: 120px; }
.paywall-card {
  position: relative; margin: -360px auto 0; width: 540px; background: #fff;
  border-radius: 12px; box-shadow: 0 4px 30px rgba(59,68,89,.16);
  padding: 40px 48px 48px; text-align: center; z-index: 11;
}
.paywall-card .pw-illustration {
  width: 120px; height: 100px; margin: 0 auto 16px;
  display: flex; align-items: center; justify-content: center;
}
.paywall-card h3 { font-size: 24px; font-weight: 700; letter-spacing: -0.48px; margin-bottom: 12px; color: #000; }
.paywall-card p { font-size: 16px; line-height: 1.5; color: #323232; margin-bottom: 24px; }
.paywall-cta {
  display: inline-flex; align-items: center; justify-content: center;
  background: linear-gradient(102deg, #265bf6, #ff6464);
  color: #fff; border: none; border-radius: 800px; padding: 12px 48px;
  font-size: 16px; font-weight: 500; font-family: inherit; cursor: pointer;
}
.paywall-cta:hover { opacity: .9; }
.rn-body.paywalled { max-height: 500px; overflow: hidden; }

/* Download bar */
.download-bar {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 90;
  background: #110176; color: #fff; display: flex; align-items: center; justify-content: center;
  gap: 12px; padding: 14px 24px; font-size: 16px; font-weight: 500;
}
.download-bar .close-x { position: absolute; left: 24px; cursor: pointer; opacity: .7; }
.download-bar .close-x:hover { opacity: 1; }
.download-bar.hidden { display: none; }

/* FAB */
.fab-btn {
  position: fixed; bottom: 70px; right: 24px; z-index: 95;
  display: flex; align-items: center; gap: 4px; background: #fff;
  border-radius: 800px; padding: 12px 16px 12px 12px;
  box-shadow: 0 8px 16px rgba(59,68,89,.16), 0 0 30px rgba(59,68,89,.16);
  cursor: pointer; border: none; font-family: inherit;
}
.fab-btn:hover { box-shadow: 0 8px 24px rgba(59,68,89,.25), 0 0 30px rgba(59,68,89,.2); }
.fab-btn svg { width: 24px; height: 24px; }
.fab-btn .fab-text {
  font-size: 16px; font-weight: 500;
  background: linear-gradient(95deg, #265bf6, #ff6464);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
}

/* Annotation */
.annotation {
  background: #fffbea; border: 1px dashed #f8d255; border-radius: 8px;
  padding: 14px 18px; font-size: 13px; color: #5a5a5a; line-height: 1.6;
}
.annotation strong { color: #323232; }
