body {
  font-family: 'Vazirmatn', 'IRANSans', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  padding: 0;
  direction: rtl;
  text-align: right;
  background-color: #f8f9fa;
  color: #343a40;
  line-height: 1.6;
  margin: 0;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

main {
  max-width: 960px;
  margin: 20px auto;
  padding: 20px;
  background-color: #ffffff;
  box-shadow: 0 0 15px rgba(0, 0, 0, 0.05);
  border-radius: 8px;
}

header {
  background-color: #007bff;
  color: #ffffff;
  padding: 20px 0;
  text-align: center;
  margin-bottom: 20px;
}

header h1 {
  color: #ffffff;
  margin: 0;
  font-size: 2.8em;
}

header p {
  color: #e9ecef;
  margin-top: 10px;
  font-size: 1.2em;
}

/* Style for the date information added by script.js */
.current-date-info {
  color: #cce5ff;
  font-size: 1em;
  margin-top: 15px;
  opacity: 0.9;
}

h1 {
  color: #007bff;
  margin-bottom: 1em;
  font-size: 2.5em;
  font-weight: 600;
}

h2 {
  color: #0056b3;
  margin-top: 1.5em;
  margin-bottom: 0.8em;
  font-size: 2em;
  font-weight: 500;
  border-bottom: 1px solid #e9ecef;
  padding-bottom: 0.5em;
}

h3 {
  color: #007bff;
  margin-top: 1.2em;
  margin-bottom: 0.6em;
  font-size: 1.5em;
  font-weight: 600;
}

p {
  margin-bottom: 1em;
  font-size: 1.1em;
}

section {
  margin-bottom: 30px;
}

ul {
  list-style-type: none;
  padding: 0;
  margin-bottom: 1em;
}

ul li {
  position: relative;
  padding-right: 25px;
  margin-bottom: 0.8em;
  line-height: 1.5;
}

ul li::before {
  content: '▪';
  color: #007bff;
  position: absolute;
  right: 0;
  top: 0;
  font-size: 1.2em;
  line-height: 1.5;
}

code {
  background-color: #e9ecef;
  padding: 3px 6px;
  border-radius: 4px;
  font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, Courier, monospace;
  font-size: 0.9em;
  color: #c82333;
  white-space: nowrap;
}

strong {
  font-weight: 700;
  color: #343a40;
}

.feature-subsection {
  margin-top: 25px;
  padding-top: 15px;
  border-top: 1px dashed #ced4da;
}

.feature-subsection:first-of-type {
  border-top: none;
  padding-top: 0;
}

/* Table of Contents styles */
.toc-container {
  background-color: #f0f8ff; /* Very light blue */
  border-right: 4px solid #007bff; /* Primary blue border on the right for RTL */
  padding: 15px 20px;
  margin-bottom: 30px;
  border-radius: 8px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.03);
}

.toc-container h2 {
  color: #0056b3; /* Darker blue for consistency with other h2 */
  font-size: 1.8em; /* Slightly smaller than main h2 */
  margin-top: 0;
  margin-bottom: 1em;
  border-bottom: 1px dashed #cce5ff; /* Lighter, dashed border */
  padding-bottom: 0.5em;
  text-align: right; /* Ensure right alignment */
}

.toc-container ul {
  list-style-type: none;
  padding: 0;
  margin: 0;
}

.toc-container ul li {
  margin-bottom: 0.5em;
  /* Override generic list item styles for TOC */
  position: static; /* Reset position */
  padding-right: 0; /* Remove generic padding */
  line-height: 1.5;
}

.toc-container ul li::before {
  content: none; /* Remove the bullet point */
}

.toc-container ul li a {
  display: block;
  padding: 5px 10px;
  color: #343a40; /* Dark text color */
  text-decoration: none;
  border-radius: 4px;
  transition: background-color 0.2s ease, color 0.2s ease;
}

.toc-container ul li a:hover,
.toc-container ul li a:focus {
  background-color: #e9ecef; /* Light gray background on hover/focus */
  color: #0056b3; /* Darker blue text */
  outline: none; /* Remove default outline, provide custom focus style */
}

/* Indentation for nested TOC items (h3) */
.toc-container ul ul {
  padding-right: 20px; /* Indent nested lists */
  margin-top: 0.5em;
}

.toc-container ul ul li {
  margin-bottom: 0.3em;
}

.toc-container ul ul li a {
  font-size: 0.95em; /* Slightly smaller font for sub-items */
  color: #555;
}

.toc-container ul ul li a:hover,
.toc-container ul ul li a:focus {
  color: #007bff; /* Primary blue on hover/focus for sub-items */
  background-color: #f8f9fa; /* Very light gray */
}

@media (max-width: 768px) {
  main {
    margin: 10px auto;
    padding: 15px;
  }

  header h1 {
    font-size: 2.2em;
  }

  header p {
    font-size: 1em;
  }

  .current-date-info {
    font-size: 0.9em;
    margin-top: 10px;
  }

  h1 {
    font-size: 2em;
  }

  h2 {
    font-size: 1.7em;
  }

  h3 {
    font-size: 1.3em;
  }

  p {
    font-size: 1em;
  }

  ul li {
    padding-right: 20px;
  }

  ul li::before {
    font-size: 1em;
  }

  /* Media queries for TOC responsiveness */
  .toc-container {
    padding: 10px 15px;
    margin-bottom: 20px;
  }
  .toc-container h2 {
    font-size: 1.5em;
    margin-bottom: 0.8em;
  }
  .toc-container ul li a {
    padding: 4px 8px;
    font-size: 0.9em;
  }
  .toc-container ul ul {
    padding-right: 15px;
  }
}

@media (max-width: 480px) {
  main {
    margin: 5px auto;
    padding: 10px;
  }

  header {
    padding: 15px 0;
  }

  header h1 {
    font-size: 1.8em;
  }

  header p {
    font-size: 0.9em;
  }

  .current-date-info {
    font-size: 0.8em;
    margin-top: 8px;
  }

  h1 {
    font-size: 1.8em;
  }

  h2 {
    font-size: 1.5em;
  }

  h3 {
    font-size: 1.2em;
  }

  p {
    font-size: 0.95em;
  }

  ul li {
    padding-right: 18px;
  }

  ul li::before {
    font-size: 1em;
  }

  /* Media queries for TOC responsiveness */
  .toc-container {
    padding: 8px 10px;
    margin-bottom: 15px;
    border-right-width: 3px;
  }
  .toc-container h2 {
    font-size: 1.3em;
    margin-bottom: 0.6em;
  }
  .toc-container ul li a {
    padding: 3px 6px;
    font-size: 0.85em;
  }
  .toc-container ul ul {
    padding-right: 10px;
  }
}