:root {
  --primary: #6366f1;
  --primary-hover: #818cf8;
  --bg-dark: #020617;
  --bg-sidebar: #0a0f1e;
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --border-color: #1e293b;
  --code-bg: #000000;
  --accent-red: #ef4444;
}

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

body {
  font-family: 'Inter', sans-serif;
  background-color: var(--bg-dark);
  color: var(--text-main);
  line-height: 1.5;
  display: flex;
}

/* Sidebar */
aside {
  width: 260px;
  background-color: var(--bg-sidebar);
  height: 100vh;
  position: fixed;
  border-right: 1px solid var(--border-color);
  padding: 2rem 1.25rem;
  overflow-y: auto;
}

aside h1 {
  font-size: 1.25rem;
  margin-bottom: 2rem;
  color: var(--primary);
  font-weight: 800;
  letter-spacing: -0.02em;
  text-transform: uppercase;
}

.studio-link-btn {
  display: flex;
  align-items: center;
  gap: 12px;
  background: linear-gradient(135deg, var(--primary), #4f46e5);
  color: white;
  text-decoration: none;
  padding: 0.75rem 1rem;
  border-radius: 0.5rem;
  font-size: 0.85rem;
  font-weight: 700;
  margin-bottom: 2rem;
  border: 1px solid rgba(255,255,255,0.1);
  transition: all 0.2s;
}

.studio-link-btn:hover {
  transform: translateY(-1px);
  filter: brightness(1.1);
}

.studio-link-btn i {
  width: 18px;
  height: 18px;
}

aside nav ul {
  list-style: none;
}

.nav-group {
  margin-bottom: 1.5rem;
}

.group-title {
  display: block;
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  padding: 0 1rem;
  margin-bottom: 0.5rem;
}

.sub-nav {
  padding-left: 0.5rem;
}

aside nav ul li {
  margin-bottom: 0.25rem;
}

aside nav ul li a {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.85rem;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  display: block;
  padding: 0.5rem 1rem;
  border-radius: 0.5rem;
  border: 1px solid transparent;
}

aside nav ul li a:hover {
  color: var(--text-main);
  background-color: rgba(99, 102, 241, 0.1);
  border-color: rgba(99, 102, 241, 0.2);
}

aside nav ul li a.active {
  color: #ffffff;
  background-color: var(--primary);
  font-weight: 600;
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

/* Content Area */
main {
  margin-left: 260px;
  padding: 3rem 8% 3rem 4rem;
  max-width: 1200px;
  width: calc(100% - 260px);
}

section {
  margin-bottom: 5rem;
}

h1 {
  font-size: 2.5rem;
  font-weight: 800;
  margin-bottom: 1.5rem;
  letter-spacing: -0.04em;
}

h2 {
  font-size: 1.75rem;
  font-weight: 700;
  margin-top: 3rem;
  margin-bottom: 1.25rem;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 0.5rem;
  color: var(--primary-hover);
}

h3 {
  font-size: 1.2rem;
  margin-top: 1.75rem;
  color: #e2e8f0;
}

p {
  margin-bottom: 1.25rem;
  font-size: 1rem;
  color: #94a3b8;
}

/* Code Blocks */
pre {
  background-color: var(--code-bg);
  padding: 1.25rem;
  border-radius: 0.5rem;
  overflow-x: auto;
  margin: 1.25rem 0;
  border: 1px solid var(--border-color);
  box-shadow: 0 8px 16px rgba(0,0,0,0.5);
}

code {
  font-family: 'Fira Code', monospace;
  font-size: 0.9rem;
}

.keyword { color: #f472b6; }
.type { color: #93c5fd; }
.string { color: #bef264; }
.comment { color: #475569; }

/* Inline Code */
p code {
  background-color: #1e293b;
  padding: 0.15rem 0.4rem;
  border-radius: 0.25rem;
  color: #e2e8f0;
}

/* Warning / Critical */
.warning {
  border-left: 4px solid var(--accent-red);
  background: linear-gradient(90deg, #1a0505, transparent);
  padding: 1.5rem;
  margin: 2.5rem 0;
  border-radius: 0 0.5rem 0.5rem 0;
}

.warning h3 {
  color: var(--accent-red);
  font-size: 1rem;
  margin-top: 0;
  margin-bottom: 0.5rem;
  text-transform: uppercase;
}

.warning p {
  color: #fca5a5;
  font-size: 0.9rem;
  margin-bottom: 0;
}

/* Stats Dropdown */
details {
  background-color: #0f172a;
  border: 1px solid var(--border-color);
  border-radius: 0.5rem;
  margin-bottom: 0.5rem;
  transition: all 0.2s;
}

details[open] {
  border-color: var(--primary);
}

summary {
  padding: 1rem;
  cursor: pointer;
  font-weight: 600;
  font-size: 0.95rem;
  color: #e2e8f0;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

summary::-webkit-details-marker {
  display: none;
}

summary::after {
  content: '+';
  font-family: monospace;
  font-size: 1.2rem;
  color: var(--text-muted);
}

details[open] summary::after {
  content: '-';
}

details .content {
  padding: 0 1rem 1rem 1rem;
  font-size: 0.9rem;
  color: #94a3b8;
  border-top: 1px solid var(--border-color);
  padding-top: 1rem;
}

details .content strong {
  color: var(--primary-hover);
}

/* Sidebar Search */
.search-container {
  margin-bottom: 1.5rem;
}

.search-input {
  width: 100%;
  background-color: #0f172a;
  border: 1px solid var(--border-color);
  border-radius: 0.375rem;
  padding: 0.5rem 0.75rem;
  color: var(--text-main);
  font-size: 0.85rem;
  transition: border-color 0.2s;
}

.search-input:focus {
  outline: none;
  border-color: var(--primary);
}

/* Mobile Toggle */
.mobile-toggle {
  display: none;
  position: fixed;
  top: 1rem;
  right: 1rem;
  z-index: 1000;
  background-color: var(--primary);
  color: white;
  border: none;
  border-radius: 0.375rem;
  padding: 0.5rem;
  cursor: pointer;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

/* Code Copy Button */
.code-wrapper {
  position: relative;
}

.copy-btn {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  background-color: #1e293b;
  color: var(--text-muted);
  border: 1px solid var(--border-color);
  border-radius: 0.25rem;
  padding: 0.25rem 0.5rem;
  font-size: 0.7rem;
  cursor: pointer;
  transition: all 0.2s;
  opacity: 0;
}

.code-wrapper:hover .copy-btn {
  opacity: 1;
}

.copy-btn:hover {
  background-color: var(--primary);
  color: white;
}

/* Vanilla Assets Table */
.assets-table {
  width: 100%;
  border-collapse: collapse;
  margin: 1rem 0;
  font-size: 0.85rem;
}

.assets-table th, .assets-table td {
  border: 1px solid var(--border-color);
  padding: 0.75rem;
  text-align: left;
}

.assets-table th {
  background-color: #0f172a;
  color: var(--primary-hover);
}

.assets-table code {
  color: var(--accent-green);
}

/* Global Scrollbar Styling */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

/* Track */
::-webkit-scrollbar-track {
  background: var(--bg-dark);
}

/* Thumb */
::-webkit-scrollbar-thumb {
  background: #1e293b;
  border-radius: 10px;
  border: 2px solid var(--bg-dark);
}

::-webkit-scrollbar-thumb:hover {
  background: var(--primary);
}

/* Sidebar Specific Scrollbar (Slimmer) */
aside::-webkit-scrollbar {
  width: 4px;
}

aside::-webkit-scrollbar-track {
  background: var(--bg-sidebar);
}

aside::-webkit-scrollbar-thumb {
  background: var(--border-color);
}

/* Code Block Scrollbar */
pre::-webkit-scrollbar {
  height: 6px;
}

pre::-webkit-scrollbar-track {
  background: var(--code-bg);
}

pre::-webkit-scrollbar-thumb {
  background: #1e293b;
  border: 1px solid var(--code-bg);
}

/* Responsive */
@media (max-width: 1024px) {
  main { padding-right: 4rem; }
}

@media (max-width: 768px) {
  .mobile-toggle {
    display: block;
  }
  aside {
    transform: translateX(-100%);
    transition: transform 0.3s ease-in-out;
    z-index: 1001;
  }
  aside.active {
    transform: translateX(0);
  }
  main {
    margin-left: 0;
    width: 100%;
    padding: 4rem 1.5rem 2rem 1.5rem;
  }
}

/* Builder Section Links */
#builders ul {
    list-style: none;
    padding-left: 0;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 0.75rem;
}

#builders li {
    background: #0f172a;
    border: 1px solid var(--border-color);
    border-radius: 0.6rem;
    transition: all 0.2s ease;
    padding: 0;
    margin-bottom: 0;
    overflow: hidden;
}

#builders li:hover {
    border-color: var(--primary);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}

#builders li a {
    text-decoration: none;
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 1rem;
    height: 100%;
    width: 100%;
    color: #94a3b8;
}

#builders li code {
    background: transparent;
    padding: 0;
    color: var(--primary-hover);
    font-size: 0.95rem;
    font-weight: 700;
}

#builders li:hover code {
    color: white;
}

#builders li span {
    font-size: 0.8rem;
    line-height: 1.4;
}

/* Lists & Bullet Points (Scoped to Content) */
main ul {
  margin-bottom: 2rem;
  padding-left: 1.25rem;
  list-style: none;
}

main li {
  margin-bottom: 0.75rem;
  position: relative;
  color: #94a3b8;
  font-size: 0.95rem;
  line-height: 1.6;
}

main ul > li::before {
  content: "•";
  color: var(--primary);
  font-weight: bold;
  display: inline-block;
  width: 1em;
  margin-left: -1em;
  position: absolute;
}

/* Sub-lists */
main ul ul {
  margin-top: 0.5rem;
  margin-bottom: 0.5rem;
  padding-left: 1.5rem;
}

main ul ul > li::before {
  content: "◦";
  color: var(--primary-hover);
}

/* Responsive */
@media (max-width: 768px) {
  aside {
    display: none;
  }
  main {
    margin-left: 0;
    padding: 2rem;
  }
}
