/* Terminal Markdown Styles */
/* Designed to blend seamlessly with the terminal theme */

/* Headers */
.md-h1 {
    color: #00ff60;
    font-size: 18px;
    font-weight: 700;
    margin: 8px 0 4px 0;
    border-bottom: 2px solid #00ff41;
    padding-bottom: 4px;
    text-shadow: 0 0 3px rgba(0, 255, 96, 0.4);
}

.md-h2 {
    color: #00ff60;
    font-size: 16px;
    font-weight: 600;
    margin: 6px 0 3px 0;
    border-bottom: 1px solid #00ff41;
    padding-bottom: 3px;
    text-shadow: 0 0 2px rgba(0, 255, 96, 0.3);
}

.md-h3 {
    color: #00ff60;
    font-size: 14px;
    font-weight: 600;
    margin: 6px 0 3px 0;
    text-shadow: 0 0 2px rgba(0, 255, 96, 0.2);
}

.md-h4 {
    color: #00ff60;
    font-size: 13px;
    font-weight: 500;
    margin: 10px 0 5px 0;
    text-shadow: 0 0 1px rgba(0, 255, 96, 0.2);
}

.md-h5, .md-h6 {
    color: #00ff60;
    font-size: 13px;
    font-weight: 500;
    margin: 8px 0 4px 0;
    opacity: 0.9;
}

/* Text formatting */
.md-bold {
    color: #00ff60;
    font-weight: 700;
    text-shadow: 0 0 2px rgba(0, 255, 96, 0.3);
}

.md-italic {
    color: #a0ff60;
    font-style: italic;
    opacity: 0.95;
}

/* Inline code */
.md-code {
    background: rgba(0, 255, 65, 0.1);
    color: #00ff90;
    padding: 2px 4px;
    border-radius: 3px;
    font-family: inherit;
    font-size: 12px;
    border: 1px solid rgba(0, 255, 65, 0.2);
    text-shadow: 0 0 1px rgba(0, 255, 144, 0.3);
}

/* Code blocks */
.md-code-block {
    background: #0a0a0a;
    border: 1px solid #00ff41;
    border-left: 3px solid #00ff60;
    border-radius: 4px;
    padding: 8px 12px;
    margin: 6px 0;
    overflow-x: auto;
    font-family: inherit;
    font-size: 12px;
    line-height: 1.3;
    color: #90ff90;
    text-shadow: 0 0 1px rgba(144, 255, 144, 0.3);
    box-shadow: 0 2px 8px rgba(0, 255, 65, 0.1);
}

/* Code blocks within terminal lines */
.terminal-line .md-code-block {
    margin: 3px 0;
    display: block;
    width: 100%;
}

.md-code-block code {
    background: transparent;
    border: none;
    padding: 0;
    color: inherit;
    font-family: inherit;
    font-size: inherit;
}

/* Language-specific code block styling */
.md-code-javascript, .md-code-js {
    border-left-color: #ffff60;
    color: #ffff90;
}

.md-code-python, .md-code-py {
    border-left-color: #60ff60;
    color: #90ff90;
}

.md-code-bash, .md-code-shell {
    border-left-color: #ff6060;
    color: #ff9090;
}

.md-code-css {
    border-left-color: #60a0ff;
    color: #90b0ff;
}

/* Lists */
.md-list-item {
    margin: 8px 0 8px 16px;
    color: #a0a0a0;
    position: relative;
}

/* Override terminal-line spacing for list items */
.terminal-line.md-list-item {
    margin-bottom: 8px !important;
}

/* Keep the green CSS bullets */
.md-list-item::before {
    content: '';
    position: absolute;
    left: -12px;
    top: 10px;
    width: 4px;
    height: 4px;
    background: #00ff41;
    border-radius: 50%;
    box-shadow: 0 0 3px rgba(0, 255, 65, 0.5);
}

/* List styling when integrated in terminal lines */
.terminal-line.output-line {
    color: #a0a0a0;
}

/* Headers when integrated in terminal lines */
.terminal-line.md-h1,
.terminal-line.md-h2,
.terminal-line.md-h3,
.terminal-line.md-h4,
.terminal-line.md-h5,
.terminal-line.md-h6 {
    font-weight: inherit;
}

.terminal-line.md-h1 {
    color: #00ff60;
    font-size: 16px;
    font-weight: 700;
}

.terminal-line.md-h2 {
    color: #00ff60;
    font-size: 15px;
    font-weight: 600;
}

.terminal-line.md-h3 {
    color: #00ff60;
    font-size: 14px;
    font-weight: 600;
}

.md-ordered-item {
    margin: 6px 0 6px 20px;
    color: #a0a0a0;
    display: flex;
    align-items: flex-start;
}

.md-list-number {
    color: #00ff60;
    font-weight: 600;
    margin-right: 8px;
    text-shadow: 0 0 1px rgba(0, 255, 96, 0.3);
    min-width: 20px;
    flex-shrink: 0;
}

/* Paragraphs and spacing */
.md-paragraph {
    margin: 3px 0;
    line-height: 1.4;
    color: inherit;
}

.md-empty-line {
    height: 6px;
    margin: 0;
}

/* Mobile responsiveness */
@media (max-width: 768px) {
    .md-h1 {
        font-size: 16px;
        margin: 6px 0 3px 0;
    }
    
    .md-h2 {
        font-size: 14px;
        margin: 5px 0 2px 0;
    }
    
    .md-h3 {
        font-size: 13px;
        margin: 4px 0 2px 0;
    }
    
    .md-code-block {
        padding: 6px 10px;
        margin: 4px 0;
        font-size: 11px;
    }
    
    .md-code {
        font-size: 11px;
        padding: 1px 3px;
    }
    
    .md-list-item {
        margin: 4px 0 4px 12px;
    }
    
    .md-ordered-item {
        margin: 4px 0 4px 16px;
    }
}

/* Small mobile devices */
@media (max-width: 480px) {
    .md-h1 {
        font-size: 15px;
    }
    
    .md-h2 {
        font-size: 13px;
    }
    
    .md-code-block {
        padding: 6px 10px;
        font-size: 10px;
    }
    
    .md-code {
        font-size: 10px;
    }
}

/* Ensure markdown content doesn't break terminal layout */
.terminal-line .md-h1,
.terminal-line .md-h2,
.terminal-line .md-h3,
.terminal-line .md-h4,
.terminal-line .md-h5,
.terminal-line .md-h6,
.terminal-line .md-paragraph,
.terminal-line .md-list-item,
.terminal-line .md-ordered-item,
.terminal-line .md-code-block {
    margin-top: 0;
    margin-bottom: 8px;
}

.terminal-line .md-code-block {
    margin-bottom: 12px;
}

/* Enhance readability with subtle animations */
.md-bold {
    transition: text-shadow 0.2s ease;
}

.md-bold:hover {
    text-shadow: 0 0 4px rgba(0, 255, 96, 0.5);
}

.md-code {
    transition: all 0.2s ease;
}

.md-code:hover {
    background: rgba(0, 255, 65, 0.15);
    border-color: rgba(0, 255, 65, 0.3);
}

.md-code-block {
    transition: box-shadow 0.2s ease;
}

.md-code-block:hover {
    box-shadow: 0 2px 12px rgba(0, 255, 65, 0.15);
}

/* Ensure proper text wrapping for long content */
.md-paragraph,
.md-list-item,
.md-ordered-item {
    word-wrap: break-word;
    word-break: break-word;
    hyphens: auto;
}

.md-code-block {
    white-space: pre-wrap;
    word-break: break-word;
}