/* /site/static/css/style.css */
/* --- ADIÇÕES E ATUALIZAÇÕES AO STYLE.CSS --- */

/* 1. Sistema de Temas (Variáveis Dinâmicas) */
:root {
    /* Cores Padrão (Volume I - Matrix/Verde) */
    --accent-color: #00FF41;
    --bg-color: #050505;
    --text-color: #EAEAEA;
    --secondary-bg: #111;
    --font-headline: 'Fira Code', monospace;
    --font-body: 'Inter', sans-serif;
}

/* Tema Volume II (Ouro/Fogo - Para usar no body class="theme-gold") */
body.theme-gold {
    --accent-color: #FFD700;
    /* Dourado */
}

/* Tema Alerta/Juízo (Vermelho - Para usar no body class="theme-crimson") */
body.theme-crimson {
    --accent-color: #DC143C;
    /* Carmesim */
}

/* 2. Reset e Base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    background-color: var(--bg-color);
    color: var(--text-color);
    font-family: var(--font-body);
    line-height: 1.7;
    text-align: center;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    position: relative;
    overflow-x: hidden;
}



/* Efeitos Visuais (Noise & Scanlines)*/
body::before {
    content: "";
    position: fixed;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)' opacity='0.05'/%3E%3C/svg%3E");
    pointer-events: none;
    z-index: 9998;
    opacity: 0.4;
    animation: noise-animation 0.2s infinite;
}

body::after {
    content: "";
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to bottom, rgba(255, 255, 255, 0), rgba(255, 255, 255, 0) 50%, rgba(0, 0, 0, 0.1) 50%, rgba(0, 0, 0, 0.1));
    background-size: 100% 4px;
    pointer-events: none;
    z-index: 9999;
}

@keyframes noise-animation {
    0% {
        transform: translate(0, 0);
    }

    10% {
        transform: translate(-5%, -5%);
    }

    20% {
        transform: translate(-10%, 5%);
    }

    30% {
        transform: translate(5%, -10%);
    }

    40% {
        transform: translate(-5%, 15%);
    }

    50% {
        transform: translate(-10%, 5%);
    }

    60% {
        transform: translate(15%, 0);
    }

    70% {
        transform: translate(0, 10%);
    }

    80% {
        transform: translate(-15%, 0);
    }

    90% {
        transform: translate(10%, 5%);
    }

    100% {
        transform: translate(5%, 0);
    }
}

/* 3. Classes Utilitárias (Substitui Inline Styles) */
.text-center {
    text-align: center;
}

.text-left {
    text-align: left;
}

.text-justify {
    text-align: justify;
}

.mt-2 {
    margin-top: 2rem;
}

.mt-4 {
    margin-top: 4rem;
}

.mb-2 {
    margin-bottom: 2rem;
}

.mb-4 {
    margin-bottom: 4rem;
}

.min-h-80vh {
    min-height: 80vh;
}

.flex-center {
    display: flex;
    align-items: center;
    justify-content: center;
}

/* 4. Tipografia */
h1,
h2,
h3 {
    font-family: var(--font-headline);
    color: var(--accent-color);
    text-transform: uppercase;
    line-height: 1.3;
}

h1 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

h2 {
    font-size: 2rem;
    margin-bottom: 2rem;
}

p {
    font-size: 1.1rem;
    max-width: 600px;
    margin: 0 auto 1.5rem auto;
}

.subtitulo {
    font-size: 1.2rem;
    margin-bottom: 2rem;
    color: var(--text-color);
}

a {
    color: var(--accent-color);
    text-decoration: none;
    transition: opacity 0.3s;
}

a:hover {
    opacity: 0.8;
}

.cursor {
    animation: blink 1s infinite;
}

@keyframes blink {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0;
    }
}

/* 5. Componentes Específicos */

/* Hero Image */
.hero-image-container {
    margin-bottom: 2rem;
    position: relative;
    display: inline-block;
}

.hero-image {
    max-width: 300px;
    width: 100%;
    border: 2px solid var(--accent-color);
    box-shadow: 0 0 20px rgba(0, 255, 65, 0.2);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.hero-image:hover {
    transform: scale(1.02);
    box-shadow: 0 0 30px var(--accent-color);
}

/* Math Container (LaTeX) */
.math-container {
    font-family: 'Computer Modern', serif;
    font-size: 1.3rem;
    margin: 2rem auto;
    padding: 1rem;
    border: 1px dashed #333;
    background: rgba(0, 0, 0, 0.5);
    max-width: fit-content;
}

/* Benefits List */
.benefits-list {
    list-style: none;
    padding: 0;
    text-align: left;
    max-width: 700px;
    margin: 2rem auto;
}

.benefit-item {
    display: flex;
    align-items: flex-start;
    margin-bottom: 1.5rem;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.03);
    border-left: 2px solid transparent;
    transition: border-color 0.3s;
}

.benefit-item:hover {
    border-left-color: var(--accent-color);
}

.benefit-icon {
    width: 32px;
    height: 32px;
    margin-right: 15px;
    fill: var(--accent-color);
    flex-shrink: 0;
}

.benefit-text {
    margin: 0;
    font-size: 1rem;
}

/* --- BOTÕES E CTA (Unificado) --- */
.cta-button,
.btn,
button[type="submit"] {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 15px 30px;
    background-color: var(--accent-color);
    color: #000000;
    border: none;
    font-family: var(--font-headline);
    font-size: 1.1rem;
    font-weight: bold;
    text-transform: uppercase;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    position: relative;
    overflow: hidden;
    text-decoration: none;
    margin-top: 1rem;
    box-shadow: 0 0 10px var(--accent-color);
    animation: pulse-neon 2s infinite;
}

/* Efeito Glitch no Hover (Pseudoelementos) */
.cta-button::before,
.cta-button::after,
.btn::before,
.btn::after,
button[type="submit"]::before,
button[type="submit"]::after {
    content: attr(data-text);
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--accent-color);
    color: #000;
    padding: 15px 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
}

.cta-button:hover::before,
.btn:hover::before,
button[type="submit"]:hover::before {
    opacity: 1;
    animation: glitch-top 0.3s forwards infinite steps(2, end);
    clip-path: inset(50% 0 0 0);
}

.cta-button:hover::after,
.btn:hover::after,
button[type="submit"]:hover::after {
    opacity: 1;
    animation: glitch-bottom 0.3s forwards infinite steps(2, end);
    clip-path: inset(0 0 50% 0);
}

/* Ajuste para inputs no tema dark */
input,
textarea {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid #333;
    color: var(--text-color);
    padding: 10px;
    width: 100%;
    font-family: var(--font-body);
}

input:focus,
textarea:focus {
    border-color: var(--accent-color);
    outline: none;
    box-shadow: 0 0 5px var(--accent-color);
}

@keyframes pulse-neon {
    0% {
        box-shadow: 0 0 10px var(--accent-color);
        transform: scale(1);
    }

    50% {
        box-shadow: 0 0 25px var(--accent-color), 0 0 5px var(--accent-color);
        transform: scale(1.02);
    }

    100% {
        box-shadow: 0 0 10px var(--accent-color);
        transform: scale(1);
    }
}

@keyframes glitch-top {
    0% {
        transform: translate(-3px, -3px);
    }

    25% {
        transform: translate(3px, 3px);
    }

    50% {
        transform: translate(-3px, 3px);
    }

    75% {
        transform: translate(3px, -3px);
    }

    100% {
        transform: translate(-3px, 0);
    }
}

@keyframes glitch-bottom {
    0% {
        clip-path: inset(50% 0 50% 0);
        transform: translate(3px, 3px);
    }

    25% {
        clip-path: inset(20% 0 70% 0);
        transform: translate(-3px, -3px);
    }

    50% {
        clip-path: inset(80% 0 10% 0);
        transform: translate(3px, -3px);
    }

    75% {
        clip-path: inset(40% 0 40% 0);
        transform: translate(-3px, 3px);
    }

    100% {
        clip-path: inset(60% 0 30% 0);
        transform: translate(3px, 0);
    }
}

/* Header & Nav */
header {
    background: rgba(18, 18, 18, 0.95);
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 100;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

nav {
    max-width: 1000px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    padding: 0 20px;
    align-items: center;
}

nav .logo {
    font-family: var(--font-headline);
    font-weight: 700;
    font-size: 1.2rem;
}

nav .menu {
    font-family: var(--font-headline);
    font-weight: 800;
    font-size: 1.0rem;
}

nav ul {
    display: flex;
    gap: 1.5rem;
    list-style: none;
}

/* Footer */
footer {
    background: #000;
    padding: 2rem 0;
    margin-top: auto;
    border-top: 1px solid #222;
    font-size: 0.9rem;
    color: #666;
}

main {
    flex: 1;
    display: flex;
    flex-direction: column;
    width: 100%;
}

section {
    padding: 80px 0;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}

section.visible {
    opacity: 1;
    transform: translateY(0);
}

.container {
    max-width: 700px;
    margin: 0 auto;
    padding: 0 20px;
}

body.layout-wide .container {
    max-width: 1200px;
    /* Largura padrão para sites modernos */
}

/* Responsividade */
@media (max-width: 768px) {
    h1 {
        font-size: 1.8rem;
    }

    .hero-image {
        max-width: 200px;
    }
}

/* --- ESTILOS: (THEME GREEN - Matrix/Verde) --- */
/* --- ESTILOS: Efeito Neon (Glow Estático + Hover) --- */
.neon-wrapper {
    position: relative;
    z-index: 1;
    padding: 10px;
}

.neon-green-box-shadow {
    /* Garante que não seja redonda */
    border-radius: 4px;
    /* Levemente arredondado nas pontas ou use 0 para quadrado perfeito */

    /* Borda e Sombra Neon usando a cor do tema */
    border: 2px solid var(--accent-color);
    box-shadow: 0 0 15px rgba(0, 255, 65, 0.2);
    transition: all 0.4s ease;
    position: relative;
    z-index: 2;
    background-color: #000;
}

.neon-green-box-shadow:hover {
    /* Adicione !important para vencer o estilo inline do HTML */
    transform: scale(1.02) !important;
    box-shadow: 0 0 30px var(--accent-color), inset 0 0 10px var(--accent-color) !important;

    filter: sepia(0%) hue-rotate(0deg) contrast(1);
    border-color: #fff !important;
}

.neon-green-glow {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 90%;
    height: 90%;
    background: var(--accent-color);
    opacity: 0.3;
    filter: blur(40px);
    /* O desfoque que cria o efeito "Glow" atrás */
    z-index: 0;
    /* Fica atrás da imagem */
    animation: pulse-glow 4s infinite alternate;
}

/* Estilo para Caixas */
.hover-outline-box {
    /* Prepara a transição suave */
    transition: all 0.3s ease;
    box-sizing: border-box;
    position: relative;

    /* --- CORREÇÃO DO DESLOCAMENTO --- */
    /* Reservamos 2px de borda em TODOS os lados desde o início. 
       Como definimos como 'transparent', ela fica invisível.
       
       IMPORTANTE: O estilo inline do seu HTML (ex: border-left: 2px solid red) 
       tem prioridade sobre isso, então ele vai "pintar" o lado esquerdo
       e deixar os outros transparentes. O tamanho total da caixa já incluirá os 2px. */
    border: 2px solid transparent;

    /* Estado inicial do transform */
    transform: translateY(0);
}



/* --- ESTILOS: (THEME TRANSCENDENTAL/GOLD) --- */
/* Cards Técnicos */
.tech-card-gold {
    background: linear-gradient(145deg, #0a0a0a, #111);
    border: 1px solid #222;
    padding: 2rem;
    transition: all 0.4s ease;
    position: relative;
    overflow: hidden;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.5);
}

.tech-card-gold::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 3px;
    height: 100%;
    background: var(--accent-secondary);
    /* Linha Dourada */
    transition: height 0.3s;
}

.tech-card-gold:hover {
    border-color: var(--accent-color);
    transform: translateY(-5px);
    box-shadow: 0 10px 40px rgba(218, 165, 32, 0.15);
    /* Glow Dourado */
}

.tech-card-gold:hover::before {
    background: var(--accent-color);
}

.card-number-gold {
    font-family: 'Cinzel', serif;
    font-size: 3rem;
    color: var(--accent-secondary);
    opacity: 0.2;
    font-weight: bold;
    position: absolute;
    top: 10px;
    right: 20px;
    z-index: 0;
}

/* Grid de Informação */
.info-grid-gold {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1px;
    background: #333;
    /* Linhas divisórias */
    border: 1px solid #333;
    position: relative;
    z-index: 1;
}

.info-cell-gold {
    background: #080808;
    padding: 2rem;
    transition: background 0.3s;
}

.info-cell-gold:hover {
    background: #111;
}

.info-icon-gold {
    color: var(--accent-color);
    font-size: 1.5rem;
    margin-bottom: 1rem;
}

/* Efeito Neon (Glow Estático + Hover) */
.neon-wrapper {
    position: relative;
    z-index: 1;
    padding: 10px;
}

.neon-gold-box-shadow {
    /* Garante que não seja redonda */
    border-radius: 4px;
    /* Levemente arredondado nas pontas ou use 0 para quadrado perfeito */

    /* Borda e Sombra Neon usando a cor do tema */
    border: 1px solid #FFD700;
    box-shadow: none;
    transition: all 0.4s ease;
    position: relative;
    z-index: 2;
    background-color: #000;
}

.neon-gold-box-shadow:hover {
    /* Adicione !important para vencer o estilo inline do HTML */
    transform: scale(1.02) !important;
    box-shadow: 0 0 30px rgba(255, 215, 0, 0.2), inset 0 0 10px #FFD700 !important;

    filter: sepia(0%) hue-rotate(0deg) contrast(1);
    border-color: #FFD700 !important;
}

.neon-gold-glow {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 90%;
    height: 90%;
    background: var(--accent-color);
    opacity: 0.3;
    filter: blur(40px);
    /* O desfoque que cria o efeito "Glow" atrás */
    z-index: 0;
    /* Fica atrás da imagem */
    animation: pulse-glow 4s infinite alternate;
}

/* Estilo para Caixas */
.hover-outline-box {
    /* Prepara a transição suave */
    transition: all 0.3s ease;
    box-sizing: border-box;
    position: relative;

    /* --- CORREÇÃO DO DESLOCAMENTO --- */
    /* Reservamos 2px de borda em TODOS os lados desde o início. 
       Como definimos como 'transparent', ela fica invisível.
       
       IMPORTANTE: O estilo inline do seu HTML (ex: border-left: 2px solid red) 
       tem prioridade sobre isso, então ele vai "pintar" o lado esquerdo
       e deixar os outros transparentes. O tamanho total da caixa já incluirá os 2px. */
    border: 2px solid transparent;

    /* Estado inicial do transform */
    transform: translateY(0);
}

/* --- EFEITO: ELEVAÇÃO + DESTAQUE ESQUERDO --- */

.hover-lift-left {
    /* Transição suave para o movimento e a cor da borda */
    transition: all 0.3s ease;
    position: relative;
}

.hover-lift-left:hover {
    /* 1. Desloca para cima */
    transform: translateY(-5px);

    /* 2. Muda SOMENTE a cor da borda esquerda para o verde (Accent) */
    /* Nota: A espessura de 2px já estará definida no HTML para evitar "pulos" */
    border-left-color: var(--accent-color) !important;

    /* Opcional: Adiciona um fundo sutil para destacar a leitura */
    background: rgba(255, 255, 255, 0.05);
}

.hover-outline-box:hover {
    /* HOVER: Agora apenas mudamos a COR da borda, pois a espessura já existe */
    border-color: var(--accent-color) !important;

    /* Garantimos que todos os lados sejam sólidos (caso algum fosse tracejado/outro) */
    border-style: solid !important;
    border-width: 2px !important;

    /* Opcional: Fundo levemente mais claro */
    background: rgba(255, 255, 255, 0.05) !important;

    /* Efeito de elevação */
    transform: translateY(-5px);

    /* Adiciona uma sombra sutil para destacar o efeito neon */
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.5);
}

/* --- PERFIL DO AUTOR (Matrix Style) --- */
.profile-wrapper {
    z-index: 1;
    padding: 10px;
}

.profile-img {
    /* Garante que não seja redonda */
    border-radius: 4px;
    /* Levemente arredondado nas pontas ou use 0 para quadrado perfeito */

    /* Borda e Sombra Neon usando a cor do tema */
    border: 2px solid var(--accent-color);
    box-shadow: 0 0 15px rgba(0, 255, 65, 0.2);

    /* Efeito de filtro para harmonizar com o fundo escuro (opcional) */
    /* filter: sepia(20%) hue-rotate(50deg) contrast(1.1); */

    transition: all 0.4s ease;
    position: relative;
    z-index: 2;
    background-color: #000;
    /* Fundo preto caso a imagem seja png transp */
}

.profile-img:hover {
    /* Efeito ao passar o mouse: aumenta brilho e escala */
    transform: scale(1.02);
    box-shadow: 0 0 30px var(--accent-color), inset 0 0 10px var(--accent-color);
    filter: sepia(0%) hue-rotate(0deg) contrast(1);
    /* Volta as cores originais */
    border-color: #fff;
}

.profile-glow {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 90%;
    height: 90%;
    background: var(--accent-color);
    opacity: 0.3;
    filter: blur(40px);
    /* O desfoque que cria o efeito "Glow" atrás */
    z-index: 0;
    /* Fica atrás da imagem */
    animation: pulse-glow 4s infinite alternate;
}

/* --- VARIAÇÃO NEON: VERMELHO (CRIMSON) --- */
.neon-red-box-shadow {
    /* Garante que não seja redonda */
    border-radius: 4px;

    /* Borda e Sombra Neon usando a cor CRIMSON (#DC143C) */
    border: 2px solid #DC143C;
    box-shadow: 0 0 15px rgba(220, 20, 60, 0.2);

    transition: all 0.4s ease;
    position: relative;
    z-index: 2;
    background-color: #000;
    display: block;
    /* Importante para imagens */
}

.neon-red-box-shadow:hover {
    /* Zoom e Glow Vermelho Intenso */
    transform: scale(1.02) !important;

    /* Sombra vermelha externa + Sombra vermelha interna */
    box-shadow: 0 0 30px #DC143C, inset 0 0 10px #DC143C !important;

    filter: sepia(0%) hue-rotate(0deg) contrast(1);
    border-color: #fff !important;
}

.neon-red-glow {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 90%;
    height: 90%;
    /* Cor de fundo vermelha para o desfoque */
    background: #DC143C;
    opacity: 0.3;
    filter: blur(40px);
    z-index: 0;
    animation: pulse-glow 4s infinite alternate;
    color: #DC143C;
}

@keyframes pulse-glow {
    0% {
        opacity: 0.2;
        filter: blur(30px);
    }

    100% {
        opacity: 0.5;
        filter: blur(50px);
    }
}

/* --- READER & TOC STYLES --- */

/* Reader Styles */
.volume-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.volume-card {
    background: #1a1a1a;
    border: 1px solid #333;
    padding: 1.5rem;
    text-align: center;
    transition: transform 0.3s ease, border-color 0.3s ease;
}

.volume-card:hover {
    transform: translateY(-5px);
    border-color: var(--accent-color);
}

.volume-cover {
    height: 300px;
    background: #000;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.volume-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.placeholder-cover {
    color: #333;
    font-family: var(--font-headline);
    font-size: 2rem;
    display: flex;
    flex-direction: column;
}

.continue-reading-box {
    background: rgba(0, 255, 65, 0.1);
    border: 1px solid var(--accent-color);
    padding: 1.5rem;
    margin-bottom: 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.chapter-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.chapter-item {
    background: #1a1a1a;
    padding: 1rem;
    display: flex;
    align-items: center;
    text-decoration: none;
    color: var(--text-color);
    border: 1px solid #333;
    transition: all 0.2s ease;
}

.chapter-item:hover {
    border-color: var(--accent-color);
    background: #222;
}

.chapter-number {
    font-family: var(--font-headline);
    color: var(--accent-color);
    font-size: 1.2rem;
    margin-right: 1rem;
    min-width: 30px;
}

/* Reader Toolbar */
.reader-toolbar {
    background: #111;
    border-bottom: 1px solid #333;
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 100;
}

.toolbar-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.back-link {
    color: var(--accent-color);
    text-decoration: none;
    font-family: var(--font-headline);
}

.font-controls {
    display: flex;
    align-items: center;
    gap: 10px;
}

.font-controls button {
    background: #333;
    border: none;
    color: #fff;
    padding: 5px 10px;
    cursor: pointer;
    font-family: var(--font-headline);
    font-size: 0.9rem;
}

.font-controls button:hover {
    background: var(--accent-color);
    color: #000;
}

#font-size-display {
    font-family: var(--font-headline);
    font-size: 0.9rem;
    color: var(--accent-color);
}

/* Reader Content */
.reader-section {
    padding: 40px 0;
    opacity: 1;
    transform: none;
}

.reader-container {
    max-width: 900px;
}

.reader-content {
    max-width: 800px;
    margin: 0 auto;
    font-family: 'Inter', sans-serif;
    line-height: 1.8;
    font-size: 100%;
    text-align: left;
}

.chapter-heading {
    text-align: center;
    margin-bottom: 3rem;
}

.reader-content p {
    margin-bottom: 1.5rem;
    text-align: justify;
}

.reader-content .reader-image {
    max-width: 100%;
    height: auto;
    margin: 2rem auto;
    display: block;
    border: 1px solid #333;
    cursor: zoom-in;
    transition: transform 0.2s ease;
}

.reader-content .reader-image:hover {
    transform: scale(1.02);
}

.reader-navigation {
    display: flex;
    justify-content: space-between;
    margin-top: 4rem;
    padding-top: 2rem;
    border-top: 1px solid #333;
}

.nav-btn {
    display: inline-block;
    padding: 10px 20px;
    border: 1px solid var(--accent-color);
    color: var(--accent-color);
    text-decoration: none;
    font-family: var(--font-headline);
    transition: all 0.3s ease;
}

.nav-btn:hover {
    background: var(--accent-color);
    color: #000;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    padding-top: 50px;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.9);
}

.modal-content {
    margin: auto;
    display: block;
    width: 80%;
    max-width: 1200px;
}

.close-modal {
    position: absolute;
    top: 15px;
    right: 35px;
    color: #f1f1f1;
    font-size: 40px;
    font-weight: bold;
    cursor: pointer;
    transition: 0.3s;
}

.close-modal:hover {
    color: var(--accent-color);
}

#caption {
    margin: auto;
    display: block;
    width: 80%;
    max-width: 700px;
    text-align: center;
    color: #ccc;
    padding: 10px 0;
}

/* TOC Sidebar */
.toc-sidebar {
    position: fixed;
    left: -320px;
    top: 0;
    width: 300px;
    height: 100vh;
    background: #0a0a0a;
    border-right: 1px solid var(--accent-color);
    z-index: 1001;
    transition: left 0.3s ease;
    overflow-y: auto;
    padding-bottom: 2rem;
}

.toc-sidebar.active {
    left: 0;
}

.toc-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 1rem;
    border-bottom: 1px solid #333;
    position: sticky;
    top: 0;
    background: #0a0a0a;
    z-index: 10;
}

.toc-header h3 {
    font-family: var(--font-headline);
    color: var(--accent-color);
    font-size: 1.2rem;
    margin: 0;
}

.toc-close-btn {
    background: none;
    border: none;
    color: var(--text-color);
    font-size: 2rem;
    cursor: pointer;
    padding: 0;
    line-height: 1;
    transition: color 0.2s ease;
}

.toc-close-btn:hover {
    color: var(--accent-color);
}

.toc-toggle-btn {
    background: #333;
    border: none;
    color: #fff;
    padding: 5px 10px;
    cursor: pointer;
    font-family: var(--font-headline);
    font-size: 1.2rem;
}

.toc-toggle-btn:hover {
    background: var(--accent-color);
    color: #000;
}

.toc-nav {
    padding: 1rem 0;
}

.toc-item {
    margin: 0;
    display: block;
    width: 100%;
    clear: both;
}

.toc-link {
    display: block;
    padding: 0.6rem;
    color: var(--text-color);
    text-decoration: none;
    font-size: 0.9rem;
    transition: all 0.2s ease;
    border-left: 3px solid transparent;
    text-align: left;
    width: 100%;
    box-sizing: border-box;
}

.toc-link:hover {
    background: #1a1a1a;
    border-left-color: var(--accent-color);
    color: var(--accent-color);
}

.toc-link.active {
    background: rgba(0, 255, 65, 0.1);
    border-left-color: var(--accent-color);
    color: var(--accent-color);
}

/* TOC Overlay */
.toc-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    z-index: 1000;
    display: none;
}

.toc-overlay.active {
    display: block;
}

/* TOC Accordion Styles */
.toc-chapter-header {
    display: flex;
    align-items: center;
    padding: 0.6rem;
    cursor: pointer;
    transition: background 0.2s ease;
    text-align: left;
    width: 100%;
    box-sizing: border-box;
}

.toc-chapter-header:hover {
    background: #1a1a1a;
}

.toc-expand-icon {
    font-size: 0.7rem;
    margin-right: 0.5rem;
    color: var(--accent-color);
    transition: transform 0.2s ease;
}

.toc-chapter-link {
    flex: 1;
    font-weight: bold;
}

.toc-subsections {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.toc-subsections.expanded {
    max-height: 2000px;
}

.toc-subsections .toc-link {
    padding-left: 2.5rem;
    font-size: 0.85rem;
    font-weight: normal;
}

/* Responsive for TOC */
@media (min-width: 1200px) {
    .toc-sidebar {
        left: 0;
    }

    .toc-toggle-btn {
        display: none;
    }

    .toc-overlay {
        display: none !important;
    }

    .reader-section {
        margin-left: 300px;
    }
}