* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  line-height: 1.4;
  color: #333;
  background: #f8f9fa;
}

.header {
  background: linear-gradient(135deg, #e91e63, #ff5722);
  color: white;
  padding: 1.5rem;
  text-align: center;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.header h1 {
  font-size: clamp(1.8rem, 5vw, 2.5rem);
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.header .version {
  opacity: 0.9;
  font-size: clamp(0.9rem, 3vw, 1.1rem);
}

.container {
  max-width: 1600px;
  margin: 0 auto;
  padding: clamp(1rem, 2vw, 2rem);
  display: grid;
  gap: clamp(1rem, 1.5vw, 2rem);
  align-items: start;
}

/* Default: 1 column on small screens */
.container {
  grid-template-columns: 1fr;
}

/* 2 columns on medium screens */
@media (min-width: 900px) {
  .container {
    grid-template-columns: repeat(2, 1fr);
  }

  /* Let table sections span both columns to get enough width */
  .section:has(table) {
    grid-column: span 2;
  }
}

/* 3 columns on large screens */
@media (min-width: 1400px) {
  .container {
    max-width: 95vw;
    grid-template-columns: repeat(3, 1fr);
  }

  /* Table sections span 2 columns */
  .section:has(table) {
    grid-column: span 2;
  }
}

/* 4 columns on very large screens */
@media (min-width: 1800px) {
  .container {
    max-width: 98vw;
    grid-template-columns: repeat(4, 1fr);
    gap: 2rem;
  }

  /* Table sections can span 2-3 columns */
  .section:has(table) {
    grid-column: span 2;
  }

  /* Wide tables with 4+ columns span 3 */
  .section:has(table):has(th:nth-child(4)) {
    grid-column: span 3;
  }
}

/* 5 columns on ultra-wide screens */
@media (min-width: 2200px) {
  .container {
    grid-template-columns: repeat(5, 1fr);
  }

  .section:has(table) {
    grid-column: span 2;
  }

  .section:has(table):has(th:nth-child(4)) {
    grid-column: span 3;
  }
}

/* Ensure sections have adequate space */
.section {
  min-width: 300px;
}

.section {
  background: white;
  border-radius: 12px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
  overflow: hidden;
  height: fit-content;
}

.section-header {
  background: linear-gradient(135deg, #e91e63, #f06292);
  color: white;
  padding: 1rem;
  font-weight: 700;
  font-size: clamp(1.1rem, 2.5vw, 1.3rem);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.section-content {
  padding: clamp(1rem, 2.5vw, 1.5rem);
}

.subsection {
  margin-bottom: 1.5rem;
}

.subsection h3 {
  color: #e91e63;
  font-size: clamp(1rem, 2vw, 1.1rem);
  margin-bottom: 0.5rem;
  border-bottom: 2px solid #f8f9fa;
  padding-bottom: 0.25rem;
}

table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 1rem;
  font-size: clamp(0.8rem, 1.4vw, 0.9rem);
  table-layout: auto;
  min-width: 600px;
}

.table-wrapper {
  margin: 1rem 0;
  border-radius: 8px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

th,
td {
  padding: clamp(0.6rem, 1.2vw, 1rem);
  text-align: left;
  border-bottom: 1px solid #eee;
  vertical-align: top;
}

th {
  background: #f8f9fa;
  font-weight: 600;
  color: #555;
  white-space: nowrap;
  min-width: max-content;
}

td {
  word-wrap: break-word;
  hyphens: auto;
}

/* Give columns generous minimum widths */
table th:first-child,
table td:first-child {
  white-space: nowrap;
  min-width: 150px;
  width: 20%;
}

table th:nth-child(2),
table td:nth-child(2) {
  min-width: 200px;
  width: 30%;
}

table th:last-child,
table td:last-child {
  min-width: 250px;
  width: 50%;
  white-space: normal;
  word-wrap: break-word;
}

/* For 2-column tables, give more space */
table:not(:has(th:nth-child(3))) th:first-child,
table:not(:has(th:nth-child(3))) td:first-child {
  width: 25%;
  min-width: 180px;
}

table:not(:has(th:nth-child(3))) th:last-child,
table:not(:has(th:nth-child(3))) td:last-child {
  width: 75%;
  min-width: 300px;
}

/* For 4-column tables, balanced spacing */
table:has(th:nth-child(4)) {
  min-width: 800px;
}

table:has(th:nth-child(4)) th,
table:has(th:nth-child(4)) td {
  width: 25%;
  min-width: 150px;
}

table:has(th:nth-child(4)) th:last-child,
table:has(th:nth-child(4)) td:last-child {
  min-width: 100px;
}

/* Improve code blocks in tables */
table code {
  background: #f4f4f4;
  padding: 0.2rem 0.4rem;
  border-radius: 3px;
  font-size: 0.85em;
  word-break: break-all;
}

/* Badge in tables */
table .badge {
  white-space: nowrap;
  min-width: auto;
}

/* Responsive table improvement */
@media (max-width: 768px) {
  table {
    min-width: 500px;
  }

  table th,
  table td {
    font-size: 0.8rem;
    padding: 0.6rem;
  }

  .section:has(table) {
    min-width: 500px;
  }
}

.code-block {
  background: #2d2d2d;
  color: #f8f8f2;
  padding: 0.3rem 0.7rem 0.3rem 0.7rem;
  border-radius: 8px;
  font-family: "Consolas", "Monaco", monospace;
  font-size: 0.87em;
  font-weight: 400;
  overflow-x: auto;
  margin: 0.1rem 0 0.7rem 0;
  white-space: pre;
  line-height: 1.15;
  border: 1px solid #232323;
}

.code-block pre {
  background: none;
  color: inherit;
  font-family: inherit;
  font-size: inherit;
  font-weight: inherit;
  margin: 0;
  padding: 0;
  line-height: inherit;
  tab-size: 2;
}

.code-block pre {
  text-indent: 0;
}


.inline-code {
  background: #f4f4f4;
  padding: 0.2rem 0.4rem;
  border-radius: 4px;
  font-family: "Consolas", "Monaco", monospace;
  font-size: clamp(0.75rem, 1.6vw, 0.85rem);
  word-break: break-all;
}

.badge {
  display: inline-block;
  background: #e91e63;
  color: white;
  padding: 0.2rem 0.6rem;
  border-radius: 20px;
  font-size: clamp(0.7rem, 1.5vw, 0.75rem);
  font-weight: 600;
  margin: 0.1rem;
}

.success {
  background: #4caf50;
}
.warning {
  background: #ff9800;
}
.error {
  background: #f44336;
}
.info {
  background: #2196f3;
}

.shortcut-table {
  font-size: clamp(0.75rem, 1.6vw, 0.85rem);
}

.shortcut-table th {
  background: #e91e63;
  color: white;
}

.highlight {
  background: #fff3e0;
  border-left: 4px solid #ff9800;
  padding: 1rem;
  margin: 1rem 0;
  border-radius: 0 8px 8px 0;
}

.example-box {
  background: #f0f8ff;
  border-left: 4px solid #2196f3;
  padding: 1rem;
  margin: 1rem 0;
  border-radius: 0 8px 8px 0;
}

.image-container {
  text-align: center;
  margin: 1rem 0;
  background: #f8f9fa;
  padding: 1rem;
  border-radius: 8px;
}

.image-container img {
  max-width: 100%;
  height: auto;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.image-caption {
  font-size: clamp(0.8rem, 1.6vw, 0.9rem);
  color: #666;
  margin-top: 0.5rem;
  font-style: italic;
}

.grid-2 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 250px), 1fr));
  gap: 1rem;
  align-items: start;
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr));
  gap: 1rem;
  align-items: start;
}

ul {
  padding-left: 1.5rem;
}

p {
  font-size: clamp(0.9rem, 1.6vw, 1rem);
  margin-bottom: 0.8rem;
  line-height: 1.6;
}

/* Better scaling for different screen sizes */
@media (min-width: 1600px) {
  .container {
    max-width: 98vw;
    grid-template-columns: repeat(auto-fit, minmax(450px, 1fr));
    gap: 2rem;
  }

  .section-content {
    padding: 2rem;
  }
}

@media (min-width: 1200px) and (max-width: 1599px) {
  .container {
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
  }
}

kbd {
  background-color: #f1f3f4;
  border: 1px solid #c4c4c4;
  border-radius: 3px;
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.2), inset 0 0 0 2px white;
  color: #444;
  display: inline-block;
  font-family: consolas, "Liberation Mono", courier, monospace;
  font-size: 0.85em;
  font-weight: 700;
  line-height: 1;
  padding: 2px 4px;
  white-space: nowrap;
}

@media (max-width: 768px) {
  .container {
    grid-template-columns: 1fr;
    padding: 1rem;
  }

  .grid-2,
  .grid-3 {
    grid-template-columns: 1fr;
  }

  table {
    font-size: 0.75rem;
  }

  .code-block {
    font-size: 0.7rem;
  }
}

@media (max-width: 480px) {
  .header {
    padding: 1rem;
  }

  .section-content {
    padding: 1rem;
  }

  .code-block {
    font-size: 0.65rem;
    padding: 0.8rem;
  }
}

/* Smooth transitions for responsive changes */
.container,
.section,
.grid-2,
.grid-3 {
  transition: all 0.3s ease;
}

