/**
 * Estilos para comentários com Markdown
 */

/* Estilo geral para comentários com Markdown */
.comentario-markdown {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.6;
    color: #4a5568;
    overflow-wrap: break-word;
    word-break: break-word;
    overflow-x: hidden;
    max-width: 100%;
}

/* Código inline */
.comentario-markdown code {
    background-color: #f7fafc;
    border: 1px solid #e2e8f0;
    border-radius: 3px;
    padding: 0.2em 0.4em;
    font-size: 0.875em;
    font-family: 'Courier New', Courier, monospace;
    color: #e53e3e;
}

/* Blocos de código */
.comentario-markdown pre {
    background-color: #2d3748;
    border-radius: 6px;
    padding: 1em;
    overflow-x: auto;
    margin: 0.5em 0;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.comentario-markdown pre code {
    background-color: transparent;
    border: none;
    padding: 0;
    color: #f7fafc;
    font-size: 0.875em;
    font-family: 'Courier New', Courier, monospace;
    line-height: 1.5;
    display: block;
}

/* Negrito */
.comentario-markdown strong {
    font-weight: 600;
    color: #2d3748;
}

/* Itálico */
.comentario-markdown em {
    font-style: italic;
}

/* Links */
.comentario-markdown a {
    color: #3182ce;
    text-decoration: none;
    border-bottom: 1px solid #bee3f8;
    transition: all 0.2s;
}

.comentario-markdown a:hover {
    color: #2c5282;
    border-bottom-color: #3182ce;
}

/* Menções (@usuario) - Apenas destaque visual, não clicável */
.comentario-markdown .mention,
.mention {
    background-color: #e3f2fd !important;
    color: #1976d2 !important;
    padding: 2px 6px !important;
    border-radius: 4px !important;
    font-weight: 500 !important;
    cursor: text !important;
    pointer-events: none !important;
    user-select: text !important;
    display: inline !important;
}

.comentario-markdown .mention:hover,
.mention:hover {
    background-color: #e3f2fd !important;
    color: #1976d2 !important;
    cursor: text !important;
}

/* Listas */
.comentario-markdown ul,
.comentario-markdown ol {
    margin: 0.5em 0;
    padding-left: 1.5em;
}

.comentario-markdown li {
    margin: 0.25em 0;
}

/* Parágrafos */
.comentario-markdown p {
    margin: 0.5em 0;
}

/* Citações */
.comentario-markdown blockquote {
    border-left: 4px solid #cbd5e0;
    padding-left: 1em;
    margin: 0.5em 0;
    color: #718096;
    font-style: italic;
}

/* Tabelas */
.comentario-markdown table {
    border-collapse: collapse;
    width: 100%;
    margin: 0.5em 0;
}

.comentario-markdown table th,
.comentario-markdown table td {
    border: 1px solid #e2e8f0;
    padding: 0.5em;
    text-align: left;
}

.comentario-markdown table th {
    background-color: #f7fafc;
    font-weight: 600;
}

/* Highlight.js - Tema escuro para blocos de código */
.hljs {
    background: #2d3748;
    color: #f7fafc;
}

.hljs-comment,
.hljs-quote {
    color: #a0aec0;
    font-style: italic;
}

.hljs-keyword,
.hljs-selector-tag,
.hljs-subst {
    color: #fc8181;
}

.hljs-number,
.hljs-literal,
.hljs-variable,
.hljs-template-variable,
.hljs-tag .hljs-attr {
    color: #f6ad55;
}

.hljs-string,
.hljs-doctag {
    color: #68d391;
}

.hljs-title,
.hljs-section,
.hljs-selector-id {
    color: #63b3ed;
    font-weight: bold;
}

.hljs-subst {
    font-weight: normal;
}

.hljs-type,
.hljs-class .hljs-title {
    color: #fbd38d;
}

.hljs-tag,
.hljs-name,
.hljs-attribute {
    color: #fc8181;
    font-weight: normal;
}

.hljs-regexp,
.hljs-link {
    color: #9f7aea;
}

.hljs-symbol,
.hljs-bullet {
    color: #b794f4;
}

.hljs-built_in,
.hljs-builtin-name {
    color: #4fd1c5;
}

.hljs-meta {
    color: #a0aec0;
}

.hljs-deletion {
    background: #fc8181;
}

.hljs-addition {
    background: #68d391;
}

.hljs-emphasis {
    font-style: italic;
}

.hljs-strong {
    font-weight: bold;
}

/* Responsividade */
@media (max-width: 768px) {
    .comentario-markdown pre {
        font-size: 0.8em;
        padding: 0.75em;
    }
    
    .comentario-markdown code {
        font-size: 0.8em;
    }
}

/* Preview de comentário */
#previewComentario {
    background-color: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 8px;
}

#previewComentario .comentario-markdown {
    min-height: 50px;
}

/* Toolbar de formatação */
.btn-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    margin-bottom: 10px;
}

.btn-toolbar .btn {
    padding: 0.25rem 0.5rem;
    font-size: 0.875rem;
}

/* Scrollbar personalizado para blocos de código */
.comentario-markdown pre::-webkit-scrollbar {
    height: 8px;
}

.comentario-markdown pre::-webkit-scrollbar-track {
    background: #1a202c;
    border-radius: 4px;
}

.comentario-markdown pre::-webkit-scrollbar-thumb {
    background: #4a5568;
    border-radius: 4px;
}

.comentario-markdown pre::-webkit-scrollbar-thumb:hover {
    background: #718096;
}
