/* Repository card grid */
.repos {
  display: grid;
  gap: 20px;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
}

.repo {
  background: white;
  padding: 20px;
  border-radius: 8px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
  transition: all 0.2s ease;
}

.repo:hover {
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  transform: translateY(-2px);
}

.repo h2 {
  margin-top: 0;
  color: #2c3e50;
  font-size: 18px;
}

.repo p {
  margin: 10px 0;
  color: #666;
  font-size: 14px;
}

/* Header and container styling */
header {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  padding: 20px;
  margin-bottom: 20px;
  border-radius: 4px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

header h1 {
  margin: 0 0 10px 0;
  font-size: 28px;
}

header .repo-meta {
  color: rgba(255,255,255,0.9);
  font-size: 14px;
}

header .repo-meta a {
  color: #fff;
  text-decoration: none;
  font-weight: 500;
}

header .repo-meta a:hover {
  text-decoration: underline;
}

#branch-selector {
  margin-left: 10px;
  padding: 6px 12px;
  border: none;
  border-radius: 4px;
  background: white;
  color: #333;
  font-size: 14px;
  cursor: pointer;
}

#branch-selector:hover {
  background: #f0f0f0;
}

/* Main layout container */
.layout {
  display: flex;
  gap: 20px;
  min-height: calc(100vh - 200px);
}

/* Sidebar (tree) */
.sidebar {
  flex: 0 0 300px;
  background: white;
  padding: 20px;
  border-radius: 8px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
  overflow-y: auto;
  max-height: 600px;
}

.sidebar h3 {
  margin: 0 0 15px 0;
  font-size: 16px;
  color: #333;
  border-bottom: 2px solid #667eea;
  padding-bottom: 10px;
}

.sidebar ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.sidebar li {
  padding: 8px 12px;
  cursor: pointer;
  border-radius: 4px;
  transition: all 0.2s ease;
  margin-bottom: 4px;
}

.sidebar li:hover {
  background: #f5f5f5;
  transform: translateX(4px);
}

.sidebar .tree-directory strong {
  color: #667eea;
  font-weight: 600;
}

.sidebar .tree-directory:hover strong {
  color: #764ba2;
}

.sidebar .tree-file {
  color: #555;
}

/* Content area */
.content {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

#file-content {
  background: white;
  padding: 20px;
  border-radius: 8px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
  display: none;
}

#file-content.visible {
  display: block;
}

#file-content h2 {
  margin: 0 0 15px 0;
  font-size: 18px;
  color: #333;
  border-bottom: 1px solid #eee;
  padding-bottom: 10px;
}

/* Code styling */
code {
  font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', 'Courier New', monospace;
  font-size: 13px;
  background: #f5f5f5;
  padding: 2px 6px;
  border-radius: 3px;
  color: #d63384;
}

pre {
  font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', 'Courier New', monospace;
  font-size: 12px;
  background: #f8f8f8;
  border: 1px solid #ddd;
  border-radius: 4px;
  padding: 12px;
  overflow-x: auto;
  white-space: pre-wrap;
  word-wrap: break-word;
  line-height: 1.4;
  color: #333;
}

pre code {
  background: none;
  padding: 0;
  color: #333;
}

/* Commit log styling */
#commit-log {
  background: white;
  padding: 20px;
  border-radius: 8px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

#commit-log h3 {
  margin: 0 0 15px 0;
  font-size: 16px;
  color: #333;
  border-bottom: 2px solid #667eea;
  padding-bottom: 10px;
}

.commit-item {
  padding: 12px 0;
  border-bottom: 1px solid #eee;
  transition: all 0.2s ease;
}

.commit-item:last-child {
  border-bottom: none;
}

.commit-item:hover {
  background: #f9f9f9;
  padding-left: 8px;
  margin-left: -8px;
  border-radius: 4px;
}

.commit-hash {
  font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', 'Courier New', monospace;
  font-size: 12px;
  color: #667eea;
  font-weight: 600;
}

.commit-message {
  font-size: 14px;
  color: #333;
  margin-top: 4px;
}

.commit-author {
  font-size: 12px;
  color: #999;
  margin-top: 4px;
}

/* Responsive design for mobile */
@media (max-width: 1024px) {
  .layout {
    flex-direction: column;
    min-height: auto;
  }

  .sidebar {
    flex: 1;
    max-height: 400px;
  }

  .content {
    flex: 1;
  }
}

@media (max-width: 768px) {
  header {
    padding: 15px;
  }

  header h1 {
    font-size: 22px;
  }

  .layout {
    gap: 15px;
  }

  .sidebar {
    max-height: 300px;
    padding: 15px;
  }

  .content {
    gap: 15px;
  }

  #file-content {
    padding: 15px;
  }

  pre {
    font-size: 11px;
    padding: 10px;
  }

  code {
    font-size: 12px;
  }
}

@media (max-width: 480px) {
  header {
    padding: 10px;
    margin-bottom: 15px;
  }

  header h1 {
    font-size: 18px;
    margin-bottom: 8px;
  }

  header .repo-meta {
    font-size: 12px;
  }

  #branch-selector {
    margin-left: 5px;
    padding: 4px 8px;
    font-size: 12px;
  }

  .layout {
    gap: 10px;
  }

  .sidebar {
    flex: 0 0 auto;
    max-height: 250px;
    padding: 10px;
  }

  .sidebar li {
    padding: 6px 8px;
    margin-bottom: 2px;
  }

  #file-content {
    padding: 10px;
  }

  #file-content h2 {
    font-size: 16px;
    margin-bottom: 10px;
  }

  pre {
    font-size: 11px;
    padding: 8px;
  }
}
