/* Syntax highlighting styles for Flash API Documentation */

:root {
  --code-bg: #f5f5f5;
  --code-color: #333;
  --badge-bg: #1655c0;
  --badge-color: white;
  --line-highlight-bg: rgba(22, 85, 192, 0.08);
}

/* Code blocks enhancements */
.code-sample {
  position: relative;
  margin: 1.5rem 0;
  border-radius: 6px;
  background-color: var(--code-bg);
  overflow: hidden;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

.code-sample pre {
  margin: 0;
  padding: 1.25rem;
  overflow-x: auto;
  font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
  font-size: 14px;
  line-height: 1.6;
  tab-size: 2;
  hyphens: none;
}

.code-sample code {
  font-family: inherit;
  background: transparent;
  padding: 0;
  border-radius: 0;
  white-space: pre;
  word-break: normal;
  word-wrap: normal;
}

/* Language badge */
.code-language-badge {
  position: absolute;
  top: 0;
  right: 0;
  background-color: var(--badge-bg);
  color: var(--badge-color);
  padding: 0.25rem 0.75rem;
  font-size: 0.75rem;
  border-bottom-left-radius: 6px;
  font-weight: 500;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
  z-index: 10;
}

/* Adjust the copy button position */
.code-sample .copy-button {
  top: 25px;
}

/* Line highlighting */
.code-sample .highlight-line {
  background-color: var(--line-highlight-bg);
  display: block;
  margin: 0 -1.25rem;
  padding: 0 1.25rem;
}

/* Add spacing between code blocks and text */
p + .code-sample, ul + .code-sample, ol + .code-sample {
  margin-top: 1.5rem;
}

.code-sample + p, .code-sample + ul, .code-sample + ol {
  margin-top: 1.5rem;
}

/* Enhance token colors beyond Prism defaults */
.token.important, .token.bold {
  font-weight: bold;
}

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

.token.entity {
  cursor: help;
}

/* Custom scrollbar for code blocks */
.code-sample pre::-webkit-scrollbar {
  height: 8px;
  width: 8px;
}

.code-sample pre::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.05);
  border-radius: 4px;
}

.code-sample pre::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.2);
  border-radius: 4px;
}

.code-sample pre::-webkit-scrollbar-thumb:hover {
  background: rgba(0, 0, 0, 0.3);
}