/**
 * Code & Note Blocks - Frontend Styles
 * GitHub Dark Theme
 */

/* Note Blocks */
.cnb-note-block {
    background: #1c2128;
    border: 1px solid #f85149;
    border-left: 4px solid #f85149;
    border-radius: 6px;
    padding: 16px;
    margin: 20px 0;
    position: relative;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
}

.cnb-note-block::before {
    content: "📝 Note";
    position: absolute;
    top: -10px;
    left: 12px;
    background: #0d1117;
    color: #f85149;
    padding: 0 8px;
    font-size: 12px;
    font-weight: 600;
}

.cnb-note-block p {
    color: #f85149;
    margin: 0 !important;
    font-size: 14px;
    line-height: 1.6;
}

/* Code Blocks */
.cnb-editor-container {
    background: #161b22;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid #30363d;
    box-shadow: 0 8px 16px rgba(0,0,0,0.2);
    margin: 20px 0;
    font-family: 'SF Mono', 'Monaco', 'Inconsolata', 'Roboto Mono', 'Consolas', monospace;
}

.cnb-editor-header {
    background: linear-gradient(135deg, #21262d 0%, #30363d 100%);
    padding: 12px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #30363d;
}

.cnb-file-tab {
    background: #0d1117;
    color: #58a6ff;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    border: 1px solid #30363d;
}

.cnb-copy-btn {
    background: #0c1117;
    border: 1px solid #30363d;
    color: white;
    padding: 6px 12px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 12px;
    transition: all 0.2s;
    font-family: inherit;
}

.cnb-copy-btn:hover {
    background: #21262d;
    border-color: #58a6ff;
    transform: translateY(-1px);
}

.cnb-copy-btn.copied {
    background: #238636;
    border-color: #238636;
}

.cnb-code-wrapper {
    display: flex;
    background: #0d1117;
    align-items: flex-start;
}

.cnb-line-numbers {
    background: #161b22;
    color: #6e7681;
    padding: 20px 8px 20px 16px;
    font-size: 13px;
    line-height: 1.45;
    text-align: right;
    user-select: none;
    border-right: 1px solid #21262d;
    min-width: 50px;
    flex-shrink: 0;
}

.cnb-line-numbers > div {
    min-height: 18.85px;
}

.cnb-code-content {
    flex: 1;
    padding: 20px;
    font-size: 13px;
    line-height: 1.45;
    color: #e6edf3;
    overflow-x: auto;
}

.cnb-code-content .code-line {
    white-space: pre-wrap;
    word-break: break-all;
    min-height: 18.85px;
    margin-bottom: 0;
}

/* Syntax Colors - GitHub Dark Theme */
.cnb-code-content .tag { color: #7ee787; }
.cnb-code-content .attr { color: #79c0ff; }
.cnb-code-content .string { color: #a5d6ff; }
.cnb-code-content .keyword { color: #ff7b72; }
.cnb-code-content .function { color: #d2a8ff; }
.cnb-code-content .comment { color: #8b949e; font-style: italic; }
.cnb-code-content .number { color: #79c0ff; }
.cnb-code-content .property { color: #79c0ff; }
.cnb-code-content .value { color: #a5d6ff; }
.cnb-code-content .operator { color: #ff7b72; }
.cnb-code-content .punctuation { color: #e6edf3; }

/* Responsive */
@media (max-width: 768px) {
    .cnb-editor-container { 
        border-radius: 8px; 
        margin: 15px 0;
    }
    .cnb-code-content { 
        padding: 15px; 
        font-size: 12px; 
    }
    .cnb-line-numbers { 
        padding: 15px 6px 15px 12px; 
        font-size: 12px; 
    }
    .cnb-note-block {
        margin: 15px 0;
        padding: 14px;
    }
}

@media (max-width: 480px) {
    .cnb-line-numbers { 
        display: none;
    }
    .cnb-code-content {
        padding: 15px;
        font-size: 12px;
    }
    .cnb-editor-header {
        padding: 10px 15px;
    }
    .cnb-file-tab {
        font-size: 12px;
        padding: 5px 10px;
    }
    .cnb-copy-btn {
        font-size: 11px;
        padding: 5px 10px;
    }
}
