:root {
    --primary: #7e1c13;       /* vermelho bordô */
    --dark: #1e2528;          /* Preto opaco */
    --alert: #E53935;         /* Vermelho vibrante */
    --action: #4CAF50;        /* Verde esmeralda */
    --bg: #F5F7FA;            /* Cinza claro */
    --text-light: #FFFFFF;    /* Branco */
}


html, body {
  overflow-x: hidden;
}

body {
    font-family: Arial, sans-serif;
    margin: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    min-height: 100vh;
    color: var(--dark);
}


/* Adicione um novo elemento wrapper para o gradiente */
.body-background {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(rgba(62,66,67,0.2) 20%, rgba(48,55,58,0.3) 30%, rgba(30, 37, 40, 1));
    z-index: -1; /* Coloca atrás de todo o conteúdo */
}


/* Container principal */
.page-container {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    padding-top: 120px; /* Altura do navbar */
}


/* Ajuste o wrapper principal */
.main-wrapper {
    width: 100%;
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding-top: 120px;
}

.site-header {
    display: flex;
    align-items: center;
    justify-content: center;
    vertical-align: middle;
    gap: 10px; /* espaço entre logo e título */
    margin-right: 80px;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

.site-header H1 {
	font-size: 2.3rem;	
}

.logo {
    width: 25px; /* ou o tamanho desejado */
    /* width: auto; */
}

.site-header img {
	width: 70px;
    margin-bottom: -14px;
}

/* Telas pequenas (mobile) */
@media (max-width: 768px) {
    .site-header {
        gap: 0px;
        /* margin-right: 10px;  */
        margin: auto;
        border-bottom: 2px solid #1e2528;      
    }

    .site-header H1 {
    	font-size: 1.7rem
    }

    .site-header img {
        margin-bottom: -1px;
    }
    
}


/* Navbar - Barra de navegação */
.navbar {
    width: 100%;
    margin: 0 auto;
    margin-bottom: 15px;
    background: radial-gradient(#cf1100 20%, var(--primary));
    color: var(--text-light);
    align-items: center;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    position: fixed !important;
    top: 0;
    z-index: 999;
}

/* body {
  padding-top: 120px;
} */

.navbar-brand {
    font-size: 1.2em;
    margin-top: -10px;
    text-align: center;
    align-items: center;
    /* padding-bottom: 5px; */
    text-shadow: 0 1px 3px rgba(0,0,0,0.8);
    /* font-family: "Permanent Marker", cursive;*/

    font-family: "Averia Serif Libre", serif;
    font-size: 22px;
    font-weight: 900;
    font-style: italic;    
}

.navbar-links {
    display: flex;
    background-color: var(--dark);
    padding-top: 5px;
    padding-bottom: 5px;
    align-items: center;
    text-align: center;
    justify-content: center;
}

.navbar a {
    color: var(--text-light);
    text-decoration: none;
    font-weight: bold;
    transition: color 0.3s;
    padding: 0 10px;
}

.navbar a:hover {
    color: var(--action);
    vertical-align: middle;
}

/* Botão do menu hambúguer - Escondido em telas grandes */
.navbar-toggle {
    display: none; /* Oculta inicialmente */
    background: none;
    border: none;
    color: var(--text-light);
    font-size: 24px;
    cursor: pointer;
    margin-left: 35px;
    padding: 0px;
    padding-top: 2px;
}

/* Telas pequenas (mobile) */
@media (max-width: 768px) {
    .navbar {
        flex-wrap: wrap;     
    }

    .navbar-brand {
        font-size: 1.0em;
        text-shadow: 0 1px 3px rgba(0,0,0,0.8);
        margin-top: 5px;
        padding: 0px;
    }
    
    .navbar-toggle {
        display: block; /* Mostra o botão apenas em mobile */
        padding-bottom: 5px;
    }
    
    .navbar-links {
        display: none; /* Esconde os links inicialmente */
        flex-direction: column;
        width: 100%;
        background-color: var(--dark);
        top: 100%; /* Coloca os links abaixo do navbar */
        /* left: 0; */
        z-index: 1000;
        align-items: center;
        text-align: center;
    }
    
    .navbar-links.active {
        display: flex; /* Mostra quando clicado */
        /* text-align: left; */    
    }
    
    .navbar a {
        padding: 10px 20px; /* Espaçamento maior para mobile */
        width: 100%;
        text-align: center;
        /* border: 1px solid black; */
    }
}


/* Conteúdo principal */
.treemap-wrapper {
    flex: 1;
    display: flex;
    flex-direction: column;
    width: 100%;
    max-width: 1200px;
    margin: auto;
    /* padding: 0 5px 15px 5px;   */
    padding: 0 0 15px 0;
    align-items: center;  
}

/* Itens do treemap */
.treemap-container {
    flex: 1;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center; /* Mantém os itens centralizados se não preencherem a linha */
    width: 100%; /* Ocupa a largura total do .treemap-wrapper */
    /* padding-top: 15px; */
    margin: auto;
    /* align-items: center; */
    min-height: calc(50vh - 120px); /* Altura mínima ajustada */
}

/* BASE: 1 item por linha para mobile */
.treemap-item {
    position: relative;
    display: flex; /* Se houver conteúdo interno que precise de flex */
    align-items: center;
    justify-content: center;
    color: var(--text-light);
    text-align: center;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-sizing: border-box;
    border-radius: 8px;
    background-size: cover;
    background-position: center;
    overflow: hidden;
    border: 2px solid #cbcbcb;

    /* APLICAÇÃO INICIAL (1 item por linha em mobile, antes de qualquer breakpoint) */
    flex: 0 0 calc(100% - 0px); /* Ocupa 100% da largura, excluindo margem/gap se houver */
    max-width: calc(100% - 0px);
    min-width: 80px; /* Mantém seu mínimo */
}

.treemap-label-subtitle {
    position: absolute;
    top: 5px;
    left: 8px;
    color: #fff;
    font-size: 14px;
    font-weight: bold;
    text-shadow: 1px 1px 2px black;
    z-index: 2;
    pointer-events: none;
    padding-left: 5px;
    padding-right: 5px;
    padding-top: 2px;
    padding-bottom: 2px;
    background-color: var(--dark);
}

/* Media Query para telas menores (mobile) */
@media (max-width: 768px) {
    .treemap-container {
        width: 90%;
        align-items: center;
        padding-top: 10px;
        /* padding: 0 10px; */ /* Adiciona respiro nas laterais */
    }
    .treemap-item {
        /* Já definido na base, mas pode ser explicitado */
        flex: 0 0 calc(100% - 0px);
        max-width: calc(100% - 0px);
    }
}

/* Media Query para telas médias (iPad, 2 itens por linha) */
@media (min-width: 769px) and (max-width: 1023px) {
    .treemap-container {
        width: 94%;
        padding: 0 15px; /* Ajuste o padding para telas médias */
    }
    .treemap-item {
        /* Para 2 itens por linha */
        flex: 0 0 calc(50% - 7.5px); /* (100% - 1 * 15px) / 2 */
        max-width: calc(50% - 7.5px);
    }
}

/* Media Query para telas grandes (desktop, 3 itens por linha) */
@media (min-width: 1024px) {
    .treemap-container {
        max-width: 1200px; /* Limita e centraliza o container em telas grandes */
        margin: 0 auto; /* Centraliza o container */
        padding: 0; /* Remove padding lateral se o max-width já gerencia */
    }
    .treemap-item {
        /* Para 3 itens por linha */
        flex: 0 0 calc(33.333% - 10px); /* (100% - 2 * 15px) / 3 */
        max-width: calc(33.333% - 10px);
    }
}


/* Telas touch (sem hover) OU telas pequenas */
@media (hover: none), (max-width: 960px) {
    .treemap-item {
        align-items: flex-end; /* Texto na parte inferior */
    }
}

/* Efeitos hover */
.treemap-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: var(--dark);
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 1;
}

.treemap-item::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border-radius: 8px; /* Igual ao .treemap-item */
    z-index: 2; /* Garante que fique acima do overlay */
    pointer-events: none; /* Permite interação com o elemento pai */
}

.treemap-item span {
    position: relative;
    z-index: 3;
    opacity: 0;
    transition: opacity 0.3s ease;
    font-size: 18px;
    font-weight: bold;
    text-shadow: 0 1px 3px rgba(0,0,0,0.8);
    padding: 8px 12px;
    width: fit-content; /* Faz o fundo se ajustar ao texto */
}




/* Dispositivos COM hover (desktops) */
@media (hover: hover) {
    .treemap-item:hover span {
        opacity: 1;
    }
}

/* Dispositivos SEM hover (mobile/touch) */
@media (hover: none) {
    .treemap-item span {
        opacity: 1; /* Mostra o texto sempre em telas touch */
        background-color: rgba(0, 0, 0, 0.8); /* Fundo semi-transparente para legibilidade */
    }
}


.treemap-item:hover {
    transform: scale(1.03);
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
    z-index: 10;
}

.treemap-item:hover::before {
    opacity: 0.9;
    background-color: rgba(0, 0, 0, 1);
}

.treemap-item:hover span {
    opacity: 1;
}

/* Modal/Popup */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.8);
    justify-content: center;
    align-items: center;
}

.modal-content {
    background-color: #cbcbcb;
    padding: 25px;
    border-radius: 8px;
    width: 70%;
    max-width: 700px;
    position: relative;
    box-shadow: 0 0px 15px rgba(255, 255, 255, 0.6);
    border: 5px solid var(--dark);
}

.modal-content a {
    display: grid;
    text-align: right;
    font-weight: bold; 
    font-size: 18px;
    text-decoration: none;
    color: var(--primary);
}

.modal-content span {
    font-size: 15px;
    color: var(--dark);
}

.close {
    color: var(--dark);
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    transition: color 0.3s;
}

.close:hover {
    color: var(--action);
}

/* Elementos de destaque (opcional) */
.alert-badge {
    background-color: var(--alert);
    color: white;
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 12px;
}

.action-button {
    background-color: var(--action);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.3s;
}

.action-button:hover {
    background-color: var(--alert);
}


.dropdown {
  position: relative;
  display: flex;
  /* display: inline-block; */
}

.dropdown-menu {
    display: none;
    position: absolute;
    /* left: 50%;
    transform: translateX(-50%); */
    margin-top: 24px;
    background-color: var(--dark);
    min-width: 160px;
    max-width: 90vw;
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
    z-index: 1;
    overflow: hidden;
    text-align: center; /* ajuda na centralização visual */
}

.dropdown-menu a {
    color: var(--bg);
    padding: 10px 16px;
    text-decoration: none;
    /* display: block;  */
    display: flex;  
    justify-content: center;
    align-items: center;  
    width: 100%; 
    box-sizing: border-box;
}

.dropdown-menu a:hover {
    background-color: var(--primary);
    /* border: 1px solid black; */
}


/* Media Query para telas menores (mobile) */
@media (max-width: 768px) {
    .dropdown-menu {
        margin-top: 43px;  
        left: 50%;
        transform: translateX(-50%);
        min-width: 80vw; /* usa uma largura mais amigável ao mobile */ 
    }
}


.filter-item.active {
    font-weight: bold;
    background-color: #f0f0f0;
    color: var(--dark);
}

.footer {
    width: 100%;
    background: radial-gradient(#cf1100 20%, var(--primary));
    text-shadow: 0 1px 3px rgba(0,0,0,0.8);
    padding: 5px 0 0 0;
    text-align: center;
    font-size: 12px;
    font-weight: bolder;
    color: var(--text-light);
    margin-top: auto; 
}

