/* TaskNotes GitHub Integration Styles */

.tasknotes-github-button {
  /* GitHub-like button styling */
  position: relative;
  display: inline-flex;
  align-items: center;
  padding: 6px 12px !important;
  font-size: 14px !important;
  font-weight: 500 !important;
  line-height: 20px;
  white-space: nowrap;
  vertical-align: middle;
  cursor: pointer;
  user-select: none;
  border: 1px solid;
  border-radius: 6px;
  appearance: none;
  text-decoration: none !important;
  transition: all 0.2s ease;
  
  /* GitHub color scheme - light mode */
  color: #24292f !important;
  background-color: #f6f8fa !important;
  border-color: #d0d7de !important;
  box-shadow: 0 1px 0 rgba(27, 31, 36, 0.04), inset 0 1px 0 rgba(255, 255, 255, 0.25);
}

.tasknotes-github-button:hover {
  background-color: #f3f4f6 !important;
  border-color: #d0d7de !important;
  text-decoration: none !important;
}

.tasknotes-github-button:active {
  background-color: #ebecf0 !important;
  border-color: #d0d7de !important;
  box-shadow: inset 0 1px 0 rgba(27, 31, 36, 0.1);
}

.tasknotes-github-button:focus {
  outline: 2px solid #0969da;
  outline-offset: -2px;
  box-shadow: none;
}

.tasknotes-github-button:disabled {
  color: #8c959f !important;
  background-color: #f6f8fa !important;
  border-color: #d0d7de !important;
  cursor: not-allowed;
}

/* Dark mode support for GitHub */
@media (prefers-color-scheme: dark) {
  .tasknotes-github-button {
    color: #f0f6fc !important;
    background-color: #21262d !important;
    border-color: #30363d !important;
    box-shadow: 0 1px 0 rgba(27, 31, 36, 0.15), inset 0 1px 0 rgba(255, 255, 255, 0.03);
  }

  .tasknotes-github-button:hover {
    background-color: #30363d !important;
    border-color: #8b949e !important;
  }

  .tasknotes-github-button:active {
    background-color: #262c36 !important;
    border-color: #6e7681 !important;
  }

  .tasknotes-github-button:focus {
    outline-color: #58a6ff;
  }

  .tasknotes-github-button:disabled {
    color: #484f58 !important;
    background-color: #21262d !important;
    border-color: #30363d !important;
  }
}

/* GitHub specific theme classes */
[data-color-mode="dark"] .tasknotes-github-button,
[data-theme="dark"] .tasknotes-github-button {
  color: #f0f6fc !important;
  background-color: #21262d !important;
  border-color: #30363d !important;
  box-shadow: 0 1px 0 rgba(27, 31, 36, 0.15), inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

[data-color-mode="dark"] .tasknotes-github-button:hover,
[data-theme="dark"] .tasknotes-github-button:hover {
  background-color: #30363d !important;
  border-color: #8b949e !important;
}

[data-color-mode="dark"] .tasknotes-github-button:active,
[data-theme="dark"] .tasknotes-github-button:active {
  background-color: #262c36 !important;
  border-color: #6e7681 !important;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
  .tasknotes-github-button {
    border-width: 2px !important;
  }
}

/* Make sure button fits well in GitHub's header */
.gh-header-actions .tasknotes-github-button {
  margin-left: 8px;
  margin-right: 4px;
}

/* Ensure proper spacing in various GitHub layouts */
.discussion-timeline-actions .tasknotes-github-button,
.js-sticky-header .tasknotes-github-button {
  margin-left: 8px;
}

/* Icon styling within button */
.tasknotes-github-button img {
  margin-right: 6px !important;
  width: 16px !important;
  height: 16px !important;
  vertical-align: middle !important;
  flex-shrink: 0;
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .tasknotes-github-button {
    padding: 4px 8px !important;
    font-size: 12px !important;
  }
  
  .tasknotes-github-button img {
    width: 14px !important;
    height: 14px !important;
    margin-right: 4px !important;
  }
}

/* Animation for notification */
.tasknotes-github-notification {
  animation: slideInRight 0.3s ease-out;
}

@keyframes slideInRight {
  from {
    opacity: 0;
    transform: translateX(100px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* Ensure button doesn't break GitHub's layout */
.tasknotes-github-button * {
  box-sizing: border-box;
}

/* Integration with GitHub's button groups */
.BtnGroup .tasknotes-github-button {
  border-radius: 0;
  margin-left: -1px;
}

.BtnGroup .tasknotes-github-button:first-child {
  border-top-left-radius: 6px;
  border-bottom-left-radius: 6px;
  margin-left: 0;
}

.BtnGroup .tasknotes-github-button:last-child {
  border-top-right-radius: 6px;
  border-bottom-right-radius: 6px;
}

/* GitHub specific overrides to ensure our button works */
.tasknotes-github-button.btn {
  /* Override any conflicting GitHub btn styles */
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif !important;
  text-align: center !important;
  text-transform: none !important;
  letter-spacing: normal !important;
}

/* Ensure button is visible in GitHub's various themes */
.colorscheme-light .tasknotes-github-button,
.theme-light .tasknotes-github-button {
  color: #24292f !important;
  background-color: #f6f8fa !important;
  border-color: #d0d7de !important;
}

.colorscheme-dark .tasknotes-github-button,
.theme-dark .tasknotes-github-button {
  color: #f0f6fc !important;
  background-color: #21262d !important;
  border-color: #30363d !important;
}