/* Escopo: index_v2.html */
* {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
        }

        body {
            font-family: 'Georgia', 'Times New Roman', serif;
            line-height: 1.8;
            color: #2c3e50;
            background-color: #f8f9fa;
            display: flex;
        }

        /* Sidebar de Navegação */
        .sidebar {
            position: fixed;
            left: 0;
            top: 0;
            width: 280px;
            height: 100vh;
            background-color: #2c3e50;
            color: #ecf0f1;
            overflow-y: auto;
            padding: 20px 0;
            box-shadow: 2px 0 5px rgba(0,0,0,0.1);
            z-index: 1000;
        }

        .sidebar h2 {
            padding: 0 20px 20px;
            font-size: 1.2em;
            border-bottom: 2px solid #34495e;
            margin-bottom: 20px;
        }

        .sidebar ul {
            list-style: none;
        }

        .sidebar ul li {
            margin: 0;
        }

        .sidebar ul li a {
            display: block;
            padding: 12px 20px;
            color: #bdc3c7;
            text-decoration: none;
            transition: all 0.3s;
            border-left: 3px solid transparent;
        }

        .sidebar ul li a:hover {
            background-color: #34495e;
            color: #ecf0f1;
            border-left-color: #3498db;
            padding-left: 25px;
        }

        .sidebar ul li a.active {
            background-color: #34495e;
            color: #3498db;
            border-left-color: #3498db;
            font-weight: bold;
        }

        .sidebar ul ul {
            margin-left: 20px;
            border-left: 1px solid #34495e;
        }

        .sidebar ul ul li a {
            padding-left: 30px;
            font-size: 0.9em;
        }

        /* Conteúdo Principal */
        .main-content {
            margin-left: 280px;
            flex: 1;
            padding: 40px 60px;
            max-width: 1200px;
            background-color: #ffffff;
            box-shadow: 0 0 10px rgba(0,0,0,0.05);
        }

        /* Cabeçalho */
        .header {
            border-bottom: 3px solid #3498db;
            padding-bottom: 20px;
            margin-bottom: 40px;
        }

        .header h1 {
            font-size: 2.5em;
            color: #2c3e50;
            margin-bottom: 10px;
        }

        .header .subtitle {
            font-size: 1.2em;
            color: #7f8c8d;
            font-style: italic;
        }

        .header .meta {
            margin-top: 15px;
            font-size: 0.95em;
            color: #95a5a6;
        }

        /* Introdução */
        .introduction {
            background-color: #ecf0f1;
            padding: 30px;
            border-left: 5px solid #3498db;
            margin-bottom: 40px;
            border-radius: 5px;
        }

        .introduction h2 {
            color: #2c3e50;
            margin-bottom: 15px;
        }

        /* Capítulos */
        .chapter {
            margin-bottom: 60px;
            padding-bottom: 40px;
            border-bottom: 2px solid #ecf0f1;
        }

        .chapter:last-child {
            border-bottom: none;
        }

        .chapter h2 {
            font-size: 2em;
            color: #2c3e50;
            margin-bottom: 20px;
            padding-bottom: 10px;
            border-bottom: 3px solid #3498db;
        }

        .chapter h3 {
            font-size: 1.5em;
            color: #34495e;
            margin-top: 30px;
            margin-bottom: 15px;
        }

        .chapter h4 {
            font-size: 1.2em;
            color: #555;
            margin-top: 20px;
            margin-bottom: 10px;
        }

        .chapter p {
            margin-bottom: 15px;
            text-align: justify;
        }

        /* Fórmulas LaTeX */
        .formula {
            background-color: #f8f9fa;
            padding: 20px;
            margin: 20px 0;
            border-left: 4px solid #3498db;
            border-radius: 5px;
            text-align: center;
            font-family: 'Times New Roman', serif;
            font-size: 1.1em;
            overflow-x: auto;
        }

        .formula-inline {
            font-family: 'Times New Roman', serif;
            font-style: italic;
            background-color: #f0f0f0;
            padding: 2px 6px;
            border-radius: 3px;
        }

        /* Exemplos e Boxes */
        .example-box {
            background-color: #e8f4f8;
            border-left: 4px solid #3498db;
            padding: 20px;
            margin: 20px 0;
            border-radius: 5px;
        }

        .example-box h4 {
            color: #2c3e50;
            margin-top: 0;
        }

        .highlight-box {
            background-color: #fff3cd;
            border-left: 4px solid #f39c12;
            padding: 20px;
            margin: 20px 0;
            border-radius: 5px;
        }

        /* Tabelas */
        table {
            width: 100%;
            border-collapse: collapse;
            margin: 20px 0;
            background-color: #ffffff;
            box-shadow: 0 2px 5px rgba(0,0,0,0.1);
        }

        table th {
            background-color: #3498db;
            color: #ffffff;
            padding: 12px;
            text-align: left;
            font-weight: bold;
        }

        table td {
            padding: 10px 12px;
            border-bottom: 1px solid #ecf0f1;
        }

        table tr:hover {
            background-color: #f8f9fa;
        }

        /* Listas */
        ul, ol {
            margin-left: 30px;
            margin-bottom: 15px;
        }

        li {
            margin-bottom: 8px;
        }

        /* Bibliografia */
        .bibliography {
            background-color: #ecf0f1;
            padding: 30px;
            border-radius: 5px;
            margin-top: 60px;
        }

        .bibliography h2 {
            color: #2c3e50;
            margin-bottom: 20px;
        }

        .bibliography ol {
            list-style: decimal;
            margin-left: 30px;
        }

        .bibliography li {
            margin-bottom: 15px;
            text-align: justify;
        }

        /* Conclusão */
        .conclusion {
            background-color: #e8f5e9;
            border-left: 5px solid #27ae60;
            padding: 30px;
            margin-top: 40px;
            border-radius: 5px;
        }

        .conclusion h2 {
            color: #2c3e50;
            margin-bottom: 15px;
        }

        /* Responsividade — sidebar fixa → empilhada (tablet / telemóvel) */
        @media (max-width: 900px) {
            body {
                flex-direction: column;
            }

            .sidebar {
                width: 100%;
                height: auto;
                max-height: min(50vh, 420px);
                position: relative;
                flex-shrink: 0;
                box-shadow: none;
                border-bottom: 2px solid #34495e;
            }

            .main-content {
                margin-left: 0;
                max-width: 100%;
                padding: 28px 22px;
            }

            .header h1 {
                font-size: 1.85em;
            }
        }

        @media (max-width: 480px) {
            .sidebar {
                max-height: min(45vh, 360px);
                padding: 14px 0;
                font-size: 0.95em;
            }

            .main-content {
                padding: 18px 14px;
            }

            .header h1 {
                font-size: 1.45em;
            }

            .chapter h2 {
                font-size: 1.45em;
            }

            .introduction {
                padding: 18px;
            }
        }

        /* Scroll suave */
        html {
            scroll-behavior: smooth;
        }

        /* Números de capítulo */
        .chapter-number {
            color: #3498db;
            font-weight: bold;
        }

        /* Imagens */
        .chapter-image {
            width: 100%;
            max-width: 900px;
            height: auto;
            margin: 30px auto;
            display: block;
            border-radius: 8px;
            box-shadow: 0 4px 12px rgba(0,0,0,0.1);
        }

        .image-container {
            text-align: center;
            margin: 30px 0;
        }

        .image-caption {
            font-size: 0.9em;
            color: #7f8c8d;
            font-style: italic;
            margin-top: 10px;
            text-align: center;
        }
