/* ox-content GitHub Plugin - Repository card styles */

.ox-github-card {
  display: block;
  margin: 1.5rem 0;
  padding: 1rem 0;
  border: 0;
  border-top: 1px solid color-mix(in srgb, var(--octc-color-border) 74%, transparent);
  border-bottom: 1px solid color-mix(in srgb, var(--octc-color-border) 74%, transparent);
  border-radius: 0;
  background: transparent;
  text-decoration: none;
  color: var(--octc-color-text);
  transition: color 0.2s ease;
}

.ox-github-card:hover {
  text-decoration: none;
}

.ox-github-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

.ox-github-icon {
  width: 20px;
  height: 20px;
  color: var(--octc-color-text-muted);
  flex-shrink: 0;
}

.ox-github-repo {
  font-weight: 600;
  font-size: 1rem;
  color: var(--octc-color-primary);
}

.ox-github-card:hover .ox-github-repo {
  text-decoration: underline;
}

.ox-github-description {
  font-size: 0.875rem;
  color: var(--octc-color-text-muted);
  margin-bottom: 0.75rem;
  line-height: 1.5;
}

.ox-github-stats {
  display: flex;
  align-items: center;
  gap: 1rem;
  font-size: 0.8125rem;
  color: var(--octc-color-text-muted);
}

.ox-github-stat {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.ox-github-stat svg {
  width: 16px;
  height: 16px;
}

.ox-github-language {
  display: flex;
  align-items: center;
  gap: 0.375rem;
}

.ox-github-language-color {
  width: 12px;
  height: 12px;
  border-radius: 50%;
}

/* Language colors */
.ox-github-language-color[data-lang="javascript"] {
  background: #f1e05a;
}
.ox-github-language-color[data-lang="typescript"] {
  background: #3178c6;
}
.ox-github-language-color[data-lang="rust"] {
  background: #dea584;
}
.ox-github-language-color[data-lang="python"] {
  background: #3572a5;
}
.ox-github-language-color[data-lang="go"] {
  background: #00add8;
}
.ox-github-language-color[data-lang="java"] {
  background: #b07219;
}
.ox-github-language-color[data-lang="c++"] {
  background: #f34b7d;
}
.ox-github-language-color[data-lang="c"] {
  background: #555555;
}
.ox-github-language-color[data-lang="ruby"] {
  background: #701516;
}
.ox-github-language-color[data-lang="php"] {
  background: #4f5d95;
}
.ox-github-language-color[data-lang="swift"] {
  background: #f05138;
}
.ox-github-language-color[data-lang="kotlin"] {
  background: #a97bff;
}
.ox-github-language-color[data-lang="vue"] {
  background: #41b883;
}
.ox-github-language-color[data-lang="svelte"] {
  background: #ff3e00;
}
.ox-github-language-color[data-lang="html"] {
  background: #e34c26;
}
.ox-github-language-color[data-lang="css"] {
  background: #563d7c;
}
.ox-github-language-color[data-lang="shell"] {
  background: #89e051;
}

/* Loading state */
.ox-github-card.loading {
  min-height: 100px;
}

.ox-github-card.loading::after {
  content: "";
  display: block;
  width: 24px;
  height: 24px;
  margin: 2rem auto;
  border: 2px solid var(--octc-color-border);
  border-top-color: var(--octc-color-primary);
  border-radius: 50%;
  animation: ox-github-spin 0.8s linear infinite;
}

@keyframes ox-github-spin {
  to {
    transform: rotate(360deg);
  }
}

/* Error state */
.ox-github-card.error {
  border-color: #f87171;
  background: transparent;
}

.ox-github-error {
  color: #f87171;
  font-size: 0.875rem;
}

.ox-github-code {
  margin: 1.5rem 0;
  border: 1px solid color-mix(in srgb, var(--octc-color-border) 74%, transparent);
  border-radius: 8px;
  overflow: hidden;
  background: color-mix(in srgb, var(--octc-color-bg) 96%, var(--octc-color-border));
}

.ox-github-code-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding: 0.625rem 0.875rem;
  border-bottom: 1px solid color-mix(in srgb, var(--octc-color-border) 74%, transparent);
  font-size: 0.8125rem;
}

.ox-github-code-title {
  min-width: 0;
  color: var(--octc-color-primary);
  font-weight: 600;
  text-decoration: none;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ox-github-code-title:hover {
  text-decoration: underline;
}

.ox-github-code-loc {
  flex-shrink: 0;
  color: var(--octc-color-text-muted);
  font-variant-numeric: tabular-nums;
}

.ox-github-code-block {
  margin: 0;
  padding: 0.75rem 0;
  overflow-x: auto;
  background: transparent;
  color: var(--octc-color-text);
  font-size: 0.875rem;
  line-height: 1.6;
}

.ox-github-code-block code {
  display: block;
  min-width: max-content;
}

.ox-github-code-line {
  display: grid;
  grid-template-columns: 4rem 1fr;
  gap: 0.875rem;
  padding-right: 1rem;
}

.ox-github-code-line-number {
  color: var(--octc-color-text-muted);
  text-align: right;
  user-select: none;
  font-variant-numeric: tabular-nums;
}

.ox-github-code-line-content {
  white-space: pre;
}
