*, *:before, *:after {
  box-sizing: border-box;
}

:root {
  /* Color Variables */
  --primary-blue: #3b82f6;
  --primary-blue-hover: #2563eb;
  --dark-bg: #2d2d2d;
  --dark-text: #e5e7eb;
  --light-gray: #2d2d2d;
  --dark-gray: #4b5563;
  --light-blue: #60a5fa;
  --white: #ffffff;
  --text-light: #f1f1f1;

  /* Size Variables */
  --spacing-sm: 0.5rem;
  --spacing-md: 1rem;
  --spacing-lg: 2rem;
  --navbar-height: 4rem;
  --icon-size: 24px;
  --faq-answer-max-height: 200px;
  --toc-max-height: calc(100vh - var(--navbar-height) - var(--spacing-lg));

  /* Transition Variables */
  --transition-duration: 0.3s;
  --transition-easing: ease;
}

/* FAQ Styles */
.faqs-container {
  overflow: hidden;
  margin: var(--spacing-lg) 0;
  width: 100%;
  padding: 0;
}

.faq-singular {
  position: relative;
  margin-bottom: var(--spacing-sm);
  border: none;
}

.faq-singular .faq-question {
  position: relative;
  cursor: pointer;
  margin: 0;
  padding: var(--spacing-md);
  font-weight: 600;
  font-size: 0.875rem;
  transition: background-color var(--transition-duration) var(--transition-easing);
  display: flex;
  justify-content: space-between;
  align-items: center;
  background-color: var(--light-gray);
  color: var(--dark-text);
}

.dark .faq-singular .faq-question {
  background-color: var(--dark-bg);
  color: var(--dark-text);
}

.faq-singular .faq-question:hover {
  background-color: rgba(155, 155, 155, 0.1);
}

.dark .faq-singular .faq-question:hover {
  background-color: rgba(39, 39, 42, 1);
}

.faq-singular .faq-question svg {
  margin-left: var(--spacing-md);
  transform: rotate(90deg);
  transition: transform 0.5s var(--transition-easing);
  width: 16px;
  height: 16px;
  fill: currentColor;
}

.faq-singular.active .faq-question svg {
  transform: rotate(-90deg);
}

.faq-answer {
  overflow: hidden;
  max-height: 0;
  transition: max-height 0.3s ease-out;
}

.faq-singular.active .faq-answer {
  max-height: 1000px;
  transition: max-height 0.3s ease-in;
}

.faq-answer > div {
  padding: var(--spacing-md);
  background-color: var(--light-gray);
  font-size: 0.875rem;
  color: var(--dark-text);
  max-width: 42rem;
  margin-bottom: var(--spacing-md);
  padding-bottom: var(--spacing-sm);
}

.dark .faq-answer > div {
  background-color: var(--dark-bg);
  color: var(--dark-text);
}

.faq-answer ul {
  width: 100%;
  max-width: 42rem;
  list-style: none;
  padding: 0;
}

.faq-answer li {
  display: flex;
  align-items: flex-start;
  padding: var(--spacing-sm) 0;
  width: 100%;
  font-size: 0.875rem;
  color: var(--dark-text);
}

.dark .faq-answer li {
  color: var(--dark-text);
}

.faq-answer li:before {
  content: "•";
  margin-right: var(--spacing-sm);
}

.faq-answer li p {
  flex: 1;
  margin: 0;
}

/* Code Block Styles */
.code-container {
  position: relative;
  margin: 1.5rem 0;
  overflow: hidden;
}

.code-container pre {
  margin: 0;
  padding: 1.5rem;
  overflow-x: auto;
  font-family: 'Fira Code', 'Consolas', 'Monaco', 'Andale Mono', 'Ubuntu Mono', monospace;
  font-size: 0.875rem;
  line-height: 1.5;
  tab-size: 4;
  hyphens: none;
  background: #2d2d2d;
  color: #e5e7eb;
}

.code-container pre[class*="language-"] {
  margin: 0;
}

.code-container pre code {
  display: block;
  padding: 0;
  background: transparent;
  color: inherit;
}

/* Line Numbers */
.line-numbers .line-numbers-rows {
  border-right: 1px solid #4b5563;
  padding-right: 1em;
}

/* Command Line */
.command-line-prompt {
  border-right: 1px solid #4b5563;
  display: block;
  float: left;
  font-size: 100%;
  letter-spacing: -1px;
  margin-right: 1em;
  pointer-events: none;
  user-select: none;
}

.command-line-prompt > span:before {
  color: #9ca3af;
  content: ' ';
  display: block;
  padding-right: 0.8em;
}

.command-line-prompt > span[data-user]:before {
  content: '[' attr(data-user) '@' attr(data-host) '] $';
}

.command-line-prompt > span[data-user="root"]:before {
  content: '[' attr(data-user) '@' attr(data-host) '] #';
}

/* Copy Button */
.copy-button {
  position: absolute;
  right: 0.5rem;
  top: 0.5rem;
  padding: 0.25rem 0.5rem;
  background-color: #3b82f6;
  color: white;
  border: none;
  cursor: pointer;
  font-size: 0.75rem;
  transition: opacity 0.2s ease;
}

.copy-button:hover {
  background-color: #2563eb;
}

/* Dark Mode Adjustments */
.dark .code-container pre {
  background: #1e1e1e;
}

/* Language Specific Styles */
.token.comment,
.token.prolog,
.token.doctype,
.token.cdata {
  color: #6b7280;
}

.token.punctuation {
  color: #d1d5db;
}

.token.property,
.token.tag,
.token.boolean,
.token.number,
.token.constant,
.token.symbol,
.token.deleted {
  color: #f472b6;
}

.token.selector,
.token.attr-name,
.token.string,
.token.char,
.token.builtin,
.token.inserted {
  color: #34d399;
}

.token.operator,
.token.entity,
.token.url,
.language-css .token.string,
.style .token.string {
  color: #93c5fd;
}

.token.atrule,
.token.attr-value,
.token.keyword {
  color: #60a5fa;
}

.token.function,
.token.class-name {
  color: #fbbf24;
}

.token.regex,
.token.important,
.token.variable {
  color: #f59e0b;
}

/* Horizontal Rule Styles */
hr {
  border: none;
  height: 1px;
  margin: 2rem 0;
  background: linear-gradient(
    to right, 
    rgba(0, 0, 0, 0.1) 0%, 
    rgba(0, 0, 0, 0.3) 50%, 
    rgba(0, 0, 0, 0.1) 100%
  );
}

.dark hr {
  background: linear-gradient(
    to right, 
    rgba(255, 255, 255, 0.1) 0%, 
    rgba(255, 255, 255, 0.3) 50%, 
    rgba(255, 255, 255, 0.1) 100%
  );
}

/* Special styling for content section dividers */
.content-section hr {
  margin: 3rem 0;
}

/* Responsive adjustments */
@media (max-width: 767px) {
  hr {
    margin: 1.5rem 0;
  }
  
  .content-section hr {
    margin: 2rem 0;
  }
}

/* Table Styles */
table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5rem 0;
  font-size: 0.875rem;
}

.dark table {
  color: var(--dark-text);
}

table th, table td {
  padding: 0.5rem;
  text-align: left;
  border: 1px solid #e5e7eb;
}

.dark table th, .dark table td {
  border-color: #4b5563;
}

.dark table th {
  background-color: #374151;
}

.dark table tr:nth-child(even) {
  background-color: #1f2937;
}

/* Checklist Styles */
ul.checklist {
  padding-left: 0;
  margin: 1.5rem 0;
}

ul.checklist li {
  position: relative;
  padding-left: 1.75rem;
  margin-bottom: 0.5rem;
  list-style-type: none;
  font-size: 0.875rem;
}

.dark ul.checklist li {
  color: #e5e7eb;
}

ul.checklist li:before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.15rem;
  width: 1.25rem;
  height: 1.25rem;
  border: 1px solid #d1d5db;
  border-radius: 0.25rem;
}

.dark ul.checklist li:before {
  border-color: #4b5563;
  background-color: #2d2d2d;
}

ul.checklist li.checked:before {
  content: "✓";
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.875rem;
  border-color: #2563eb;
  color: #2563eb;
}

.dark ul.checklist li.checked:before {
  border-color: #60a5fa;
  color: #60a5fa;
  background-color: #2d2d2d;
}

/* Responsive Table Adjustments */
@media (max-width: 767px) {
  table {
    display: block;
    overflow-x: auto;
    white-space: nowrap;
  }
  
  table th, table td {
    padding: 0.5rem;
    font-size: 0.75rem;
  }
}

/* Table of Contents Styles */
.toc-container {
  display: flex;
  flex-direction: column;
  width: 100%;
}

.toc-container .p-2 {
  width: 100%;
}

.toc-container svg {
  width: var(--icon-size);
  height: var(--icon-size);
}

.toc-item.active-toc {
  background-color: var(--light-gray);
  color: var(--text-light);
}

.dark .toc-item.active-toc {
  background-color: var(--dark-gray);
  color: var(--light-blue);
}

.dark .toc-item.active-toc p {
  color: var(--light-blue);
}

/* Content Section Styles */
.content-section {
  min-height: 100vh;
  position: relative;
}

/* Smooth Scrolling */
html {
  scroll-behavior: smooth;
}

/* Mobile Styles (below 768px) */
@media (max-width: 767px) {
  /* Main layout adjustments */
  .content-section {
      padding: 1rem;
      overflow-x: hidden;
  }
  
  .grid {
      display: flex;
      flex-direction: column;
      gap: 1.5rem;
  }
  
  /* Table of Contents - make it visible but compact */
  .toc-container {
      display: block;
      position: relative;
      top: auto;
      max-height: none;
      margin-bottom: 2rem;
      padding: 0;
  }
  
  .toc-container .dark\:bg-gray, 
  .toc-container .bg-gray-100 {
      padding: 1rem;
  }
  
  /* Main content area */
  .main-content {
      width: 100%;
      padding: 0;
  }
  
  /* Sidebar - stack below main content */
  .sidebar-container {
      width: 100%;
      margin-top: 2rem;
  }
  
  /* Code blocks - ensure they don't overflow */
  .code-container {
      width: 100%;
      margin-left: 0;
      margin-right: 0;
  }
  
  .code-container pre {
      padding: 1rem;
      font-size: 0.75rem;
      overflow-x: scroll;
  }
  
  /* FAQ items - make more compact */
  .faqs-container {
      margin: var(--spacing-md) 0;
  }
  
  .faq-question {
      padding: var(--spacing-sm);
  }
  
  .faq-answer > div {
      padding: var(--spacing-sm);
  }
  
  .faq-answer li {
      font-size: 0.75rem;
  }
  
  /* Promo card adjustments */
  .promo-card {
      margin-top: 1rem;
      padding: 1rem;
  }
  
  .promo-header {
      flex-direction: column;
      align-items: flex-start;
      gap: 0.5rem;
  }
  
  /* Footer content adjustments */
  footer .grid {
      gap: 2rem;
  }
  
  /* Ensure text doesn't overflow */
  p, li, a {
      word-wrap: break-word;
  }
  
  /* Button sizing */
  .text-xs {
      font-size: 0.7rem;
  }
  
  /* Section spacing */
  #section1, #section2, #section3, #section4, #section5, #section6 {
      margin-bottom: 2rem;
  }
  
  /* Hide some decorative elements to save space */
  .toc-container svg {
      width: 20px;
      height: 20px;
  }
  
  /* Make sure all content is visible */
  body, html {
      overflow-x: hidden;
      width: 100%;
  }
  
  /* Adjust padding for mobile */
  .px-8, .px-12, .lg\:px-36 {
      padding-left: 1rem;
      padding-right: 1rem;
  }
  
  .pt-32, .pb-24 {
      padding-top: 2rem;
      padding-bottom: 2rem;
  }
  
  /* Text sizing for mobile */
  .text-4xl {
      font-size: 2rem;
      line-height: 2.5rem;
  }
  
  .text-2xl {
      font-size: 1.5rem;
      line-height: 2rem;
  }
}

/* Responsive Grid Layout for Large Screens */
@media (min-width: 768px) {
  .lg\:grid-cols-12 {
      grid-template-columns: repeat(12, minmax(0, 1fr));
  }

  .toc-container {
      grid-column: 1 / 4;
      position: sticky;
      top: calc(var(--navbar-height) + var(--spacing-lg));
      align-self: start;
      max-height: var(--toc-max-height);
      overflow-y: auto;
      padding: var(--spacing-md);
      z-index: 10;
      background-color: inherit;
      width: 100%;
  }

  .main-content {
      grid-column: 4 / 10;
  }

  .sidebar-container {
      grid-column: 10 / 13;
      display: flex;
      flex-direction: column;
      gap: var(--spacing-lg);
  }

  .content-section {
      overflow: visible !important;
  }
}

/* Promo Card Styles */
.promo-card {
  padding: 1.5rem;
  margin-top: 1.5rem;
}

.promo-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1rem;
}

.promo-icon {
  width: 2rem;
  height: 2rem;
}

/* Dark Mode Styles */
.dark .bg-gray-100 {
  background-color: #1a1a1a;
}

.dark .bg-white {
  background-color: #2d2d2d;
}

.dark .text-black {
  color: #e5e7eb;
}

.dark .bg-gray-over {
  background-color: rgba(45, 45, 45, 0.9);
}

/* Hover Effects */
.hover\:underline-on-hover:hover {
  text-decoration: underline;
  text-underline-offset: 0.25em;
}

/* Utility Classes */
.sharp-text {
  font-smooth: never;
  -webkit-font-smoothing: none;
}

.duration-500 {
  transition-duration: 500ms;
}

.hover\:delay-\[0ms\] {
  transition-delay: 0ms;
}

/* Fix for Prism line numbers in dark mode */
.dark .line-numbers .line-numbers-rows {
  border-right-color: #4b5563;
}

.dark .command-line-prompt {
  border-right-color: #4b5563;
}

.image-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--spacing-md);
}

.image-container img {
  max-width: 100%;
  height: auto;
  max-height: 400px;
  width: 100%;
  object-fit: contain;
}

/* Common Components */
.breadcrumb {
  font-size: 0.9em;
  margin-bottom: 20px;
}

.breadcrumb a {
  color: #3b82f6;
  text-decoration: none;
}

.breadcrumb a:hover {
  text-decoration: underline;
}

.breadcrumb span {
  color: #6b7280;
}

.category-badge {
  display: inline-block;
  background: #e0f2fe;
  color: #0369a1;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 0.75rem;
  margin-right: 4px;
  margin-bottom: 4px;
}

.category-badge:hover {
  background: #bae6fd;
  text-decoration: none;
}

.category-badge {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 500;
  background-color: #e0f2fe;
  color: #0369a1;
}

.dark .category-badge {
  background-color: #1e3a8a;
  color: #bfdbfe;
}

/* Mobile adjustments */
@media (max-width: 767px) {
  .image-container img {
      max-height: 300px;
  }
  .image-container p {
      font-size: 0.75rem;
  }
}

/* List Styles - Specific to content only */
.content-section ul,
.content-section ol,
.faq-answer ul,
.faq-answer ol {
  margin: 1.5rem 0;
  padding-left: 1.5rem;
}

/* Unordered List Styles */
.content-section ul,
.faq-answer ul {
  list-style-type: none;
}

.content-section ul li,
.faq-answer ul li {
  position: relative;
  padding-left: 1.75rem;
  margin-bottom: 0.5rem;
  line-height: 1.625;
}

.content-section ul li:before,
.faq-answer ul li:before {
  content: "•";
  position: absolute;
  left: 0;
  font-size: 1.2rem;
  line-height: 1.5;
}

/* Ordered List Styles */
.content-section ol,
.faq-answer ol {
  list-style-type: none;
  counter-reset: item;
}

.content-section ol li,
.faq-answer ol li {
  position: relative;
  padding-left: 1.75rem;
  margin-bottom: 0.5rem;
  counter-increment: item;
  line-height: 1.625;
}

.content-section ol li:before,
.faq-answer ol li:before {
  content: counter(item) ".";
  position: absolute;
  left: 0;
  font-weight: 600;
}

/* Nested List Styles */
.content-section ul ul, 
.content-section ol ol, 
.content-section ul ol, 
.content-section ol ul,
.faq-answer ul ul,
.faq-answer ol ol,
.faq-answer ul ol,
.faq-answer ol ul {
  margin-top: 0.5rem;
  margin-bottom: 0.5rem;
  padding-left: 1.5rem;
}

/* Dark Mode List Styles */
.dark .content-section ul li,
.dark .content-section ol li,
.dark .faq-answer ul li,
.dark .faq-answer ol li {
  color: #e5e7eb;
}

.dark .content-section ul li:before,
.dark .content-section ol li:before,
.dark .faq-answer ul li:before,
.dark .faq-answer ol li:before {
  color: #60a5fa;
}

/* FAQ Specific List Styles */
.faq-answer ul {
  width: 100%;
  max-width: 42rem;
  padding: 0;
  margin: 0;
}

.faq-answer li {
  display: flex;
  align-items: flex-start;
  padding: 0.5rem 0;
  width: 100%;
  font-size: 0.875rem;
}

.faq-answer li p {
  flex: 1;
  margin: 0;
  padding-left: 1rem;
}

/* Checklist Styles */
ul.checklist {
  padding-left: 0;
  margin: 1.5rem 0;
}

ul.checklist li {
  position: relative;
  padding-left: 1.75rem;
  margin-bottom: 0.5rem;
  list-style-type: none;
  font-size: 0.875rem;
}

.dark ul.checklist li {
  color: #e5e7eb;
}

ul.checklist li:before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.15rem;
  width: 1.25rem;
  height: 1.25rem;
  border: 1px solid #d1d5db;
  border-radius: 0.25rem;
}

.dark ul.checklist li:before {
  border-color: #4b5563;
  background-color: #2d2d2d;
}

ul.checklist li.checked:before {
  content: "✓";
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.875rem;
  border-color: #2563eb;
  color: #2563eb;
}

.dark ul.checklist li.checked:before {
  border-color: #60a5fa;
  color: #60a5fa;
  background-color: #2d2d2d;
}

/* Responsive List Styles */
@media (max-width: 767px) {
  .content-section ul,
  .content-section ol,
  .faq-answer ul,
  .faq-answer ol {
    padding-left: 1.25rem;
  }
  
  .content-section ul li,
  .content-section ol li,
  .faq-answer ul li,
  .faq-answer ol li {
    padding-left: 1.5rem;
  }
  
  .faq-answer li {
    font-size: 0.75rem;
  }
}

/* Inline List Items - Specific to your example */
.faq-answer .inline-flex.flex {
  display: inline-flex;
  align-items: flex-start;
}

.faq-answer .inline-flex.flex p {
  margin: 0;
  padding-left: 1rem;
}

/* Specific style for the example HTML */
.faq-answer .max-w-2xl {
  max-width: 42rem;
}

.faq-answer .py-1 {
  padding-top: 0.25rem;
  padding-bottom: 0.25rem;
}

.faq-answer .px-4 {
  padding-left: 1rem;
  padding-right: 1rem;
}

/* Additional spacing for nested content */
.faq-answer .mb-7 {
  margin-bottom: 1.75rem;
}

.faq-answer .pb-4 {
  padding-bottom: 1rem;
}

.faq-answer .p-3 {
  padding: 0.75rem;
}