/**
 * Code Blocks Component
 * Styles for code blocks and syntax highlighting
 */

/* Code Block Styles */
pre {
    background: linear-gradient(135deg, 
        rgba(30, 30, 30, 0.9) 0%, 
        rgba(26, 26, 26, 0.95) 100%);
    backdrop-filter: blur(10px) saturate(150%);
    -webkit-backdrop-filter: blur(10px) saturate(150%);
    border-radius: var(--radius-sm);
    padding: 1.5em;
    margin: 1.5em 0;
    overflow-x: auto;
    position: relative;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 
        0 4px 16px rgba(0, 0, 0, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.05);
    isolation: isolate;
}

code {
    font-family: 'Menlo', 'Monaco', 'Courier New', monospace;
    font-size: 0.9em;
    line-height: 1.6;
    color: #e6e6e6;
}

/* Inline code styling */
p code {
    background: rgba(93, 143, 179, 0.15);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    padding: 0.2em 0.4em;
    border-radius: var(--radius-xs);
    font-size: 0.9em;
    color: var(--color-primary-light);
    border: 1px solid rgba(93, 143, 179, 0.2);
    font-weight: 500;
}

/* Language indicator */
pre::before {
    content: attr(data-language);
    position: absolute;
    top: 0;
    right: 1em;
    padding: 0.3em 0.6em;
    background: rgba(93, 143, 179, 0.2);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    color: var(--color-primary-light);
    border-radius: 0 0 4px 4px;
    font-size: 0.75em;
    font-family: var(--font-family);
    font-weight: 600;
    border: 1px solid rgba(93, 143, 179, 0.3);
    border-top: none;
}

/* Dark mode specific overrides */
.dark-mode pre {
    background: linear-gradient(135deg, 
        rgba(26, 26, 26, 0.95) 0%, 
        rgba(0, 0, 0, 0.98) 100%);
    backdrop-filter: blur(10px) saturate(150%);
    -webkit-backdrop-filter: blur(10px) saturate(150%);
    border-color: rgba(255, 255, 255, 0.15);
}

.dark-mode code {
    color: #e6e6e6;
}

.dark-mode p code {
    background-color: #2d2d2d;
    color: #e6e6e6;
}

.dark-mode pre, .dark-mode code {
    background-color: var(--color-dark-grey);
    color: var(--color-white);
    border-radius: var(--radius-xs);
}

.dark-mode .code-block {
    background-color: var(--color-dark-grey);
}

.dark-mode .copy-button {
    background-color: var(--color-hover);
}

/* Scrollbar styling for code blocks */
pre::-webkit-scrollbar {
    height: 8px;
    background-color: #1e1e1e;
}

pre::-webkit-scrollbar-thumb {
    background-color: #444;
    border-radius: var(--radius-xs);
}

pre::-webkit-scrollbar-thumb:hover {
    background-color: #555;
}

