/* ========================================================
   Finanzen Academy – Global Stylesheet
   ======================================================== */

:root {
  --bg:          #0a1628;
  --bg-card:     #0f1f3d;
  --bg-elevated: #142a4e;
  --accent:      #c9a84c;
  --accent-h:    #e8c87a;
  --text:        #e8ecf1;
  --text-muted:  #8b9ab5;
  --text-dim:    #566580;
  --border:      #1e3560;
  --success:     #2ecc71;
  --danger:      #e74c3c;
  --sidebar-w:   260px;
  --header-h:    60px;
  --radius:      8px;
  --radius-lg:   14px;
  --shadow:      0 4px 24px rgba(0,0,0,0.4);
  --font:        'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --mono:        'JetBrains Mono', 'Fira Code', 'Courier New', monospace;
}

/* ── Reset ─────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; scroll-behavior: smooth; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  line-height: 1.65;
  min-height: 100vh;
}
img, svg { display: block; max-width: 100%; }
button { cursor: pointer; border: none; background: none; font-family: inherit; }

/* ── Typography ─────────────────────────────────────────── */
h1 { font-size: clamp(1.6rem, 3vw, 2.4rem); font-weight: 700; line-height: 1.2; letter-spacing: -0.02em; }
h2 {
  font-size: 1.35rem; font-weight: 600;
  color: var(--accent);
  margin: 2.5rem 0 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border);
}
h3 { font-size: 1.05rem; font-weight: 600; color: var(--text); margin: 1.5rem 0 0.5rem; }
h4 { font-size: 0.9rem; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.08em; margin: 1rem 0 0.4rem; }
p  { margin-bottom: 0.9rem; color: var(--text); }
em { color: var(--accent); font-style: italic; }
strong { font-weight: 600; color: var(--text); }
small { font-size: 0.8rem; color: var(--text-muted); }
code {
  background: var(--bg-elevated);
  color: var(--accent);
  font-family: var(--mono);
  font-size: 0.85em;
  padding: 0.15em 0.45em;
  border-radius: 4px;
  border: 1px solid var(--border);
}
a { color: var(--accent); text-decoration: none; transition: color 0.15s; }
a:hover { color: var(--accent-h); }
ul, ol { padding-left: 1.5rem; margin-bottom: 0.9rem; }
li { margin-bottom: 0.3rem; }

/* ── Formula / math block ───────────────────────────────── */
.formula {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius);
  padding: 0.9rem 1.2rem;
  font-family: var(--mono);
  font-size: 0.9rem;
  color: var(--accent-h);
  margin: 1rem 0;
  overflow-x: auto;
}

/* ── Callout boxes ──────────────────────────────────────── */
.callout {
  border-radius: var(--radius);
  padding: 0.9rem 1.2rem;
  margin: 1.2rem 0;
  border-left: 3px solid;
}
.callout-info    { background: rgba(201,168,76,0.08);  border-color: var(--accent);  }
.callout-success { background: rgba(46,204,113,0.08);  border-color: var(--success); }
.callout-danger  { background: rgba(231,76,60,0.08);   border-color: var(--danger);  }
.callout p:last-child { margin-bottom: 0; }

/* ── Tables ─────────────────────────────────────────────── */
.table-wrap { overflow-x: auto; margin: 1rem 0; }
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}
thead th {
  background: var(--bg-elevated);
  color: var(--accent);
  font-weight: 600;
  text-align: left;
  padding: 0.65rem 1rem;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
tbody td {
  padding: 0.6rem 1rem;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}
tbody tr:hover { background: rgba(255,255,255,0.03); }
tbody tr:last-child td { border-bottom: none; }
.td-green { color: var(--success); font-weight: 600; }
.td-red   { color: var(--danger);  font-weight: 600; }
.td-gold  { color: var(--accent);  font-weight: 600; }

/* ── Badge / pill ───────────────────────────────────────── */
.badge {
  display: inline-block;
  padding: 0.2em 0.7em;
  border-radius: 99px;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.badge-gold    { background: rgba(201,168,76,0.15);  color: var(--accent);  border: 1px solid rgba(201,168,76,0.3); }
.badge-green   { background: rgba(46,204,113,0.15);  color: var(--success); border: 1px solid rgba(46,204,113,0.3); }
.badge-red     { background: rgba(231,76,60,0.15);   color: var(--danger);  border: 1px solid rgba(231,76,60,0.3); }
.badge-muted   { background: rgba(139,154,181,0.1);  color: var(--text-muted); border: 1px solid var(--border); }

/* ── Site Header ────────────────────────────────────────── */
.site-header {
  height: var(--header-h);
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 2rem;
  position: sticky;
  top: 0;
  z-index: 100;
}
.site-logo {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  text-decoration: none;
}
.site-logo-mark {
  width: 32px; height: 32px;
  background: var(--accent);
  border-radius: 6px;
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 0.9rem; color: #0a1628;
}
.site-logo-text { font-weight: 700; font-size: 1rem; color: var(--text); letter-spacing: -0.01em; }
.site-logo-text span { color: var(--accent); }
.header-spacer { flex: 1; }
.breadcrumb {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.85rem;
  color: var(--text-muted);
}
.breadcrumb a { color: var(--text-muted); }
.breadcrumb a:hover { color: var(--accent); }
.breadcrumb-sep { color: var(--text-dim); }
.breadcrumb-current { color: var(--text); font-weight: 500; }

/* ── Page layout (sidebar + main) ───────────────────────── */
.page-wrap {
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr;
  min-height: calc(100vh - var(--header-h));
}

/* ── Sidebar ─────────────────────────────────────────────── */
.sidebar {
  background: var(--bg-card);
  border-right: 1px solid var(--border);
  padding: 1.5rem 0;
  position: sticky;
  top: var(--header-h);
  height: calc(100vh - var(--header-h));
  overflow-y: auto;
}
.sidebar-section { margin-bottom: 1.5rem; }
.sidebar-label {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-dim);
  padding: 0 1.25rem;
  margin-bottom: 0.4rem;
}
.sidebar-link {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.5rem 1.25rem;
  color: var(--text-muted);
  font-size: 0.9rem;
  transition: all 0.15s;
  border-left: 2px solid transparent;
}
.sidebar-link:hover { color: var(--text); background: rgba(255,255,255,0.04); }
.sidebar-link.active {
  color: var(--accent);
  background: rgba(201,168,76,0.08);
  border-left-color: var(--accent);
}
.sidebar-icon { font-size: 1rem; min-width: 20px; text-align: center; }

/* ── Main content ────────────────────────────────────────── */
.main-content {
  padding: 2.5rem 3rem;
  max-width: 900px;
}
.page-title { margin-bottom: 0.3rem; }
.page-subtitle { color: var(--text-muted); font-size: 1rem; margin-bottom: 2rem; }

/* ── Content sections ────────────────────────────────────── */
.content-section { margin-bottom: 3rem; }
.section-intro { color: var(--text-muted); font-size: 0.95rem; margin-bottom: 1.2rem; }

/* ── Definition grid ─────────────────────────────────────── */
.def-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1rem;
  margin: 1rem 0;
}
.def-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.1rem 1.2rem;
}
.def-card h4 { margin-top: 0; margin-bottom: 0.4rem; font-size: 0.85rem; }
.def-card p  { font-size: 0.88rem; margin-bottom: 0; color: var(--text-muted); }
.def-card .def-value { font-size: 1.2rem; font-weight: 700; color: var(--accent); margin-bottom: 0.3rem; }

/* ── Payoff chart grid ───────────────────────────────────── */
.chart-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.5rem;
  margin: 1.5rem 0;
}
.chart-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.2rem;
}
.chart-card h3 { font-size: 1rem; margin-top: 0; margin-bottom: 0.2rem; }
.chart-subtitle { font-size: 0.78rem; color: var(--text-muted); margin-bottom: 1rem; }
.chart-meta {
  display: flex;
  gap: 1rem;
  margin-top: 0.8rem;
  font-size: 0.8rem;
}
.chart-meta-item { display: flex; align-items: center; gap: 0.3rem; }
.chart-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }

/* ── Hero (landing pages) ────────────────────────────────── */
.hero {
  padding: 5rem 2rem 4rem;
  text-align: center;
  background: radial-gradient(ellipse at 50% 0%, rgba(201,168,76,0.08) 0%, transparent 60%);
  border-bottom: 1px solid var(--border);
}
.hero-tag {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
  background: rgba(201,168,76,0.1);
  border: 1px solid rgba(201,168,76,0.25);
  border-radius: 99px;
  padding: 0.3em 1em;
  margin-bottom: 1.2rem;
}
.hero h1 { margin-bottom: 0.8rem; }
.hero-desc { font-size: 1.05rem; color: var(--text-muted); max-width: 580px; margin: 0 auto 2rem; }

/* ── Asset card grid (Academy index) ─────────────────────── */
.asset-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 1.5rem;
  padding: 3rem 2rem;
  max-width: 1100px;
  margin: 0 auto;
}
.asset-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.8rem 1.5rem;
  transition: all 0.2s;
  position: relative;
  overflow: hidden;
}
.asset-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: var(--card-accent, var(--border));
  transition: opacity 0.2s;
}
.asset-card.active { cursor: pointer; }
.asset-card.active:hover {
  border-color: var(--card-accent, var(--accent));
  background: var(--bg-elevated);
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}
.asset-card.disabled { opacity: 0.5; pointer-events: none; }
.asset-icon { font-size: 2.2rem; margin-bottom: 0.8rem; }
.asset-name { font-size: 1.15rem; font-weight: 700; margin-bottom: 0.3rem; }
.asset-desc { font-size: 0.85rem; color: var(--text-muted); }
.coming-soon {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-dim);
  background: rgba(86,101,128,0.15);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 0.15em 0.6em;
  margin-top: 0.6rem;
}

/* ── Topic card grid (section index) ─────────────────────── */
.topic-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.2rem;
  padding: 2.5rem 2rem;
  max-width: 1100px;
  margin: 0 auto;
}
.topic-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  text-decoration: none;
  color: inherit;
  display: block;
  transition: all 0.2s;
  position: relative;
}
.topic-card::after {
  content: '→';
  position: absolute;
  right: 1.2rem; top: 50%;
  transform: translateY(-50%);
  color: var(--text-dim);
  font-size: 1.1rem;
  transition: all 0.2s;
}
.topic-card:hover {
  border-color: var(--accent);
  background: var(--bg-elevated);
  transform: translateX(3px);
  color: inherit;
}
.topic-card:hover::after { color: var(--accent); right: 0.9rem; }
.topic-num {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 0.5rem;
}
.topic-card h3 { font-size: 1rem; margin: 0 0 0.4rem; }
.topic-card p  { font-size: 0.83rem; color: var(--text-muted); margin: 0; }
.topic-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-top: 0.8rem;
}
.topic-tag {
  font-size: 0.7rem;
  color: var(--text-dim);
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 0.1em 0.5em;
}

/* ── Section overview header ─────────────────────────────── */
.section-hero {
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  padding: 2rem 2rem 1.8rem;
}
.section-hero-inner {
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  align-items: flex-start;
  gap: 1.5rem;
}
.section-icon-lg {
  font-size: 3rem;
  line-height: 1;
  flex-shrink: 0;
}
.section-hero h1 { font-size: 1.8rem; margin-bottom: 0.3rem; }
.section-hero p  { color: var(--text-muted); font-size: 0.95rem; margin: 0; }

/* ── Responsive ──────────────────────────────────────────── */
@media (max-width: 900px) {
  .page-wrap {
    grid-template-columns: 1fr;
  }
  .sidebar {
    position: static;
    height: auto;
    border-right: none;
    border-bottom: 1px solid var(--border);
    padding: 1rem 0;
    display: flex;
    flex-wrap: wrap;
    gap: 0;
  }
  .sidebar-section { margin-bottom: 0; flex: 1; min-width: 150px; }
  .sidebar-label { display: none; }
  .main-content { padding: 1.5rem; }
  .chart-grid { grid-template-columns: 1fr; }
}
@media (max-width: 600px) {
  .hero { padding: 3rem 1.2rem 2.5rem; }
  .asset-grid, .topic-grid { padding: 1.5rem 1rem; }
  .def-grid { grid-template-columns: 1fr; }
  .main-content { padding: 1.2rem 1rem; }
}

/* ── Utility ─────────────────────────────────────────────── */
.mt-0 { margin-top: 0; }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.text-muted  { color: var(--text-muted); }
.text-accent { color: var(--accent); }
.text-green  { color: var(--success); }
.text-red    { color: var(--danger); }
.text-center { text-align: center; }
.flex-gap {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}
