/* ButterStack Documentation Custom Styles */

/* Inline code styling - purple to match brand */
/* Match Just the Docs selector: :not(pre, figure) > code */
:not(pre, figure) > code {
  background-color: rgba(93, 93, 255, 0.15) !important;
  color: #818cf8 !important;
  padding: 0.2em 0.4em !important;
  border-radius: 0.25rem !important;
  border: none !important;
}

/* Code inside pre blocks should inherit pre styling */
pre code,
.highlight code,
.highlighter-rouge code,
div.highlighter-rouge code,
.language-plaintext code,
.main-content pre code,
#main-content pre code {
  background: transparent !important;
  color: inherit !important;
  padding: 0 !important;
  border-radius: 0 !important;
  font-size: inherit !important;
}

/* Remove backgrounds from Rouge syntax highlighting spans */
.highlight span,
.highlighter-rouge span,
pre code span,
.highlight pre code span {
  background-color: transparent !important;
  background: transparent !important;
}

/* Fix text color for http code blocks */
.language-http .highlight code,
.language-http code,
.language-http span,
.language-plaintext code {
  color: #374151 !important;
}

/* Gradient text for headings */
.gradient-text {
  background: linear-gradient(135deg, #5D5DFF 0%, #3B82F6 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* Hide search bar */
.search,
.search-input-wrap,
.search-shortcut,
#search-input,
#search-button,
.search-overlay {
  display: none !important;
}

/* Integration cards styling */
.integration-card {
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 1.5rem;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  text-decoration: none;
  color: inherit;
  transition: all 0.3s ease;
}

.integration-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
  border-color: #5D5DFF;
}

.integration-logo {
  width: 48px !important;
  height: 48px !important;
  object-fit: contain;
  margin-bottom: 1rem;
}

.integration-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1.5rem;
  margin: 1.5rem 0;
}

.integration-category h3 {
  margin-bottom: 0.5rem;
}

.integration-card h4 {
  margin: 0.5rem 0;
  font-size: 1.1rem;
  font-weight: 600;
}

.integration-card p {
  margin: 0;
  font-size: 0.9rem;
  color: #6b7280;
  text-align: center;
}

.integration-card.coming-soon {
  opacity: 0.7;
  cursor: not-allowed;
  background: #f3f4f6;
}

.badge {
  position: absolute;
  top: 8px;
  right: 8px;
  background: #fbbf24;
  color: #92400e;
  padding: 2px 8px;
  font-size: 0.75rem;
  border-radius: 12px;
  font-weight: 500;
}

/* Code block enhancements */
.highlight {
  position: relative;
  margin: 1.5rem 0;
}

.highlight pre {
  padding: 1.5rem;
  overflow-x: auto;
}

/* Copy button styling */
.copy-button {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  padding: 0.375rem 0.75rem;
  font-size: 0.75rem;
  font-weight: 600;
  color: white;
  background: linear-gradient(135deg, #5D5DFF 0%, #3B82F6 100%);
  border: none;
  border-radius: 0.375rem;
  cursor: pointer;
  opacity: 0;
  transition: all 0.2s ease;
  z-index: 10;
}

.highlight:hover .copy-button {
  opacity: 1;
}

.copy-button:hover {
  transform: scale(1.05);
  box-shadow: 0 4px 12px rgba(93, 93, 255, 0.3);
}

.copy-button.copied {
  background: linear-gradient(135deg, #22C55E 0%, #16A34A 100%);
}

/* Feature grid responsive */
@media (max-width: 768px) {
  .feature-grid {
    grid-template-columns: 1fr;
  }
}

/* Callout box animations */
.callout {
  position: relative;
  overflow: hidden;
  transition: all 0.3s ease;
}

.callout:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* Navigation improvements */
.nav-list-link {
  position: relative;
  transition: all 0.2s ease;
}

.nav-list-link::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 0;
  background: #5D5DFF;
  transition: height 0.2s ease;
}

.nav-list-link:hover::before,
.nav-list-link.active::before {
  height: 70%;
}

/* Button animations */
.btn-gradient {
  position: relative;
  overflow: hidden;
  z-index: 1;
}

.btn-gradient::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, #3B82F6 0%, #5D5DFF 100%);
  opacity: 0;
  transition: opacity 0.3s ease;
  z-index: -1;
}

.btn-gradient:hover::before {
  opacity: 1;
}

/* TOC styling */
.table-of-contents {
  background-color: #1A1A1F;
  border: 1px solid #2A2A30;
  border-radius: 0.5rem;
  padding: 1.5rem;
  margin: 2rem 0;
}

.table-of-contents a {
  color: #9B9BA7;
  text-decoration: none;
  transition: color 0.2s ease;
}

.table-of-contents a:hover {
  color: #5D5DFF;
}

/* Smooth scrolling */
html {
  scroll-behavior: smooth;
}

/* Back to top button */
#back-to-top {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  padding: 0.75rem 1.5rem;
  background: linear-gradient(135deg, #5D5DFF 0%, #3B82F6 100%);
  color: white;
  border-radius: 2rem;
  text-decoration: none;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
  z-index: 100;
}

#back-to-top.show {
  opacity: 1;
  visibility: visible;
}

#back-to-top:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(93, 93, 255, 0.3);
}

/* Full width layout */
.main-content-wrap {
  max-width: none !important;
  padding-right: 2rem;
}

.main-content {
  max-width: none !important;
}

.side-bar {
  width: 264px;
  min-width: 264px;
}

.main {
  margin-left: 264px;
  width: calc(100% - 264px);
}

@media (max-width: 1200px) {
  .main-content-wrap {
    padding-right: 1rem;
  }
}

@media (max-width: 768px) {
  .main {
    margin-left: 0;
    width: 100%;
  }
  
  .side-bar {
    width: 100%;
    position: static;
  }
}