/* ======== RESET & BASE ======== */
body {
    font-family: Arial, sans-serif;
    background-color: #f9f9f9;
    color: #333;
    margin: 0;
    padding: 0;
}

/* Aplica centralização de texto onde realmente precisa */
.container-a,
header {
    text-align: center;
}

header {
    background-color: #005a8b;
    padding: 24px 0 12px 0;
    color: white;
}

header img {
    max-width: 150px;
    margin-bottom: 8px;
}

header h1 {
    margin: 8px 0 10px 0;
    font-size: 2rem;
    font-weight: bold;
}

/* Corrigido: ponto faltando em .button-btn */
.button-btn {
    background-color: #005a8b;  
}

.container {
    width: 100%;
    max-width: 1200px;
    margin: 30px auto;
    background: white;
    border-radius: 8px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
    text-align: left;  /* texto alinhado à esquerda neste container */
    padding: 60px 20px;
}

.container-a {
    width: 100%;
    max-width: 1200px;
    margin: 30px auto;
    background: white;
    border-radius: 8px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
    text-align: center; /* texto centrado */
}

.descricao-votos-header {
    margin: 8px 0 0 0;
    font-size: 1.15rem;
    color: #ffe37e;
    font-weight: 500;
    letter-spacing: 0.01em;
}

canvas {
    margin: 20px 0;
}

.testing-label {
    color: #e74c3c;
    font-weight: bold;
    margin-left:8px;
    font-size: 1.15em;
    letter-spacing: 0.08em;
}

.text {
    text-align: center;
}

/* ======== LAYOUT PRINCIPAL: GRÁFICO + IMAGEM ======== */

.grafico-e-imagem {
    display: flex;
    flex-direction: row;
    align-items: stretch;
    justify-content: center;
    gap: 2.5rem;
    max-width: 1200px;
    width: 95%;
    margin: 36px auto 0 auto;
    box-sizing: border-box;
}

.grafico-container, 
.imagem-container {
    flex: 1 1 0;
    display: flex;
    flex-direction: column;
    align-items: center; /* Se queres alinhamento à esquerda no gráfico, mudar aqui */
    background: #fff;
    box-shadow: 0 2px 16px rgba(0,0,0,0.07);
    padding: 2.4rem;
    border-radius: 8px;
    min-width: 0;
    min-height: 500px;
    box-sizing: border-box;
}

/* Para alinhar título à esquerda na grafico-container, podes adicionar: */
.grafico-container h2 {
    color: #004a7c;
    font-size: 1.25rem;
    margin: 0 0 18px 0;
    width: 100%;
    text-align: center; /* se quiser este alinhamento */
}

/* Canvas gráfico responsivo com altura fixa */
.grafico-container canvas {
    display: block;
    width: 100%;
    max-width: 100%;
    height: 380px;
    margin-top: 10px;
    margin-left: 0;
}

/* Container da imagem */
.imagem-container {
    max-width: 550px;
    align-items: center;
}

.imagem-container img {
    width: 100%;
    max-width: 480px;
    border-radius: 7px;
    object-fit: contain;
    box-shadow: 0 2px 24px rgba(0,0,0,0.11);
    cursor: pointer;
}

/* ======== LIGHTBOX COM EFEITO FADE ======== */

.lightbox-modal {
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
    display: flex;
    position: fixed;
    z-index: 9999;
    left: 0; 
    top: 0;
    width: 100vw; 
    height: 100vh;
    background: rgba(0,0,0,0.90);
    align-items: center;
    justify-content: center;
}

.lightbox-modal.active {
    opacity: 1;
    pointer-events: auto;
}

.lightbox-modal img {
    max-width: 90vw;
    max-height: 90vh;
    border-radius: 12px;
    box-shadow: 0 4px 32px rgba(0,0,0,0.4);
    opacity: 0;
    transform: scale(0.96);
    transition: opacity 0.4s cubic-bezier(.4,0,.2,1), transform 0.4s cubic-bezier(.4,0,.2,1);
}

.lightbox-modal.active img {
    opacity: 1;
    transform: scale(1);
}

.lightbox-modal .close {
    position: absolute;
    top: 24px;
    right: 32px;
    font-size: 2.8rem;
    color: white;
    cursor: pointer;
    background: none;
    border: none;
    opacity: 0.6;
    transition: opacity 0.2s;
}

.lightbox-modal .close:hover {
    opacity: 1;
}

/* ======== RESPONSIVIDADE ======== */

@media (max-width: 980px) {
    .grafico-e-imagem {
        flex-direction: column;
        gap: 1.5rem;
        max-width: 98vw;
    }
    .grafico-container, 
    .imagem-container {
        max-width: 100%;
        padding: 1rem;
        min-height: 560px;
    }
}

@media (max-width: 600px) {
    .grafico-container, 
    .imagem-container {
        padding: 0.6rem;
    }
    .imagem-container img {
        max-width: 98vw;
    }
    .grafico-container h2 {
        font-size: 1.05rem;
    }
}

/* ======== FOOTER - EXEMPLO ======== */

footer {
    background-color: #777;
    color: white;
    text-align: center;
    padding: 22px 10px 18px 10px;
    font-size: 14px;
    margin-top: 60px;
}

footer a {
    color: #f1c40f;
    text-decoration: none;
    transition: text-decoration 0.3s ease;
}

footer a:hover {
    text-decoration: underline;
}

/* ======== MENU PRINCIPAL ======== */

.main-menu {
    background: #034978;
    text-align: center;
    box-shadow: 0 2px 6px rgba(0,0,0,0.07);
    position: relative;
}

.main-menu ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    justify-content: center;
    gap: 16px;
    transition: max-height 0.3s;
}

.main-menu li {
    display: inline-block;
}

.main-menu a {
    display: block;
    color: #fff;
    text-decoration: none;
    padding: 15px 22px;
    transition: background 0.18s;
    border-radius: 5px 5px 0 0;
}

.main-menu a:hover,
.main-menu a:focus {
    background: #177bbc;
    color: #ffe37e;
}

/* Hamburger - escondido em desktop */
.menu-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0 19px;
    height: 55px;
    position: absolute;
    right: 0;
    top: 0;
    z-index: 10;
}
.menu-toggle span {
    display: block;
    width: 28px;
    height: 4px;
    margin: 6px 0;
    background: #fff;
    border-radius: 2px;
    transition: all 0.27s;
}

/* Mobile: Hamburger visível, menu oculto até clicar */
@media (max-width: 700px) {
    .main-menu ul {
        flex-direction: column;
        justify-content: flex-start;
        align-items: flex-start;
        background: #034978;
        max-height: 0;
        overflow: hidden;
        width: 100%;
        box-shadow: 0 4px 10px rgba(0,0,0,.08);
        margin: 0;
        transition: max-height 0.28s cubic-bezier(.60,.01,0,1.02);
    }
    .main-menu ul.menu-open {
        max-height: 300px; /* suficiente para até 6 links */
    }
    .main-menu li {
        width: 100%;
    }
    .main-menu a {
        border-radius: 0;
        padding: 15px 24px 15px 32px;
        text-align: left;
        width: 100%;
    }
    .menu-toggle {
        display: block;
    }
}

/* ======== ACCORDION ======== */

.accordion {
    width: 80%;
    max-width: 600px;
    margin: 20px auto;
}

.accordion-item {
    background-color: #fff;
    border: 1px solid #ddd;
    border-radius: 5px;
    margin-bottom: 10px;
}

.accordion-item h2 {
    margin: 0;
    padding: 15px;
    font-size: 18px;
    cursor: pointer;
    background-color: #005a8b;
    color: white;
    border-radius: 5px 5px 0 0;
    text-align: left;
}

.accordion-item:hover h2 {
    background-color: #004a87;
}

.accordion-content {
    display: none;
    padding: 15px;
    text-align: left;
    background-color: #f9f9f9;
    border-top: 1px solid #ddd;
}