/* Basic styling for the documentation */
:root {
  --primary: #68478d;
  --primary-dark: #4a3164;
  --primary-light: #8662b0;
  --accent: #b8a1d9;
  --background: #f5f0ff;
  --text: #2c1810;
  --text-light: #fff;
  --link: #8662b0;
  --link-hover: #68478d;
  --link-visited: #9f6ed4;
}

body {
  position: relative;
  font-family: Arial, sans-serif;
  margin: 0;
  padding: 0;
  line-height: 1.6;
  background-color: var(--background);
  color: var(--text);
}

header {
  position: sticky;
  top: 0;
  left: 0;
  right: 0;
  background: var(--primary);
  color: var(--text-light);
  padding: 20px 20px 25px 90px;
  z-index: 90;
  backdrop-filter: blur(10px);
  background: rgba(104, 71, 141, 0.95);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
}

header h1 {
  margin: 0;
  font-size: 1.5em;
}

#search {
  width: 250px;
  padding: 8px;
  border-radius: 15px;
  margin-left: 0;
}

/* Navigation Styles */
#sidebar {
  position: fixed;
  left: 0;
  top: 0;
  width: 280px;
  height: 100vh;
  background: #2d2d3d;
  color: var(--text-light);
  padding: 80px 0 20px 0;
  overflow-y: auto;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 80;
  border-right: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 2px 0 5px rgba(0, 0, 0, 0.1);
}

#sidebar.closed {
  transform: translateX(-280px);
}

#sidebar h2 {
  padding: 0 20px;
  margin-bottom: 20px;
  font-size: 1.4em;
  color: var(--text-light);
}

#sidebar ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

#sidebar ul li {
  padding: 0;
  margin: 0;
}

#sidebar ul li a {
  display: block;
  padding: 12px 20px;
  color: var(--text-light);
  text-decoration: none;
  transition: all 0.2s ease;
  border-left: 3px solid transparent;
}

#sidebar ul li a:hover {
  background: rgba(255, 255, 255, 0.1);
  border-left-color: var(--primary-light);
}

#sidebar ul li a.active {
  background: var(--primary);
  border-left-color: var(--accent);
}

/* Custom scrollbar for sidebar */
#sidebar::-webkit-scrollbar {
  width: 6px;
}

#sidebar::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.1);
}

#sidebar::-webkit-scrollbar-thumb {
  background: var(--primary);
  border-radius: 3px;
}

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

.dark-mode {
  background-color: #121212; /* Dark background */
  color: #e0e0e0; /* Light text color */
}

header.dark-mode {
  background: #1f1f1f; /* Dark header background */
  color: #ffffff; /* Light header text */
}

#sidebar.dark-mode {
  background: #2d2d3d; /* Dark sidebar background */
  color: #e0e0e0; /* Light sidebar text */
}

a.dark-mode {
  color: #bb86fc; /* Light link color */
}

a.dark-mode:hover {
  color: #3700b3; /* Darker shade on hover */
}

section.dark-mode {
  background: #1f1f1f; /* Dark background for sections */
  color: #e0e0e0; /* Light text color for sections */
}

section.dark-mode:hover {
  background: #2d2d3d; /* Darker background for hovered sections in dark mode */
  color: #ffffff; /* Light text color for hovered sections */
}

/* Dark mode styles for method class */
body.dark-mode .method {
  background-color: #2a2a2a; /* Dark background for method class */
  color: #ffffff; /* Light text color */
  border: 1px solid #444; /* Optional: border for visibility */
  padding: 10px; /* Add some padding for better spacing */
}

/* Dark mode styles for code block */
body.dark-mode .code-block {
  background-color: #1e1e1e; /* Darker background for code blocks */
  color: #ffffff; /* Light text color for code */
  border: 1px solid #444; /* Optional: border for visibility */
  padding: 10px; /* Add some padding for better spacing */
  border-radius: 5px; /* Optional: rounded corners */
}

/* Additional styles for method class in dark mode */
body.dark-mode .method h3, /* Header in method class */
body.dark-mode .method p {
  /* Paragraph in method class */
  color: #ffffff; /* Ensure text is visible */
}

.dark-mode-toggle .slider {
  position: relative; /* Keep it relative */
  width: 20px; /* Width of the slider */
  height: 10px; /* Height of the slider */
  background-color: transparent; /* Background color of the slider */
  border-radius: 10px; /* Rounded corners */
  transition: background-color 0.3s; /* Smooth background transition */
  margin: 0 10px; /* Add margin to separate it from icons */
}

.dark-mode-toggle .slider::before {
  content: ""; /* Required for pseudo-elements */
  position: absolute;
  width: 20px; /* Width of the circle */
  height: 20px; /* Height of the circle */
  background-color: transparent; /* Make the circle transparent */
  border-radius: 50%; /* Make it circular */
  transition: transform 0.3s; /* Smooth transition for movement */
  top: -5px; /* Position the circle */
  left: -5px; /* Adjust as necessary */
}

/* Animation for dark mode */
body.dark-mode .dark-mode-toggle .slider::before {
  transform: translateX(20px); /* Move the circle to the right */
}

body.dark-mode {
  background-color: #121212; /* Dark background */
  color: #ffffff; /* Light text */
  transition: background-color 0.3s, color 0.3s; /* Smooth transition for background and text color */
}

/* Optionally hide the sun icon by default */
.dark-mode .fa-sun {
  display: none;
}

/* Optionally show the moon icon by default */
.dark-mode .fa-moon {
  display: inline;
}

.dark-mode-toggle {
  cursor: pointer;
  width: 50px; /* Width of the toggle */
  height: 25px; /* Height of the toggle */
  background-color: #cccccc79; /* Light background for the toggle */
  border-radius: 25px; /* Rounded corners */
  transition: background-color 0.3s;

  display: flex; /* Use flexbox for alignment */
  align-items: center; /* Center items vertically */
  position: fixed;
  top: 35%;
  right: 15px; /* Positioning the toggle */
}

.dark-mode-toggle .fa-sun,
.dark-mode-toggle .fa-moon {
  margin: 0 5px; /* Space between icons and slider */
  cursor: pointer; /* Change cursor to pointer for better UX */
}

.dark-mode-toggle:hover {
  background-color: #aaa; /* Darker background on hover */
}

body.dark-mode .dark-mode-toggle {
  background-color: #444; /* Dark background for the toggle in dark mode */
}

body.dark-mode .dark-mode-toggle .slider {
  transform: translateX(25px); /* Move slider to the right in dark mode */
}

.menuToggle {
  position: fixed;
  top: 15px;
  left: 15px;
  z-index: 1000;
  background: var(--primary-dark);
  border: none;
  color: var(--text-light);
  font-size: 1.5em;
  cursor: pointer;
  padding: 8px;
  border-radius: 4px;
  transition: all 0.3s ease;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
}

.menuToggle:hover {
  background: var(--primary);
  transform: scale(1.05);
}

.menuToggle .fas {
  transition: transform 0.3s ease;
}

.menuToggle.closed .fas {
  transform: rotate(180deg);
}

main {
  max-width: 50vw;
  width: 100%;
  padding: 20px;
  padding-bottom: 5vw; /* Ensure space for footer */
  transition: margin-left 0.3s ease;
}

#sidebar.closed + main {
  margin-left: 0;
}

main.full-width {
  margin-left: 0;
}

/* Navigation is handled by sidebar */

.back-link {
  margin-top: auto;
  padding: 20px 25px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(0, 0, 0, 0.2);
}

.back-link a {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #a8b2d1;
  text-decoration: none;
  padding: 10px;
  border-radius: 4px;
  transition: all 0.2s ease;
  font-size: 0.95em;
}

.back-link a:hover {
  background: rgba(104, 71, 141, 0.2);
  color: var(--text-light);
}

.back-link i {
  font-size: 1.1em;
}

/* ==============================================
   SECTION STYLES
   ============================================== */

section {
  background: #fff;
  border: 1px solid var(--primary-light);
  box-shadow: 0 2px 4px rgba(104, 71, 141, 0.1);
  padding: 25px;
  border-radius: 8px;
  margin-bottom: 20px;
  overflow: visible;
  height: auto;
  min-height: 100px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  transition: all 0.3s ease;
  overflow: hidden;
}

section:hover {
  transform: translateY(-5px);
  box-shadow: 0 5px 15px rgba(104, 71, 141, 0.2);
  border-color: var(--primary);
  background: linear-gradient(
    to right,
    rgba(255, 255, 255, 1),
    rgba(184, 161, 217, 0.1)
  );
}

section h2 {
  color: var(--primary);
  margin-top: 0;
  margin: 0;
  font-size: 1.5em;
  margin-bottom: 10px;
}

section p {
  margin: 0;
  margin-top: 10px; /* Ensure p starts on a new line with space */
  opacity: 0.8;
  transition: opacity 0.3s ease;
}

section:hover p {
  opacity: 1;
}

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

a:hover {
  color: var(--link-hover);
  text-decoration: underline;
}

a:visited {
  color: var(--link-visited);
}

details {
  margin-top: 10px;
}

.command {
  background-color: rgba(0, 0, 0, 0.75);
  color: white;
  padding: 0.5rem 1rem;
  border-radius: 1rem;
  font-size: 1.5rem;
  text-align: center;
}

.command-alt {
  background-color: rgba(0, 0, 0, 0.75);
  color: white;
  padding: 0.5rem 1rem;
  border-radius: 1rem;
  font-size: 1rem;
  text-align: center;
}

.features ul {
  list-style-type: none;
  padding-left: 0;
}

.features li {
  margin: 8px 0;
  padding-left: 20px;
  position: relative;
}

.features li:before {
  content: "•";
  color: var(--primary);
  position: absolute;
  left: 0;
}

.example {
  margin-top: 0px;
  width: 90%;
  align-items: center;
  justify-content: center;
  display: flex;
  flex-direction: column;
}

.example * {
  margin: 0;
}

.example pre {
  background: var(--background);
  padding: 15px;
  border-radius: 5px;
  border: 1px solid var(--primary-light);
  overflow-x: auto;
}

.example code {
  font-family: "Consolas", "Monaco", monospace;
  color: var(--primary-dark);
}

.section-link {
  text-decoration: none;
  color: inherit;
  display: block;
}

.section-link:hover {
  text-decoration: none;
}

.tags {
  display: flex;
  gap: 10px;
}
.tag {
  backdrop-filter: blur(10px);
  background: rgba(104, 71, 141, 0.7);
  color: var(--text-light);
  padding: 0.3vw;
  border-radius: 15px;
  background-color: #68478d;
  background-image: linear-gradient(to bottom, #68478d, #8a44c9);

  width: 5rem;
  text-align: center;

  font-size: 0.9rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;

  display: inline-block;
  transform: scaleX(1); /* fallback for shrink */

  box-shadow:
        0px 1px 4px -2px #333, /* Optional: subtle shadow */
        inset 0 -5px 20px hsla(0, 0%, 0%, 0.4), /* Optional: top light */
        inset 0 5px 20px hsla(0, 0%, 100%, 0.4); /* Optional: bottom shadow */
}

.tag::after {
  content: '';
  position: absolute;
  top: 2px; /* Adjust as needed */
  left: 2px; /* Adjust as needed */
  width: calc(100% - 4px); /* Adjust as needed */
  height: 50%; /* Adjust as needed */
  background: linear-gradient(rgba(169, 63, 231, 0.8), rgba(169, 63, 231, 0.2)); /* Highlight gradient */
  /* Optional: border-radius for rounded corners */
  border-radius: 3px;
}

.learn-more {
  margin-top: 15px;
  color: var(--primary);
  font-weight: 500;
  opacity: 0;
  transform: translateX(-10px);
  transition: all 0.3s ease;
}

section:hover .learn-more {
  opacity: 1;
  transform: translateX(0);
}

.documentation {
  max-width: 1400px;
  margin: 0 auto;
  padding: 20px;
  position: flex;

  display: flex;
  justify-content: center;
  flex-direction: column;
  min-height: auto;
}

.documentation section {
  margin-bottom: 40px;
}

.method {
  background: white;
  border: 1px solid var(--primary-light);
  margin: 5px 0;
  width: 90%;
  text-align: center;
  align-items: center;
  justify-content: center;
  display: flex;
  flex-direction: column;
}

.method h3 {
  color: var(--primary);
  margin: 0;
}

.method p {
  margin: 0;
  opacity: 0.8;
  transition: opacity 0.3s ease;
}

.code-block {
  margin: 10px 0;
  border-radius: 8px;
  overflow: hidden;
  background: #2d2d3d; /* Dark background for code blocks */
  color: #e0e0e0; /* Light text color */
  width: 90%;
}

.code-block pre {
  background: #1e1e1e; /* Darker background for code */
  color: #ffffff; /* Light text for code */
}

.code-summary {
  cursor: pointer;
  font-weight: bold;
  background-color: #121212;
  color: #f8f8f2;
  padding: 0.5em 1em;
  border-radius: 0.3em 0.3em 0 0;
}


.code-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 3px 15px;
  background: #1e1e1e;
  color: #e0e0e0;
}

.code-title {
  font-weight: bold;
  font-size: 0.95em;
}

.language {
  font-family: monospace;
  font-size: 0.9em;
  color: #888;
}

.copy-button {
  background: #383838;
  border: none;
  color: #e0e0e0;
  padding: 4px 12px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.9em;
  transition: all 0.2s ease;
}

.copy-button:hover {
  background: #454545;
}

.code-block pre {
  margin: 0;
  padding: 15px;
}

.code-block code {
  font-family: "Consolas", "Monaco", monospace;
  font-size: 0.95em;
  line-height: 1.5;
}

.note {
  background: var(--background);
  border-left: 4px solid var(--primary);
  padding: 15px;
  margin: 15px 0;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  width: 80%;
}

.note i {
  color: var(--primary);
  font-size: 1.2em;
  margin-top: 3px;
}

.note code {
  background: rgba(104, 71, 141, 0.1);
  padding: 2px 6px;
  border-radius: 4px;
  font-family: "Consolas", "Monaco", monospace;
}

.main-content {
  display: flex;
  justify-content: center;
  flex-direction: column;
  min-height: auto;
  padding-left: 25vw;
}

.main-content section {
  margin-bottom: 1rem;
}

.rounded-button {
  display: inline-block;
  padding: 10px 20px;
  background-color: #3700b3; /* Change to your preferred color */
  color: white;
  text-align: center;
  text-decoration: none;
  border-radius: 25px; /* Makes the button rounded */
  transition: background-color 0.3s;
}

.rounded-button:visited {
  color: #9f6ed4;
}

.rounded-button:hover {
  background-color: #3600b39a; /* Darker shade for hover effect */
}

.method-header code {
  font-family: "Fira Code", monospace;
  font-size: 1.05em;
  background-color: transparent;
  color: #ddd;
  padding: 0.3em 0.6em;
  border-radius: 6px;
  display: inline-block;
}

footer {
  background-color: #2d2d2d;
  color: #ccc;
  padding: 1.5rem 1rem;
  font-size: 0.9rem;
  text-align: center;
}

.footer-container {
  max-width: 900px;
  margin: 0 auto;
}

.footer-container h4 {
  margin: 0 0 1rem;
  font-weight: 600;
  color: #fff;
}

.social-links {
  list-style: none;
  padding: 0;
  margin: 0 0 1rem;
  display: flex;
  justify-content: center;
  gap: 2rem;
}

.social-links a {
  color: #ccc;
  text-decoration: none;
  font-weight: 500;
  transition: color 0.2s ease;
}

.social-links a:hover {
  color: #fff;
}

.footer-meta {
  font-size: 0.8rem;
  opacity: 0.6;
  display: flex;
  justify-content: center;
  gap: 1.5rem;
  flex-wrap: wrap;
  margin-top: 0.5rem;
}

.powered-by {
  font-style: italic;
}


/* Mobile adjustments */
@media (max-width: 768px) {
  #sidebar {
    transform: translateX(-280px);
  }

  #sidebar.open {
    transform: translateX(0);
  }

  header {
    text-align: center;
    font-size: x-small;
  }

  section {
    width: 80vw;
    margin-left: -4em;
  }

  footer {
    font-size: x-small;
  }

  .tags {
    flex-wrap: wrap;
  }

  .tag {
    margin-bottom: 5px;
  }

  .main-content {
    padding-left: 5em;
  }

  main {
    padding-bottom: 80px;
  }

  #methods,
  #basic-usage,
  #overview,
  #installation,
  #examples,
  #advanced {
    margin-left: -4em;
    width: 80vw;
  }

  /* Command text styling */
  .command span {
    font-family: "Courier New", monospace;
    padding: 10px;
    border-radius: 5px;
    display: block; /* Ensure it takes full width */
  }

  .copy-button {
    padding: 10px 15px;
    background-color: var(--primary);
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.3s;
  }

  .copy-button:hover {
    background-color: var(--primary-dark); /* Darker shade on hover */
  }

  .copy-button.active {
    background-color: #0056b3; /* Darker shade for active state */
    transform: translateY(2px); /* Slightly move the button down */
  }

  .method {
    width: 100%;
    margin: 10px 0;
  }

  .command {
    font-size: 1em;
    overflow: hidden; /* Hide overflowed text */
    text-overflow: ellipsis; /* Add ellipsis for overflowed text */
    white-space: nowrap; /* Prevent text from wrapping */
    max-width: 100%;
  }

  .command .copy-button {
    padding: 0px 15px;
    visibility: visible; /* Always show the copy button */
    position: absolute; /* Positioning to keep it visible */
    right: 5%; /* Adjust as needed for your layout */
    top: 14.5%;
    font-size: 0.8em; /* too big */
    transform: translateY(-150%); /* Adjust for perfect centering */
    z-index: 1;
    size: 1em;
  }

  .code-block {
    width: 85vw;
  }

}
