/* nav.css — Shared navigation styles for Ollama Self-Learning System */

:root {
  --bg:        #0d1117;
  --surface:   #161b22;
  --surface2:  #21262d;
  --border:    #30363d;
  --text:      #c9d1d9;
  --text-muted:#8b949e;
  --accent:    #58a6ff;
  --green:     #3fb950;
  --yellow:    #d29922;
  --red:       #f85149;
  --purple:    #bc8cff;
  --nav-h:     52px;
  --debug-h:   36px;
  --content-h: 40px;
  --radius:    6px;
  --transition:150ms ease;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
}

/* ── NAV WRAPPER ─────────────────────────────────────────────────────────── */
#main-nav {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  box-shadow: 0 2px 8px rgba(0,0,0,.4);
}

.nav-container { width: 100%; }

/* ── TOP BAR (brand + search + social) ──────────────────────────────────── */
.nav-top {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 16px;
  height: var(--nav-h);
  max-width: 1400px;
  margin: 0 auto;
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.nav-hamburger {
  display: none;
  background: none;
  border: 1px solid var(--border);
  color: var(--text);
  font-size: 18px;
  width: 34px; height: 34px;
  border-radius: var(--radius);
  cursor: pointer;
  transition: var(--transition);
}
.nav-hamburger:hover { background: var(--surface2); }

.nav-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  text-decoration: none;
  white-space: nowrap;
}
.nav-title:hover { color: var(--accent); }

/* ── SEARCH ──────────────────────────────────────────────────────────────── */
.nav-search-wrap {
  position: relative;
  flex: 1;
  max-width: 480px;
}

.nav-search {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--text);
  font-size: 14px;
  padding: 6px 12px;
  border-radius: var(--radius);
  outline: none;
  transition: var(--transition);
}
.nav-search:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(88,166,255,.15); }
.nav-search::placeholder { color: var(--text-muted); }

.nav-search-results {
  display: none;
  position: absolute;
  top: calc(100% + 4px);
  left: 0; right: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 8px 24px rgba(0,0,0,.5);
  max-height: 360px;
  overflow-y: auto;
  z-index: 2000;
}

.nav-search-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 9px 14px;
  text-decoration: none;
  color: var(--text);
  border-bottom: 1px solid var(--border);
  transition: var(--transition);
}
.nav-search-item:last-child { border-bottom: none; }
.nav-search-item:hover, .nav-search-item.active { background: var(--surface2); }
.nav-search-emoji { font-size: 16px; flex-shrink: 0; margin-top: 1px; }
.nav-search-text { display: flex; flex-direction: column; gap: 2px; }
.nav-search-label { font-size: 14px; font-weight: 500; }
.nav-search-desc  { font-size: 12px; color: var(--text-muted); }
.nav-search-empty { padding: 12px 14px; color: var(--text-muted); font-size: 14px; }
.nav-search-item mark { background: none; color: var(--accent); font-weight: 600; }

/* ── SOCIAL LINKS ────────────────────────────────────────────────────────── */
.nav-social { display: flex; align-items: center; gap: 4px; flex-shrink: 0; }
.nav-social-link {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px; height: 32px;
  font-size: 16px;
  text-decoration: none;
  border-radius: var(--radius);
  transition: var(--transition);
}
.nav-social-link:hover { background: var(--surface2); transform: scale(1.1); }

/* ── DEBUG BAR ───────────────────────────────────────────────────────────── */
.nav-debug-bar {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 0 16px;
  height: var(--debug-h);
  background: rgba(210,153,34,.08);
  border-top: 1px solid rgba(210,153,34,.25);
  overflow-x: auto;
  scrollbar-width: none;
}
.nav-debug-bar::-webkit-scrollbar { display: none; }

.nav-debug-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--yellow);
  text-transform: uppercase;
  letter-spacing: .6px;
  margin-right: 6px;
  flex-shrink: 0;
}

.nav-debug-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  font-size: 12px;
  font-weight: 500;
  color: var(--yellow);
  text-decoration: none;
  border: 1px solid rgba(210,153,34,.35);
  border-radius: var(--radius);
  white-space: nowrap;
  transition: var(--transition);
}
.nav-debug-link:hover { background: rgba(210,153,34,.15); }

/* ── CONTENT MENU BAR ────────────────────────────────────────────────────── */
.nav-content-bar {
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 0 16px;
  height: var(--content-h);
  border-top: 1px solid var(--border);
  overflow-x: auto;
  scrollbar-width: none;
  max-width: 1400px;
  margin: 0 auto;
}
.nav-content-bar::-webkit-scrollbar { display: none; }

.nav-content-link {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 11px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
  text-decoration: none;
  border-radius: var(--radius);
  white-space: nowrap;
  transition: var(--transition);
}
.nav-content-link:hover { color: var(--text); background: var(--surface2); }
.nav-content-link.active { color: var(--accent); background: rgba(88,166,255,.1); }

/* ── MOBILE DROPDOWN MENU ────────────────────────────────────────────────── */
.nav-mobile-menu {
  display: none;
  flex-direction: column;
  padding: 8px 0 16px;
  background: var(--surface);
  border-top: 1px solid var(--border);
  max-height: 70vh;
  overflow-y: auto;
}
.nav-mobile-menu.open { display: flex; }

.nav-mobile-section { padding: 8px 16px; }
.nav-mobile-section-title {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .6px;
  padding: 6px 0 4px;
}

.nav-mobile-link {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  font-size: 14px;
  color: var(--text);
  text-decoration: none;
  border-radius: var(--radius);
  transition: var(--transition);
}
.nav-mobile-link:hover { background: var(--surface2); }

/* ── DEBUG TOGGLE BUTTON ─────────────────────────────────────────────────── */
.debug-toggle-btn {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 9999;
  background: var(--surface2);
  border: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 13px;
  padding: 8px 14px;
  border-radius: 20px;
  cursor: pointer;
  transition: var(--transition);
  box-shadow: 0 4px 12px rgba(0,0,0,.4);
}
.debug-toggle-btn:hover { background: var(--surface); color: var(--text); }
.debug-toggle-btn.debug-on {
  background: rgba(210,153,34,.15);
  border-color: var(--yellow);
  color: var(--yellow);
}

/* ── MAIN CONTENT AREA ───────────────────────────────────────────────────── */
main {
  max-width: 1200px;
  margin: 0 auto;
  padding: 32px 24px;
}

/* ── CARDS ───────────────────────────────────────────────────────────────── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 24px;
  transition: var(--transition);
}
.card:hover { border-color: var(--accent); }

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
  margin: 24px 0;
}

.card-emoji { font-size: 32px; margin-bottom: 12px; display: block; }
.card-title { font-size: 16px; font-weight: 600; margin-bottom: 8px; }
.card-desc  { font-size: 14px; color: var(--text-muted); margin-bottom: 16px; }
.card-link  {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 13px;
  color: var(--accent);
  text-decoration: none;
  font-weight: 500;
}
.card-link:hover { text-decoration: underline; }

/* ── HERO ────────────────────────────────────────────────────────────────── */
.hero {
  text-align: center;
  padding: 48px 24px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 40px;
}
.hero-title  { font-size: clamp(24px, 5vw, 42px); font-weight: 700; margin-bottom: 12px; }
.hero-sub    { font-size: 16px; color: var(--text-muted); max-width: 600px; margin: 0 auto 24px; }
.hero-badges { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }

.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 14px;
  font-size: 13px;
  font-weight: 500;
  border-radius: 20px;
  text-decoration: none;
  transition: var(--transition);
}
.badge-blue   { background: rgba(88,166,255,.15); color: var(--accent); border: 1px solid rgba(88,166,255,.3); }
.badge-green  { background: rgba(63,185,80,.15);  color: var(--green);  border: 1px solid rgba(63,185,80,.3); }
.badge-purple { background: rgba(188,140,255,.15);color: var(--purple); border: 1px solid rgba(188,140,255,.3); }
.badge:hover { filter: brightness(1.2); }

/* ── SECTION HEADER ──────────────────────────────────────────────────────── */
.section-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}
.section-emoji { font-size: 28px; }
.section-title { font-size: 20px; font-weight: 600; }
.section-subtitle { font-size: 14px; color: var(--text-muted); }

/* ── PROSE (for markdown content) ───────────────────────────────────────── */
.prose h1,.prose h2,.prose h3,.prose h4 { font-weight: 600; margin: 1.5em 0 .5em; color: var(--text); }
.prose h1 { font-size: 28px; border-bottom: 1px solid var(--border); padding-bottom: 8px; }
.prose h2 { font-size: 22px; border-bottom: 1px solid var(--border); padding-bottom: 6px; }
.prose h3 { font-size: 18px; }
.prose p  { margin: .75em 0; }
.prose a  { color: var(--accent); text-decoration: none; }
.prose a:hover { text-decoration: underline; }
.prose code {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 2px 6px;
  font-size: .9em;
  font-family: 'JetBrains Mono', 'Fira Code', monospace;
}
.prose pre {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  overflow-x: auto;
  margin: 1em 0;
}
.prose pre code { background: none; border: none; padding: 0; font-size: 13px; }
.prose ul,.prose ol { padding-left: 24px; margin: .75em 0; }
.prose li { margin: .3em 0; }
.prose blockquote {
  border-left: 4px solid var(--accent);
  margin: 1em 0;
  padding: 8px 16px;
  color: var(--text-muted);
  background: rgba(88,166,255,.05);
  border-radius: 0 var(--radius) var(--radius) 0;
}
.prose table { border-collapse: collapse; width: 100%; margin: 1em 0; }
.prose th,.prose td { border: 1px solid var(--border); padding: 8px 12px; text-align: left; }
.prose th { background: var(--surface2); font-weight: 600; }
.prose tr:hover td { background: var(--surface2); }
.prose img { max-width: 100%; border-radius: var(--radius); }

/* ── BREADCRUMB ──────────────────────────────────────────────────────────── */
.breadcrumb {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 20px;
}
.breadcrumb a { color: var(--accent); text-decoration: none; }
.breadcrumb a:hover { text-decoration: underline; }
.breadcrumb-sep { color: var(--border); }

/* ── CHECKLIST ───────────────────────────────────────────────────────────── */
.checklist-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 8px 12px;
  border-radius: var(--radius);
  margin-bottom: 6px;
  font-size: 14px;
  background: var(--surface2);
}
.checklist-item input[type=checkbox] { margin-top: 2px; accent-color: var(--green); }

/* ── PAGE FOOTER ─────────────────────────────────────────────────────────── */
footer {
  text-align: center;
  padding: 32px 16px;
  border-top: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 13px;
  margin-top: 60px;
}
footer a { color: var(--accent); text-decoration: none; }
footer a:hover { text-decoration: underline; }

/* ── CAROUSEL ────────────────────────────────────────────────────────────── */
.carousel-wrap {
  position: relative;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  margin: 24px 0;
}
.carousel-track {
  display: flex;
  transition: transform 0.4s ease;
}
.carousel-slide {
  min-width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  min-height: 320px;
  text-align: center;
}
.carousel-slide img { max-height: 280px; max-width: 100%; object-fit: contain; border-radius: var(--radius); }
.carousel-slide .slide-placeholder {
  color: var(--text-muted);
  font-size: 14px;
  padding: 40px;
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  width: 100%;
}
.carousel-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(22,27,34,.85);
  border: 1px solid var(--border);
  color: var(--text);
  font-size: 20px;
  width: 40px; height: 40px;
  border-radius: 50%;
  cursor: pointer;
  z-index: 10;
  transition: var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
}
.carousel-btn:hover { background: var(--surface); }
.carousel-prev { left: 12px; }
.carousel-next { right: 12px; }
.carousel-dots {
  display: flex;
  justify-content: center;
  gap: 6px;
  padding: 12px;
  background: var(--surface);
}
.carousel-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--border);
  cursor: pointer;
  transition: var(--transition);
  border: none;
}
.carousel-dot.active { background: var(--accent); transform: scale(1.3); }

/* ── UTIL ────────────────────────────────────────────────────────────────── */
.tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 9px;
  font-size: 12px;
  font-weight: 500;
  border-radius: 12px;
  background: var(--surface2);
  border: 1px solid var(--border);
  color: var(--text-muted);
}
.tag-green  { background: rgba(63,185,80,.1);  border-color: rgba(63,185,80,.3);  color: var(--green); }
.tag-blue   { background: rgba(88,166,255,.1); border-color: rgba(88,166,255,.3); color: var(--accent); }
.tag-yellow { background: rgba(210,153,34,.1); border-color: rgba(210,153,34,.3); color: var(--yellow); }
.tag-red    { background: rgba(248,81,73,.1);  border-color: rgba(248,81,73,.3);  color: var(--red); }

.mt-4  { margin-top: 16px; }
.mt-8  { margin-top: 32px; }
.mb-4  { margin-bottom: 16px; }
.flex  { display: flex; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.wrap  { flex-wrap: wrap; }
.items-center { align-items: center; }
.text-muted { color: var(--text-muted); }
.text-sm { font-size: 13px; }

/* ── RESPONSIVE ──────────────────────────────────────────────────────────── */
@media (max-width: 768px) {
  .nav-hamburger { display: flex; align-items: center; justify-content: center; }
  .nav-content-bar { display: none; }
  .nav-debug-bar { display: none; }
  .nav-mobile-menu { display: none; }
  .nav-mobile-menu.open { display: flex; }
  .nav-social { display: none; }
  .nav-search-wrap { max-width: none; }
  main { padding: 20px 16px; }
  .card-grid { grid-template-columns: 1fr; }
  .hero { padding: 32px 16px; }
}

@media (max-width: 480px) {
  .nav-top { gap: 8px; padding: 0 12px; }
  .nav-title { font-size: 13px; }
}
