/* ============================================================
   blyx-enhanced.css — Premium Blyx Book Design System
   Injected into every page via blyx.css chain
   ============================================================ */

/* ----- Google Fonts Import ----- */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=JetBrains+Mono:wght@400;500&display=swap');

/* ----- CSS Custom Properties ----- */
:root {
  --blyx-purple:       #7c3aed;
  --blyx-purple-light: #a78bfa;
  --blyx-purple-dark:  #5b21b6;
  --blyx-accent:       #06b6d4;
  --blyx-accent2:      #f59e0b;
  --blyx-glow:         rgba(124, 58, 237, 0.25);
  --blyx-radius:       10px;
  --blyx-shadow:       0 4px 24px rgba(0,0,0,0.12);
  --blyx-transition:   0.22s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ── LOGO IN MENU BAR ─────────────────────────────────── */
.blyx-logo-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 14px;
  text-decoration: none !important;
}

.blyx-logo-wrap img {
  height: 36px;
  width: auto;
  border-radius: 8px;
  box-shadow: 0 2px 8px var(--blyx-glow);
  transition: transform var(--blyx-transition), box-shadow var(--blyx-transition);
}

.blyx-logo-wrap:hover img {
  transform: scale(1.08) rotate(-2deg);
  box-shadow: 0 4px 16px var(--blyx-glow);
}

.blyx-logo-text {
  font-family: 'Inter', sans-serif;
  font-weight: 700;
  font-size: 1.1rem;
  background: linear-gradient(135deg, var(--blyx-purple-light), var(--blyx-accent));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: -0.02em;
}

/* ── MENU BAR ENHANCEMENTS ───────────────────────────── */
#mdbook-menu-bar {
  border-bottom: 1px solid rgba(124, 58, 237, 0.15) !important;
  backdrop-filter: blur(12px) !important;
  -webkit-backdrop-filter: blur(12px) !important;
}

.menu-title {
  font-family: 'Inter', sans-serif !important;
  font-weight: 600 !important;
  letter-spacing: -0.02em !important;
  background: linear-gradient(135deg, var(--blyx-purple-light) 0%, var(--blyx-accent) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ── THEME POPUP → Rename "Rust" label via CSS ───────── */
#mdbook-theme-rust::after {
  content: 'Blyx';
}
#mdbook-theme-rust {
  font-size: 0 !important; /* hide original text */
}
#mdbook-theme-rust::after {
  font-size: 1rem;
}

/* ── SIDEBAR ENHANCEMENTS ────────────────────────────── */
#mdbook-sidebar {
  border-right: 1px solid rgba(124, 58, 237, 0.12) !important;
}

#mdbook-sidebar .chapter li.chapter-item a:hover,
#mdbook-sidebar .chapter li.chapter-item a.active {
  color: var(--blyx-purple-light) !important;
  border-left: 3px solid var(--blyx-purple) !important;
  padding-left: 13px !important;
  transition: all var(--blyx-transition) !important;
}

/* ── TYPOGRAPHY ───────────────────────────────────────── */
.content {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif !important;
  line-height: 1.75 !important;
  font-size: 16.5px !important;
}

h1, h2, h3, h4 {
  font-family: 'Inter', sans-serif !important;
  font-weight: 700 !important;
  letter-spacing: -0.03em !important;
}

h1 { font-size: 2.2rem !important; }
h2 { font-size: 1.6rem !important; border-bottom: none !important; padding-bottom: 0.4em !important; }
h3 { font-size: 1.2rem !important; }

/* ── CODE BLOCKS ─────────────────────────────────────── */
pre {
  font-family: 'JetBrains Mono', 'Fira Code', monospace !important;
  font-size: 0.88rem !important;
  border-radius: 0 !important;
  border-left: none !important;
  box-shadow: var(--blyx-shadow) !important;
  transition: box-shadow var(--blyx-transition) !important;
}

pre:hover {
  box-shadow: 0 8px 32px rgba(0,0,0,0.15) !important;
}

code {
  font-family: 'JetBrains Mono', 'Fira Code', monospace !important;
  font-size: 0.85em !important;
  border-radius: 5px !important;
  padding: 0.15em 0.4em !important;
}

/* ── BLOCKQUOTES / NOTES ────────────────────────────── */
blockquote {
  border-left: none !important;
  border-radius: 0 !important;
  background: rgba(124,58,237,0.05) !important;
  padding: 1em 1.4em !important;
  margin: 1.5em 0 !important;
}

/* ── LINKS ───────────────────────────────────────────── */
a {
  color: var(--blyx-purple-light) !important;
  text-decoration: none !important;
  border-bottom: 1px solid transparent !important;
  transition: border-color var(--blyx-transition), color var(--blyx-transition) !important;
}

a:hover {
  color: var(--blyx-accent) !important;
  border-bottom-color: var(--blyx-accent) !important;
}

/* ── BLYX DIAGRAM SECTION ────────────────────────────── */
.blyx-diagram-section {
  margin: 2.5rem 0;
  padding: 2rem;
  border-radius: 16px;
  background: linear-gradient(135deg, rgba(124,58,237,0.06) 0%, rgba(6,182,212,0.04) 100%);
  border: 1px solid rgba(124,58,237,0.15);
  box-shadow: 0 2px 16px rgba(0,0,0,0.06);
}

.blyx-diagram-section h3 {
  text-align: center;
  font-size: 1.1rem !important;
  color: var(--blyx-purple-light) !important;
  margin-bottom: 1.5rem !important;
  border: none !important;
}

.blyx-diagram-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  margin-top: 1rem;
}

.blyx-stat-card {
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(124,58,237,0.2);
  border-radius: 12px;
  padding: 1.2rem;
  text-align: center;
  transition: transform var(--blyx-transition), box-shadow var(--blyx-transition);
}

.blyx-stat-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 24px var(--blyx-glow);
}

.blyx-stat-card .stat-number {
  font-size: 2rem;
  font-weight: 700;
  background: linear-gradient(135deg, var(--blyx-purple-light), var(--blyx-accent));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.blyx-stat-card .stat-label {
  font-size: 0.8rem;
  opacity: 0.65;
  margin-top: 0.3rem;
  font-weight: 500;
}

/* Progress bars */
.blyx-progress-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0.6rem 0;
  font-size: 0.85rem;
}

.blyx-progress-label {
  min-width: 140px;
  font-weight: 500;
  opacity: 0.85;
}

.blyx-progress-bar-track {
  flex: 1;
  height: 8px;
  border-radius: 99px;
  background: rgba(124,58,237,0.12);
  overflow: hidden;
}

.blyx-progress-bar-fill {
  height: 100%;
  border-radius: 99px;
  background: linear-gradient(90deg, var(--blyx-purple), var(--blyx-accent));
  transform-origin: left;
  animation: blyx-grow 1.2s ease-out forwards;
  transform: scaleX(0);
}

@keyframes blyx-grow {
  to { transform: scaleX(1); }
}

/* Feature pills */
.blyx-feature-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 1rem 0;
}

.blyx-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0.35rem 0.9rem;
  border-radius: 99px;
  font-size: 0.8rem;
  font-weight: 500;
  background: linear-gradient(135deg, rgba(124,58,237,0.15), rgba(6,182,212,0.1));
  border: 1px solid rgba(124,58,237,0.25);
  transition: transform var(--blyx-transition);
}

.blyx-pill:hover {
  transform: scale(1.05);
}

/* ── CANVAS CHARTS ───────────────────────────────────── */
.blyx-chart-wrap {
  position: relative;
  max-height: 260px;
  margin: 1rem 0;
}

/* ── SEARCH BAR POLISH ───────────────────────────────── */
#mdbook-searchbar {
  border-radius: 24px !important;
  border: 1.5px solid rgba(124,58,237,0.3) !important;
  transition: border-color var(--blyx-transition), box-shadow var(--blyx-transition) !important;
}

#mdbook-searchbar:focus {
  border-color: var(--blyx-purple) !important;
  box-shadow: 0 0 0 3px var(--blyx-glow) !important;
  outline: none !important;
}

/* ── ERROR / PANIC code blocks ──────────────────────── */
body.light .does_not_compile,
body.light .panics,
body.light .not_desired_behavior,
body.blyx .does_not_compile,
body.blyx .panics,
body.blyx .not_desired_behavior {
  background: #F0F8FF;
  border-left: none;
}

body.coal .does_not_compile,
body.coal .panics,
body.coal .not_desired_behavior,
body.navy .does_not_compile,
body.navy .panics,
body.navy .not_desired_behavior,
body.ayu .does_not_compile,
body.ayu .panics,
body.ayu .not_desired_behavior {
  background: #1E3A5F;
  border-left: none;
}

/* ── BLYX MASCOT ─────────────────────────────────────── */
.blyx-container { position: absolute; z-index: 99; right: 5px; top: 30px; }
.blyx { vertical-align: top; margin-left: 0.2em; height: auto; }
.blyx-large { width: 4.5em; }
.blyx-small { width: 2.3em; }
.blyx-explain { width: 100px; }

pre > .buttons { visibility: visible; opacity: 1; transition: none; }
pre > .buttons button { visibility: hidden; opacity: 0; transition: visibility 0.1s linear, opacity 0.1s linear; }
pre:hover > .buttons button { visibility: visible; opacity: 1; }

/* ── SCROLL BAR STYLE ────────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(124,58,237,0.3); border-radius: 99px; }
::-webkit-scrollbar-thumb:hover { background: var(--blyx-purple); }

/* ── PRINT BUTTON GLOW ───────────────────────────────── */
#print-button svg { transition: filter var(--blyx-transition); }
#print-button:hover svg { filter: drop-shadow(0 0 6px var(--blyx-purple)); }
