:root {
  --primary-color: #3177be;
  --secondary-color: #FFA726;
  --background-color: #f5f5f5;
  --card-background: #fff;
  --code-background: hsl(0, 0%, 98%);
  --code-border: hsl(0, 0%, 80%);
  --border-color: #ddd;
  --text-color: #333;
  --code-text: #333;
  --highlight-color: #fff7e9;
}

@media (prefers-color-scheme: dark) {
  :root {
    --background-color: #121212;
    --card-background: #212121;
    --code-background: hsl(0, 0%, 20%);
    --code-border: hsl(0, 0%, 30%);
    --border-color: #333;
    --text-color: #f5f5f5;
    --code-text: #ddd;
    --highlight-color: #372a00;
  }

  table th {
    background-color: #2c2c2c !important;
  }
}


body {
  font-size: 16px;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  line-height: 1.6;
  color: var(--text-color);
  background-color: var(--background-color);
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 1rem;
}

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

h1 {
  text-align: center;
  margin-top: 30px;
  margin-bottom: 10px;
  border-bottom: 2px solid;
  padding-bottom: 10px;
}

h2 {
  color: var(--secondary-color);
  margin-top: 30px;
  margin-bottom: 15px;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 5px;
}

h3 {
  margin-top: 25px;
  margin-bottom: 10px;
}

main {
  max-width: 60rem;
  margin: 0 auto;
}

.container {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  justify-content: center;
}

section {
  background-color: var(--card-background);
  border-radius: 5px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  padding: 1rem;
  flex-shrink: 0;
}

code {
  border-radius: 0.5rem;
  font-size: 0.8rem;
}

.comment {
  color: #6a737d;
}

table {
  width: 100%;
  border-collapse: collapse;
  margin: 20px 0;
}

table th,
table td {
  border: 1px solid var(--border-color);
  padding: 8px 12px;
  text-align: left;
}

table th {
  background-color: #f1f1f1;
}

.parameter {
  background-color: #fff3e0;
  border-radius: 3px;
  padding: 2px 5px;
  font-style: italic;
  color: var(--secondary-color);
}

.screenshot {
  display: block;
  max-width: 100%;
  border-radius: 8px;
  margin: 1.5rem auto;
}

footer {
  text-align: center;
  margin-top: 40px;
  padding: 20px 0;
  color: #666;
  font-size: 0.9em;
  border-top: 1px solid var(--border-color);
}

.top-button {
  position: fixed;
  bottom: 20px;
  right: 20px;
  background-color: var(--primary-color);
  color: white;
  border: none;
  border-radius: 50%;
  width: 50px;
  height: 50px;
  font-size: 20px;
  cursor: pointer;
  display: flex;
  justify-content: center;
  align-items: center;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
  z-index: 1000;
}

.top-button:hover {
  background-color: #1565c0;
}

.navbar {
  display: flex;
  justify-content: center;
  gap: 20px;
  margin-top: 20px;
  margin-bottom: 30px;
}

.nav-link {
  padding: 10px 20px;
  text-decoration: none;
  font-weight: bold;
  color: var(--text-color);
  border-bottom: 2px solid transparent;
  transition: border-color 0.3s;
}

.nav-link:hover {
  border-bottom-color: var(--secondary-color);
}

.nav-link.active {
  border-bottom-color: var(--primary-color);
}

.example-container {
  display: flex;
  flex-direction: column;
  gap: 40px;
  margin-bottom: 40px;
}

.example-card {
  background-color: var(--card-background);
  border-radius: 8px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  overflow: hidden;
}

.example-header {
  background-color: var(--primary-color);
  color: white;
  padding: 15px 20px;
  font-size: 18px;
  font-weight: bold;
}

.example-content {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 20px;
  padding: 20px;
}

.code-column {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.code-title {
  font-weight: bold;
  margin-bottom: 10px;
  color: var(--secondary-color);
}

.code-container {
  flex-grow: 1;
  border-radius: 5px;
  overflow: hidden;
}

.preview-column {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.preview-image {
  max-width: 100%;
  max-height: 300px;
  border-radius: 5px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.description {
  margin-top: 15px;
  text-align: center;
  font-style: italic;
}


@media (max-width: 700px) {
  body {
    font-size: 14px;
    padding: 0.5rem;
  }

  section {
    width: 100%;
    padding: 0.5rem;
  }
}

@media (max-width: 1200px) {
  .example-content {
    grid-template-columns: 1fr 1fr;
  }

  .preview-column {
    grid-column: span 2;
  }
}
