/* Base styles */
body {
  font-family:
    system-ui,
    -apple-system,
    sans-serif;
  margin: 0;
  padding: 0;
  background-color: #0d1117;
  color: #c9d1d9;
}

body * {
  box-sizing: border-box;
}

/* Layout */
.app-layout {
  display: grid;
  grid-template-columns: minmax(300px, 400px) 1fr minmax(300px, 400px);
  min-height: 100vh;
  width: 100vw;
}

/* Sidebar */
.sidebar {
  padding: 20px;
  overflow-y: auto;
  height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 20px;
  background-color: #0d1117;
}

/* Main content */
.main-content {
  padding: 20px;
  overflow-y: auto;
  height: 100vh;
  background-color: #0d1117;
}

.header h1 {
  font-size: 24px;
  margin-bottom: 5px;
}

.header h1 a {
  color: #f0f6fc;
  text-decoration: none;
  font-weight: bold;
}

.header h2 {
  font-size: 14px;
  color: #8b949e;
  margin-bottom: 15px;
}

.header-links {
  display: flex;
  gap: 15px;
  font-size: 12px;
}

.header-links a {
  color: #58a6ff;
}

/* Sections */
.section-title {
  font-size: 12px;
  color: #8b949e;
  margin-bottom: 10px;
}

/* Forms */
.form {
  margin-bottom: 15px;
}

.form-row {
  display: flex;
  gap: 10px;
}

.input {
  flex: 1;
  padding: 8px;
  border: 1px solid #30363d;
  border-radius: 4px;
  background-color: #0d1117;
  color: #c9d1d9;
}

.small-input {
  flex: 1;
  padding: 8px;
  border: 1px solid #30363d;
  border-radius: 4px;
  font-size: 12px;
  background-color: #0d1117;
  color: #c9d1d9;
}

/* Buttons */
.primary-btn {
  padding: 8px 15px;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  background-color: #238636;
  color: white;
}

.primary-btn[disabled] {
  background-color: #21262d;
  color: #484f58;
}

.secondary-btn {
  padding: 8px 15px;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  background-color: #21262d;
  color: #c9d1d9;
  border: 1px solid #30363d;
}

.small-btn {
  padding: 4px 8px;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-size: 12px;
  background-color: #21262d;
  color: #c9d1d9;
  border: 1px solid #30363d;
}

.active-tag-btn {
  padding: 4px 8px;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-size: 12px;
  background-color: #238636;
  color: white;
}

.exclude-tag-btn {
  padding: 4px 8px;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-size: 12px;
  background-color: #da3633;
  color: white;
}

/* Tags */
.tag {
  padding: 2px 6px;
  background-color: #1c2128;
  color: #58a6ff;
  border-radius: 3px;
  font-size: 11px;
}

.tag-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

/* Repository list */
.repo-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 12px;
}

.repo-list a {
  color: #58a6ff;
  text-decoration: none;
}

/* Events */
.events-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 30px;
}

.event-card {
  padding: 15px;
  border: 1px solid #30363d;
  border-radius: 4px;
  background-color: #161b22;
  transition: background-color 0.2s;
}

.event-card:hover {
  background-color: #1c2128;
}

.event-header {
  margin-bottom: 10px;
}

.event-link {
  color: #58a6ff;
  text-decoration: none;
  font-weight: 500;
  font-size: 14px;
}

.event-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  font-size: 12px;
  color: #8b949e;
}

.event-changes {
  color: #28a745;
}

.event-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.event-description {
  margin-top: 10px;
  color: #8b949e;
  font-size: 13px;
  line-height: 1.4;
}

/* Report section */
.report-section {
  margin-bottom: 30px;
}

.report-summary {
  margin-bottom: 20px;
}

.report-summary h3 {
  font-size: 18px;
  margin-bottom: 10px;
}

.report-summary p {
  color: #8b949e;
  line-height: 1.6;
}

.suggestions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 20px;
}

.suggestion {
  padding: 8px 12px;
  background-color: #21262d;
  color: #c9d1d9;
  text-decoration: none;
  border-radius: 4px;
  font-size: 14px;
}

/* Visualization */
.visualization {
  margin-top: 30px;
  padding: 20px;
  background-color: #161b22;
  border-radius: 4px;
}

.visualization h3 {
  font-size: 18px;
  margin-bottom: 10px;
}

.visualization p {
  color: #8b949e;
}

/* Empty state */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  color: #8b949e;
}

.empty-state h2 {
  font-size: 24px;
  margin-bottom: 10px;
}

.empty-state p {
  font-size: 16px;
}

/* Claude section */
.claude-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.select {
  padding: 8px;
  border: 1px solid #30363d;
  border-radius: 4px;
  font-size: 14px;
  background-color: #0d1117;
  color: #c9d1d9;
  width: 100%;
}

.claude-stats {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: #8b949e;
}

.api-preview {
  background-color: #161b22;
  border: 1px solid #30363d;
  border-radius: 4px;
  padding: 12px;
  font-family: monospace;
  font-size: 12px;
  line-height: 1.4;
  overflow-x: auto;
  margin-top: 20px;
}

/* Filter info */
.filter-count.filter-info {
  font-size: 12px;
  color: #8b949e;
  margin-bottom: 15px;
}

/* Progress bars */
.progress-container {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  background: #0d1117;
  border-bottom: 1px solid #30363d;
}

.progress-item {
  margin-bottom: 4px;
}

.progress-label {
  font-size: 12px;
  color: #8b949e;
  margin-bottom: 2px;
}

.progress-bar-container {
  width: 100%;
  height: 4px;
  background: #21262d;
  border-radius: 2px;
  overflow: hidden;
}

.progress-bar-fill {
  height: 100%;
  background: #4caf50;
  transition: width 0.3s ease;
}

/* Error display */
.error-container {
  position: fixed;
  bottom: 20px;
  right: 20px;
  max-width: 400px;
  z-index: 1001;
}

.error-item {
  background: #da3633;
  color: white;
  padding: 12px;
  margin-bottom: 8px;
  border-radius: 4px;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
  display: flex;
  justify-content: space-between;
  align-items: start;
}

.error-message {
  flex: 1;
  margin-right: 8px;
  font-size: 14px;
}

.error-close {
  background: transparent;
  border: none;
  color: white;
  font-size: 18px;
  cursor: pointer;
  padding: 0;
  margin: 0;
  line-height: 1;
  opacity: 0.8;
  transition: opacity 0.2s;
}

.error-close:hover {
  opacity: 1;
}

/* Responsive layout */
@media (max-width: 1200px) {
  .app-layout {
    grid-template-columns: minmax(280px, 300px) 1fr minmax(280px, 300px);
  }
}

@media (max-width: 900px) {
  .app-layout {
    grid-template-columns: 1fr;
    grid-template-rows: auto auto auto;
  }

  .sidebar {
    height: auto;
    max-height: 50vh;
  }

  .main-content {
    height: auto;
  }
}
