/* ================================
   ARTICLE.CSS - Estilos profissionais para artigos com tema dark/light
   Christian Mulato Dev Blog - Versão Profissional
   ================================ */

/* Importar fontes profissionais */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&family=Fira+Code:wght@300;400;500;600&display=swap');

/* Variáveis CSS - Tema Claro */
:root {
    --primary-color: #2563eb;
    --secondary-color: #1e40af;
    --text-color: #1f2937;
    --text-light: #6b7280;
    --background: #ffffff;
    --background-light: #f9fafb;
    --border-color: #e5e7eb;
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    --border-radius: 8px;
    --transition: all 0.3s ease;
    --card-bg: #ffffff;
    --hover-bg: #f3f4f6;
    --code-bg: #f8fafc;
    --pre-bg: #1e293b;
    --code-color: #e2e8f0;
}

/* Tema Escuro */
[data-theme="dark"] {
    --primary-color: #3b82f6;
    --secondary-color: #2563eb;
    --text-color: #ffffff;
    --text-light: #d1d5db;
    --background: #111827;
    --background-light: #1f2937;
    --border-color: #374151;
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.3);
    --card-bg: #1f2937;
    --hover-bg: #374151;
    --code-bg: #374151;
    --pre-bg: #0f172a;
    --code-color: #e2e8f0;
}

/* Botão de tema */
.theme-toggle {
    position: fixed;
    top: 20px;
    right: 20px;
    background: var(--card-bg);
    border: 2px solid var(--border-color);
    border-radius: 50px;
    padding: 12px;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: var(--shadow);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 50px;
    height: 50px;
}

.theme-toggle:hover {
    background: var(--hover-bg);
    border-color: var(--primary-color);
    transform: scale(1.1);
}

.theme-toggle svg {
    width: 20px;
    height: 20px;
    fill: var(--text-color);
    transition: var(--transition);
}

/* === NAVEGAÇÃO === */
.navbar {
    background: var(--background);
    border-bottom: 1px solid var(--border-color);
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(10px);
    background: var(--card-bg);
    transition: var(--transition);
}

.nav-container {
    max-width: 800px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 2rem;
}

.nav-brand {
    font-weight: 600;
    color: var(--primary-color);
    text-decoration: none;
    font-size: 1.1rem;
    transition: var(--transition);
}

.nav-brand:hover {
    color: var(--secondary-color);
}

.nav-links {
    display: flex;
    gap: 2rem;
}

.nav-links a {
    color: var(--text-light);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s ease;
}

.nav-links a:hover {
    color: var(--primary-color);
}

/* Header de artigo melhorado */
.header {
    background: var(--background);
    border-bottom: 1px solid var(--border-color);
}

.nav {
    background: var(--card-bg);
}

.nav-logo .logo-text {
    color: var(--primary-color);
}

.nav-logo .logo-subtitle {
    color: var(--text-light);
}

/* === RESET E BASE === */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    background: var(--background);
    transition: var(--transition);
}

/* === ARTIGO === */
.article-container {
    max-width: 900px;
    margin: 0 auto;
    padding: 3rem 2rem;
    line-height: 1.75;
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    background: var(--card-bg);
    box-shadow: var(--shadow-lg);
    border-radius: 12px;
    margin-top: 2rem;
    margin-bottom: 3rem;
    border: 1px solid var(--border-color);
}

.article-header {
    margin-bottom: 4rem;
    padding-bottom: 3rem;
    border-bottom: 2px solid var(--border-color);
    text-align: center;
}

.article-meta {
    display: flex;
    justify-content: center;
    gap: 2rem;
    margin-bottom: 2rem;
    font-size: 0.95rem;
}

.category {
    background: linear-gradient(135deg, #3b82f6 0%, #1e40af 100%);
    color: white;
    padding: 0.6rem 1.2rem;
    border-radius: 25px;
    font-weight: 600;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.date {
    color: var(--text-light);
    font-weight: 500;
    display: flex;
    align-items: center;
    font-size: 0.95rem;
}

.article-title {
    font-size: 3rem;
    font-weight: 800;
    color: var(--text-color);
    margin: 2rem 0;
    line-height: 1.1;
}

.author-info {
    margin: 2rem 0;
    color: var(--text-light);
    font-size: 1.1rem;
}

.author-info a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
}

.author-info a:hover {
    color: #1e40af;
    text-decoration: underline;
    text-decoration-thickness: 2px;
    text-underline-offset: 4px;
}

.article-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.8rem;
    margin-top: 2rem;
    justify-content: center;
}

.article-tags .tag {
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
    color: #475569;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 500;
    border: 1px solid #e2e8f0;
    transition: all 0.3s ease;
}

.article-tags .tag:hover {
    background: linear-gradient(135deg, #3b82f6 0%, #1e40af 100%);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 8px 16px rgba(59, 130, 246, 0.3);
}

/* === CONTEÚDO DO ARTIGO - VERSÃO PROFISSIONAL === */
.article-content, .post-content {
    font-size: 1.125rem;
    color: var(--text-color);
    max-width: none;
    line-height: 1.8;
    font-weight: 400;
    padding-right: 1.5rem;
    border-right: 1px solid var(--border-color);
}

.article-content h1 {
    font-size: 2.25rem;
    font-weight: 700;
    color: var(--text-color);
    margin: 3rem 0 1.5rem 0;
    line-height: 1.2;
    position: relative;
    padding-left: 1rem;
}

.article-content h1::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: linear-gradient(135deg, #3b82f6 0%, #1e40af 100%);
    border-radius: 2px;
}

.article-content h2 {
    font-size: 1.875rem;
    font-weight: 600;
    color: var(--text-color);
    margin: 2.5rem 0 1.25rem 0;
    line-height: 1.3;
    position: relative;
}

.article-content h2::after {
    content: '';
    position: absolute;
    bottom: -0.5rem;
    left: 0;
    width: 60px;
    height: 3px;
    background: linear-gradient(90deg, #3b82f6, #60a5fa);
    border-radius: 2px;
}

.article-content h3 {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-color);
    margin: 2rem 0 1rem 0;
    position: relative;
    padding-left: 1rem;
}

.article-content h3::before {
    content: '▶';
    position: absolute;
    left: 0;
    color: #3b82f6;
    font-size: 0.875rem;
}

.article-content h4 {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-color);
    margin: 1.75rem 0 0.75rem 0;
}

.article-content p {
    margin-bottom: 1.75rem;
    line-height: 1.8;
    text-align: justify;
    color: var(--text-color);
}

.article-content p:first-of-type {
    font-size: 1.2rem;
    color: var(--text-color);
    font-weight: 400;
    line-height: 1.7;
}

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

.article-content li {
    margin-bottom: 1rem;
    line-height: 1.7;
    position: relative;
    color: var(--text-color);
}

.article-content ul li::before {
    content: '●';
    color: #3b82f6;
    font-size: 1.2rem;
    position: absolute;
    left: -1.5rem;
    top: 0;
}

.article-content blockquote {
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border-left: 5px solid #3b82f6;
    padding: 2rem;
    margin: 3rem 0;
    border-radius: 0 12px 12px 0;
    font-style: italic;
    color: #475569;
    position: relative;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.article-content blockquote::before {
    content: '"';
    font-size: 4rem;
    color: #3b82f6;
    position: absolute;
    top: 0.5rem;
    left: 1rem;
    opacity: 0.3;
    font-weight: bold;
}

.article-content blockquote p {
    margin: 0;
    font-size: 1.1rem;
    padding-left: 2rem;
}

/* === IMAGENS PROFISSIONAIS === */

/* === IMAGEM PRINCIPAL DO ARTIGO === */
.hero-image {
    width: 100%;
    max-width: 800px;
    height: auto;
    display: block;
    margin: 0 auto 2rem auto;
    border-radius: 8px;
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border-color);
    border-right: 3px solid var(--primary-color);
    object-fit: cover;
}

/* Estilo para outras imagens */
.article-content img,
.post-content img:not(.hero-image) {
    max-width: 100%;
    height: auto;
    margin: 3rem auto;
    display: block;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
    border-right: 3px solid var(--primary-color);
    transition: all 0.3s ease;
}

.article-content img:hover,
.post-content img:not(.hero-image):hover {
    transform: scale(1.02);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.18);
}

/* Container para imagens com legenda */
.image-container {
    margin: 3rem 0;
    text-align: center;
}

.image-container img {
    margin-bottom: 1rem;
    border: 1px solid #e2e8f0;
}

.image-caption {
    font-size: 0.95rem;
    color: #64748b;
    font-style: italic;
    margin-top: 0.5rem;
    padding: 0 1rem;
}

/* Imagens lado a lado */
.images-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin: 3rem 0;
}

.images-grid img {
    margin: 0;
    width: 100%;
}

/* Imagem destacada */
.featured-image {
    width: 100%;
    height: 400px;
    object-fit: cover;
    border-radius: 16px;
    margin: 3rem 0;
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.15);
}

/* === BLOCOS DE CÓDIGO PROFISSIONAIS === */
.article-content pre {
    background: var(--pre-bg);
    color: var(--code-color);
    padding: 2rem;
    border-radius: 12px;
    overflow-x: auto;
    margin: 3rem 0;
    font-family: 'Fira Code', 'Monaco', 'Consolas', monospace;
    line-height: 1.6;
    position: relative;
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border-color);
}

.article-content pre::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 40px;
    background: linear-gradient(90deg, #475569, #64748b);
    border-radius: 12px 12px 0 0;
    border-bottom: 1px solid #334155;
}

.article-content pre::after {
    content: '⬤ ⬤ ⬤';
    position: absolute;
    top: 12px;
    left: 16px;
    color: #94a3b8;
    font-size: 0.75rem;
    letter-spacing: 4px;
}

.article-content pre code {
    background: transparent;
    color: inherit;
    padding: 0;
    border-radius: 0;
    font-weight: 400;
    display: block;
    margin-top: 40px;
    font-size: 0.95rem;
}

.article-content code {
    font-family: 'Fira Code', 'Monaco', 'Consolas', monospace;
    font-size: 0.9em;
    font-weight: 500;
}

.article-content p code,
.article-content li code {
    background: var(--code-bg);
    color: var(--primary-color);
    padding: 0.3rem 0.6rem;
    border-radius: 6px;
    font-weight: 600;
    font-size: 0.9em;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow);
}

/* Container para código com título */
.code-block {
    margin: 3rem 0;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
}

.code-title {
    background: linear-gradient(90deg, #3b82f6, #1e40af);
    color: white;
    padding: 0.75rem 1.5rem;
    font-weight: 600;
    font-size: 0.9rem;
    margin: 0;
}

.code-title::before {
    content: '📄 ';
    margin-right: 0.5rem;
}

/* Botão de copiar código */
.copy-button {
    position: absolute;
    top: 8px;
    right: 12px;
    background: rgba(255, 255, 255, 0.1);
    color: #e2e8f0;
    border: 1px solid rgba(255, 255, 255, 0.2);
    padding: 0.4rem 0.8rem;
    border-radius: 6px;
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 10;
}

.copy-button:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-1px);
}

/* Syntax highlighting melhorado */
.highlight {
    background: linear-gradient(135deg, #1e293b 0%, #334155 100%);
    color: #e2e8f0;
    border-radius: 12px;
    overflow: hidden;
    position: relative;
}

.highlight pre {
    background: transparent;
    margin: 0;
    padding: 2rem;
    overflow-x: auto;
}

/* Cores de syntax highlighting */
.highlight .k { color: #8b5cf6; } /* Keywords */
.highlight .s { color: #10b981; } /* Strings */
.highlight .c { color: #6b7280; font-style: italic; } /* Comments */
.highlight .n { color: #e2e8f0; } /* Names */
.highlight .o { color: #f59e0b; } /* Operators */
.highlight .m { color: #3b82f6; } /* Numbers */
.highlight .kc { color: #ef4444; } /* Constants */
.highlight .kt { color: #8b5cf6; } /* Types */

/* === TABELAS === */
.article-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 2rem 0;
    font-size: 0.95rem;
}

.article-content th,
.article-content td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid #e2e8f0;
}

.article-content th {
    background: #f8fafc;
    font-weight: 600;
    color: #374151;
}

.article-content tr:hover {
    background: #f9fafb;
}

/* === LINKS === */
.article-content a {
    color: #2563eb;
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 2px;
    transition: color 0.2s ease;
}

.article-content a:hover {
    color: #1d4ed8;
    text-decoration-thickness: 2px;
}

/* === RODAPÉ DO ARTIGO === */
.article-footer {
    background: #f8fafc;
    border-top: 1px solid #e2e8f0;
    padding: 2rem 0;
    margin-top: 4rem;
}

.footer-content {
    max-width: 800px;
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: #64748b;
}

.footer-links {
    display: flex;
    gap: 2rem;
}

.footer-links a {
    color: #64748b;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s ease;
}

.footer-links a:hover {
    color: #2563eb;
}

/* === RESPONSIVIDADE === */
@media (max-width: 768px) {
    .nav-container {
        flex-direction: column;
        gap: 1rem;
        padding: 0 1rem;
    }
    
    .nav-links {
        gap: 1rem;
    }
    
    .article-container {
        padding: 1rem;
    }
    
    .article-title {
        font-size: 2rem;
    }
    
    .article-content h1 {
        font-size: 1.6rem;
    }
    
    .article-content h2 {
        font-size: 1.4rem;
    }
    
    .article-meta {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .footer-content {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }
    
    .article-content pre {
        padding: 1rem;
        font-size: 0.85rem;
    }
    
    .article-content table {
        font-size: 0.85rem;
        overflow-x: auto;
        display: block;
        white-space: nowrap;
    }
    
    .hero-image {
        max-width: 100%;
    }
    
    .article-content, .post-content {
        padding-right: 0;
        border-right: none;
    }
}

@media (max-width: 480px) {
    .article-title {
        font-size: 1.8rem;
    }
    
    .article-content {
        font-size: 1rem;
    }
    
    .article-content th,
    .article-content td {
        padding: 0.7rem;
    }
}

/* === ACESSIBILIDADE === */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* === DARK MODE (opcional) === */
@media (prefers-color-scheme: dark) {
    .navbar {
        background: rgba(15, 23, 42, 0.95);
        border-color: #334155;
    }
    
    .nav-brand, .nav-links a:hover {
        color: #60a5fa;
    }
    
    .nav-links a {
        color: #94a3b8;
    }
    
    .article-container {
        background: #0f172a;
    }
    
    /* Todas as cores de texto são controladas por variáveis CSS */
    
    /* Cor do marcador de lista no dark mode */
    .article-content ul li::before,
    .post-content ul li::before {
        color: #60a5fa;
    }
    
    /* Ajuste de cores para citações em dark mode */
    .article-content blockquote,
    .post-content blockquote {
        background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
        border-left: 5px solid #3b82f6;
    }
    
    .article-content blockquote::before,
    .post-content blockquote::before {
        color: #60a5fa;
    }
}
