/* ── IntelliTrade Learn — Self-contained GitHub Pages Styles ────── */

/* CSS Variables */
:root {
    --blue: #0A84FF;
    --green: #2FD068;
    --gold: #FFD60A;
    --red: #FF453A;
    --teal: #5AC8FA;
    --purple: #BF5AF2;
    --bg: #09101f;
    --card: rgba(255,255,255,0.05);
    --border: rgba(255,255,255,0.08);
}

/* Reset & Base */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
    font-family: 'Nunito', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg);
    color: rgba(255,255,255,0.70);
    line-height: 1.6;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
}

/* Background effects */
.bg-layer {
    position: fixed; inset: 0; z-index: -2;
    background: radial-gradient(ellipse at 20% 50%, rgba(10,132,255,0.08) 0%, transparent 60%),
                radial-gradient(ellipse at 80% 20%, rgba(191,90,242,0.06) 0%, transparent 50%),
                var(--bg);
}
.blob {
    position: fixed; border-radius: 50%; z-index: -1;
    filter: blur(100px); opacity: 0.35; pointer-events: none;
}
.b1 { width: 500px; height: 500px; top: -120px; left: -80px; background: rgba(10,132,255,0.12); }
.b2 { width: 400px; height: 400px; bottom: -100px; right: -60px; background: rgba(191,90,242,0.10); }

/* Learn header bar */
.learn-header {
    position: fixed; top: 0; left: 0; right: 0; z-index: 200;
    height: 60px;
    background: rgba(9,16,31,0.82);
    backdrop-filter: blur(48px) saturate(2);
    -webkit-backdrop-filter: blur(48px) saturate(2);
    border-bottom: 1px solid rgba(255,255,255,0.07);
    box-shadow: 0 1px 0 rgba(255,255,255,0.06), 0 8px 32px rgba(0,0,0,0.25);
    display: flex; align-items: center; padding: 0 28px;
}
.learn-header .lh-brand {
    display: flex; align-items: center; gap: 10px; flex: 0 0 auto;
    text-decoration: none;
}
.learn-header .lh-gem { font-size: 22px; }
.learn-header .lh-wordmark {
    font-size: 18px; font-weight: 800; color: rgba(255,255,255,0.95);
    letter-spacing: -0.3px;
}
.learn-header .lh-wordmark span { color: var(--blue); }
.learn-header .lh-sep {
    width: 1px; height: 24px; background: rgba(255,255,255,0.12);
    margin: 0 16px;
}
.learn-header .lh-title {
    font-size: 14px; font-weight: 600; color: rgba(255,255,255,0.60);
}
.learn-header .lh-spacer { flex: 1; }
.learn-header .lh-back {
    font-size: 13px; color: var(--blue); text-decoration: none;
    font-weight: 600; padding: 6px 14px; border-radius: 8px;
    border: 1px solid rgba(10,132,255,0.25);
    transition: background 0.2s;
}
.learn-header .lh-back:hover { background: rgba(10,132,255,0.12); }
.learn-header .lh-cta {
    font-size: 13px; color: #09101f; text-decoration: none;
    font-weight: 700; padding: 6px 16px; border-radius: 8px;
    background: var(--green); margin-left: 10px;
    transition: opacity 0.2s;
}
.learn-header .lh-cta:hover { opacity: 0.85; }

/* Topic sidebar nav (desktop) */
.learn-layout {
    display: flex; gap: 28px; margin-top: 72px;
    min-height: calc(100vh - 72px);
}
.learn-sidebar {
    position: sticky; top: 80px;
    flex: 0 0 200px; align-self: flex-start;
}
.learn-sidebar a {
    display: block; padding: 8px 14px; margin-bottom: 2px;
    font-size: 13px; font-weight: 500; color: rgba(255,255,255,0.50);
    text-decoration: none; border-radius: 8px;
    transition: color 0.2s, background 0.2s;
}
.learn-sidebar a:hover {
    color: rgba(255,255,255,0.85); background: rgba(255,255,255,0.05);
}
.learn-sidebar a.active {
    color: rgba(255,255,255,0.95); background: rgba(10,132,255,0.15);
    font-weight: 700;
}
.learn-main { flex: 1; min-width: 0; }

/* Article container */
.edu-page {
    max-width: 820px;
    margin: 0 auto;
    padding: 24px 20px 60px;
}

/* Breadcrumb */
.edu-breadcrumb {
    display: flex; align-items: center; gap: 6px;
    font-size: 13px; color: rgba(255,255,255,0.35); margin-bottom: 20px;
}
.edu-breadcrumb a { color: var(--blue); text-decoration: none; }
.edu-breadcrumb a:hover { text-decoration: underline; }
.edu-breadcrumb .sep { color: rgba(255,255,255,0.15); }

/* Article header */
.edu-header {
    margin-bottom: 32px; padding-bottom: 20px;
    border-bottom: 1px solid var(--border);
}
.edu-header h1 {
    font-size: 1.8rem; font-weight: 800; color: rgba(255,255,255,0.95);
    line-height: 1.25; margin-bottom: 8px; letter-spacing: -0.3px;
}
.edu-header .edu-subtitle {
    font-size: 1rem; color: rgba(255,255,255,0.55); line-height: 1.5;
}
.edu-header .edu-subtitle a { color: var(--blue); text-decoration: none; }
.edu-header .edu-meta {
    display: flex; align-items: center; gap: 12px;
    margin-top: 12px; font-size: 13px; color: rgba(255,255,255,0.35);
}
.edu-meta .difficulty-badge {
    padding: 2px 10px; border-radius: 10px; font-weight: 700;
    font-size: 11px; text-transform: uppercase;
}
.difficulty-badge.beginner { background: rgba(47,208,104,0.15); color: #2FD068; }
.difficulty-badge.intermediate { background: rgba(10,132,255,0.15); color: #0A84FF; }
.difficulty-badge.advanced { background: rgba(191,90,242,0.15); color: #BF5AF2; }

/* TOC */
.edu-toc {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 14px; padding: 16px 20px; margin-bottom: 28px;
}
.edu-toc h3 {
    font-size: 12px; color: rgba(255,255,255,0.50); margin-bottom: 10px;
    text-transform: uppercase; letter-spacing: 1px; font-weight: 700;
}
.edu-toc ol { list-style: decimal; padding-left: 20px; margin: 0; }
.edu-toc li { margin-bottom: 4px; }
.edu-toc a { color: var(--blue); text-decoration: none; font-size: 14px; }
.edu-toc a:hover { text-decoration: underline; }

/* Body typography */
.edu-body h2 {
    font-size: 1.35rem; font-weight: 800; color: rgba(255,255,255,0.95);
    margin: 36px 0 12px; padding-top: 16px;
    border-top: 1px solid rgba(255,255,255,0.06);
    letter-spacing: -0.2px;
}
.edu-body h2:first-child { border-top: none; margin-top: 0; padding-top: 0; }
.edu-body h3 {
    font-size: 1.05rem; font-weight: 700; color: rgba(255,255,255,0.90);
    margin: 24px 0 8px;
}
.edu-body p {
    font-size: 15px; color: rgba(255,255,255,0.60); line-height: 1.75; margin-bottom: 14px;
}
.edu-body ul, .edu-body ol { padding-left: 22px; margin-bottom: 14px; }
.edu-body li {
    font-size: 15px; color: rgba(255,255,255,0.60); line-height: 1.75; margin-bottom: 4px;
}
.edu-body strong { color: rgba(255,255,255,0.92); font-weight: 700; }
.edu-body a { color: var(--blue); text-decoration: none; }
.edu-body a:hover { text-decoration: underline; }

/* Callout boxes */
.edu-callout {
    background: rgba(255,255,255,0.04);
    border: 1px solid var(--border);
    border-left: 3px solid var(--teal);
    border-radius: 10px; padding: 14px 18px; margin: 18px 0;
    font-size: 14px; color: rgba(255,255,255,0.55); line-height: 1.65;
}
.edu-callout.warning { border-left-color: var(--gold); }
.edu-callout.danger { border-left-color: var(--red); }
.edu-callout.success { border-left-color: var(--green); }
.edu-callout strong { color: rgba(255,255,255,0.92); }

/* Code */
.edu-body code {
    background: rgba(255,255,255,0.07); padding: 1px 6px; border-radius: 4px;
    font-size: 13px; color: var(--teal);
    font-family: 'JetBrains Mono', monospace;
}
.edu-body pre {
    background: rgba(255,255,255,0.04); padding: 14px 18px; border-radius: 10px;
    overflow-x: auto; font-size: 13px; margin: 12px 0 18px;
    color: rgba(255,255,255,0.80); line-height: 1.5;
    font-family: 'JetBrains Mono', monospace;
    border: 1px solid rgba(255,255,255,0.06);
}

/* Definition list */
.edu-body dl { margin: 12px 0 18px; }
.edu-body dt {
    font-weight: 700; color: rgba(255,255,255,0.92); font-size: 15px; margin-top: 12px;
}
.edu-body dd {
    color: rgba(255,255,255,0.55); font-size: 14px; line-height: 1.65;
    margin-left: 16px; margin-bottom: 8px;
}

/* Concept cards */
.edu-concept-grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 14px; margin: 18px 0;
}
.edu-concept-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 14px; padding: 16px;
}
.edu-concept-card h4 {
    font-size: 14px; color: var(--teal); margin-bottom: 6px; font-weight: 700;
}
.edu-concept-card p {
    font-size: 13px; color: rgba(255,255,255,0.50); line-height: 1.55; margin: 0;
}

/* Tables */
.edu-body table {
    width: 100%; border-collapse: collapse; margin: 12px 0 18px; font-size: 14px;
}
.edu-body th {
    text-align: left; padding: 8px 12px;
    background: rgba(255,255,255,0.06); color: rgba(255,255,255,0.85);
    font-weight: 700; border-bottom: 1px solid rgba(255,255,255,0.10);
}
.edu-body td {
    padding: 8px 12px; color: rgba(255,255,255,0.55);
    border-bottom: 1px solid rgba(255,255,255,0.04);
}

/* Prev / Next nav */
.edu-nav-bottom {
    display: flex; justify-content: space-between;
    margin-top: 40px; padding-top: 20px;
    border-top: 1px solid var(--border);
}
.edu-nav-link {
    display: flex; flex-direction: column; text-decoration: none;
    padding: 10px 16px; border: 1px solid var(--border);
    border-radius: 12px; background: rgba(255,255,255,0.03);
    transition: border-color 0.2s, background 0.2s; max-width: 48%;
}
.edu-nav-link:hover {
    border-color: rgba(10,132,255,0.4); background: rgba(10,132,255,0.06);
}
.edu-nav-link .nav-direction {
    font-size: 11px; color: rgba(255,255,255,0.35);
    text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 2px;
}
.edu-nav-link .nav-title {
    font-size: 14px; color: var(--blue); font-weight: 700;
}
.edu-nav-link.next { text-align: right; margin-left: auto; }

/* Hub cards */
.edu-hub-hero { text-align: center; margin-bottom: 32px; padding-bottom: 24px;
    border-bottom: 1px solid var(--border); }
.edu-hub-hero h1 {
    font-size: 2rem; font-weight: 800; color: rgba(255,255,255,0.95);
    margin-bottom: 10px; letter-spacing: -0.5px;
}
.edu-hub-hero p {
    font-size: 16px; color: rgba(255,255,255,0.50);
    max-width: 600px; margin: 0 auto; line-height: 1.6;
}
.edu-hub-grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px; margin: 24px 0;
}
.edu-hub-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 16px; padding: 20px; text-decoration: none; display: block;
    transition: border-color 0.2s, transform 0.15s, background 0.2s;
}
.edu-hub-card:hover {
    border-color: rgba(47,208,104,0.4); transform: translateY(-2px);
    background: rgba(255,255,255,0.07);
}
.edu-hub-card .hub-icon { font-size: 28px; margin-bottom: 10px; display: block; }
.edu-hub-card h3 { font-size: 16px; color: rgba(255,255,255,0.92); margin-bottom: 6px; font-weight: 700; }
.edu-hub-card p { font-size: 13px; color: rgba(255,255,255,0.50); line-height: 1.55; margin: 0; }
.edu-hub-card .hub-badge {
    display: inline-block; margin-top: 10px; font-size: 11px;
    padding: 2px 8px; border-radius: 10px; font-weight: 700; text-transform: uppercase;
}
.edu-hub-cta { text-align: center; margin-top: 32px; padding-top: 24px;
    border-top: 1px solid var(--border); }
.edu-hub-cta a {
    display: inline-block; padding: 10px 28px;
    background: var(--green); color: #09101f;
    font-weight: 700; font-size: 15px; border-radius: 10px;
    text-decoration: none; transition: opacity 0.2s;
}
.edu-hub-cta a:hover { opacity: 0.85; }

/* Site-wide CTA banner */
.site-cta {
    text-align: center; margin: 40px 0 20px; padding: 28px 20px;
    background: rgba(10,132,255,0.06);
    border: 1px solid rgba(10,132,255,0.15);
    border-radius: 16px;
}
.site-cta h3 {
    font-size: 18px; font-weight: 800; color: rgba(255,255,255,0.92);
    margin-bottom: 8px;
}
.site-cta p {
    font-size: 14px; color: rgba(255,255,255,0.50); margin-bottom: 14px;
}
.site-cta a {
    display: inline-block; padding: 10px 24px;
    background: var(--blue); color: #fff;
    font-weight: 700; font-size: 14px; border-radius: 10px;
    text-decoration: none; transition: opacity 0.2s;
}
.site-cta a:hover { opacity: 0.85; }

/* Footer */
.site-footer {
    text-align: center; padding: 24px 20px; margin-top: 40px;
    border-top: 1px solid var(--border);
    font-size: 13px; color: rgba(255,255,255,0.30);
}
.site-footer a { color: var(--blue); text-decoration: none; }
.site-footer a:hover { text-decoration: underline; }

/* Responsive */
@media (max-width: 768px) {
    .learn-sidebar { display: none; }
    .learn-layout { margin-top: 68px; }
    .edu-page { padding: 12px 14px 40px; }
    .edu-header h1 { font-size: 1.4rem; }
    .edu-hub-hero h1 { font-size: 1.5rem; }
    .edu-concept-grid { grid-template-columns: 1fr; }
    .edu-hub-grid { grid-template-columns: 1fr; }
    .edu-nav-bottom { flex-direction: column; gap: 10px; }
    .edu-nav-link { max-width: 100%; }
    .learn-header { padding: 0 14px; }
    .learn-header .lh-sep, .learn-header .lh-title { display: none; }
}
