* {
  box-sizing: border-box;
}

html {
  overscroll-behavior: none;
  scrollbar-width: thin;
  scrollbar-color: rgba(99, 102, 241, 0.4) transparent;
}

::-webkit-scrollbar {
  width: 10px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: rgba(99, 102, 241, 0.4);
  border-radius: 6px;
  border: 2px solid transparent;
  background-clip: padding-box;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(99, 102, 241, 0.6);
  background-clip: padding-box;
}

:root {
  color-scheme: light dark;
  --primary: #6366f1;
  --primary-dark: #4f46e5;
  --primary-light: #818cf8;
  --accent: #06b6d4;
  --accent-dark: #0891b2;
  --surface: #ffffff;
  --surface-dim: #f8fafc;
  --surface-dark: #1e293b;
  --text: #1e293b;
  --text-muted: #64748b;
  --text-light: #f8fafc;
  --border: #e2e8f0;
  --border-dark: #334155;
  --success: #10b981;
  --warning: #f59e0b;
  --error: #ef4444;
}

body {
  margin: 0;
  min-width: min-content;
  width: 100vw;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--surface-dim);
  color: var(--text);
  padding-top: 140px;
  overscroll-behavior: none;
  overflow-y: auto;
  line-height: 1.6;
}

#main-wrapper {
  width: 100vw;
  min-height: calc(100vh - 140px);
  display: flex;
}

main {
  padding: 40px;
  width: calc(100% - 280px);
  flex: 1;
}

main .content {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);
  font-size: 16px;
  line-height: 1.7em;
  color: var(--text);
  padding: 40px 50px;
  position: relative;
  overflow: hidden;
}

main .content::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--primary), var(--accent));
}

header {
  width: 100%;
  display: flex;
  flex-direction: row;
  align-items: center;
  height: 140px;
  margin: 0;
  background: linear-gradient(135deg, var(--surface-dark) 0%, #0f172a 100%);
  color: var(--text-light);
  border-bottom: 1px solid var(--border-dark);
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
}

header > .logo-container {
  display: flex;
  align-items: center;
  padding: 0 30px;
  z-index: 1;
  color: var(--primary-light);
}

header > .logo-container svg {
  width: 70px;
  height: 70px;
}

header > .launch-app-button {
  margin-left: auto;
  padding: 12px 24px;
  background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
  color: white;
  text-decoration: none;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.95em;
  transition: transform 0.2s, box-shadow 0.2s;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

header > .launch-app-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
}

header > .logo-container.github {
  margin-left: 20px;
  padding: 0 30px;
}

header > .logo-container.github a {
  display: flex;
  align-items: center;
}

header > .logo-container.github img {
  width: 40px;
  height: 40px;
  filter: brightness(0) invert(1);
  opacity: 0.9;
  transition: opacity 0.2s;
  border: none;
  border-radius: 0;
}

header > .logo-container.github img:hover {
  opacity: 1;
}

header > .title {
  display: flex;
  flex-direction: column;
  justify-content: center;
  flex: 1;
  margin-left: 20px;
  z-index: 1;
}

header > .title h1 {
  margin: 0 0 8px 0;
  line-height: 1.1;
  font-size: 2.5em;
  font-weight: 700;
  background: linear-gradient(135deg, #fff 0%, var(--primary-light) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: -0.5px;
}

header > .title h4 {
  margin: 0;
  font-weight: 400;
  line-height: 1.2;
  font-size: 1em;
  color: var(--text-muted);
}

h1, h2, h3, h4, h5, h6 {
  font-weight: 600;
  letter-spacing: -0.3px;
}

h1 {
  font-size: 2.2em;
  color: var(--text);
  margin-top: 40px;
  margin-bottom: 20px;
}

main .content h1:first-child {
  margin-top: 0;
}

h2 {
  padding-top: 30px;
  font-size: 1.6em;
  color: var(--text);
  border-bottom: 2px solid var(--border);
  padding-bottom: 10px;
  margin-bottom: 20px;
}

h3 {
  font-size: 1.3em;
  color: var(--text);
  margin-top: 30px;
}

h4 {
  color: var(--text-muted);
  font-weight: 500;
}

p > code,
a > code,
li > code {
  background-color: var(--surface-dim);
  color: var(--primary-dark);
  border-radius: 6px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.9em;
  font-weight: 500;
  padding: 2px 8px;
  margin: 0 2px;
  border: 1px solid var(--border);
}

nav {
  display: block;
  min-width: 280px;
  width: 280px;
  font-size: 15px;
  background: var(--surface);
  padding: 25px;
  border-right: 1px solid var(--border);
  font-family: 'Inter', sans-serif;
  position: relative;
}

nav > h4 {
  color: var(--text-muted);
  margin: 0;
  margin-top: 30px;
  margin-bottom: 10px;
  padding-top: 20px;
  text-transform: uppercase;
  font-weight: 600;
  letter-spacing: 0.5px;
  font-size: 0.75em;
  border-top: 1px solid var(--border);
}

nav > h4:first-of-type {
  border-top: none;
  padding-top: 0;
  margin-top: 0;
}

nav > a {
  color: var(--text);
  display: block;
  text-decoration: none;
  padding: 8px 0;
  padding-left: 12px;
  border-left: 3px solid transparent;
  transition: all 0.2s;
  font-size: 0.95em;
}

nav > a:hover {
  border-left-color: var(--primary);
  background: var(--surface-dim);
  color: var(--primary);
  padding-left: 16px;
}

.table-wrapper {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
  margin: 20px 0;
}

table {
  border-collapse: collapse;
  width: 100%;
}

table th {
  background: var(--surface-dim);
  color: var(--text);
  padding: 12px 15px;
  text-align: left;
  font-weight: 600;
  font-size: 0.9em;
  border-bottom: 1px solid var(--border);
}

table td {
  padding: 12px 15px;
  border-bottom: 1px solid var(--border);
}

table tr:last-child td {
  border-bottom: none;
}

table tr:hover td {
  background: var(--surface-dim);
}

.mobile-header {
  display: none;
}

.mobile-menu-button {
  display: none;
  background: transparent;
  border: 2px solid rgba(255, 255, 255, 0.3);
  cursor: pointer;
  padding: 10px;
  border-radius: 8px;
  transition: all 0.2s;
}

.mobile-menu-button:hover {
  background-color: rgba(255, 255, 255, 0.1);
}

.mobile-menu-button svg {
  filter: brightness(0) invert(1);
}

#page-title {
  margin-top: 0;
  margin-bottom: 30px;
  padding: 0;
  padding-bottom: 15px;
  font-weight: 400;
  color: var(--text-muted);
  font-size: 1.1em;
  border-bottom: 1px dashed var(--border);
}

pre[class*="language-"] {
  border: 1px solid var(--border) !important;
  border-radius: 12px !important;
  background: #1e293b !important;
  margin: 20px 0 !important;
}

a {
  color: var(--primary);
  font-weight: 500;
  text-decoration: none;
}

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

strong {
  color: var(--text);
  font-weight: 600;
}

ul, ol {
  padding-left: 24px;
}

li {
  margin-bottom: 8px;
}

blockquote {
  margin: 20px 0;
  padding: 16px 20px;
  background: var(--surface-dim);
  border-left: 4px solid var(--primary);
  border-radius: 0 8px 8px 0;
}

blockquote p {
  margin: 0;
}

img {
  max-width: 100%;
  border-radius: 8px;
  border: 1px solid var(--border);
}

hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 40px 0;
}

@media only screen and (max-device-width: 490px) {
  body {
    padding-top: 70px;
  }

  header {
    height: 70px;
  }

  header .mobile-menu-button {
    margin-left: 15px;
    margin-top: 5px;
  }

  header .logo-container {
    display: none;
  }

  header .title {
    margin-top: 15px;
  }

  header > .title h1 {
    font-size: 1.5em;
  }

  header .title h4 {
    display: none;
  }

  header > .launch-app-button {
    padding: 8px 14px;
    font-size: 0.85em;
    margin-right: 10px;
  }

  .mobile-header {
    display: block;
    padding: 10px;
  }

  .mobile-header h1 {
    color: var(--text);
  }

  nav {
    display: none;
  }

  .menu-open nav {
    position: fixed;
    background: var(--surface);
    top: 70px;
    width: 80%;
    height: calc(100vh - 70px);
    display: block;
    z-index: 1000;
    overflow-y: auto;
  }

  #main-wrapper {
    min-height: calc(100vh - 70px);
  }

  .mobile-menu-button {
    margin-top: 15px;
    display: inline-block;
  }

  main {
    margin: 0;
    padding: 15px;
    width: 100%;
  }

  main .content {
    padding: 20px;
  }
}
