:root {
  --primary-color: #0d1117;
  --secondary-color: #161b22;
  --accent-color: #30363d;
  --text-color: #c9d1d9;
  --hover-color: #21262d;
}

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

body {
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", "Roboto",
    "Oxygen", "Ubuntu", "Cantarell", "Fira Sans", "Droid Sans", "Helvetica Neue",
    sans-serif;
  background-color: var(--primary-color);
  color: var(--text-color);
  line-height: 1.6;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px;
}

.header {
  text-align: center;
  margin-bottom: 30px;
  background-color: var(--secondary-color);
  padding: 30px;
  border-radius: 10px;
}

.header h1 {
  color: #58a6ff;
  margin-bottom: 10px;
  font-size: 2.5rem;
}

.header h4 {
  color: var(--text-color);
  margin-bottom: 15px;
}

.info-text {
  background-color: var(--accent-color);
  padding: 20px;
  border-radius: 8px;
  margin-bottom: 20px;
  font-size: 0.9rem;
  text-wrap: pretty;
  text-align: center;
}

.info-text a {
  color: #58a6ff;
  text-decoration: none;
  font-weight: bold;
}

.form-container {
  display: flex;
  justify-content: center;
  margin-bottom: 30px;
}

.input-group {
  display: flex;
  align-items: center;
  background-color: var(--secondary-color);
  border-radius: 6px;
  padding: 10px;
}

.input-group input {
  background-color: var(--accent-color);
  border: none;
  color: var(--text-color);
  padding: 10px;
  margin-right: 10px;
  border-radius: 4px;
  width: 250px;
}

.input-group input::placeholder {
  color: #6e7681;
}

.submit-btn {
  background-color: #238636;
  color: white;
  font-weight: 600;
  border: none;
  padding: 10px 20px;
  border-radius: 6px;
  cursor: pointer;
  transition: background-color 0.3s ease;
}

.submit-btn:hover {
  background-color: #2ea44f;
}

.results-grid {
  position: relative;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(50px, 1fr));
  justify-content: center;
  padding: 20px;
  overflow-y: auto;
  margin-inline: auto;
}

.avatars {
  display: flex;
  align-items: center;
}

.avatars img {
  border: 2px solid #f0f0f0;
  width: 45px;
  height: 45px;
  transition: transform 0.3s ease;
}

.avatars img:hover {
  transform: scale(1.15);
  z-index: 10;
}

.stats-table {
  width: fit-content;
  justify-content: center;
  margin: 0 auto;
  background-color: var(--secondary-color);
  border-radius: 8px;
}

.stats-table th {
  background-color: var(--accent-color);
  color: #58a6ff;
  padding: 15px;
  text-transform: uppercase;
  font-size: 0.8rem;
}

.stats-table th:first-child {
  border-top-left-radius: 7px;
}

.stats-table th:last-child {
  border-top-right-radius: 7px;
}

.stats-table td {
  padding: 15px;
  text-align: center;
  color: var(--text-color);
}

.options {
  position: fixed;
  bottom: 8px;
  left: 8px;
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 4px 8px;
  background-color: #ffffff0c;
  backdrop-filter: blur(5px);
  border-radius: 4px;
}

.options button {
  border: none;
  border-radius: 4px;
  padding: 2px;
  cursor: pointer;
  background: linear-gradient(to bottom, #f0f0f0, #aaaaaa);
  box-shadow: 1px 2px 3px #0d1117;
}

dialog[open] {
  position: fixed;
  border: none;
  bottom: calc(45% - 50px);
  left: 0;
  width: 40%;
  justify-content: center;
  margin: 0 auto;
  background-color: #c9d1d9;
  border-radius: 10px;
  animation: zoomIn 0.2s ease-in;
  overflow: hidden;
}

dialog header {
  width: 100%;
  padding: 8px;
  border-bottom: 1px solid #b6bbc2;
  display: flex;
  justify-content: space-between;
}

dialog header span {
  font-weight: 400;
  cursor: default;
  margin-inline: 8px;
}

dialog header span:last-child {
  cursor: pointer;
}

#share > i,
#github > i,
#benchmark-js > i,
#personal-web > i {
  margin-right: 8px;
}

dialog li {
  margin: 0;
  list-style: none;
  width: 100%;
  padding: 8px;
  cursor: pointer;
}

dialog li:hover {
  background-color: #aeb5bea8;
}

@keyframes zoomIn {
  from {
    scale: 0.5;
    transform: translateZ(-30%);
  }
  to {
    scale: 1;
    transform: translateZ(0);
  }
}

.loader {
  position: absolute;
  top: 0;
  left: 0;
  display: flex;
  justify-content: center;
  align-items: center;
  height: 200px;
  width: 100%;
}

.spinner {
  width: 50px;
  height: 50px;
  border: 5px solid rgba(88, 166, 255, 0.2);
  border-top: 5px solid #58a6ff;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

#errors {
  display: flex;
  text-align: center;
  margin: 45px auto;
}

#api-stats {
  text-align: center;
}

footer {
  text-align: center;
  margin-top: 20px auto;
}

footer a {
  text-decoration: none;
  color: #f0f0f0;
}

footer a:hover {
  color: #58a6ff;
  transition: color 0.2s ease-in-out;
}

@media (max-width: 600px) {
  .input-group {
    flex-direction: column;
  }

  .input-group input {
    width: 100%;
    margin-bottom: 10px;
    margin-right: 0;
  }

  dialog[open] {
    width: 90%;
  }

  .options span {
    display: none;
  }
}
