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

:root {
  --primary-color: #3b82f6;
  --secondary-color: #2563eb;
  --accent-color: #8b5cf6;
  --text-color: #1f2937;
  --text-light: #6b7280;
  --bg-color: #ffffff;
  --bg-secondary: #f9fafb;
  --border-color: #e5e7eb;
  --code-bg: #f3f4f6;
  --success-color: #10b981;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  color: var(--text-color);
  background-color: var(--bg-color);
  line-height: 1.6;
}

/* Navbar */
.navbar {
  background: linear-gradient(135deg, var(--primary-color) 0%, var(--accent-color) 100%);
  color: white;
  padding: 1rem 0;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
  position: sticky;
  top: 0;
  z-index: 100;
}

.navbar .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 1.5rem;
  font-weight: 700;
}

.nav-icon {
  font-size: 2rem;
}

.nav-links {
  display: flex;
  gap: 2rem;
  align-items: center;
}

.nav-links a {
  color: white;
  text-decoration: none;
  font-weight: 500;
  transition: opacity 0.2s;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.nav-links a:hover {
  opacity: 0.8;
}

.nav-links a.active {
  border-bottom: 2px solid white;
}

.github-link {
  background: rgba(255,255,255,0.2);
  padding: 0.5rem 1rem;
  border-radius: 6px;
}

/* Container */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 2rem;
}

/* Main Content */
main {
  padding: 3rem 0;
  min-height: calc(100vh - 200px);
}

.content {
  background: white;
  padding: 3rem;
  border-radius: 12px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

/* Typography */
h1 {
  font-size: 2.5rem;
  font-weight: 700;
  margin-bottom: 1.5rem;
  color: var(--text-color);
  border-bottom: 3px solid var(--primary-color);
  padding-bottom: 0.5rem;
}

h2 {
  font-size: 2rem;
  font-weight: 600;
  margin-top: 2.5rem;
  margin-bottom: 1rem;
  color: var(--text-color);
}

h3 {
  font-size: 1.5rem;
  font-weight: 600;
  margin-top: 2rem;
  margin-bottom: 0.75rem;
  color: var(--text-color);
}

h4 {
  font-size: 1.25rem;
  font-weight: 600;
  margin-top: 1.5rem;
  margin-bottom: 0.5rem;
}

p {
  margin-bottom: 1rem;
  color: var(--text-color);
}

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

a:hover {
  text-decoration: underline;
}

/* Code Blocks */
code {
  background: var(--code-bg);
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  font-family: 'JetBrains Mono', 'Monaco', 'Menlo', monospace;
  font-size: 0.9em;
  color: #e83e8c;
  font-weight: 500;
}

pre {
  background: #1e293b;
  padding: 1.5rem;
  border-radius: 8px;
  overflow-x: auto;
  margin: 1.5rem 0;
  border-left: 4px solid var(--primary-color);
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

pre code {
  background: none;
  padding: 0;
  color: #e2e8f0;
  font-size: 0.875rem;
  font-weight: 400;
  line-height: 1.6;
}

/* Inline code in headings */
h1 code, h2 code, h3 code, h4 code {
  font-size: 0.9em;
  background: var(--code-bg);
  color: var(--primary-color);
}

/* Lists */
ul, ol {
  margin: 1rem 0 1rem 2rem;
}

li {
  margin-bottom: 0.5rem;
}

/* Badges and Labels */
img[alt*="badge"], img[alt*="Badge"] {
  display: inline-block;
  margin: 0.25rem;
}

/* Tables */
table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5rem 0;
  overflow: hidden;
  border-radius: 8px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

th, td {
  padding: 0.75rem;
  text-align: left;
  border-bottom: 1px solid var(--border-color);
}

th {
  background: var(--bg-secondary);
  font-weight: 600;
  color: var(--primary-color);
}

tr:hover {
  background: var(--bg-secondary);
}

/* Blockquotes */
blockquote {
  border-left: 4px solid var(--primary-color);
  padding-left: 1rem;
  margin: 1.5rem 0;
  color: var(--text-light);
  font-style: italic;
  background: var(--bg-secondary);
  padding: 1rem 1rem 1rem 2rem;
  border-radius: 0 8px 8px 0;
}

/* HR */
hr {
  border: none;
  border-top: 2px solid var(--border-color);
  margin: 2rem 0;
}

/* Footer */
footer {
  background: var(--bg-secondary);
  padding: 2rem 0;
  text-align: center;
  color: var(--text-light);
  border-top: 1px solid var(--border-color);
}

footer p {
  margin: 0.5rem 0;
}

footer a {
  color: var(--primary-color);
  margin: 0 0.5rem;
}

/* Checkboxes */
input[type="checkbox"] {
  margin-right: 0.5rem;
}

/* Badges */
.badge {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  background: var(--primary-color);
  color: white;
  border-radius: 12px;
  font-size: 0.875rem;
  font-weight: 500;
  margin: 0.25rem;
}

/* Special sections */
.content > p:first-child {
  font-size: 1.125rem;
  color: var(--text-light);
}

/* Directory structure styling */
ul ul {
  margin-top: 0.5rem;
}

/* Anchor links */
.header-anchor {
  opacity: 0;
  transition: opacity 0.2s;
  margin-left: -1.5rem;
  padding-right: 0.5rem;
  color: var(--primary-color);
}

h2:hover .header-anchor,
h3:hover .header-anchor,
h4:hover .header-anchor {
  opacity: 1;
}

/* Responsive */
@media (max-width: 768px) {
  .container {
    padding: 0 1rem;
  }

  .content {
    padding: 1.5rem;
  }

  .nav-links {
    gap: 1rem;
    font-size: 0.9rem;
  }

  .github-link span {
    display: none;
  }

  h1 {
    font-size: 2rem;
  }

  h2 {
    font-size: 1.5rem;
  }

  pre {
    padding: 1rem;
  }

  table {
    font-size: 0.875rem;
  }

  th, td {
    padding: 0.5rem;
  }
}

/* Smooth scrolling */
html {
  scroll-behavior: smooth;
}

/* Selection color */
::selection {
  background: var(--primary-color);
  color: white;
}

/* Cheatsheet Grid */
.cheatsheet-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.5rem;
  margin: 1.5rem 0 2.5rem 0;
}

.cheatsheet-card {
  background: var(--bg-secondary);
  padding: 1.5rem;
  border-radius: 8px;
  border: 2px solid var(--border-color);
  transition: all 0.2s ease;
}

.cheatsheet-card:hover {
  border-color: var(--primary-color);
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.15);
  transform: translateY(-2px);
}

.cheatsheet-card h3 {
  margin: 0 0 0.5rem 0;
  font-size: 1.25rem;
}

.cheatsheet-card h3 a {
  color: var(--text-color);
  text-decoration: none;
}

.cheatsheet-card h3 a:hover {
  color: var(--primary-color);
}

.cheatsheet-card p {
  margin: 0;
  font-size: 0.9rem;
}

.read-more {
  color: var(--primary-color);
  font-weight: 500;
}

.intro {
  font-size: 1.125rem;
  color: var(--text-light);
  margin-bottom: 2rem;
}

/* Images */
img {
  max-width: 100%;
  height: auto;
  border-radius: 8px;
  margin: 1rem 0;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

/* Cheatsheet Page Styling */
.cheatsheet-header {
  margin-bottom: 2rem;
  padding-bottom: 1rem;
  border-bottom: 2px solid var(--border-color);
}

.cheatsheet-header h1 {
  margin-top: 1rem;
  margin-bottom: 0;
  font-size: 2.25rem;
}

.back-link {
  display: inline-flex;
  align-items: center;
  color: var(--primary-color);
  text-decoration: none;
  font-weight: 500;
  padding: 0.5rem 1rem;
  border-radius: 6px;
  background: var(--bg-secondary);
  transition: all 0.2s;
}

.back-link:hover {
  background: var(--primary-color);
  color: white;
  text-decoration: none;
}

/* Table of Contents */
.toc {
  background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
  padding: 1.5rem 2rem;
  border-radius: 8px;
  margin: 2rem 0;
  border-left: 4px solid var(--primary-color);
  box-shadow: 0 2px 8px rgba(59, 130, 246, 0.1);
}

.toc h2 {
  margin: 0 0 1rem 0;
  font-size: 1.25rem;
  color: var(--primary-color);
  border-top: none;
  padding-top: 0;
}

.toc ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.toc ul li {
  padding: 0.5rem 0;
  margin: 0;
}

.toc ul li:before {
  content: "▸";
  margin-right: 0.5rem;
  color: var(--primary-color);
  font-weight: bold;
}

.toc ul li.toc-sub {
  padding-left: 1.5rem;
  font-size: 0.95rem;
}

.toc ul li.toc-sub:before {
  content: "◦";
  color: var(--secondary-color);
}

.toc a {
  color: var(--text-color);
  text-decoration: none;
  transition: color 0.2s;
}

.toc a:hover {
  color: var(--primary-color);
  text-decoration: none;
}

.cheatsheet-content {
  margin: 2rem 0;
}

/* Section backgrounds */
.cheatsheet-content > h2 {
  margin-top: 3rem;
  padding: 1.5rem 1.5rem 1.5rem 2rem;
  border-top: none;
  font-size: 1.75rem;
  color: white;
  background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(59, 130, 246, 0.2);
  position: relative;
  margin-left: -1rem;
  margin-right: -1rem;
  padding-left: 2rem;
}

.cheatsheet-content > h2:first-child {
  margin-top: 0;
}

.cheatsheet-content h2:before {
  content: "📚";
  position: absolute;
  left: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  font-size: 1.5rem;
}

.cheatsheet-content h3 {
  color: white;
  margin-top: 2rem;
  font-size: 1.35rem;
  font-weight: 600;
  padding: 1rem 1.5rem;
  background: linear-gradient(135deg, var(--accent-color) 0%, #a855f7 100%);
  border-radius: 6px;
  box-shadow: 0 2px 6px rgba(139, 92, 246, 0.15);
  border: none;
}

.cheatsheet-content h4 {
  color: var(--secondary-color);
  font-size: 1.1rem;
  font-weight: 600;
  margin-top: 1.5rem;
  padding: 0.75rem 1rem;
  background: var(--bg-secondary);
  border-left: 4px solid var(--accent-color);
  border-radius: 4px;
}

/* Enhanced code blocks */
.cheatsheet-content pre {
  background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
  color: #e2e8f0;
  padding: 1.5rem;
  border-radius: 8px;
  overflow-x: auto;
  border-left: 4px solid #10b981;
  box-shadow: 0 4px 12px rgba(0,0,0,0.2);
  margin: 1.5rem 0;
  position: relative;
}

.cheatsheet-content pre:before {
  content: "Code";
  position: absolute;
  top: 0.5rem;
  right: 1rem;
  font-size: 0.75rem;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.cheatsheet-content pre code {
  color: #e2e8f0;
  font-size: 0.9rem;
  line-height: 1.7;
}

.cheatsheet-content code {
  background: linear-gradient(135deg, #fce7f3 0%, #fbcfe8 100%);
  color: #e83e8c;
  padding: 0.25rem 0.6rem;
  border-radius: 4px;
  font-size: 0.9em;
  font-weight: 500;
  border: 1px solid #f9a8d4;
}

.cheatsheet-content pre code {
  background: transparent;
  padding: 0;
  border: none;
}

/* Better list styling */
.cheatsheet-content ul {
  list-style: none;
  padding-left: 0;
  background: #f8fafc;
  padding: 1rem 1.5rem;
  border-radius: 6px;
  margin: 1rem 0;
  border-left: 3px solid var(--primary-color);
}

.cheatsheet-content ul li {
  padding-left: 1.5rem;
  position: relative;
  margin-bottom: 0.75rem;
  line-height: 1.7;
}

.cheatsheet-content ul li:before {
  content: "▸";
  position: absolute;
  left: 0;
  color: var(--primary-color);
  font-weight: bold;
  font-size: 1.1em;
}

.cheatsheet-content ul ul {
  margin-top: 0.5rem;
  padding: 0.5rem 0 0.5rem 1.5rem;
  background: transparent;
  border-left: 2px solid var(--accent-color);
}

.cheatsheet-content ul ul li:before {
  content: "◦";
  color: var(--accent-color);
}

.cheatsheet-content ol {
  padding-left: 2rem;
  background: #fef3c7;
  padding: 1rem 1.5rem 1rem 3rem;
  border-radius: 6px;
  margin: 1rem 0;
  border-left: 3px solid #f59e0b;
}

.cheatsheet-content ol li {
  margin-bottom: 0.75rem;
  line-height: 1.7;
}

.cheatsheet-content ol li::marker {
  color: #f59e0b;
  font-weight: bold;
}

/* Cheatsheet footer */
.cheatsheet-footer {
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 2px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
}

.github-edit {
  display: inline-flex;
  align-items: center;
  color: var(--text-light);
  text-decoration: none;
  font-size: 0.9rem;
  transition: color 0.2s;
}

.github-edit:hover {
  color: var(--primary-color);
}

/* Paragraphs in cheatsheet */
.cheatsheet-content > p {
  background: #fefce8;
  padding: 1rem 1.5rem;
  border-radius: 6px;
  margin: 1rem 0;
  line-height: 1.8;
  border-left: 3px solid #eab308;
}

/* Blockquote in cheatsheets */
.cheatsheet-content blockquote {
  background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%);
  border-left: 4px solid #10b981;
  color: var(--text-color);
  font-style: normal;
  padding: 1.25rem 1.75rem;
  border-radius: 6px;
  box-shadow: 0 2px 8px rgba(16, 185, 129, 0.1);
  margin: 1.5rem 0;
  position: relative;
}

.cheatsheet-content blockquote:before {
  content: "💡";
  position: absolute;
  top: 1.25rem;
  left: -0.5rem;
  font-size: 1.5rem;
  background: white;
  border-radius: 50%;
  width: 2rem;
  height: 2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.cheatsheet-content blockquote p {
  margin: 0;
  padding-left: 1.5rem;
}

.cheatsheet-content blockquote p:first-child {
  font-weight: 500;
}

/* Table improvements */
.cheatsheet-content table {
  font-size: 0.95rem;
  background: white;
  margin: 1.5rem 0;
}

.cheatsheet-content table thead {
  background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
}

.cheatsheet-content table th {
  color: white;
  font-weight: 600;
  padding: 1rem 0.75rem;
}

.cheatsheet-content table td {
  padding: 0.875rem 0.75rem;
}

.cheatsheet-content table tbody tr:nth-child(even) {
  background: #f8fafc;
}

.cheatsheet-content table tbody tr:hover {
  background: #e0f2fe;
}

.cheatsheet-content table code {
  font-size: 0.85rem;
}

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

  .cheatsheet-footer {
    flex-direction: column;
    align-items: flex-start;
  }

  .cheatsheet-content pre {
    padding: 1rem;
    font-size: 0.85rem;
  }

  .cheatsheet-header h1 {
    font-size: 1.75rem;
  }

  .cheatsheet-content > h2 {
    font-size: 1.5rem;
    padding: 1rem 1rem 1rem 2.5rem;
    margin-left: 0;
    margin-right: 0;
  }

  .cheatsheet-content h2:before {
    font-size: 1.2rem;
    left: 0.5rem;
  }

  .cheatsheet-content h3 {
    font-size: 1.2rem;
    padding: 0.875rem 1rem;
  }

  .cheatsheet-content h4 {
    font-size: 1rem;
    padding: 0.625rem 0.875rem;
  }

  .toc {
    padding: 1rem 1.25rem;
  }

  .toc h2 {
    font-size: 1.1rem;
  }

  .cheatsheet-content > p {
    padding: 0.875rem 1rem;
    font-size: 0.95rem;
  }

  .cheatsheet-content ul,
  .cheatsheet-content ol {
    padding: 0.875rem 1rem;
    font-size: 0.95rem;
  }

  .cheatsheet-content blockquote {
    padding: 1rem 1.25rem;
    padding-left: 2rem;
  }

  .cheatsheet-content blockquote:before {
    left: -0.75rem;
    font-size: 1.25rem;
    width: 1.75rem;
    height: 1.75rem;
  }

  .cheatsheet-content table {
    font-size: 0.85rem;
  }

  .cheatsheet-content table th,
  .cheatsheet-content table td {
    padding: 0.625rem 0.5rem;
  }
}
