/* Custom scrollbar */
::-webkit-scrollbar {
  width: 10px;
}
::-webkit-scrollbar-track {
  background: #f1f5f9;
}
.dark ::-webkit-scrollbar-track {
  background: #0f172a;
}
::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, #8b5cf6, #06b6d4);
  border-radius: 5px;
}

/* Gradient text */
.gradient-text {
  background: linear-gradient(135deg, #8b5cf6 0%, #06b6d4 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* Glow effect */
.glow {
  box-shadow: 0 0 40px rgba(139, 92, 246, 0.3);
}

/* Card hover */
.card-hover {
  transition: all 0.3s ease;
}
.card-hover:hover {
  transform: translateY(-5px);
  box-shadow: 0 20px 40px rgba(139, 92, 246, 0.15);
}
.dark .card-hover:hover {
  box-shadow: 0 20px 40px rgba(139, 92, 246, 0.2);
}

/* Button gradient */
.btn-gradient {
  background: linear-gradient(135deg, #8b5cf6 0%, #06b6d4 100%);
  transition: all 0.3s ease;
}
.btn-gradient:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 30px rgba(139, 92, 246, 0.4);
}

/* Flow animation lines */
.flow-line {
  stroke-dasharray: 5;
  animation: dash 1s linear infinite;
}
@keyframes dash {
  to {
    stroke-dashoffset: -10;
  }
}

/* Smooth transitions for theme switch */
body, div, nav, header, section, footer, button, input {
  transition: background-color 0.3s ease, border-color 0.3s ease, color 0.3s ease;
}

/* Sidebar link active */
.sidebar-link.active {
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.1), rgba(6, 182, 212, 0.1));
  border-left: 3px solid #8b5cf6;
  color: #8b5cf6;
  font-weight: 600;
}

/* TOC link active */
.toc-link.active {
  color: #8b5cf6;
  font-weight: 600;
  border-left-color: #8b5cf6;
}

/* Prose styles for article content */
.prose h2 {
  font-size: 1.875rem;
  font-weight: 700;
  margin-top: 2.5rem;
  margin-bottom: 1.25rem;
  scroll-margin-top: 6rem;
}
.prose h3 {
  font-size: 1.5rem;
  font-weight: 600;
  margin-top: 2rem;
  margin-bottom: 1rem;
  scroll-margin-top: 6rem;
}
.prose p {
  margin-bottom: 1.25rem;
  line-height: 1.75;
}
.prose code {
  background: rgb(241 245 249);
  padding: 0.2rem 0.4rem;
  border-radius: 0.25rem;
  font-size: 0.875em;
}
.prose a {
  color: #8b5cf6;
  text-decoration: underline;
}

/* Code block styles */
.prose pre {
	margin: 1.5rem 0;
	border-radius: 0.5rem;
	overflow-x: auto;
	background: #2d2d2d;
	color: #ccc;
	font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
	font-size: 0.875rem;
	line-height: 1.5;
	padding: 1rem;
}
.prose pre code {
	background: transparent;
	padding: 0;
	font-size: inherit;
	color: inherit;
}
.dark .prose pre {
	background: #1a1a1a;
	color: #f8f8f2;
}

/* Prism overrides */
pre[class*="language-"] {
	margin: 1.5rem 0;
	border-radius: 0.5rem;
	padding: 1rem;
}
code[class*="language-"] {
	font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
}

/* Hide browser default search clear button */
input[type="search"]::-webkit-search-cancel-button,
input[type="search"]::-webkit-search-decoration,
input[type="search"]::-webkit-search-results-button,
input[type="search"]::-webkit-search-results-decoration {
	-webkit-appearance: none;
	appearance: none;
	display: none;
}

/* Animated gradient text */
@keyframes gradient-flow {
	0% { 
		background-position: 0% 50%;
	}
	50% { 
		background-position: 100% 50%;
	}
	100% { 
		background-position: 0% 50%;
	}
}

.gradient-animate {
	background: linear-gradient(135deg, #8b5cf6 0%, #06b6d4 50%, #8b5cf6 100%);
	background-size: 200% 100%;
	animation: gradient-flow 4s ease infinite;
	-webkit-background-clip: text;
	-webkit-text-fill-color: transparent;
	background-clip: text;
}

