:root {
  --primary-color: #90caf9;
  --secondary-color: #ce93d8;
  --background-color: #121212;
  --surface-color: #1e1e1e;
  --card-color: #252525;
  --text-primary: rgba(255, 255, 255, 0.87);
  --text-secondary: rgba(255, 255, 255, 0.6);
  --divider-color: rgba(255, 255, 255, 0.12);
  --error-color: #f44336;
  --success-color: #4caf50;
  --sidebar-width: 280px;
  --header-height: 64px;
  --transition-speed: 0.3s;
}

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

body {
  font-family: 'Roboto', sans-serif;
  background-color: var(--background-color);
  color: var(--text-primary);
  line-height: 1.6;
}

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

ul {
  list-style: none;
}

/* Layout */
.app-container {
  display: flex;
  min-height: 100vh;
}

/* Sidebar */
.sidebar {
  width: var(--sidebar-width);
  background-color: var(--surface-color);
  position: fixed;
  top: 0;
  left: 0;
  height: 100vh;
  overflow-y: auto;
  z-index: 1000;
  transition: transform var(--transition-speed);
  border-right: 1px solid var(--divider-color);
}

.sidebar-header {
  padding: 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--divider-color);
}

.sidebar-header h2 {
  font-size: 1.25rem;
  font-weight: 500;
}

.close-sidebar-btn {
  display: none;
  background: none;
  border: none;
  color: var(--text-primary);
  cursor: pointer;
}

.sidebar-nav ul {
  padding: 16px 0;
}

.sidebar-nav li {
  margin-bottom: 4px;
}

.sidebar-nav a {
  display: block;
  padding: 12px 16px;
  color: var(--text-primary);
  transition: background-color 0.2s;
  border-radius: 4px;
  margin: 0 8px;
}

.sidebar-nav a:hover {
  background-color: rgba(255, 255, 255, 0.08);
}

.sidebar-nav a.active {
  background-color: rgba(144, 202, 249, 0.16);
  color: var(--primary-color);
}

/* Main Content */
.main-content {
  flex: 1;
  margin-left: var(--sidebar-width);
  transition: margin-left var(--transition-speed);
}

.header {
  height: var(--header-height);
  background-color: var(--surface-color);
  display: flex;
  align-items: center;
  padding: 0 16px;
  position: sticky;
  top: 0;
  z-index: 900;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.header h1 {
  flex: 1;
  font-size: 1.25rem;
  font-weight: 500;
  text-align: center;
}

.menu-toggle {
  background: none;
  border: none;
  color: var(--text-primary);
  cursor: pointer;
  display: none;
}

.github-link {
  color: var(--text-primary);
  display: flex;
  align-items: center;
}

.content {
  padding: 24px;
  max-width: 1200px;
  margin: 0 auto;
}

/* Hero Section */
.hero {
  text-align: center;
  margin-bottom: 48px;
}

.hero h2 {
  font-size: 2rem;
  margin-bottom: 24px;
  font-weight: 400;
}

.hero-buttons {
  display: flex;
  justify-content: center;
  gap: 16px;
  flex-wrap: wrap;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  padding: 10px 16px;
  border-radius: 4px;
  font-weight: 500;
  transition: background-color 0.2s;
  cursor: pointer;
}

.btn .material-icons {
  margin-right: 8px;
}

.primary {
  background-color: var(--primary-color);
  color: #000;
}

.primary:hover {
  background-color: #64b5f6;
}

.secondary {
  background-color: transparent;
  color: var(--primary-color);
  border: 1px solid var(--primary-color);
}

.secondary:hover {
  background-color: rgba(144, 202, 249, 0.08);
}

/* Feature Cards */
.features {
  margin-bottom: 48px;
}

.features h2 {
  font-size: 1.75rem;
  margin-bottom: 24px;
  font-weight: 400;
}

.feature-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 24px;
}

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

.feature-icon {
  font-size: 2.5rem;
  color: var(--primary-color);
  margin-bottom: 16px;
}

.card h3 {
  font-size: 1.25rem;
  margin-bottom: 12px;
  font-weight: 500;
}

.card p {
  color: var(--text-secondary);
}

/* Data Structure Grid */
.data-structures h2 {
  font-size: 1.75rem;
  margin-bottom: 24px;
  font-weight: 400;
}

.ds-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px;
}

.ds-card {
  background-color: var(--card-color);
  border-radius: 8px;
  padding: 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  color: var(--text-primary);
  transition: transform 0.2s, box-shadow 0.2s;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.ds-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2);
}

.ds-icon {
  font-size: 2.5rem;
  color: var(--primary-color);
  margin-bottom: 16px;
}

.ds-card h3 {
  font-size: 1.1rem;
  font-weight: 500;
}

/* Footer */
.footer {
  padding: 24px;
  text-align: center;
  color: var(--text-secondary);
  border-top: 1px solid var(--divider-color);
  margin-top: 48px;
}

/* Content Page Styles */
.content-page {
  max-width: 900px;
  margin: 0 auto;
}

.content-page h1 {
  font-size: 2.5rem;
  margin-bottom: 24px;
  font-weight: 500;
}

.content-page h2 {
  font-size: 2rem;
  margin-top: 48px;
  margin-bottom: 16px;
  font-weight: 500;
}

.content-page h3 {
  font-size: 1.5rem;
  margin-top: 32px;
  margin-bottom: 12px;
  font-weight: 500;
}

.content-page p {
  margin-bottom: 16px;
}

.content-page ul, .content-page ol {
  margin-bottom: 16px;
  padding-left: 24px;
}

.content-page li {
  margin-bottom: 8px;
}

.content-page code {
  font-family: 'Roboto Mono', monospace;
  background-color: rgba(255, 255, 255, 0.1);
  padding: 2px 4px;
  border-radius: 3px;
}

.content-page pre {
  margin-bottom: 24px;
  position: relative;
}

.content-page pre code {
  display: block;
  overflow-x: auto;
  padding: 16px;
  background-color: #1a1a1a;
  border-radius: 4px;
}

.copy-btn {
  position: absolute;
  top: 8px;
  right: 8px;
  background-color: rgba(255, 255, 255, 0.1);
  border: none;
  border-radius: 4px;
  color: var(--text-primary);
  padding: 4px 8px;
  font-size: 12px;
  cursor: pointer;
  transition: background-color 0.2s;
}

.copy-btn:hover {
  background-color: rgba(255, 255, 255, 0.2);
}

.table-of-contents {
  background-color: var(--card-color);
  border-radius: 8px;
  padding: 16px;
  margin-bottom: 24px;
  top: 80px;
}

.table-of-contents h3 {
  font-size: 1.1rem;
  margin-top: 0;
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--divider-color);
}

.table-of-contents ul {
  padding-left: 16px;
}

.table-of-contents li {
  margin-bottom: 8px;
}

.table-of-contents a {
  color: var(--text-primary);
  transition: color 0.2s;
}

.table-of-contents a:hover {
  color: var(--primary-color);
}

/* Responsive Styles */
@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-100%);
  }
  
  .sidebar.open {
    transform: translateX(0);
  }
  
  .close-sidebar-btn {
    display: block;
  }
  
  .main-content {
    margin-left: 0;
  }
  
  .menu-toggle {
    display: block;
  }
  
  .header h1 {
    font-size: 1.1rem;
  }
  
  .hero h2 {
    font-size: 1.5rem;
  }
  
  .content {
    padding: 16px;
  }
  
  .feature-cards {
    grid-template-columns: 1fr;
  }
  
  .ds-grid {
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  }
  
  .content-page h1 {
    font-size: 2rem;
  }
  
  .content-page h2 {
    font-size: 1.5rem;
  }
  
  .content-page h3 {
    font-size: 1.25rem;
  }
}

/* Table Styles */
table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 24px;
  background-color: var(--card-color);
  border-radius: 4px;
  overflow: hidden;
}

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

th {
  background-color: rgba(255, 255, 255, 0.05);
  font-weight: 500;
}

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

/* Notification */
.notification {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background-color: var(--success-color);
  color: white;
  padding: 12px 24px;
  border-radius: 4px;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
  transform: translateY(100px);
  opacity: 0;
  transition: transform 0.3s, opacity 0.3s;
  z-index: 1100;
}

.notification.show {
  transform: translateY(0);
  opacity: 1;
}

/* Scrollbar */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: var(--background-color);
}

::-webkit-scrollbar-thumb {
  background: #555;
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: #777;
}
