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

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background: #f5f5f5;
  color: #333;
  line-height: 1.6;
}

.container {
  height: 100vh;
  display: flex;
  flex-direction: column;
  background: white;
}

.header {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  padding: 20px 30px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.header h1 {
  font-size: 28px;
  font-weight: 700;
}

.badge {
  background: rgba(255,255,255,0.3);
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 600;
}

.main-content {
  display: flex;
  flex: 1;
  overflow: hidden;
}

.sidebar {
  width: 280px;
  background: #fafafa;
  border-right: 1px solid #e0e0e0;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}

.sidebar-title {
  padding: 15px 20px;
  font-weight: 700;
  font-size: 14px;
  text-transform: uppercase;
  color: #666;
  border-bottom: 1px solid #e0e0e0;
  background: white;
}

.file-list {
  list-style: none;
  padding: 10px;
  flex: 1;
}

.file-list li {
  padding: 12px 15px;
  margin-bottom: 4px;
  cursor: pointer;
  border-radius: 6px;
  font-size: 14px;
  transition: all 0.2s;
  background: white;
  border: 1px solid transparent;
  user-select: none;
}

.file-list li:hover {
  background: #f0f0f0;
  border-color: #ddd;
}

/* Active (selected) file */
.file-list li.active {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  font-weight: 600;
  border-color: #667eea;
}

.file-list li.loading {
  color: #999;
  cursor: default;
  padding: 20px 15px;
  text-align: center;
}

.main-panel {
  flex: 1;
  overflow-y: auto;
  padding: 40px;
  background: #fafafa;
}

.content-area {
  background: white;
  padding: 30px;
  border-radius: 8px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
  max-width: 900px;
  margin: 0 auto;
}

.placeholder {
  color: #999;
  text-align: center;
  padding: 60px 20px;
  font-size: 16px;
}

/* Markdown-like rendering */
.md-content h1,
.md-content h2,
.md-content h3 {
  margin-top: 24px;
  margin-bottom: 12px;
  font-weight: 700;
  color: #222;
}

.md-content h1 {
  font-size: 32px;
  border-bottom: 2px solid #667eea;
  padding-bottom: 8px;
}

.md-content h2 {
  font-size: 24px;
  color: #444;
}

.md-content h3 {
  font-size: 20px;
  color: #666;
}

.md-content p {
  margin-bottom: 16px;
  line-height: 1.7;
}

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

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

.md-content code {
  background: #f4f4f4;
  padding: 2px 6px;
  border-radius: 3px;
  font-family: "Courier New", monospace;
  font-size: 14px;
}

.md-content pre {
  background: #2d2d2d;
  color: #f8f8f2;
  padding: 16px;
  border-radius: 6px;
  overflow-x: auto;
  margin-bottom: 16px;
  font-size: 13px;
  line-height: 1.5;
}

.md-content pre code {
  background: none;
  padding: 0;
  color: inherit;
}

.md-content a {
  color: #667eea;
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: all 0.2s;
}

.md-content a:hover {
  border-bottom-color: #667eea;
}

.md-content table {
  border-collapse: collapse;
  width: 100%;
  margin-bottom: 16px;
}

.md-content th,
.md-content td {
  border: 1px solid #ddd;
  padding: 10px;
  text-align: left;
}

.md-content th {
  background: #f5f5f5;
  font-weight: 700;
}

.md-content blockquote {
  border-left: 4px solid #667eea;
  padding-left: 16px;
  margin-left: 0;
  margin-bottom: 16px;
  color: #666;
  font-style: italic;
}

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

::-webkit-scrollbar-track {
  background: #f1f1f1;
}

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

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

@media (max-width: 768px) {
  .main-content {
    flex-direction: column;
  }

  .sidebar {
    width: 100%;
    max-height: 200px;
  }

  .main-panel {
    padding: 20px;
  }

  .content-area {
    padding: 20px;
  }

  .header {
    flex-direction: column;
    gap: 10px;
    align-items: flex-start;
  }

  .header h1 {
    font-size: 22px;
  }
}