/*
 * 📝 MARKDOWN STYLES
 * Estilos para conteúdo renderizado em markdown
 */

/* ============================================
   TYPOGRAPHY
   ============================================ */

.markdown-content {
    line-height: 1.7;
    color: #2d3748;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.markdown-content p {
    margin-bottom: 1rem;
}

.markdown-content p:last-child {
    margin-bottom: 0;
}

/* Headings */
.markdown-content h1,
.markdown-content h2,
.markdown-content h3,
.markdown-content h4,
.markdown-content h5,
.markdown-content h6 {
    font-weight: 700;
    margin-top: 1.5rem;
    margin-bottom: 0.75rem;
    line-height: 1.3;
    color: #1a202c;
}

.markdown-content h1 { font-size: 2rem; }
.markdown-content h2 { font-size: 1.75rem; }
.markdown-content h3 { font-size: 1.5rem; }
.markdown-content h4 { font-size: 1.25rem; }
.markdown-content h5 { font-size: 1.1rem; }
.markdown-content h6 { font-size: 1rem; }

/* Emphasis */
.markdown-content strong {
    font-weight: 700;
    color: #1a202c;
}

.markdown-content em {
    font-style: italic;
    color: #4a5568;
}

.markdown-content del {
    text-decoration: line-through;
    opacity: 0.7;
}

/* Links */
.markdown-content a {
    color: #667eea;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s ease;
    border-bottom: 1px solid rgba(102, 126, 234, 0.3);
}

.markdown-content a:hover {
    color: #764ba2;
    border-bottom-color: #764ba2;
}

/* ============================================
   CODE BLOCKS
   ============================================ */

/* Inline code */
.markdown-code {
    background: #f7fafc;
    border: 1px solid #e2e8f0;
    border-radius: 4px;
    padding: 0.2rem 0.4rem;
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    font-size: 0.9em;
    color: #e53e3e;
}

/* Code blocks */
.markdown-pre {
    background: #2d3748;
    color: #e2e8f0;
    border-radius: 8px;
    padding: 1rem;
    overflow-x: auto;
    margin: 1rem 0;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.markdown-pre code {
    background: transparent;
    border: none;
    padding: 0;
    color: inherit;
    font-size: 0.9rem;
    line-height: 1.6;
    display: block;
}

/* ============================================
   LISTS
   ============================================ */

.markdown-content ul,
.markdown-content ol {
    margin: 1rem 0;
    padding-left: 2rem;
}

.markdown-content ul {
    list-style-type: disc;
}

.markdown-content ol {
    list-style-type: decimal;
}

.markdown-content li {
    margin-bottom: 0.5rem;
    line-height: 1.6;
}

.markdown-content li:last-child {
    margin-bottom: 0;
}

/* Nested lists */
.markdown-content ul ul,
.markdown-content ol ul {
    list-style-type: circle;
    margin-top: 0.5rem;
}

.markdown-content ul ol,
.markdown-content ol ol {
    margin-top: 0.5rem;
}

/* Task lists */
.markdown-content input[type="checkbox"] {
    margin-right: 0.5rem;
}

/* ============================================
   BLOCKQUOTES
   ============================================ */

.markdown-blockquote {
    border-left: 4px solid #667eea;
    background: linear-gradient(90deg, rgba(102, 126, 234, 0.05) 0%, transparent 100%);
    padding: 1rem 1.5rem;
    margin: 1rem 0;
    border-radius: 0 8px 8px 0;
    color: #4a5568;
    font-style: italic;
}

.markdown-blockquote p {
    margin: 0;
}

.markdown-blockquote p + p {
    margin-top: 0.75rem;
}

/* ============================================
   TABLES
   ============================================ */

.markdown-table {
    width: 100%;
    border-collapse: collapse;
    margin: 1rem 0;
    overflow: hidden;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.markdown-table thead {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.markdown-table th {
    padding: 0.75rem 1rem;
    text-align: left;
    font-weight: 600;
    font-size: 0.9rem;
}

.markdown-table td {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid #e2e8f0;
    color: #4a5568;
}

.markdown-table tbody tr:hover {
    background: #f7fafc;
}

.markdown-table tbody tr:last-child td {
    border-bottom: none;
}

/* ============================================
   HORIZONTAL RULES
   ============================================ */

.markdown-content hr {
    border: none;
    height: 2px;
    background: linear-gradient(90deg, transparent 0%, #e2e8f0 50%, transparent 100%);
    margin: 2rem 0;
}

/* ============================================
   MARKDOWN HELP TOOLTIP
   ============================================ */

.markdown-help {
    background: #f7fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 1rem;
    font-size: 0.85rem;
    margin-top: 0.5rem;
}

.markdown-help strong {
    color: #667eea;
}

.markdown-help ul {
    margin: 0.5rem 0 0 0;
    padding-left: 1.5rem;
    list-style-type: none;
}

.markdown-help li {
    padding: 0.25rem 0;
    display: flex;
    align-items: baseline;
}

.markdown-help li::before {
    content: '▹';
    color: #667eea;
    font-weight: 700;
    margin-right: 0.5rem;
}

/* ============================================
   MARKDOWN PREVIEW BADGE
   ============================================ */

.markdown-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.1) 0%, rgba(118, 75, 162, 0.1) 100%);
    color: #667eea;
    padding: 0.25rem 0.65rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    border: 1px solid rgba(102, 126, 234, 0.2);
}

.markdown-badge i {
    font-size: 0.7rem;
}

/* ============================================
   RESPONSIVE
   ============================================ */

@media (max-width: 768px) {
    .markdown-content h1 { font-size: 1.5rem; }
    .markdown-content h2 { font-size: 1.35rem; }
    .markdown-content h3 { font-size: 1.2rem; }
    
    .markdown-pre {
        padding: 0.75rem;
        font-size: 0.85rem;
    }
    
    .markdown-blockquote {
        padding: 0.75rem 1rem;
    }
    
    .markdown-table {
        font-size: 0.85rem;
    }
    
    .markdown-table th,
    .markdown-table td {
        padding: 0.5rem 0.75rem;
    }
}

/* ============================================
   DARK MODE SUPPORT (Optional)
   ============================================ */

@media (prefers-color-scheme: dark) {
    .markdown-content {
        color: #e2e8f0;
    }
    
    .markdown-content h1,
    .markdown-content h2,
    .markdown-content h3,
    .markdown-content h4,
    .markdown-content h5,
    .markdown-content h6 {
        color: #f7fafc;
    }
    
    .markdown-code {
        background: #2d3748;
        border-color: #4a5568;
        color: #fc8181;
    }
    
    .markdown-blockquote {
        background: linear-gradient(90deg, rgba(102, 126, 234, 0.1) 0%, transparent 100%);
        color: #cbd5e0;
    }
    
    .markdown-help {
        background: #2d3748;
        border-color: #4a5568;
        color: #e2e8f0;
    }
}
