* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}
body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
  background-color: #f6f8fa;
  color: #24292e;
  line-height: 1.5;
  padding: 20px;
}
.container {
  max-width: 720px;
  margin: 0 auto;
}
h1 {
  margin-bottom: 20px;
  text-align: center;
}
.filter-container {
  display: flex;
  gap: 10px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}
.filter-select {
  flex: 1;
  min-width: 150px;
  padding: 8px 12px;
  border-radius: 6px;
  border: 1px solid #e1e4e8;
  background-color: #fff;
  font-size: 14px;
  color: #24292e;
  cursor: pointer;
  outline: none;
  transition: border-color 0.2s;
}
.filter-select:hover, .filter-select:focus {
  border-color: #0366d6;
}
.filter-button {
  padding: 8px 16px;
  border-radius: 6px;
  border: none;
  background-color: #0366d6;
  color: white;
  font-weight: 500;
  cursor: pointer;
  transition: background-color 0.2s;
}
.filter-button:hover {
  background-color:rgb(2, 83, 175);
}
.repo-list {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
}
.repo-card {
  background-color: #ffffff;
  border-radius: 6px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
  padding: 20px;
  position: relative;
  transition: transform 0.2s;
}
.repo-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}
.repo-top {
  display: flex;
  margin-bottom: 5px;
  padding-left: 40px; /* Space for rank */
}
.repo-logo {
  width: 60px;
  height: 60px;
  margin-right: 15px;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 60px; /* Ensure minimum width */
  min-height: 60px; /* Ensure minimum height */
}
.repo-logo img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain; /* Maintain aspect ratio */
  border-radius: 4px;
}
.repo-header-content {
  flex: 1;
  display: flex;
  flex-direction: column;
}
.repo-name {
  font-size: 18px;
  font-weight: 600;
  color: #0366d6;
  text-decoration: none;
  margin-bottom: 8px;
}
.repo-name:hover {
  text-decoration: underline;
}
.repo-stats {
  display: flex;
  flex-wrap: wrap;
  font-size: 14px;
  color: #586069;
}
.repo-stat {
  display: flex;
  align-items: center;
  margin-right: 16px;
  margin-bottom: 4px;
}
.repo-stat svg {
  margin-right: 4px;
  fill: currentColor;
}
.repo-description {
  color: #586069;
  font-size: 14px;
  padding-left: 40px; /* Align with content above */
  line-height: 1.5;
}
.rank {
  position: absolute;
  top: 20px;
  left: 20px;
  font-size: 20px;
  color: #24292e;
}
.updated {
  text-align: center;
  font-size: 12px;
  color: #586069;
  margin-top: 20px;
}
.pagination {
  display: flex;
  justify-content: center;
  margin: 20px 0;
  gap: 5px;
}
.page-link {
  display: inline-block;
  padding: 8px 12px;
  border-radius: 4px;
  background-color: #f6f8fa;
  color: #0366d6;
  text-decoration: none;
  border: 1px solid #e1e4e8;
  transition: background-color 0.2s;
  cursor: pointer;
}
.page-link:hover {
  background-color: #e1e4e8;
}
.page-link.current {
  background-color: #0366d6;
  color: white;
  border-color: #0366d6;
}
.page-link.disabled {
  color: #8b949e;
  pointer-events: none;
  cursor: default;
}
.stats-summary {
  background-color: #f6f8fa;
  border-radius: 6px;
  padding: 2px;
  margin-bottom: 20px;
  font-size: 14px;
  color: #586069;
}
.loading {
  text-align: center;
  padding: 40px;
  color: #586069;
}
.error {
  text-align: center;
  padding: 40px;
  color: #d73a49;
}
@media (max-width: 600px) {
  body {
    padding: 10px;
  }
  .filter-container {
    flex-direction: column;
  }
  .filter-select, .filter-button {
    width: 100%;
  }
  .repo-card {
    padding: 15px;
    display: block;
    position: relative;
  }
  .rank {
    position: absolute;
    top: 15px;
    left: 15px;
    font-size: 16px;
    margin-right: 10px;
  }
  .repo-top {
    display: flex;
    margin-bottom: 5px;
    padding-left: 30px; /* Space for rank */
  }
  .repo-logo {
    width: 48px;
    height: 48px;
    min-width: 48px;
    min-height: 48px;
    margin-right: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
  }
  .repo-logo img {
    max-width: 100%;
    max-height: 100%;
    border-radius: 4px;
  }
  .repo-header-content {
    flex: 1;
    display: flex;
    flex-direction: column;
  }
  .repo-name {
    font-size: 16px;
    font-weight: 600;
    color: #0366d6;
    text-decoration: none;
    margin-bottom: 5px;
  }
  .repo-stats {
    display: flex;
    flex-wrap: wrap;
    font-size: 14px;
    color: #586069;
  }
  .repo-stat {
    display: flex;
    align-items: center;
    margin-right: 12px;
    margin-bottom: 4px;
  }
  .repo-stat svg {
    margin-right: 4px;
    fill: currentColor;
  }
  .repo-description {
    font-size: 13px;
    color: #586069;
    padding-left: 30px; /* Align with content above */
    line-height: 1.4;
  }
  .pagination {
    flex-wrap: wrap;
  }
  .page-link {
    padding: 6px 10px;
    font-size: 14px;
  }
}
/* Extra small devices */
@media (max-width: 400px) {
  .repo-card {
    padding: 12px;
  }
  .rank {
    top: 12px;
    left: 12px;
    font-size: 15px;
  }
  .repo-top {
    padding-left: 25px; /* Less space for rank */
  }
  .repo-logo {
    width: 40px;
    height: 40px;
    min-width: 40px;
    min-height: 40px;
    margin-right: 10px;
  }
  .repo-stats {
    font-size: 12px;
  }
  .repo-stat {
    margin-right: 8px;
  }
  .repo-stat svg {
    width: 14px;
    height: 14px;
  }
  .repo-name {
    font-size: 14px;
  }
  .repo-description {
    font-size: 12px;
    padding-left: 25px; /* Match top padding */
  }
}