<template>
  <!-- Custom FDSA Layout — wraps ALL pages in our design system -->
  <div class="fdsa-layout">
    <header class="fdsa-nav">
      <div class="nav-inner">
        <div class="logo-wrap">
          <span class="material-symbols-outlined" style="color:#d95c41;font-size:24px">terminal</span>
          <span class="logo-text">FDSA</span>
        </div>
        <nav class="nav-links">
          <a href="/">Home</a>
          <a href="/modules/m1-foundations">Course</a>
          <a href="/labs/l1-first-agent">Labs</a>
          <a href="/skills">Skills</a>
          <a href="/blog">Blog</a>
          <a href="/buy" class="nav-cta">Enroll</a>
        </nav>
      </div>
    </header>

    <main class="fdsa-main">
      <aside class="fdsa-sidebar">
        <Content :slot-key="'sidebar-top'" />
        <slot name="sidebar" />
      </aside>

      <article class="fdsa-content">
        <div class="content-card">
          <slot />
        </div>
      </article>
    </main>

    <footer class="fdsa-footer">
      <div class="footer-inner">
        <div class="ft-l">FDSA</div>
        <div class="ft-links">
          <a href="/troubleshooting">FAQ</a>
          <a href="/certificate">Certificate</a>
          <a href="/buy">Pricing</a>
        </div>
        <div class="ft-c">FDSA Agency — Agentic Engineering Course</div>
      </div>
    </footer>
  </div>
</template>

<style>
.fdsa-layout {
  font-family: 'DM Sans', -apple-system, sans-serif;
  background: #0a0a0a;
  color: #e8e8e8;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

/* Nav — matches landing page */
.fdsa-nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 50;
  background: rgba(10,10,10,0.8); backdrop-filter: blur(16px);
  border-bottom: 1px solid #1a1a1a;
}
.nav-inner {
  max-width: 1280px; margin: 0 auto;
  display: flex; align-items: center; justify-content: space-between;
  height: 64px; padding: 0 24px;
}
.logo-wrap { display: flex; align-items: center; gap: 8px; }
.logo-text { font-weight: 800; font-size: 20px; letter-spacing: -0.5px; color: #e8e8e8; }
.nav-links { display: flex; gap: 28px; align-items: center; }
.nav-links a { color: #888; text-decoration: none; font-size: 14px; font-weight: 500; transition: color .2s; }
.nav-links a:hover { color: #e8e8e8; }
.nav-cta { background: #d95c41; color: #fff !important; padding: 8px 20px; border-radius: 6px; font-weight: 600; }
.nav-cta:hover { background: #c44a30 !important; }

/* Main layout — content + optional sidebar */
.fdsa-main {
  display: flex;
  max-width: 1280px;
  margin: 0 auto;
  padding: 96px 24px 64px;
  gap: 32px;
}

.fdsa-sidebar {
  width: 220px;
  flex-shrink: 0;
  position: sticky;
  top: 96px;
  height: fit-content;
  max-height: calc(100vh - 120px);
  overflow-y: auto;
  padding-right: 16px;
  border-right: 1px solid #1a1a1a;
}

.fdsa-content {
  flex: 1;
  min-width: 0;
}

/* Content card — glass style */
.content-card {
  background: rgba(17,17,17,0.85);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255,255,255,0.06);
  border-top: 1px solid rgba(255,255,255,0.1);
  border-radius: 12px;
  padding: 40px;
}

/* Typography inside content */
.content-card h1 {
  font-size: 2.25rem; font-weight: 800;
  letter-spacing: -0.5px; line-height: 1.1;
  margin-bottom: 24px; color: #f0f0f0;
}
.content-card h2 {
  font-size: 1.375rem; font-weight: 700;
  letter-spacing: -0.3px;
  padding-top: 32px; margin-top: 40px; margin-bottom: 16px;
  border-top: 1px solid rgba(255,255,255,0.06);
  color: #f0f0f0;
}
.content-card h3 {
  font-size: 1.0625rem; font-weight: 600;
  margin-top: 28px; margin-bottom: 12px; color: #f0f0f0;
}
.content-card p {
  font-size: 0.9375rem; line-height: 1.7;
  color: #d0d0d0; margin-bottom: 16px;
}
.content-card a { color: #d95c41; text-decoration: underline; text-underline-offset: 2px; }
.content-card a:hover { color: #e87d2f; }
.content-card code {
  font-family: 'DM Mono', monospace; font-size: 0.8125rem;
  background: #181818; border: 1px solid #222;
  padding: 2px 8px; border-radius: 6px; color: #e8e8e8;
}
.content-card pre {
  background: rgba(17,17,17,0.9) !important;
  border: 1px solid #222; border-radius: 10px;
  padding: 20px; overflow-x: auto; margin: 24px 0;
}
.content-card pre code {
  background: none; border: none; padding: 0;
  font-size: 13px; line-height: 1.7;
}
.content-card table {
  width: 100%; border-collapse: collapse;
  border: 1px solid #222; border-radius: 10px; overflow: hidden;
  font-size: 0.875rem; margin: 24px 0;
}
.content-card th {
  background: #181818; font-weight: 600; font-size: 0.75rem;
  text-transform: uppercase; letter-spacing: 0.06em;
  color: #888; padding: 12px 16px;
  border-bottom: 1px solid #222;
}
.content-card td {
  padding: 12px 16px; border-bottom: 1px solid #1a1a1a;
  font-size: 0.875rem; color: #d0d0d0;
}
.content-card tr:hover td { background: rgba(255,255,255,0.02); }
.content-card blockquote {
  border-left: 3px solid #d95c41;
  background: rgba(217,92,65,0.06);
  padding: 16px 24px; border-radius: 0 10px 10px 0;
  margin: 24px 0;
}
.content-card ul, .content-card ol {
  font-size: 0.9375rem; line-height: 1.7;
  padding-left: 1.5em; margin-bottom: 16px; color: #d0d0d0;
}
.content-card li { margin: 6px 0; }
.content-card img {
  max-width: 100%; height: auto;
  border-radius: 10px; margin: 24px 0;
  border: 1px solid #222;
}
.content-card hr {
  border: none; border-top: 1px solid #1a1a1a; margin: 48px 0;
}

/* Footer */
.fdsa-footer {
  border-top: 1px solid #1a1a1a; padding: 32px 24px; text-align: center;
}
.footer-inner { max-width: 1280px; margin: 0 auto; }
.ft-l { font-size: 18px; font-weight: 800; color: #f0f0f0; margin-bottom: 16px; }
.ft-links { display: flex; justify-content: center; gap: 24px; margin-bottom: 16px; }
.ft-links a { color: #555; text-decoration: none; font-size: 13px; transition: color .2s; }
.ft-links a:hover { color: #888; }
.ft-c { font-size: 12px; color: #444; }

/* Responsive */
@media (max-width: 768px) {
  .fdsa-main { flex-direction: column; padding: 80px 16px 64px; }
  .fdsa-sidebar { display: none; }
  .content-card { padding: 24px 20px; }
}
</style>
