.login-button {
    display: inline-block;
    padding: 2px 10px;
    margin-left: auto; /* Push the button to the right */
    margin-right: 10px;
    background-color: hsl(315, 80%, 42%); /* Use a solid, high-contrast color */
    color: #fff; /* Ensure text is white */
    text-decoration: none;
    border-radius: 4px;
    font-weight: bold;
    transition: background-color 0.2s ease;
    font-size: 0.9em;
    vertical-align: middle;
}

.login-button:hover {
    background-color: #003c8f; /* Darker shade for hover */
    text-decoration: none;
}

.git-code-button {
    display: inline-block;
    background: #30363d;
    color: white !important;
    padding: 0.6rem 1.2rem;
    border-radius: 20px;
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: bold;
    margin-left: 1rem;
    transition: all 0.3s ease;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

.git-code-button:hover {
    background: #444d56;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.3);
    text-decoration: none;
}

.git-code-button .material-icons {
    font-size: 1rem;
    vertical-align: middle;
    margin-right: 4px;
}

/* Force code blocks to wrap text instead of horizontal scroll */
.highlight pre,
.codehilite pre {
    white-space: pre-wrap !important;
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    overflow-x: auto !important;
}

/* Ensure code block containers maintain proper positioning */
.highlight,
.codehilite {
    position: relative !important;
    overflow: visible !important;
}

/* For inline code elements only */
p code,
li code,
td code,
h1 code,
h2 code,
h3 code,
h4 code,
h5 code,
h6 code {
    white-space: pre-wrap !important;
    word-break: break-word !important;
}

/* Ensure tables with code don't break layout */
table {
    table-layout: auto;
    width: 100%;
}

table td {
    word-wrap: break-word;
    overflow-wrap: break-word;
}



/* GitHub Widget Styles */
.github-widget {
  margin: 1.5rem 0;
  display: block;
}

.github-widget-container {
  border: 1px solid rgba(var(--md-primary-fg-color--rgb), 0.15);
  border-radius: 12px;
  padding: 20px;
  background: linear-gradient(135deg, var(--md-code-bg-color) 0%, rgba(var(--md-primary-fg-color--rgb), 0.03) 100%);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  font-size: 14px;
  line-height: 1.6;
  transition: all 0.3s ease;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  position: relative;
  overflow: hidden;
}

.github-widget-container::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--md-primary-fg-color), var(--md-accent-fg-color));
  border-radius: 12px 12px 0 0;
}

.github-widget-container:hover {
  border-color: var(--md-accent-fg-color);
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
}

.github-widget-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 16px;
  flex-wrap: wrap;
  gap: 12px;
}

.github-widget-title {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  min-width: 0;
}

.github-icon {
  color: var(--md-default-fg-color--light);
  flex-shrink: 0;
  width: 20px;
  height: 20px;
}

.github-widget .repo-link {
  color: var(--md-accent-fg-color);
  text-decoration: none;
  font-weight: 600;
  font-size: 16px;
  transition: color 0.2s ease;
  word-break: break-word;
}

.github-widget .repo-link:hover {
  color: var(--md-primary-fg-color);
  text-decoration: none;
}

.github-widget-stats {
  display: flex;
  gap: 20px;
  align-items: center;
  flex-wrap: wrap;
}

.stat-item {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--md-default-fg-color);
  font-size: 13px;
  font-weight: 600;
  background: rgba(var(--md-primary-fg-color--rgb), 0.08);
  padding: 4px 8px;
  border-radius: 16px;
  transition: all 0.2s ease;
}

.stat-item:hover {
  background: rgba(var(--md-accent-fg-color--rgb), 0.15);
  transform: scale(1.05);
}

.stat-item svg {
  color: var(--md-accent-fg-color);
  width: 14px;
  height: 14px;
}

.github-widget-description {
  color: var(--md-default-fg-color--light);
  margin-bottom: 16px;
  line-height: 1.5;
  font-size: 14px;
  font-style: italic;
  padding: 12px;
  background: rgba(var(--md-default-fg-color--rgb), 0.03);
  border-radius: 8px;
  border-left: 3px solid var(--md-accent-fg-color);
}

.github-widget-footer {
  display: flex;
  gap: 20px;
  align-items: center;
  font-size: 12px;
  color: var(--md-default-fg-color--lighter);
  border-top: 1px solid rgba(var(--md-default-fg-color--rgb), 0.1);
  padding-top: 16px;
  margin-top: 16px;
  flex-wrap: wrap;
}

.language-info {
  display: flex;
  align-items: center;
  gap: 6px;
}

.language-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  display: inline-block;
}

.last-update,
.license-info {
  color: var(--md-default-fg-color--lighter);
}

/* Loading State */
.github-widget-loading {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 20px;
  color: var(--md-default-fg-color--light);
  justify-content: center;
}

.loading-spinner {
  width: 20px;
  height: 20px;
  border: 2px solid var(--md-default-fg-color--lightest);
  border-top: 2px solid var(--md-accent-fg-color);
  border-radius: 50%;
  animation: github-widget-spin 1s linear infinite;
}

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

/* Error State */
.github-widget-error {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 20px;
  color: var(--md-typeset-color);
  text-align: center;
  background: var(--md-code-bg-color);
  border: 1px solid #f85149;
  border-radius: 6px;
}

.github-widget-error svg {
  color: #f85149;
}

.github-widget-error small {
  color: var(--md-default-fg-color--lighter);
  font-size: 11px;
}

/* Dark mode specific adjustments */
[data-md-color-scheme="slate"] .github-widget-container {
  background: var(--md-code-bg-color);
  border-color: #30363d;
}

[data-md-color-scheme="slate"] .github-widget-container:hover {
  border-color: var(--md-accent-fg-color);
}

/* Multiple widgets in a row */
.github-widgets-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1rem;
  margin: 1rem 0;
}

.github-widgets-row .github-widget {
  margin: 0;
}

/* Compact widget variant */
.github-widget.compact .github-widget-container {
  padding: 12px;
}

.github-widget.compact .github-widget-header {
  margin-bottom: 8px;
}

.github-widget.compact .github-widget-description {
  display: none;
}

.github-widget.compact .github-widget-footer {
  margin-top: 8px;
  padding-top: 8px;
}

/* GitHub Widget Responsive - placed after existing mobile styles */
@media (max-width: 768px) {
  .github-widget-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }
  
  .github-widget-stats {
    gap: 12px;
  }
  
  .github-widget-footer {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }
}

/* Gitea Widget Styles */
.gitea-widget {
  margin: 1.5rem 0;
  display: block;
}

.gitea-widget-container {
  border: 1px solid rgba(var(--md-primary-fg-color--rgb), 0.15);
  border-radius: 12px;
  padding: 20px;
  background: linear-gradient(135deg, var(--md-code-bg-color) 0%, rgba(var(--md-primary-fg-color--rgb), 0.03) 100%);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  font-size: 14px;
  line-height: 1.6;
  transition: all 0.3s ease;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  position: relative;
  overflow: hidden;
}

.gitea-widget-container::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, #609926, #89c442);
  border-radius: 12px 12px 0 0;
}

.gitea-widget-container:hover {
  border-color: #89c442;
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
}

.gitea-widget-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 16px;
  flex-wrap: wrap;
  gap: 12px;
}

.gitea-widget-title {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  min-width: 0;
}

.gitea-icon {
  color: #89c442;
  flex-shrink: 0;
  width: 20px;
  height: 20px;
}

.gitea-widget .repo-link {
  color: #89c442;
  text-decoration: none;
  font-weight: 600;
  font-size: 16px;
  transition: color 0.2s ease;
  word-break: break-word;
}

.gitea-widget .repo-link:hover {
  color: #609926;
  text-decoration: none;
}

.gitea-widget-stats {
  display: flex;
  gap: 20px;
  align-items: center;
  flex-wrap: wrap;
}

.gitea-widget .stat-item {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--md-default-fg-color);
  font-size: 13px;
  font-weight: 600;
  background: rgba(137, 196, 66, 0.1);
  padding: 4px 8px;
  border-radius: 16px;
  transition: all 0.2s ease;
}

.gitea-widget .stat-item:hover {
  background: rgba(137, 196, 66, 0.2);
  transform: scale(1.05);
}

.gitea-widget .stat-item svg {
  color: #89c442;
  width: 14px;
  height: 14px;
}

.gitea-widget-description {
  color: var(--md-default-fg-color--light);
  margin-bottom: 16px;
  line-height: 1.5;
  font-size: 14px;
  font-style: italic;
  padding: 12px;
  background: rgba(var(--md-default-fg-color--rgb), 0.03);
  border-radius: 8px;
  border-left: 3px solid #89c442;
}

.gitea-widget-footer {
  display: flex;
  gap: 20px;
  align-items: center;
  font-size: 12px;
  color: var(--md-default-fg-color--lighter);
  border-top: 1px solid rgba(var(--md-default-fg-color--rgb), 0.1);
  padding-top: 16px;
  margin-top: 16px;
  flex-wrap: wrap;
}

.gitea-widget .language-info {
  display: flex;
  align-items: center;
  gap: 6px;
}

.gitea-widget .language-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  display: inline-block;
}

.gitea-widget .last-update,
.gitea-widget .license-info {
  color: var(--md-default-fg-color--lighter);
}

/* Gitea Loading State */
.gitea-widget-loading {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 20px;
  color: var(--md-default-fg-color--light);
  justify-content: center;
}

.gitea-widget-loading .loading-spinner {
  width: 20px;
  height: 20px;
  border: 2px solid var(--md-default-fg-color--lightest);
  border-top: 2px solid #89c442;
  border-radius: 50%;
  animation: gitea-widget-spin 1s linear infinite;
}

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

/* Gitea Error State */
.gitea-widget-error {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 20px;
  color: var(--md-typeset-color);
  text-align: center;
  background: var(--md-code-bg-color);
  border: 1px solid #f85149;
  border-radius: 6px;
}

.gitea-widget-error svg {
  color: #f85149;
}

.gitea-widget-error small {
  color: var(--md-default-fg-color--lighter);
  font-size: 11px;
}

/* Dark mode specific adjustments for Gitea */
[data-md-color-scheme="slate"] .gitea-widget-container {
  background: var(--md-code-bg-color);
  border-color: #30363d;
}

[data-md-color-scheme="slate"] .gitea-widget-container:hover {
  border-color: #89c442;
}

/* Multiple Gitea widgets in a row */
.gitea-widgets-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1rem;
  margin: 1rem 0;
}

.gitea-widgets-row .gitea-widget {
  margin: 0;
}

/* Compact Gitea widget variant */
.gitea-widget.compact .gitea-widget-container {
  padding: 12px;
}

.gitea-widget.compact .gitea-widget-header {
  margin-bottom: 8px;
}

.gitea-widget.compact .gitea-widget-description {
  display: none;
}

.gitea-widget.compact .gitea-widget-footer {
  margin-top: 8px;
  padding-top: 8px;
}

/* Gitea Widget Responsive */
@media (max-width: 768px) {
  .gitea-widget-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }
  
  .gitea-widget-stats {
    gap: 12px;
  }
  
  .gitea-widget-footer {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }
}
