@font-face {
  font-family: "roboto";
  src: url("../fonts/Roboto.ttf");
  font-weight: 100 900;
  font-display: fallback;
}
@font-face {
  font-family: "jet";
  src: url("../fonts/JetBrainsMono.ttf");
  font-weight: 100 900;
  font-display: fallback;
}

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}
.container li {
  list-style: none;
}
.btn-prime {
  padding: 0.7rem 1.8rem;
  background: #1f883d;
  color: #fff;
  border: 1px solid rgba(31 35 40 / 15%);
  box-shadow:
    0 1px 1px 0 rgba(31 35 40 / 4%),
    0 1px 2px 0 rgba(31 35 40 / 3%);
}
.btn-prime:hover {
  background: #1c8139;
}
.btn-prime:focus {
  background: #197935;
}
body {
  background-color: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.7;
  padding: 2rem 1rem;
}
body,
button,
input {
  font-family: "roboto";
}
code[class*="language-"],
pre[class*="language-"] {
  font-family: "jet" !important;
}
.clr-bg {
  background: center / cover no-repeat url("../bg.png");
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100vh;
  z-index: -1;
}

.container {
  max-width: 960px;
  margin: auto;
}

.app-header {
  text-align: center;
  margin: 0 auto 4rem;
  width: 90%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.app-header h1 {
  font-weight: 300;
  font-size: 48px;
  color: var(--text-primary);
  margin-bottom: 0.3rem;
  display: flex;
  align-items: center;
  justify-content: center;
  column-gap: 6px;
}

.app-header svg {
  stroke: var(--text-primary);
}

.search-bar {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 2rem;
}
.search-bar input {
  flex: 1;
  padding: 0.7rem 1rem;
  border: 1px solid var(--border-color);
  border-radius: 10px;
  font-size: 1rem;
  background: var(--bg-card);
  color: var(--text-muted);
  transition: border-color 0.2s;
}
.search-bar input:focus {
  outline: 2px solid #0969da;
  border-color: #0969da;
  outline-offset: -1px;
}
.search-bar button {
  border-radius: 12px;
  font-size: 1rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.2s;
  letter-spacing: 4px;
  text-transform: uppercase;
}
.search-bar input:-webkit-autofill,
.search-bar input:-webkit-autofill:hover,
.search-bar input:-webkit-autofill:focus,
.search-bar input:-internal-autofill-selected,
.search-bar input:-internal-autofill-previewed {
  -webkit-box-shadow: 0 0 0 1000px var(--bg-card) inset !important;
  box-shadow: 0 0 0 1000px var(--bg-card) inset !important;
  -webkit-text-fill-color: var(--text-muted) !important;
  caret-color: var(--text-muted);
}

.card {
  background: var(--bg-card);
  border-radius: 16px;
  padding: 1.5rem;
  margin-bottom: 2rem;
  border: 1px solid var(--border-color);
  display: flex;
  align-items: flex-start;
  flex-direction: column;
  row-gap: 16px;
}

.repo-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 1.2rem;
  font-size: 0.95rem;
  color: #4b5563;
}
.repo-stats span {
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  column-gap: 4px;
}
.language-bar {
  width: 100%;
  display: flex;
  border-radius: 30px;
  overflow: hidden;
  height: 10px;
  background: #e5e7eb;
}
.language-bar span {
  display: inline-block;
  height: 10px;
  margin-left: 2px;
}
.language-bar span:first-child {
  margin-left: 0;
}
.download-btn {
  border-radius: 14px;
  text-decoration: none;
  font-weight: 500;
  transition: background 0.2s;
}

.tabs {
  display: flex;
  gap: 0.3rem;
  margin-bottom: 1.5rem;
}
.tab-btn {
  background: none;
  border: none;
  padding: 0.6rem 1.2rem;
  font-size: 0.95rem;
  color: #6b7280;
  cursor: pointer;
  border-radius: 10px;
  transition: all 0.2s;
}
.tab-btn:hover {
  background: var(--bg-card);
}
.tab-btn.active {
  background: var(--bg-card);
  color: var(--text-secondary);
  border-radius: 10px;
  border: 1px solid var(--border-color);
}

.preloader {
  position: absolute;
  inset-inline: 0;
  text-align: center;
  padding: 3rem 1rem;
  color: var(--text-muted);
  font-size: 1.1rem;
}
.preloader::after {
  content: "";
  display: inline-block;
  width: 1.5rem;
  height: 1.5rem;
  border: 3px solid var(--preloader-track);
  border-top-color: var(--preloader-spin);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  margin-left: 0.5rem;
  vertical-align: middle;
}
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.tab-content {
  background: var(--bg-card);
  border-radius: 16px;
  padding: 1.5rem;
  min-height: 200px;
  border: 1px solid var(--border-color);
}

.file-tree {
  list-style: none;
  padding-right: 1rem;
}
.file-tree li {
  padding: 0.4rem 0.5rem;
  cursor: pointer;
  border-radius: 6px;
  transition: background 0.2s;
  display: flex;
  align-items: center;
  column-gap: 6px;
}
.file-tree li:hover {
  background: var(--bg-tertiary);
}
.folder {
  color: #6366f1;
  font-weight: 500;
}
.file {
  color: #374151;
}

.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 1rem;
  margin-top: 1.5rem;
}
.pagination button {
  color: var(--text-primary);
  background: var(--bg-secondary);
  border: none;
  padding: 0.4rem 1rem;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.2s;
}
.pagination button:hover {
  background: var(--border-color);
}
.pagination button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.hidden {
  display: none !important;
}
.error {
  color: var(--error-text);
  background: var(--error-bg);
  padding: 0.8rem 1rem;
  border-radius: 10px;
  margin: 1rem 0;
}

.language-list {
  list-style: none;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  font-size: 0.85rem;
}

.language-list li {
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 0.3rem;
}

.lang-color-dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.lang-percent {
  color: var(--text-muted);
  margin-right: 0.2rem;
}

.error-toast {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translate(-50%, 200%);
  background: oklch(63.7% 0.237 25.331 / 15%);
  color: #b91c1c;
  border: 1px solid oklch(63.7% 0.237 25.331 / 15%);
  padding: 0.8rem 1.2rem;
  border-radius: 12px;
  display: flex;
  align-items: center;
  gap: 1rem;
  min-width: 280px;
  max-width: 90vw;
  z-index: 9999;
  transition: transform 0.35s ease;
  font-size: 0.95rem;
  font-weight: 500;
  line-height: 1.5;
}

.error-toast.show {
  transform: translate(-50%, 0);
}

#error-toast-msg {
  flex: 1;
}

.contributors-list li {
  color: var(--text-primary);
  display: flex;
  align-items: center;
  column-gap: 6px;
}
.contributor-img {
  width: 35px;
  border-radius: 10px;
}

.release-item {
  margin-bottom: 2rem;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 1.5rem;
}

.release-tag {
  font-size: 1.2rem;
  color: var(--text-primary);
}

.release-date {
  margin-left: 1rem;
  color: var(--text-secondary);
  font-size: 0.9rem;
}

.release-assets {
  display: flex;
  align-items: flex-start;
  flex-direction: column;
  border: 1px solid var(--border-color);
  border-radius: 14px;
}

.release-assets a {
  border-bottom: 1px solid var(--border-color);
  text-decoration: none !important;
  border-radius: 0;
  padding: 10px;
  width: 100%;
}

.release-assets a:last-child {
  border-bottom: 0;
}

.release-assets a:hover {
  text-decoration: underline !important;
}

.release-body {
  margin: 0.8rem 0 1.5rem 0;
  padding: 1rem;
  background: var(--bg-secondary);
  border-radius: 8px;
  max-height: 300px;
  overflow-y: auto;
}

.release-body li {
  list-style: none;
  position: relative;
}
.release-body li::before {
  content: url("../add.svg");
  position: absolute;
  left: -23px;
  top: 3px;
}

.release-body h1,
.release-body h2 {
  border-bottom: 1px solid #eaecef;
  padding-bottom: 0.3em;
}
.release-body pre,
.release-body code {
  background: #f3f4f6;
  border-radius: 6px;
}

.commit-item {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  padding: 0.6rem 0;
  border-bottom: 1px solid var(--border-color);
  flex-wrap: wrap;
}

.commit-avatar {
  border-radius: 50%;
}

.commit-sha {
  font-family: monospace;
  color: #6366f1;
  cursor: pointer;
  border-bottom: 1px dashed #6366f1;
}

.commit-sha:hover {
  color: #4f46e5;
}

.commit-message {
  flex: 1;
  font-weight: 500;
}

.commit-author,
.commit-date {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.diff-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 10000;
}

.diff-modal-content {
  background: var(--bg-card);
  border-radius: 12px;
  padding: 1.5rem;
  max-width: 90vw;
  max-height: 90vh;
  overflow: auto;
  position: relative;
}

.diff-close {
  position: absolute;
  top: 0.5rem;
  right: 1rem;
  font-size: 1.5rem;
  cursor: pointer;
  color: #6b7280;
}

.diff-view {
  background: var(--diff-bg);
  padding: 1rem;
  border-radius: 8px;
  overflow-x: auto;
  font-size: 0.85rem;
  line-height: 1.5;
}

.file-viewer {
  margin-top: 0;
}

.file-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.6rem 0;
  border-bottom: 1px solid #e5e7eb;
  margin-bottom: 1rem;
  font-size: 0.95rem;
}

.file-name {
  font-weight: 600;
}

.file-size {
  color: #6b7280;
}

.file-github-link {
  margin-left: auto;
  color: #6366f1;
  text-decoration: none;
  font-size: 0.85rem;
}

.file-github-link:hover {
  text-decoration: underline;
}

.file-not-available {
  text-align: center;
  padding: 2rem;
  color: #6b7280;
}

.code-container {
  max-height: 70vh;
  overflow: auto;
  border-radius: 8px;
  background: var(--code-bg);
  margin-top: 0;
}

.code-container code {
  background: transparent !important;
}

.back-btn {
  background: none;
  border: 1px solid #d1d5db;
  padding: 0.3rem 0.8rem;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.85rem;
  color: #374151;
  transition: background 0.2s;
}

.back-btn:hover {
  background: #f3f4f6;
}

#theme-toggle {
  background-color: var(--bg-card);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
  padding: 6px 10px;
  border-radius: 8px;
  cursor: pointer;
}

.community-card {
  padding: 1rem;
}

.health-bar-container {
  height: 24px;
  background: var(--bg-secondary);
  border-radius: 12px;
  overflow: hidden;
  position: relative;
  margin: 1rem 0;
  display: flex;
  align-items: center;
}

.health-bar {
  height: 100%;
  background: #10b981;
  transition: width 0.5s;
  border-radius: 12px;
}

.health-percent {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  font-weight: bold;
  color: var(--text-primary);
}

.community-files {
  list-style: none;
  padding: 0;
}

.community-files li {
  padding: 0.4rem 0;
  border-bottom: 1px solid var(--border-light);
}

.community-files li.present {
  color: var(--text-primary);
}

.community-files li.missing {
  color: var(--error-text);
  background: var(--error-bg);
  border-radius: 4px;
  padding: 0.4rem 0.6rem;
}

.search-container {
  margin-top: 6px;
}
.search-form {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
  align-items: center;
  width: 100%;
}

.search-form > * {
  width: 100%;
}
.search-form button {
  border-radius: 10px;
  padding: 8px 24px;
  cursor: pointer;
}
.search-form select,
.search-form input {
  padding: 0.5rem 0.8rem;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  background: var(--bg-card);
  color: var(--text-primary);
}
.search-results-list {
  list-style: none;
  padding: 0;
}
.search-results-list li {
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  gap: 0.8rem;
  flex-wrap: wrap;
}
.search-repo,
.search-state,
.search-author {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-left: auto;
}

.search-note {
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 500;
}

.recent-repos {
  position: relative;
}

.recent-repos select {
  padding: 0.7rem 1rem;
  border: 1px solid var(--border-color);
  border-radius: 10px;
  background: var(--bg-card);
  color: var(--text-primary);
  font-size: 1rem;
  cursor: pointer;
  max-width: 200px;
  text-overflow: ellipsis;
  appearance: auto;
}

.file-filter-input {
  width: 100%;
  padding: 0.5rem 1rem;
  margin-bottom: 0.8rem;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  background: var(--bg-card);
  color: var(--text-primary);
  font-size: 0.95rem;
}
.file-filter-input:focus {
  outline: 2px solid var(--accent);
}

/* Responsive */
@media screen and (max-width: 670px) {
  .search-bar {
    flex-direction: column;
  }
  .download-btn {
    width: 100%;
    text-align: center;
  }
}
