:root {
  --primary-color: #40BFA9;
  --primary-dark: #39a896;
  --secondary-color: #cc67e5;
  --bg-dark: #2B3033;   /* #242a2d*/
  --bg-card: #3e4247;
  --bg-sidebar: #242a2d;
  --text-primary: #dee7ef;
  --text-secondary: #adb5bd;
  --text-muted: #6c757d;
  --border-color: #58616f;
  --success-color: #40c057;
  --warning-color: #fab005;
  --danger-color: #fa5252;
  --info-color: #4dabf7;
  --code-bg: #141920;
  --example-bg: rgba(255, 255, 255, 0.03);
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.12);
  --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.15);
  --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.2);
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --sidebar-width: 280px;
  --header-height: 70px;

  /* Optional: fluid typography scale (base overridden by clamp on html) */
  --text-scale-min: 12px;
  --text-scale-max: 18px;
}

/* Fluid base typography for all devices */
html {
  font-size: clamp(12px, 0.7vw + 8px, 18px);
}

/* Reset & Base Styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Inter', sans-serif;
  background-color: var(--bg-dark);
  color: var(--text-primary);
  line-height: 1.6;
  overflow-x: hidden;
}

/* Fluid headings for ultrawide readability */
h1, h2, h3, h4, h5, h6 {
  font-weight: 600;
  line-height: 1.3;
  margin-bottom: 1rem;
  color: var(--text-primary);
}

h1 {
  font-size: clamp(1.8rem, 2.2vw + 1rem, 3.6rem);
  margin-top: 0;
}

h2 {
  font-size: clamp(1.6rem, 1.8vw + 0.8rem, 2.8rem);
  padding-top: 2.5rem;
  border-bottom: 1px solid var(--border-color);
  margin-bottom: 1.5rem;
}

h3 {
  font-size: clamp(1.25rem, 1.5vw + 0.6rem, 2rem);
}

h4 {
  font-size: clamp(1rem, 1.2vw + 0.5rem, 1.5rem);
}

p {
  margin-bottom: 1.5rem;
  color: var(--text-secondary);
}

a {
  color: var(--primary-color);
  text-decoration: none;
  transition: color 0.2s ease;
}

a:hover {
  color: var(--primary-dark);
}

ul, ol {
  margin-bottom: 1.5rem;
  padding-left: 1.5rem;
  color: var(--text-secondary);
}

li {
  margin-bottom: 0.5rem;
}

/* Layout */
.container {
  display: flex;
  min-height: 100vh;
}

/* Sidebar */
.sidebar {
  width: var(--sidebar-width);
  background-color: var(--bg-sidebar);
  position: fixed;
  top: 0;
  left: 0;
  height: 100vh;
  overflow-y: auto;
  padding: 1.5rem;
  border-right: 1px solid var(--border-color);
  transition: transform 0.3s ease;
  z-index: 100;
  overflow-y: auto;
}

.sidebar::-webkit-scrollbar {
    display: none; /* Chrome, Safari, Edge */
}

.sidebar {
    -ms-overflow-style: none; /* IE and Edge */
    scrollbar-width: none; /* Firefox */
}

.sidebar-header {
  margin-bottom: 2rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border-color);
}

.sidebar-header h2 {
  font-size: 1.5rem;
  border: none;
  padding: 0;
  margin: 0;
  color: var(--primary-color);
}

.sidebar-header .logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.sidebar-header .logo-icon {
  font-size: 1.8rem;
  color: var(--primary-color);
}

.nav-links {
  list-style: none;
  padding-left: 0;
}

.nav-links li {
  margin-bottom: 0.5rem;
}

.nav-links a {
  display: block;
  padding: 0.75rem 1rem;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  transition: all 0.2s ease;
}

.nav-links a:hover {
  background-color: rgba(255, 255, 255, 0.05);
  color: var(--text-primary);
}

.nav-links a.active {
  background-color: rgba(77, 171, 247, 0.1);
  color: var(--primary-color);
  font-weight: 500;
}

.nav-section {
  margin-bottom: 2rem;
}

.nav-section-title {
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin-bottom: 1rem;
  padding-left: 1rem;
}

/* Main Content */
.main-content {
  flex: 1;
  margin-left: var(--sidebar-width);
  padding: 2rem 3rem;
  max-width: 1200px;
}

.header {
  display: grid;
  grid-template-columns: 80fr 2fr ;
  gap: 10px;
  margin-bottom: 2.5rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--border-color);
}

.header-title h1 {
  margin-bottom: 0.5rem;
}

.header-subtitle {
  color: var(--text-muted);
  font-size: 1.1rem;
}

.header-actions {
  display: flex;
  gap: 1rem;
  align-items: center;
}

/* Custom Classes for Documentation */
.example {
  background-color: var(--example-bg);
  border-left: 4px solid var(--info-color);
  padding: 1.5rem;
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  margin-bottom: 1.5rem;
}

.example-title {
  font-weight: 600;
  margin-bottom: 0.75rem;
  color: var(--info-color);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.explanation {
  background-color: var(--bg-card);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  box-shadow: var(--shadow-sm);
  border-left: 4px solid var(--success-color);
}

.explanation-title {
  font-weight: 600;
  margin-bottom: 0.75rem;
  color: var(--success-color);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.code {
  background-color: var(--code-bg);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  overflow-x: auto;
  font-family: 'Fira Code', monospace;
  font-size: 0.9rem;
  line-height: 1.5;
  border: 1px solid var(--border-color);
}

.code-title {
  font-weight: 600;
  margin-bottom: 0.75rem;
  color: var(--secondary-color);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.code-title i {
  font-size: 1.2rem;
}

pre {
  margin: 0;
  white-space: pre-wrap;
}

code {
  font-family: 'Fira Code', monospace;
  background-color: rgba(0, 0, 0, 0.3);
  padding: 0.2rem 0.4rem;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  color: var(--secondary-color);
}

.code pre code {
  background-color: transparent;
  padding: 0;
}

/* Other blocks */
.note {
  background-color: rgba(250, 176, 5, 0.1);
  border-left: 4px solid var(--warning-color);
  padding: 1.5rem;
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  margin-bottom: 1.5rem;
}

.note-title {
  font-weight: 600;
  margin-bottom: 0.75rem;
  color: var(--warning-color);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.warning {
  background-color: rgba(250, 82, 82, 0.1);
  border-left: 4px solid var(--danger-color);
  padding: 1.5rem;
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  margin-bottom: 1.5rem;
}

.warning-title {
  font-weight: 600;
  margin-bottom: 0.75rem;
  color: var(--danger-color);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.tip {
  background-color: rgba(64, 192, 87, 0.1);
  border-left: 4px solid var(--success-color);
  padding: 1.5rem;
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  margin-bottom: 1.5rem;
}

.tip-title {
  font-weight: 600;
  margin-bottom: 0.75rem;
  color: var(--success-color);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.definition {
  background-color: var(--bg-card);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  border: 1px solid var(--border-color);
}

.definition-title {
  font-weight: 600;
  margin-bottom: 0.75rem;
  color: var(--primary-color);
}

/* Syntax highlighting for code */
.token.comment { color: #6a9955; }
.token.keyword { color: #569cd6; }
.token.string { color: #ce9178; }
.token.function { color: #dcdcaa; }
.token.number { color: #b5cea8; }
.token.operator { color: #d4d4d4; }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.65rem 1.3rem;
  border-radius: var(--radius-sm);
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  border: none;
  font-family: 'Inter', sans-serif;
  font-size: 0.95rem;
}

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

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

.btn-outline {
  background-color: transparent;
  color: var(--primary-color);
  border: 1px solid var(--primary-color);
}

.btn-outline:hover {
  background-color: rgba(77, 171, 247, 0.1);
}

/* Table */
.table-container {
  overflow-x: auto;
  margin-bottom: 1.5rem;
}

table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 1.5rem;
  border: 1px solid var(--border-color);
}

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

td {
  padding: 1rem;
  border-bottom: 1px solid var(--border-color);
  color: var(--text-secondary);
}

tr:hover {
  background-color: rgba(255, 255, 255, 0.02);
}

/* Mobile Menu Button */
.mobile-menu-btn {
  display: none;
  background: none;
  border: none;
  color: var(--text-primary);
  font-size: 1.5rem;
  cursor: pointer;
  padding: 0.5rem;
}

/* Search */
.search-box {
  position: relative;
  margin-bottom: 1.5rem;
}

.search-box input {
  width: 100%;
  padding: 0.75rem 1rem 0.75rem 2.5rem;
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-family: 'Inter', sans-serif;
}

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

.search-box i {
  position: absolute;
  left: 1rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
}

/* Theme Toggle */
.theme-toggle {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem;
  background-color: var(--bg-card);
  border-radius: var(--radius-sm);
  cursor: pointer;
  border: 1px solid var(--border-color);
  justify-self: end;
}

.theme-toggle i {
  font-size: 1.2rem;
}

/* Footer & page nav */
.footer {
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border-color);
  color: var(--text-muted);
  font-size: 0.9rem;
  text-align: center;
}

.page-nav {
  display: flex;
  justify-content: space-between;
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border-color);
}

/* Code Copy Button */
.copy-btn {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  padding: 0.2rem 0.7rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.2s ease;
  font-size: 0.85rem;
  width: 100px;
  justify-self: end;
}
.copy-btn:hover {
  background-color: var(--primary-color);
  color: white;
}

/* Responsive tweaks: extra breakpoints for 4K and small devices */
@media (min-width: 1400px) {
  :root { --sidebar-width: 320px; }
  .main-content { padding: 2.5rem 3.5rem; }
}

@media (min-width: 1920px) {
  /* Optional: slightly wider content margins on very large displays */
  .main-content { padding: 3rem 4rem; }
}

@media (max-width: 1280px) {
  .main-content { padding: 2rem 2.5rem; }
}

@media (max-width: 768px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.active { transform: translateX(0); }
  .main-content { margin-left: 0; padding: 1rem 1.5rem; }
  .mobile-menu-btn { display: block; }
  h1 { font-size: 1.75rem; }
  h2 { font-size: 1.5rem; }
  h3 { font-size: 1.25rem; }

  .header {
  display: grid;
  grid-template-columns: 70fr 10fr;
  gap: 10px;
  margin-bottom: 2.5rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--border-color);
}

}
@media (max-width: 480px) {
  .main-content { padding: 1rem; }
  h1 { font-size: 1.6rem; }
  h2 { font-size: 1.4rem; }
  .btn { padding: 0.6rem 1rem; font-size: 0.9rem; }
}

@media (max-width: 375px) {
  .sidebar{
    height: 100%;
  }
}

.code-header{
  display: grid;
  grid-template-columns: 1fr 70fr;
  gap: 10px
}