/* Reset and base styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen,
    Ubuntu, Cantarell, sans-serif;
  line-height: 1.6;
  color: #333;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  min-height: 100vh;
}

.container {
  max-width: 900px;
  margin: 0 auto;
  padding: 20px;
  background: white;
  min-height: 100vh;
  box-shadow: 0 0 20px rgba(0, 0, 0, 0.1);
}

/* Header styles */
header {
  text-align: center;
  margin-bottom: 40px;
  padding: 40px 0;
  border-bottom: 2px solid #f0f0f0;
}

header h1 {
  font-size: 2.5rem;
  color: #2c3e50;
  margin-bottom: 10px;
}

header p {
  color: #7f8c8d;
  font-size: 1.1rem;
}

/* Navigation */
.nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 30px;
  padding-bottom: 15px;
  border-bottom: 1px solid #eee;
}

.back-link {
  color: #667eea;
  text-decoration: none;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 8px 15px;
  border-radius: 5px;
  transition: all 0.3s ease;
}

.back-link:hover {
  background: #f8f9ff;
  color: #5a67d8;
}

.file-name {
  color: #666;
  font-family: 'Courier New', monospace;
  background: #f8f9fa;
  padding: 5px 10px;
  border-radius: 3px;
  font-size: 0.9rem;
}

/* File list styles */
.file-list {
  display: grid;
  gap: 15px;
  margin-bottom: 40px;
}

.file-item {
  background: #fff;
  border: 1px solid #e1e8ed;
  border-radius: 8px;
  transition: all 0.3s ease;
  overflow: hidden;
}

.file-item:hover {
  border-color: #667eea;
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.15);
  transform: translateY(-2px);
}

.file-link {
  display: block;
  padding: 20px;
  text-decoration: none;
  color: #2c3e50;
  font-weight: 500;
  font-size: 1.1rem;
  transition: color 0.3s ease;
}

.file-link:hover {
  color: #667eea;
}

.no-files {
  text-align: center;
  padding: 60px 20px;
  color: #95a5a6;
  font-size: 1.1rem;
  background: #f8f9fa;
  border-radius: 8px;
  border: 2px dashed #dee2e6;
}

/* Markdown content styles */
.markdown-content {
  max-width: none;
  line-height: 1.7;
}

.markdown-content h1,
.markdown-content h2,
.markdown-content h3,
.markdown-content h4,
.markdown-content h5,
.markdown-content h6 {
  margin: 30px 0 15px 0;
  color: #2c3e50;
  font-weight: 600;
}

.markdown-content h1 {
  font-size: 2.2rem;
  border-bottom: 3px solid #667eea;
  padding-bottom: 10px;
}

.markdown-content h2 {
  font-size: 1.8rem;
  border-bottom: 2px solid #ecf0f1;
  padding-bottom: 8px;
}

.markdown-content h3 {
  font-size: 1.4rem;
  color: #34495e;
}

.markdown-content p {
  margin: 15px 0;
}

.markdown-content ul,
.markdown-content ol {
  margin: 15px 0;
  padding-left: 30px;
}

.markdown-content li {
  margin: 5px 0;
}

.markdown-content blockquote {
  border-left: 4px solid #667eea;
  margin: 20px 0;
  padding: 15px 20px;
  background: #f8f9ff;
  font-style: italic;
  color: #555;
}

.markdown-content pre {
  background: #f8f9fa;
  border: 1px solid #e9ecef;
  border-radius: 6px;
  padding: 15px;
  overflow-x: auto;
  margin: 20px 0;
  font-size: 0.9rem;
}

.markdown-content code {
  background: #f1f3f4;
  padding: 2px 6px;
  border-radius: 3px;
  font-family: 'Courier New', monospace;
  font-size: 0.9rem;
  color: #d73a49;
}

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

.markdown-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 20px 0;
  overflow-x: auto;
  display: block;
  white-space: nowrap;
}

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

.markdown-content th {
  background: #f8f9fa;
  font-weight: 600;
  color: #495057;
}

.markdown-content tr:nth-child(even) {
  background: #f8f9fa;
}

.markdown-content a {
  color: #667eea;
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: border-color 0.3s ease;
}

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

.markdown-content img {
  max-width: 100%;
  height: auto;
  border-radius: 6px;
  margin: 20px 0;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.markdown-content hr {
  border: none;
  border-top: 2px solid #ecf0f1;
  margin: 40px 0;
}

/* Footer */
footer {
  text-align: center;
  padding: 40px 0;
  color: #95a5a6;
  border-top: 1px solid #ecf0f1;
  margin-top: 40px;
}

footer code {
  background: #f8f9fa;
  padding: 2px 6px;
  border-radius: 3px;
  font-family: 'Courier New', monospace;
}

/* Responsive design */
@media (max-width: 768px) {
  .container {
    padding: 15px;
  }

  header h1 {
    font-size: 2rem;
  }

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

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

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

/* Search and Filter Styles */
.search-container {
  margin-bottom: 30px;
}

.search-input {
  width: 100%;
  padding: 12px 20px;
  font-size: 16px;
  border: 2px solid #e1e8ed;
  border-radius: 25px;
  outline: none;
  transition: border-color 0.3s ease;
  background: #fff;
}

.search-input:focus {
  border-color: #667eea;
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.search-input::placeholder {
  color: #95a5a6;
}

/* Tab Styles */
.tabs-container {
  margin-bottom: 30px;
}

.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  border-bottom: 2px solid #f0f0f0;
  margin-bottom: 20px;
}

.tab {
  background: none;
  border: none;
  padding: 12px 20px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  color: #666;
  border-radius: 8px 8px 0 0;
  transition: all 0.3s ease;
  position: relative;
}

.tab:hover {
  background: #f8f9ff;
  color: #667eea;
}

.tab.active {
  background: #667eea;
  color: white;
}

.tab.active::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  right: 0;
  height: 2px;
  background: #667eea;
}

/* File count badge */
.tab-count {
  background: rgba(255, 255, 255, 0.3);
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 12px;
  margin-left: 8px;
}

.tab.active .tab-count {
  background: rgba(255, 255, 255, 0.3);
}

.tab:not(.active) .tab-count {
  background: #e1e8ed;
  color: #666;
}

/* File list improvements */
.file-item.hidden {
  display: none;
}

.no-results {
  text-align: center;
  padding: 40px 20px;
  color: #95a5a6;
  font-size: 1.1rem;
  background: #f8f9fa;
  border-radius: 8px;
  border: 2px dashed #dee2e6;
  display: none;
}

.file-path {
  font-size: 0.8rem;
  color: #95a5a6;
  font-family: 'Courier New', monospace;
  margin-top: 5px;
}

/* Additional responsive styles for new features */
@media (max-width: 768px) {
  .tabs {
    flex-direction: column;
  }

  .tab {
    border-radius: 8px;
    margin-bottom: 5px;
  }

  .tab.active::after {
    display: none;
  }

  .search-input {
    font-size: 16px; /* Prevent zoom on iOS */
  }
}
