@import url('https://fonts.googleapis.com/css2?family=Press+Start+2P&family=Orbitron:wght@400;700&family=Exo+2:wght@400;500&display=swap');

/* ===== FONTS ===== */

body {
  font-family: 'Exo 2', -apple-system, 'Segoe UI', sans-serif;
  font-size: 16px;
  line-height: 1.65;
}


div[style*="border-left: 4px solid #2C5282"] {
  margin-bottom: 20px;
}

/* Headings — exclude TOC by using :not() */
h1:not(#toc-title),
h2:not(#toc-title),
h3, h4, h5, h6 {
  font-family: 'Orbitron', 'Courier New', monospace !important;
  letter-spacing: 1px;
}

.quarto-title-block .title,
h1.title {
  font-family: 'Press Start 2P', monospace !important;
  font-size: 1.6em !important;
  line-height: 1.5 !important;
}

/* ===== TABLE OF CONTENTS (right sidebar) ===== */

/* TOC title */
#toc-title {
  font-family: 'Exo 2', -apple-system, sans-serif !important;
  color: #2C5282 !important;
  font-weight: bold !important;
  font-size: 16px !important;
  letter-spacing: normal !important;
}

/* TOC links — target multiple possible structures */
#TOC a,
#TOC a span,
nav#TOC a {
  font-family: 'Exo 2', -apple-system, sans-serif !important;
  color: #2C5282 !important;
  font-size: 14px !important;
  font-weight: normal !important;
  letter-spacing: normal !important;
}

/* Active TOC link */
#TOC a.active,
#TOC a.active span,
nav#TOC a.active {
  color: #1B4F72 !important;
  font-weight: bold !important;
}

/* Hover state */
#TOC a:hover,
#TOC a:hover span,
nav#TOC a:hover {
  color: #6495ED !important;
}

/* ===== LEFT SIDEBAR (chapter navigation) ===== */

/* Sidebar container background and border */
.sidebar.sidebar-navigation,
nav.sidebar-navigation,
.sidebar-menu-container {
  background: #f8f9fc !important;
  border-right: 1px solid #e1e4e8 !important;
}

/* Sidebar title */
.sidebar-title,
.sidebar .sidebar-title {
  font-family: 'Orbitron', monospace !important;
  color: #0a0e27 !important;
  font-size: 16px !important;
  font-weight: 700 !important;
  letter-spacing: 1px !important;
  padding: 1rem !important;
  border-bottom: 2px solid #00d4ff;
  text-transform: uppercase;
}

/* Section headers inside sidebar (e.g. "Chapters") */
.sidebar-item-section .sidebar-item-text,
.sidebar-section > .sidebar-item > .sidebar-item-container > a,
.sidebar .sidebar-item-section > .sidebar-item-container .sidebar-item-text {
  font-family: 'Orbitron', monospace !important;
  color: #2C5282 !important;
  font-size: 13px !important;
  font-weight: 700 !important;
  text-transform: uppercase;
  letter-spacing: 1px;
}

/* Sidebar links — leaf items */
.sidebar a,
.sidebar .sidebar-item a,
.sidebar-item-text {
  font-family: 'Exo 2', -apple-system, sans-serif !important;
  color: #2C5282 !important;
  font-size: 14px !important;
  font-weight: normal !important;
  letter-spacing: normal !important;
  line-height: 1.5;
}

/* Active sidebar link */
.sidebar a.active,
.sidebar .sidebar-item.active a,
.sidebar-item-container.active .sidebar-item-text {
  color: #00d4ff !important;
  font-weight: bold !important;
  background: rgba(0, 212, 255, 0.08);
  border-left: 3px solid #00d4ff;
  padding-left: calc(1rem - 3px) !important;
}

/* Sidebar link hover */
.sidebar a:hover,
.sidebar .sidebar-item a:hover {
  color: #1a73e8 !important;
  background: rgba(0, 212, 255, 0.05);
}

/* Tighter spacing for sidebar items */
.sidebar .sidebar-item {
  padding: 0.2rem 0;
}

/* ===== NAVBAR ===== */

.navbar {
  background: #0a0e27 !important;
  border-bottom: 2px solid #00d4ff !important;
}

.navbar-logo,
.navbar-brand img {
  max-height: 80px !important;
  width: auto !important;
  padding: 2px 0;
}

.navbar-brand .navbar-title,
.navbar-title {
  display: none !important;
}

.navbar-nav .nav-link,
.navbar a {
  font-family: 'Orbitron', monospace !important;
  color: #82b1ff !important;
}

.navbar-nav .nav-link:hover,
.navbar a:hover {
  color: #00d4ff !important;
}

.navbar-nav .nav-link.active,
.navbar a.active {
  color: #00d4ff !important;
}

/* ===== DROPDOWN MENU ===== */

.dropdown-menu {
  background: #0a0e27 !important;
}

.dropdown-item {
  color: #00d4ff !important;
}

.dropdown-item:hover {
  background: rgba(0, 212, 255, 0.2) !important;
  color: #ffffff !important;
}

.chapter-banner {
  background: linear-gradient(135deg, #0a0e27 0%, #1a1f4a 50%, #0a0e27 100%);
  color: #00d4ff !important;
  padding: 1.5rem 2.5rem;
  margin: 4rem 0 2.5rem 0;
  border: 2px solid #00d4ff;
  border-radius: 4px;
  font-family: 'Press Start 2P', monospace !important;
  font-size: 1.3em !important;
  letter-spacing: 3px;
  text-align: center;
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 80px;
  text-shadow: 
    0 0 5px #00d4ff,
    0 0 10px #00d4ff,
    0 0 20px #00d4ff,
    0 0 40px rgba(0, 212, 255, 0.5);
  box-shadow: 
    0 0 10px rgba(0, 212, 255, 0.5),
    0 0 20px rgba(0, 212, 255, 0.3),
    inset 0 0 20px rgba(0, 212, 255, 0.1);
  animation: bannerGlow 3s ease-in-out infinite alternate;
}

.chapter-banner > * {
  margin: 0 !important;
  padding: 0 !important;
  text-align: center;
  width: 100%;
}

/* Pulsing neon glow animation */
@keyframes bannerGlow {
  from {
    box-shadow: 
      0 0 10px rgba(0, 212, 255, 0.5),
      0 0 20px rgba(0, 212, 255, 0.3),
      inset 0 0 20px rgba(0, 212, 255, 0.1);
  }
  to {
    box-shadow: 
      0 0 15px rgba(0, 212, 255, 0.7),
      0 0 30px rgba(0, 212, 255, 0.5),
      0 0 60px rgba(0, 212, 255, 0.3),
      inset 0 0 30px rgba(0, 212, 255, 0.15);
  }
}

/* Scan lines overlay — CRT TV effect */
.chapter-banner::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: repeating-linear-gradient(
    0deg,
    rgba(0, 212, 255, 0.03) 0px,
    rgba(0, 212, 255, 0.03) 1px,
    transparent 1px,
    transparent 3px
  );
  pointer-events: none;
}

/* Decorative corner brackets */
.chapter-banner::after {
  content: '';
  position: absolute;
  top: 8px;
  left: 8px;
  right: 8px;
  bottom: 8px;
  border: 1px solid rgba(0, 212, 255, 0.4);
  border-radius: 2px;
  pointer-events: none;
}
