/* docs/_static/custom_style.css
   Versão: Refatorada, Otimizada para Legibilidade e Suporte C++/Python
*/

/* ==========================================================================
   1. FONTES
   ========================================================================== */
@font-face {
    font-family: 'Rajdhani';
    font-weight: 500;
    src: url('fonts/Rajdhani-Light.woff2') format('woff2'),
         url('fonts/Rajdhani-Light.woff') format('woff');
}
@font-face {
    font-family: 'Rajdhani';
    font-weight: 700;
    src: url('fonts/Rajdhani-Bold.woff2') format('woff2'),
         url('fonts/Rajdhani-Bold.woff') format('woff');
}
@font-face {
    font-family: 'Roboto';
    font-weight: 400;
    src: url('fonts/Roboto-Regular.woff2') format('woff2'),
         url('fonts/Roboto-Regular.woff') format('woff');
}

/* ==========================================================================
   2. LIGHT MODE (PADRÃO) - Layout e Tipografia
   ========================================================================== */
body, .wy-body-content, .wy-nav-content, .wy-nav-content-wrap, .document, .rst-content {
    background-color: #FFF0E7 !important;
}

body, .rst-content p, .rst-content li, .rst-content span, .rst-content div {
    font-family: 'Roboto', sans-serif;
    color: #333;
    line-height: 1.6;
}

/* Títulos */
.rst-content h1, .rst-content h2, .rst-content h3 {
    font-family: 'Rajdhani', sans-serif !important;
    font-weight: 700 !important;
    color: #321F13 !important;
}
.rst-content h4, .rst-content h5, .rst-content h6 {
    font-family: 'Rajdhani', sans-serif !important;
    font-weight: 400 !important;
    color: #321F13 !important;
}

/* Links */
.rst-content a {
    color: #004975;
    text-decoration: none;
    position: relative;
    transition: color 0.3s ease;
}
.rst-content a:hover {
    color: #036B9D;
}
.rst-content a::after {
    content: "";
    position: absolute;
    width: 0;
    height: 2px;
    display: block;
    margin-top: 2px;
    right: 0;
    background: #036B9D;
    transition: width 0.3s ease;
}
.rst-content a:hover::after {
    width: 100%;
    left: 0;
    right: auto;
}

/* ==========================================================================
   3. MENU LATERAL (SIDEBAR)
   ========================================================================== */
.wy-nav-top, .wy-side-nav-search, .wy-nav-side {
    background-color: #001C39 !important;
    font-family: 'Roboto', sans-serif !important;
}
.wy-side-nav-search a, .wy-menu-vertical a {
    color: #FFF0E7 !important;
}
.wy-menu-vertical a:hover {
    background-color: #036B9D !important;
}
.wy-menu-vertical li.current > a {
    color: #FFF0E7 !important;
    background-color: #21B1D9 !important;
}
.wy-menu-vertical li.current li.toctree-l2 a {
    color: #FFF0E7 !important;
    background-color: #004975 !important;
}

/* ==========================================================================
   4. BLOCOS DE CÓDIGO E ASSINATURAS (API) - Light Mode
   ========================================================================== */
/* Código inline */
.rst-content code, .rst-content kbd, .rst-content tt {
    font-family: "Roboto Mono", monospace !important;
    background-color: rgba(0, 0, 0, 0.05) !important;
    color: #c7254e !important;
    padding: 2px 6px !important;
    border-radius: 4px !important;
    font-size: 0.9em;
}

/* Blocos de código longos */
.rst-content pre.literal-block, .rst-content pre.highlight, .rst-content .highlight pre {
    background-color: #f5f7fa !important;
    color: #1e1e1e !important;
    font-family: "Roboto Mono", monospace !important;
    font-size: 0.95em !important;
    padding: 12px 14px !important;
    border-radius: 6px !important;
    border: 1px solid #e1e4e8 !important;
    box-shadow: 0 2px 6px rgba(0,0,0,0.04) !important;
}

/* Assinaturas de Classes/Funções (Suporta C++ e Python) */
.rst-content .desc .sig, .rst-content .sig, .rst-content dt .sig {
    display: inline-block !important;
    padding: 10px 12px !important;
    border-radius: 6px !important;
    font-family: "Roboto Mono", "Courier New", monospace !important;
    background-color: #e8f7fb !important;
    color: #004975 !important;
    border-left: 4px solid #21B1D9 !important;
    margin-bottom: 8px;
}
.rst-content .sig-name, .rst-content .descname {
    color: #004975 !important;
    font-weight: bold !important;
    font-size: 1.1em;
}

/* Tabelas (muito usadas na documentação de parâmetros) */
.rst-content table.docutils {
    border-collapse: collapse !important;
    width: 100%;
    margin-bottom: 20px;
}
.rst-content table.docutils th {
    background-color: #e8f7fb !important;
    color: #004975 !important;
    border: 1px solid #d1e5eb !important;
}
.rst-content table.docutils td {
    border: 1px solid #d1e5eb !important;
}

/* ==========================================================================
   5. ADMONITIONS (Avisos, Notas)
   ========================================================================== */
.admonition {
    border-radius: 4px;
    padding: 12px;
    margin-bottom: 20px;
}
.admonition.note {
    background-color: #e8f4fd;
    border-left: 5px solid #007BFF;
}
.admonition.warning, .admonition.caution {
    background-color: #fff8e6;
    border-left: 5px solid #FFC107;
}

/* ==========================================================================
   6. DARK MODE
   ========================================================================== */
body.dark-mode, html.dark-mode,
body.dark-mode .wy-body-content, 
body.dark-mode .wy-nav-content, 
body.dark-mode .wy-nav-content-wrap, 
body.dark-mode .document, 
body.dark-mode .rst-content {
    background-color: #000E1C !important;
    color: #E8E8E8 !important;
}

/* Força texto claro no dark mode */
body.dark-mode .rst-content p, 
body.dark-mode .rst-content li, 
body.dark-mode .rst-content span, 
body.dark-mode .rst-content td {
    color: #E8E8E8 !important;
}

body.dark-mode .rst-content h1, body.dark-mode .rst-content h2, body.dark-mode .rst-content h3, 
body.dark-mode .rst-content h4, body.dark-mode .rst-content h5, body.dark-mode .rst-content h6 {
    color: #FFF0E7 !important;
}

body.dark-mode .rst-content a {
    color: #569cd6 !important;
}
body.dark-mode .rst-content a::after {
    background: #569cd6 !important;
}

/* Código Inline Dark Mode */
body.dark-mode .rst-content code, 
body.dark-mode .rst-content kbd {
    background-color: #0A2C4F !important;
    color: #A9D6EA !important;
    border: 1px solid #134675 !important;
}

/* Blocos de Código Dark Mode */
body.dark-mode .rst-content pre.literal-block, 
body.dark-mode .rst-content pre.highlight, 
body.dark-mode .rst-content .highlight pre {
    background-color: #041424 !important;
    color: #e6edf3 !important;
    border: 1px solid #134675 !important;
}

/* Assinaturas API (C++/Python) Dark Mode */
body.dark-mode .rst-content .desc .sig, 
body.dark-mode .rst-content .sig, 
body.dark-mode .rst-content dt .sig {
    background-color: #0A2C4F !important;
    color: #E8E8E8 !important;
    border-left-color: #21B1D9 !important;
}
body.dark-mode .rst-content .sig-name, 
body.dark-mode .rst-content .descname {
    color: #21B1D9 !important;
}

/* Tabelas Dark Mode */
body.dark-mode .rst-content table.docutils th {
    background-color: #0A2C4F !important;
    color: #21B1D9 !important;
    border: 1px solid #134675 !important;
}
body.dark-mode .rst-content table.docutils td {
    border: 1px solid #134675 !important;
}

/* Admonitions Dark Mode */
body.dark-mode .admonition.note {
    background-color: #03203d !important;
    border-left: 5px solid #21B1D9 !important;
}
body.dark-mode .admonition.warning, 
body.dark-mode .admonition.caution {
    background-color: #382c03 !important;
    border-left: 5px solid #F2C572 !important;
}

/* Cores do Sintax Highlight no Dark Mode */
body.dark-mode .highlight .k { color: #ff7b72 !important; } /* keywords (if, void, class) */
body.dark-mode .highlight .s { color: #a5d6ff !important; } /* strings */
body.dark-mode .highlight .n { color: #d2a8ff !important; } /* variables */
body.dark-mode .highlight .c, body.dark-mode .highlight .c1 { color: #8b949e !important; font-style: italic !important; } /* comments */
body.dark-mode .highlight .p { color: #E8E8E8 !important; } /* pontuação */

/* ==========================================================================
   7. ANIMAÇÕES (Sutis)
   ========================================================================== */
body {
    animation: fadeIn 0.3s ease-in forwards;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

h1, h2 {
    animation: slideIn 0.4s ease forwards;
}
@keyframes slideIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* =========================================================
   AJUSTES DE CONTRASTE - EXCLUSIVO PARA DARK MODE (FORÇADO)
   ========================================================= */

/* 1. Tabela de Classes e Métodos (Matando o fundo branco radioativo) */
body.dark-mode .wy-table-responsive table.docutils tbody tr:nth-child(odd) td,
body.dark-mode .wy-table-responsive table.docutils tbody tr.row-odd td,
body.dark-mode .rst-content table.docutils tbody tr:nth-child(odd) td,
body.dark-mode .rst-content table.docutils tbody tr.row-odd td {
    background-color: #0A2C4F !important; /* Azul escuro da sua paleta */
    color: #E8E8E8 !important;
}

body.dark-mode .wy-table-responsive table.docutils tbody tr:nth-child(even) td,
body.dark-mode .wy-table-responsive table.docutils tbody tr.row-even td,
body.dark-mode .rst-content table.docutils tbody tr:nth-child(even) td,
body.dark-mode .rst-content table.docutils tbody tr.row-even td {
    background-color: #041424 !important; /* Fundo mais escuro para contraste */
    color: #E8E8E8 !important;
}

/* Arrumando o cabeçalho da tabela */
body.dark-mode .wy-table-responsive table.docutils thead th,
body.dark-mode .rst-content table.docutils thead th {
    background-color: #001C39 !important;
    color: #21B1D9 !important; /* Ciano de destaque */
    border-bottom: 2px solid #21B1D9 !important;
}

/* 2. Caixa de Assinatura da Classe/Função (Deixando o texto visível) */
body.dark-mode dl.class > dt, 
body.dark-mode dl.function > dt, 
body.dark-mode dl.method > dt,
body.dark-mode .rst-content dl > dt {
    background-color: #0A2C4F !important;
    color: #A9D6EA !important;
    border-left: 4px solid #21B1D9 !important;
    padding: 8px 12px !important;
}

body.dark-mode dl.class > dt .descname, 
body.dark-mode dl.class > dt .descclassname,
body.dark-mode .rst-content dl > dt .descname {
    color: #FFFFFF !important; 
    font-weight: bold;
}

/* 3. Ajustando o "Parameters:" que estava invisível */
body.dark-mode table.field-list th.field-name, 
body.dark-mode .field-list th.field-name {
    color: #21B1D9 !important; /* Azul clarinho pra destacar bem */
    font-weight: bold;
}

body.dark-mode .field-list td.field-body {
    color: #E8E8E8 !important;
}

/* Tipos dos parâmetros (ex: str, float) */
body.dark-mode .classifier {
    color: #F2C572 !important; /* Amarelinho da sua paleta de Warning */
}

/* ==========================================================================
   ALINHAMENTO VERTICAL DA API (C++ / BREATHE)
   Cria a "linha guia" unindo a assinatura ao conteúdo
   ========================================================================== */

/* 1. Ajusta a margem do container de conteúdo para alinhar com a caixa acima */
.rst-content dl.cpp > dd {
    margin-left: 2px !important; /* Aproxima a linha guia da borda da caixa principal */
    padding-left: 15px !important; /* Afasta o texto da linha guia */
    border-left: 3px solid #21B1D9 !important; /* A LINHA VERTICAL CIANO */
    margin-bottom: 40px !important; /* Espaço antes da próxima função */
    padding-bottom: 10px !important;
}

/* 2. Suaviza a linha no Light Mode (opcional, para não ficar muito agressiva) */
body:not(.dark-mode) .rst-content dl.cpp > dd {
    border-left: 3px solid rgba(33, 177, 217, 0.3) !important; /* Ciano mais transparente */
}

/* 3. Garante que os títulos "Parameters:" acompanhem o novo alinhamento */
.rst-content dl.cpp dl.field-list th.field-name {
    padding-left: 0 !important;
}

/* 4. Tira a linha guia do final das classes para não ficar sobrando */
.rst-content dl.class > dd > dl:last-child > dd {
    border-left: none !important;
}

/* ==========================================================================
   CAIXAS DE PARÂMETROS E RETORNOS (API)
   ========================================================================== */

/* Transforma as labels "Parameters:" e "Returns:" em caixinhas (badges) */
.rst-content dl.cpp table.field-list th.field-name,
.rst-content dl.cpp dl.field-list > dt {
    background-color: #e8f7fb !important; /* Azul clarinho de fundo */
    color: #004975 !important;            /* Texto escuro */
    border-left: 4px solid #21B1D9 !important; /* Mantém a identidade visual da borda */
    border-radius: 4px !important;        /* Bordas arredondadas */
    padding: 6px 12px !important;         /* Espaço interno para dar formato de caixa */
    text-transform: uppercase !important;
    font-size: 0.85em !important;
    font-weight: 900 !important;
    white-space: nowrap !important;       /* Impede o texto de quebrar linha */
}

/* Espaçamento para a lista de variáveis não ficar colada na caixinha */
.rst-content dl.cpp table.field-list td.field-body,
.rst-content dl.cpp dl.field-list > dd {
    padding-left: 20px !important;
    padding-top: 5px !important;
    vertical-align: top !important;
}

/* Margem em cima e embaixo para respirar no texto */
.rst-content dl.cpp table.field-list,
.rst-content dl.cpp dl.field-list {
    margin-top: 15px !important;
    margin-bottom: 20px !important;
}

/* --- DARK MODE PARA OS PARÂMETROS --- */
body.dark-mode .rst-content dl.cpp table.field-list th.field-name,
body.dark-mode .rst-content dl.cpp dl.field-list > dt {
    background-color: #0A2C4F !important; /* Azul marinho do seu dark mode */
    color: #21B1D9 !important;            /* Texto ciano brilhante */
    border-left: 4px solid #21B1D9 !important;
}