/* shared.css — StockTrendz AI Learning Pages */
:root {
  --bg: #080810;
  --bg2: #0d0d1a;
  --bg3: #12121f;
  --purple-deep: #5b3fa0;
  --purple: #7c5cbf;
  --purple-light: #9b7fd4;
  --purple-glow: #a78bfa;
  --blue: #3b82f6;
  --blue-light: #60a5fa;
  --ai-gradient: linear-gradient(135deg, #3b82f6, #7c5cbf);
  --text: #f0eeff;
  --text-muted: #8b8aaa;
  --border: rgba(124,92,191,0.18);
  --card-bg: rgba(15,14,30,0.92);
  --glow: 0 0 40px rgba(124,92,191,0.25);
  --accent: var(--purple-glow);
}
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: 'DM Sans', sans-serif;
  font-size: 16px;
  line-height: 1.7;
  min-height: 100vh;
  overflow-x: hidden;
}
body::before {
  content: '';
  position: fixed; inset: 0; z-index: 0;
  background:
    radial-gradient(ellipse 70% 50% at 15% 10%, rgba(91,63,160,0.15) 0%, transparent 60%),
    radial-gradient(ellipse 50% 40% at 85% 85%, rgba(59,130,246,0.10) 0%, transparent 55%);
  pointer-events: none;
}


/* PAGE HEADER */
.page-header {
  position: relative; z-index: 1;
  padding: 120px 40px 60px;
  max-width: 900px; margin: 0 auto;
}
.page-badge {
  display: inline-flex; align-items: center; gap: 8px;
  background: rgba(124,92,191,0.12);
  border: 1px solid rgba(124,92,191,0.25);
  border-radius: 100px; padding: 5px 16px;
  font-size: 0.78rem; color: var(--purple-glow);
  margin-bottom: 20px;
}
.page-header h1 {
  font-family: 'Syne', sans-serif; font-weight: 800;
  font-size: clamp(2rem, 5vw, 3.2rem);
  letter-spacing: -0.03em; line-height: 1.1;
  margin-bottom: 16px;
}
.page-header h1 .grad {
  background: linear-gradient(135deg, var(--purple-glow), var(--blue-light));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
}
.page-header p { color: var(--text-muted); font-size: 1.05rem; max-width: 580px; }

/* PROGRESS BAR */
.level-progress {
  display: flex; align-items: center; gap: 12px;
  max-width: 900px; margin: 0 auto 0; padding: 0 40px 40px;
  position: relative; z-index: 1;
}
.progress-label { font-size: 0.78rem; color: var(--text-muted); white-space: nowrap; }
.progress-bar { flex: 1; height: 4px; background: rgba(124,92,191,0.15); border-radius: 4px; overflow: hidden; }
.progress-fill { height: 100%; border-radius: 4px; background: linear-gradient(90deg, var(--purple-deep), var(--purple-glow)); }

/* CONTENT LAYOUT */
.content-wrapper {
  position: relative; z-index: 1;
  max-width: 1100px; margin: 0 auto;
  padding: 0 40px 100px;
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 40px;
}

/* SIDEBAR */
.sidebar {
  position: sticky; top: 88px;
  height: fit-content; max-height: calc(100vh - 108px);
  overflow-y: auto; padding-right: 4px;
}
.sidebar::-webkit-scrollbar { width: 3px; }
.sidebar::-webkit-scrollbar-thumb { background: var(--purple-deep); border-radius: 3px; }
.sidebar-title {
  font-family: 'Syne', sans-serif; font-weight: 700; font-size: 0.75rem;
  letter-spacing: 0.1em; text-transform: uppercase; color: var(--text-muted);
  margin-bottom: 16px; padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}
.sidebar-nav { list-style: none; }
.sidebar-nav li { margin-bottom: 4px; }
.sidebar-nav a {
  display: flex; align-items: center; gap: 10px;
  color: var(--text-muted); text-decoration: none; font-size: 0.88rem;
  padding: 8px 12px; border-radius: 8px;
  transition: background 0.2s, color 0.2s;
}
.sidebar-nav a:hover, .sidebar-nav a.active {
  background: rgba(124,92,191,0.12); color: var(--purple-glow);
}
.sidebar-nav a .num {
  font-family: 'Syne', sans-serif; font-weight: 700;
  font-size: 0.7rem; color: var(--purple-deep);
  min-width: 20px;
}

/* MAIN CONTENT */
.main-content { min-width: 0; }

/* TOPIC SECTION */
.topic {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 20px; margin-bottom: 32px;
  overflow: hidden;
}
.topic-header {
  display: flex; align-items: center; gap: 16px;
  padding: 28px 32px; cursor: pointer;
  transition: background 0.2s;
  border-bottom: 1px solid transparent;
}
.topic.open .topic-header { border-bottom-color: var(--border); }
.topic-header:hover { background: rgba(124,92,191,0.06); }
.topic-num {
  font-family: 'Syne', sans-serif; font-weight: 800; font-size: 0.75rem;
  color: var(--purple-deep); min-width: 28px;
}
.topic-icon { font-size: 1.5rem; }
.topic-title { font-family: 'Syne', sans-serif; font-weight: 700; font-size: 1.1rem; flex: 1; }
.topic-toggle {
  width: 28px; height: 28px;
  border-radius: 50%; background: rgba(124,92,191,0.12);
  display: flex; align-items: center; justify-content: center;
  color: var(--purple-glow); font-size: 0.8rem;
  transition: transform 0.3s, background 0.2s; flex-shrink: 0;
}
.topic.open .topic-toggle { transform: rotate(180deg); background: rgba(124,92,191,0.25); }

.topic-body {
  display: none; padding: 0 32px 32px;
}
.topic.open .topic-body { display: block; }

/* CONTENT BLOCKS */
.content-section { margin-top: 24px; }
.content-section h3 {
  font-family: 'Syne', sans-serif; font-weight: 700; font-size: 0.95rem;
  color: var(--purple-glow); letter-spacing: 0.05em; text-transform: uppercase;
  margin-bottom: 12px;
}
.content-section p { color: var(--text-muted); font-size: 0.95rem; margin-bottom: 12px; }

.concept-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 12px; margin-top: 12px;
}
.concept-item {
  background: rgba(91,63,160,0.12); border: 1px solid rgba(124,92,191,0.2);
  border-radius: 10px; padding: 12px 16px;
  font-size: 0.85rem; color: var(--text);
}
.concept-item strong { display: block; color: var(--purple-glow); margin-bottom: 2px; font-size: 0.8rem; }

.key-list { list-style: none; margin-top: 10px; }
.key-list li {
  padding: 8px 0; border-bottom: 1px solid var(--border);
  font-size: 0.9rem; display: flex; align-items: flex-start; gap: 10px;
}
.key-list li:last-child { border-bottom: none; }
.key-list li::before { content: '›'; color: var(--purple-glow); font-weight: 700; margin-top: 1px; }

.info-box {
  background: rgba(59,130,246,0.08); border: 1px solid rgba(59,130,246,0.2);
  border-radius: 12px; padding: 16px 20px; margin-top: 16px;
  font-size: 0.9rem;
}
.info-box .label {
  font-family: 'Syne', sans-serif; font-weight: 700;
  font-size: 0.75rem; color: var(--blue-light);
  letter-spacing: 0.08em; text-transform: uppercase; margin-bottom: 6px;
}

.tip-box {
  background: rgba(167,139,250,0.08); border-left: 3px solid var(--purple-glow);
  border-radius: 0 10px 10px 0; padding: 14px 18px; margin-top: 16px;
  font-size: 0.9rem; color: var(--text-muted);
}
.tip-box strong { color: var(--purple-glow); }

/* NAV BETWEEN LEVELS */
.level-nav {
  display: flex; justify-content: space-between; align-items: center;
  margin-top: 60px; padding-top: 40px; border-top: 1px solid var(--border);
}
.level-nav a {
  display: inline-flex; align-items: center; gap: 8px;
  color: var(--text-muted); text-decoration: none; font-size: 0.9rem;
  padding: 10px 20px; border: 1px solid var(--border); border-radius: 10px;
  transition: border-color 0.2s, color 0.2s;
}
.level-nav a:hover { border-color: var(--purple-light); color: var(--purple-glow); }
.level-nav .next-btn {
  background: linear-gradient(135deg, var(--purple-deep), var(--blue));
  border: none; color: #fff;
  box-shadow: 0 4px 16px rgba(91,63,160,0.35);
}
.level-nav .next-btn:hover { box-shadow: 0 8px 24px rgba(91,63,160,0.5); color: #fff; }


@media(max-width: 900px) {
  .content-wrapper { grid-template-columns: 1fr; }
  .sidebar { position: static; max-height: none; }
  .page-header, .level-progress { padding-left: 20px; padding-right: 20px; }
  .content-wrapper { padding-left: 20px; padding-right: 20px; }
  .topic-header { padding: 20px; }
  .topic-body { padding: 0 20px 24px; }
}
