/* Code Block Styles */


.code-block {
  margin: 2rem 0;
  border-radius: 1rem;
  overflow: hidden;
  background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.1);
  position: relative;
  transition: all 0.3s ease;
  max-width: 100%;
  width: 100%;
  box-sizing: border-box;
}

.code-block::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, #3b82f6, #8b5cf6, #ec4899);
  opacity: 0.8;
}

.code-block:hover {
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25), 0 0 0 1px rgba(59, 130, 246, 0.1);
  transform: translateY(-2px);
}

.code-block:focus-within {
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25), 0 0 0 2px rgba(59, 130, 246, 0.3);
}

.code-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 1.5rem;
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.code-info {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.code-title {
  font-size: 0.875rem;
  font-weight: 600;
  color: #f1f5f9;
}

.code-language {
  font-size: 0.875rem;
  font-weight: 600;
  color: #e2e8f0;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.code-language::before {
  content: '';
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: linear-gradient(135deg, #3b82f6, #8b5cf6);
  box-shadow: 0 0 10px rgba(59, 130, 246, 0.5);
}

.code-content {
  padding: 1.5rem;
  overflow-x: auto;
  background: rgba(15, 23, 42, 0.3);
  position: relative;
}

.code-content pre {
  margin: 0;
  padding: 0;
  background: none;
  color: #e2e8f0;
  font-family: SF Mono, Monaco, 'Inconsolata', 'Roboto Mono', 'Source Code Pro', monospace;
  font-size: 0.9rem;
  line-height: 1.6;
  white-space: pre;
  word-wrap: normal;
  tab-size: 4;
}

.code-content::-webkit-scrollbar {
  height: 8px;
}

.code-content::-webkit-scrollbar-track {
  background: rgba(30, 41, 59, 0.5);
  border-radius: 4px;
}

.code-content::-webkit-scrollbar-thumb {
  background: rgba(148, 163, 184, 0.3);
  border-radius: 4px;
}

.code-content::-webkit-scrollbar-thumb:hover {
  background: rgba(148, 163, 184, 0.5);
}

.code-content.with-line-numbers {
  padding-left: 0;
}

.line-number {
  display: inline-block;
  width: 3.5rem;
  padding: 0 1rem;
  text-align: right;
  color: #64748b;
  background: rgba(30, 41, 59, 0.5);
  border-right: 1px solid rgba(255, 255, 255, 0.1);
  user-select: none;
  font-weight: 500;
  transition: background-color 0.2s ease;
  cursor: pointer;
}

.line-number:hover {
  background: rgba(59, 130, 246, 0.1);
  color: #e2e8f0;
}

.line-highlight {
  background: linear-gradient(90deg, rgba(59, 130, 246, 0.2), rgba(139, 92, 246, 0.1));
  display: block;
  border-left: 3px solid #3b82f6;
  margin-left: -3px;
  position: relative;
}

.line-highlight .line-number {
  background: rgba(59, 130, 246, 0.3);
  color: #e2e8f0;
}

.code-copy-button {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: #e2e8f0;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 0.5rem;
  cursor: pointer;
  transition: all 0.3s ease;
  backdrop-filter: blur(10px);
}

.code-copy-button:hover {
  background: rgba(255, 255, 255, 0.2);
  border-color: rgba(255, 255, 255, 0.3);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.code-copy-button:active {
  transform: translateY(0);
}

.code-copy-button:focus {
  outline: 2px solid #3b82f6;
  outline-offset: 2px;
}

.code-icon {
  width: 1rem;
  height: 1rem;
  transition: transform 0.2s ease;
}

.code-copy-button:hover .code-icon {
  transform: scale(1.1);
}

@keyframes copySuccess {
  0% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.05);
  }
  100% {
    transform: scale(1);
  }
}

.code-copy-button.copied {
  animation: copySuccess 0.3s ease;
  background: rgba(16, 185, 129, 0.2);
  border-color: rgba(16, 185, 129, 0.5);
}
/* Syntax Highlighting Colors */

.token-punctuation {
  color: #abb2bf;
}

.token-type {
  color: #e5c07b;
}

.token-selector {
  color: #c678dd;
}

.token-tag {
  color: #e06c75;
}

.token-attribute {
  color: #d19a66;
}

.token-function {
  color: #61afef;
}

.token-number {
  color: #d19a66;
}

.token-comment {
  color: #5c6370;
}

.token-variable {
  color: #e06c75;
}

.token-property {
  color: #d19a66;
}

.token-keyword {
  color: #c678dd;
}

.token-string {
  color: #98c379;
}

.token-operator {
  color: #56b6c2;
}


.token.italic {
  font-style: italic;
}

.token.bold {
  font-weight: bold;
}

.token.underline {
  text-decoration: underline;
}

.token.inserted {
  background-color: rgba(134, 239, 172, 0.2);
  color: #86efac;
  border-radius: 2px;
  padding: 0 2px;
}

.token.deleted {
  background-color: rgba(248, 113, 113, 0.2);
  color: #f87171;
  border-radius: 2px;
  padding: 0 2px;
}

/* Syntect wrapper classes - inherit styling from child elements */
.meta,
.source,
.text {
  color: inherit;
}

@media (max-width: 768px) {
  .code-block {
    margin: 1.5rem 0;
    border-radius: 0.75rem;
  }

  .code-header {
    padding: 0.75rem 1rem;
  }

  .code-content {
    padding: 1rem;
  }

  .code-language {
    font-size: 0.75rem;
  }

  .code-copy-button {
    padding: 0.25rem 0.75rem;
    font-size: 0.75rem;
  }

  .line-number {
    width: 2.5rem;
    padding: 0 0.5rem;
  }

  .code-content pre {
    font-size: 0.8rem;
  }
}
