:root {
  --bg: #fafafa;
  --fg: #1a1a1a;
  --accent: #333333;
  --muted: #666666;
  --sidebar-bg: #f5f5f5;
  --code-bg: #eeeeee;
  --border: #e0e0e0;
  --hover: #e8e8e8;
}

[data-theme="dark"] {
  --bg: #0f0f0f;
  --fg: #e5e5e5;
  --accent: #cccccc;
  --muted: #999999;
  --sidebar-bg: #1a1a1a;
  --code-bg: #1e1e1e;
  --border: #333333;
  --hover: #2a2a2a;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: "Inter", sans-serif;
}

body {
  padding: 0 10rem;
  background: var(--bg);
  color: var(--fg);
  display: flex;
  min-height: 100vh;
  transition:
    background-color 0.3s ease,
    color 0.3s ease;
}

/* Mobile header - hidden on desktop */
.mobile-header {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  background: var(--sidebar-bg);
  border-bottom: 1px solid var(--border);
  padding: 1rem;
  z-index: 1001;
  align-items: center;
  justify-content: space-between;
}

.mobile-nav-toggle {
  background: none;
  border: none;
  color: var(--fg);
  font-size: 1.5rem;
  cursor: pointer;
  padding: 0.5rem;
  border-radius: 4px;
  transition: background-color 0.2s ease;
}

.mobile-nav-toggle:hover {
  background: var(--hover);
}

.mobile-logo {
  font-size: 1.5rem;
  color: var(--fg);
  font-weight: 600;
  text-decoration: none;
}

.mobile-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  z-index: 999;
  opacity: 0;
  visibility: hidden;
  transition:
    opacity 0.3s ease,
    visibility 0.3s ease;
}

.mobile-overlay.active {
  opacity: 1;
  visibility: visible;
}

.bar {
  /* background: var(--sidebar-bg); */
  width: 300px;
  min-height: 100vh;
  padding: 2rem 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 2rem;
  position: sticky;
  top: 0;
  border-right: 1px solid var(--border);
}

.bar h1 {
  font-size: 1.5rem;
  color: var(--fg);
  margin-bottom: 1rem;
  text-align: center;
  font-weight: 600;
  padding: 0.5rem 0;
}

.bar .container {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  width: 100%;
  max-width: 220px;
  margin: 0 auto;
}

.bar section h3 {
  font-size: 1rem;
  color: var(--accent);
  margin-bottom: 0.8rem;
  font-weight: 600;
  text-align: left;
  border-bottom: 1px solid var(--border);
  padding-bottom: 0.5rem;
}

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

.bar li {
  margin-bottom: 0.5rem;
}

.bar a {
  color: var(--muted);
  text-decoration: none;
  font-size: 0.9rem;
  padding: 0.3rem 0.5rem;
  display: block;
  border-radius: 4px;
  transition: all 0.2s ease;
}

.bar a:hover {
  color: var(--fg);
  text-decoration: underline;
}

.bar .logo {
  font-size: 2rem;
}

.bar .logo:hover {
  text-decoration: none;
}

.content {
  padding: 3rem 4rem;
  flex: 1;
  max-width: 1000px;
  background: var(--bg);
}

.content h1 {
  font-size: 2.5rem;
  margin-bottom: 2rem;
  color: var(--fg);
  font-weight: 700;
  line-height: 1.2;
}

.content h2 {
  font-size: 2rem;
  margin: 2rem 0 1rem 0;
  color: var(--accent);
  font-weight: 600;
  border-bottom: 2px solid var(--border);
  padding-bottom: 0.5rem;
}

.content h3 {
  font-size: 1.5rem;
  margin: 1.5rem 0 0.8rem 0;
  color: var(--accent);
  font-weight: 600;
}

.content h4 {
  font-size: 1.2rem;
  margin: 1rem 0 0.6rem 0;
  color: var(--accent);
  font-weight: 500;
}

.content p {
  margin-bottom: 1.2rem;
  line-height: 1.7;
  color: var(--fg);
  font-size: 1rem;
}

.content ul,
.content ol {
  margin: 1rem 0 1.5rem 2rem;
  line-height: 1.6;
}

.content li {
  margin-bottom: 0.5rem;
  color: var(--fg);
}

.content blockquote {
  margin: 1.5rem 0;
  padding: 1rem 1.5rem;
  background: var(--code-bg);
  border-left: 4px solid var(--accent);
  border-radius: 4px;
  font-style: italic;
  color: var(--muted);
}

.content strong {
  font-weight: 600;
  color: var(--accent);
}

.content em {
  font-style: italic;
  color: var(--muted);
}

.content a {
  color: blue;
  text-decoration: none;
}

.content a:visited {
  color: purple;
}

.content a:hover {
  text-decoration: underline;
}

code {
  background: var(--code-bg);
  color: var(--accent);
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  font-family: "Monaco", "Menlo", monospace;
  font-size: 0.9rem;
  border: 1px solid var(--border);
}

pre {
  background: var(--code-bg);
  color: var(--fg);
  padding: 1.5rem;
  border-radius: 8px;
  overflow-x: auto;
  margin: 1.5rem 0;
  border: 1px solid var(--border);
  font-family: "Monaco", "Menlo", monospace;
  font-size: 0.9rem;
  line-height: 1.5;
}

pre code {
  background: none;
  padding: 0;
  border: none;
  color: inherit;
}

.theme-toggle {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  background: var(--code-bg);
  border: 1px solid var(--border);
  color: var(--fg);
  padding: 0.8rem;
  border-radius: 50%;
  cursor: pointer;
  font-size: 1.2rem;
  transition: all 0.3s ease;
  z-index: 1003;
  width: 50px;
  height: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.theme-toggle:hover {
  background: var(--hover);
  transform: scale(1.1);
}

/* Mobile responsive styles */
@media (max-width: 768px) {
  body {
    padding: 0;
    flex-direction: column;
  }
  .logo {
    display: none !important;
  }

  .mobile-header {
    display: flex;
  }

  .bar {
    position: fixed;
    top: 0;
    left: -100%;
    width: 280px;
    height: 100vh;
    background: var(--sidebar-bg);
    border-right: 1px solid var(--border);
    z-index: 1000;
    transition: left 0.3s ease;
    overflow-y: auto;
    padding-left: -1;
    padding-top: 6rem;
    padding-right: 6rem;
  }

  .bar.open {
    left: 0;
  }

  .content {
    padding: 5rem 1.5rem 2rem 1.5rem;
    margin-top: 1rem;
  }

  .content h1 {
    font-size: 2rem;
  }

  .content h2 {
    font-size: 1.5rem;
  }

  .theme-toggle {
    bottom: 1rem;
    right: 1rem;
    z-index: 1003;
  }
}

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

  .content h1 {
    font-size: 1.8rem;
  }

  .bar {
    width: 100%;
    left: -100%;
  }
}
