@import url('https://fonts.googleapis.com/css2?family=Fira+Code:wght@400;500;600&family=Outfit:wght@300;400;500;600;700;800&display=swap');

:root {
  /* HSL Color Palette */
  --bg-main: 240 10% 3.9%;          /* Midnight Obsidian (#09090b) */
  --bg-card: 240 10% 6%;            /* Slate Dark Overlay (#101012) */
  --bg-card-hover: 240 10% 9%;      /* Lighter Slate Card Hover */
  
  --border: 240 5.9% 15%;           /* Subtle Border Line */
  --border-glow: 180 100% 50%;      /* Neon Cyan Glow (#00f0ff) */
  --accent: 180 100% 47%;           /* Neon Cyan Accent color */
  --accent-glow: 180 100% 50% / 0.15;
  
  --text-primary: 0 0% 98%;         /* Crisp white text */
  --text-secondary: 240 5% 64.9%;   /* Muted gray text */
  --text-dim: 240 5% 45%;           /* Deeply muted details */

  --font-sans: 'Outfit', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-mono: 'Fira Code', ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  
  --header-height: 70px;
  --sidebar-width: 280px;
  --toc-width: 240px;
  
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-height) + 20px);
}

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

body {
  background-color: hsl(var(--bg-main));
  color: hsl(var(--text-primary));
  font-family: var(--font-sans);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Custom Scrollbars */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: hsl(var(--bg-main));
}
::-webkit-scrollbar-thumb {
  background: hsl(var(--border));
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: hsl(var(--accent) / 0.5);
}

/* Glassmorphism Background Pattern */
.bg-grid {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image: 
    linear-gradient(to right, hsl(var(--border) / 0.15) 1px, transparent 1px),
    linear-gradient(to bottom, hsl(var(--border) / 0.15) 1px, transparent 1px);
  background-size: 40px 40px;
  pointer-events: none;
  z-index: -2;
}

.bg-radial {
  position: fixed;
  top: -10%;
  right: -10%;
  width: 80vw;
  height: 80vw;
  background: radial-gradient(circle, hsl(var(--accent) / 0.05) 0%, transparent 70%);
  pointer-events: none;
  z-index: -1;
}

/* Header Styling */
header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: var(--header-height);
  background-color: hsl(var(--bg-main) / 0.75);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid hsl(var(--border));
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 40px;
  z-index: 50;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: hsl(var(--text-primary));
}

.brand img {
  width: 32px;
  height: 32px;
  filter: drop-shadow(0 0 6px hsl(var(--accent) / 0.6));
}

.brand-text {
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.5px;
}

.brand-badge {
  background-color: hsl(var(--accent) / 0.1);
  border: 1px solid hsl(var(--accent) / 0.3);
  color: hsl(var(--accent));
  font-size: 0.65rem;
  font-weight: 800;
  padding: 2px 6px;
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.header-links {
  display: flex;
  align-items: center;
  gap: 20px;
}

.header-btn {
  color: hsl(var(--text-secondary));
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  transition: color 0.2s ease;
}

.header-btn:hover {
  color: hsl(var(--accent));
}

.header-btn-primary {
  background-color: hsl(var(--accent));
  color: hsl(var(--bg-main));
  font-weight: 600;
  padding: 8px 16px;
  border-radius: 6px;
  box-shadow: 0 0 15px hsl(var(--accent) / 0.3);
  transition: all 0.2s ease;
}

.header-btn-primary:hover {
  background-color: hsl(var(--text-primary));
  box-shadow: 0 0 20px hsl(var(--text-primary) / 0.4);
  color: hsl(var(--bg-main));
}

.menu-toggle {
  display: none;
  background: none;
  border: none;
  color: hsl(var(--text-primary));
  font-size: 1.5rem;
  cursor: pointer;
}

/* Master Layout */
.layout-wrapper {
  display: flex;
  margin-top: var(--header-height);
  min-height: calc(100vh - var(--header-height));
  position: relative;
}

/* Sidebar Styling */
.sidebar {
  width: var(--sidebar-width);
  position: fixed;
  top: var(--header-height);
  left: 0;
  bottom: 0;
  border-right: 1px solid hsl(var(--border));
  background-color: hsl(var(--bg-main));
  padding: 30px;
  overflow-y: auto;
  z-index: 40;
}

.search-box {
  position: relative;
  margin-bottom: 24px;
}

.search-box input {
  width: 100%;
  background-color: hsl(var(--bg-card));
  border: 1px solid hsl(var(--border));
  color: hsl(var(--text-primary));
  border-radius: 6px;
  padding: 10px 12px 10px 36px;
  font-family: var(--font-sans);
  font-size: 0.85rem;
  transition: all 0.2s ease;
}

.search-box input:focus {
  border-color: hsl(var(--accent));
  box-shadow: 0 0 10px hsl(var(--accent) / 0.15);
  outline: none;
}

.search-box svg {
  position: absolute;
  top: 50%;
  left: 12px;
  transform: translateY(-50%);
  color: hsl(var(--text-dim));
  width: 16px;
  height: 16px;
  pointer-events: none;
}

.sidebar-nav-title {
  font-size: 0.75rem;
  font-weight: 700;
  color: hsl(var(--text-dim));
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 12px;
  margin-top: 24px;
}

.sidebar-nav-links {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.sidebar-nav-links a {
  color: hsl(var(--text-secondary));
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  display: block;
  padding: 6px 12px;
  border-radius: 6px;
  border-left: 2px solid transparent;
  transition: all 0.2s ease;
}

.sidebar-nav-links a:hover,
.sidebar-nav-links a.active {
  color: hsl(var(--accent));
  background-color: hsl(var(--accent) / 0.04);
  border-left-color: hsl(var(--accent));
  padding-left: 14px;
}

/* Main Documentation Area */
main.content-pane {
  flex: 1;
  margin-left: var(--sidebar-width);
  margin-right: var(--toc-width);
  padding: 60px 80px;
  max-width: 1000px;
}

/* Right Sticky Outline Table of Contents */
.toc-pane {
  width: var(--toc-width);
  position: fixed;
  top: var(--header-height);
  right: 0;
  bottom: 0;
  background-color: hsl(var(--bg-main));
  padding: 40px 24px;
  overflow-y: auto;
  border-left: 1px solid hsl(var(--border));
  z-index: 30;
}

.toc-title {
  font-size: 0.75rem;
  font-weight: 700;
  color: hsl(var(--text-dim));
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 16px;
}

.toc-links {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.toc-links a {
  color: hsl(var(--text-secondary));
  text-decoration: none;
  font-size: 0.8rem;
  font-weight: 500;
  display: block;
  transition: color 0.2s ease;
}

.toc-links a:hover,
.toc-links a.active {
  color: hsl(var(--accent));
}

/* Typography Styles */
h1 {
  font-size: 2.75rem;
  font-weight: 800;
  letter-spacing: -1.5px;
  margin-bottom: 24px;
  line-height: 1.1;
  background: linear-gradient(135deg, hsl(var(--text-primary)) 30%, hsl(var(--text-dim)) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

h2 {
  font-size: 1.75rem;
  font-weight: 700;
  letter-spacing: -0.75px;
  margin-top: 48px;
  margin-bottom: 16px;
  padding-bottom: 8px;
  border-bottom: 1px solid hsl(var(--border));
}

h3 {
  font-size: 1.25rem;
  font-weight: 600;
  letter-spacing: -0.5px;
  margin-top: 32px;
  margin-bottom: 12px;
}

p {
  color: hsl(var(--text-secondary));
  font-size: 1.05rem;
  line-height: 1.6;
  margin-bottom: 20px;
}

a.doc-link {
  color: hsl(var(--accent));
  text-decoration: none;
  border-bottom: 1px dashed hsl(var(--accent));
  transition: all 0.2s ease;
}

a.doc-link:hover {
  border-bottom-style: solid;
  text-shadow: 0 0 8px hsl(var(--accent) / 0.3);
}

/* Separator Line */
hr {
  border: 0;
  height: 1px;
  background-color: hsl(var(--border));
  margin: 40px 0;
}

/* Key Callouts & Alerts */
.alert {
  border-radius: 8px;
  padding: 16px 20px;
  margin: 24px 0;
  border-left: 4px solid transparent;
  background-color: hsl(var(--bg-card));
  display: flex;
  gap: 16px;
}

.alert-icon {
  font-size: 1.25rem;
  display: flex;
  align-items: flex-start;
}

.alert-content p {
  font-size: 0.95rem;
  margin-bottom: 0;
  color: hsl(var(--text-primary));
}

.alert-tip {
  border-left-color: hsl(var(--accent));
  border-color: hsl(var(--accent) / 0.15);
  background-color: hsl(var(--accent) / 0.02);
}

.alert-tip .alert-icon {
  color: hsl(var(--accent));
}

.alert-warning {
  border-left-color: #f59e0b;
  border-color: rgba(245, 158, 11, 0.15);
  background-color: rgba(245, 158, 11, 0.02);
}

.alert-warning .alert-icon {
  color: #f59e0b;
}

/* Glassmorphism Cards Grid */
.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
  margin: 32px 0;
}

.card {
  background-color: hsl(var(--bg-card));
  border: 1px solid hsl(var(--border));
  border-radius: 12px;
  padding: 24px;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.card:hover {
  border-color: hsl(var(--accent) / 0.4);
  transform: translateY(-4px);
  box-shadow: 0 10px 30px hsl(var(--accent) / 0.04);
}

.card-icon {
  font-size: 2rem;
  margin-bottom: 16px;
}

.card-title {
  font-size: 1.15rem;
  font-weight: 600;
  margin-bottom: 8px;
}

.card-desc {
  font-size: 0.9rem;
  color: hsl(var(--text-secondary));
  line-height: 1.5;
  margin-bottom: 0;
}

/* Package Manager Tabs & Snippets */
.tabs-container {
  margin: 24px 0;
  background-color: hsl(var(--bg-card));
  border: 1px solid hsl(var(--border));
  border-radius: 8px;
  overflow: hidden;
}

.tabs-header {
  background-color: hsl(var(--bg-main) / 0.4);
  border-bottom: 1px solid hsl(var(--border));
  display: flex;
  padding: 0 16px;
}

.tab-btn {
  background: none;
  border: none;
  color: hsl(var(--text-secondary));
  font-family: var(--font-sans);
  font-size: 0.85rem;
  font-weight: 600;
  padding: 12px 16px;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: all 0.2s ease;
}

.tab-btn:hover {
  color: hsl(var(--text-primary));
}

.tab-btn.active {
  color: hsl(var(--accent));
  border-bottom-color: hsl(var(--accent));
}

.tab-pane {
  display: none;
  padding: 20px;
}

.tab-pane.active {
  display: block;
}

/* Code Highlights Container */
.code-block-wrapper {
  position: relative;
  background-color: hsl(var(--bg-card));
  border: 1px solid hsl(var(--border));
  border-radius: 8px;
  margin: 24px 0;
  overflow: hidden;
}

.code-block-header {
  background-color: hsl(var(--bg-main) / 0.4);
  border-bottom: 1px solid hsl(var(--border));
  padding: 8px 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.code-block-lang {
  font-size: 0.75rem;
  font-family: var(--font-sans);
  color: hsl(var(--text-dim));
  font-weight: 600;
  text-transform: uppercase;
}

.copy-btn {
  background: none;
  border: 1px solid hsl(var(--border));
  color: hsl(var(--text-secondary));
  font-family: var(--font-sans);
  font-size: 0.75rem;
  font-weight: 500;
  padding: 4px 8px;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.copy-btn:hover {
  border-color: hsl(var(--accent) / 0.5);
  color: hsl(var(--accent));
}

.code-block-wrapper pre {
  padding: 20px;
  overflow-x: auto;
  margin: 0;
}

.code-block-wrapper code {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  line-height: 1.5;
  color: #a5b4fc; /* Indigo base for code highlights */
}

/* Inline Code Element */
code.inline-code {
  font-family: var(--font-mono);
  background-color: hsl(var(--border) / 0.4);
  color: hsl(var(--accent));
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.85rem;
}

/* Detailed Parameters Table */
table {
  width: 100%;
  border-collapse: collapse;
  margin: 32px 0;
  font-size: 0.95rem;
}

th {
  background-color: hsl(var(--bg-card));
  font-weight: 600;
  text-align: left;
  border-bottom: 2px solid hsl(var(--border));
  color: hsl(var(--text-primary));
}

th, td {
  padding: 12px 16px;
  border-bottom: 1px solid hsl(var(--border));
}

td {
  color: hsl(var(--text-secondary));
}

tr:hover td {
  color: hsl(var(--text-primary));
  background-color: hsl(var(--accent) / 0.01);
}

/* Premium CLI Terminal Simulator */
.terminal-wrapper {
  background-color: #0b0f19;
  border: 1px solid hsl(var(--border));
  border-radius: 12px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4), 0 0 30px hsl(var(--accent) / 0.05);
  overflow: hidden;
  margin: 40px 0;
}

.terminal-header {
  background-color: #121824;
  border-bottom: 1px solid hsl(var(--border));
  padding: 12px 20px;
  display: flex;
  align-items: center;
  position: relative;
}

.terminal-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  margin-right: 8px;
}

.dot-red { background-color: #ef4444; }
.dot-yellow { background-color: #f59e0b; }
.dot-green { background-color: #10b981; }

.terminal-title {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  color: hsl(var(--text-dim));
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 500;
}

.terminal-body {
  padding: 24px;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: #f3f4f6;
  line-height: 1.5;
  min-height: 380px;
}

.terminal-prompt {
  color: #10b981;
  font-weight: bold;
}

.terminal-input {
  color: #f3f4f6;
  position: relative;
  display: inline-block;
}

.cursor {
  display: inline-block;
  width: 8px;
  height: 15px;
  background-color: #00F0FF;
  animation: blink 0.8s infinite;
  margin-left: 2px;
  vertical-align: middle;
}

@keyframes blink {
  0%, 100% { opacity: 0; }
  50% { opacity: 1; }
}

.terminal-line {
  margin-bottom: 8px;
  opacity: 0;
  transform: translateY(4px);
  animation: showLine 0.2s forwards;
}

@keyframes showLine {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* CLI Scan Progress Bar Visuals */
.cli-bar-outer {
  background-color: rgba(255, 255, 255, 0.1);
  border-radius: 4px;
  width: 250px;
  height: 12px;
  display: inline-flex;
  vertical-align: middle;
  margin: 0 10px;
  overflow: hidden;
}

.cli-bar-inner {
  height: 100%;
  background: linear-gradient(90deg, #00f0ff, #0284c7);
  width: 0%;
  border-radius: 4px;
}

/* Interactive Finding Card styling inside Terminal */
.finding-box {
  border: 1px solid rgba(239, 68, 68, 0.3);
  background-color: rgba(239, 68, 68, 0.05);
  border-radius: 8px;
  padding: 12px 16px;
  margin: 12px 0;
  border-left: 4px solid #ef4444;
}

.finding-crit {
  background-color: #ef4444;
  color: #0b0f19;
  font-weight: 800;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.7rem;
  margin-right: 8px;
  text-transform: uppercase;
}

/* Commands Index Quick Grid */
.cmd-accordion {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin: 24px 0;
}

.cmd-item {
  border: 1px solid hsl(var(--border));
  background-color: hsl(var(--bg-card));
  border-radius: 8px;
  overflow: hidden;
}

.cmd-trigger {
  width: 100%;
  background: none;
  border: none;
  text-align: left;
  padding: 16px 20px;
  font-family: var(--font-sans);
  font-size: 1rem;
  font-weight: 600;
  color: hsl(var(--text-primary));
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: background-color 0.2s ease;
}

.cmd-trigger:hover {
  background-color: hsl(var(--bg-card-hover));
}

.cmd-name {
  font-family: var(--font-mono);
  color: hsl(var(--accent));
  font-size: 0.9rem;
}

.cmd-arrow {
  color: hsl(var(--text-dim));
  font-size: 0.8rem;
  transition: transform 0.25s ease;
}

.cmd-item.active .cmd-arrow {
  transform: rotate(180deg);
}

.cmd-content {
  display: none;
  padding: 0 20px 20px 20px;
  border-top: 1px solid hsl(var(--border));
  background-color: hsl(var(--bg-main) / 0.2);
}

.cmd-item.active .cmd-content {
  display: block;
}

.cmd-content p {
  font-size: 0.95rem;
  margin-top: 16px;
  margin-bottom: 12px;
}

/* Hero Section */
.hero {
  text-align: center;
  padding: 60px 0;
  max-width: 800px;
  margin: 0 auto;
}

.hero h1 {
  font-size: 3.5rem;
  line-height: 1.05;
  margin-bottom: 20px;
}

.hero p {
  font-size: 1.25rem;
  max-width: 600px;
  margin: 0 auto 32px auto;
}

.hero-actions {
  display: flex;
  justify-content: center;
  gap: 16px;
  margin-bottom: 48px;
}

/* Responsive Rules Override */
@media (max-width: 1024px) {
  .toc-pane {
    display: none;
  }
  
  main.content-pane {
    margin-right: 0;
    padding: 40px;
  }
}

@media (max-width: 768px) {
  header {
    padding: 0 20px;
  }
  
  .menu-toggle {
    display: block;
  }
  
  .header-links {
    display: none;
  }
  
  .sidebar {
    transform: translateX(-100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  }
  
  .sidebar.open {
    transform: translateX(0);
  }
  
  main.content-pane {
    margin-left: 0;
    padding: 30px 20px;
  }
  
  .hero h1 {
    font-size: 2.5rem;
  }
  
  .hero p {
    font-size: 1.1rem;
  }
}
