/* ===== RESET & BASE ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
/*
    background: radial-gradient(circle at center, #7FD9FF 0%, #ffffff 100%);
*/
/*
    background: linear-gradient(to right, #7FD9FF, #7FD9FF, #7FD9FF, #000000);
*/
    box-shadow: inset 0px 0px 100px rgba(0,0,0,0.8);
    background: #7FD9FF;
    min-height: 100vh;
    color: #3c3c3c;
    overflow-x: hidden;
    line-height: 1.5;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    justify-content: center;  /* Centraliza verticalmente */
    min-height: calc(100vh);  /* Altura total menos padding */
    padding: 20px;
/*
    border: 1px solid black;
*/
/*
    padding: 20px;
*/
}

/* ===== HEADER ===== */
.header {
/*
    display: flex;
    justify-content: space-between;
    border-top-left-radius: 12px;
    align-items: center;
    margin-bottom: 30px;
    flex-wrap: wrap;
    gap: 20px;
    margin-top: 0;
    margin-bottom: 0;
    padding: 15px 20px 15px 20px;

	background: linear-gradient(to right, #ffffff, #ffffff, transparent);
*/

    display: flex;
    justify-content: space-between;
    border-top-left-radius: 12px;
    align-items: center;  /* Alinha verticalmente */
    margin-bottom: 30px;
    flex-wrap: wrap;  /* ← PERMITE quebra de linha */
    gap: 20px;
    margin-top: 0;
    margin-bottom: 0;
    padding: 20px 20px 20px 20px;
    background: linear-gradient(to right, #ffffff, #ffffff, transparent);

}

.header-content {
    flex: 1;  /* ← OCUPA espaço disponível */
    min-width: 0;  /* ← PERMITE encolher */
}

.header-content h1 {
    font-family: helvetica;
    color: #3498db;
    font-size: 2rem;
    color: #2c3e50;
    font-size: 25px;
    line-height: 1.3;  /* ← MELHOR espaçamento entre linhas */
    word-wrap: break-word;  ← PERMITE quebra de palavras longas
}

.header-content h1 span {
    font-size: 20px;
    color: #5c5c5c;
    font-weight: bold;
}


.header-content span {
    font-size: 16px;
    color: #5c5c5c;
}

.social-icons {
    display: flex;
    gap: 10px;
    padding: 0px;
}

.social-icons a {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    background: white;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #667eea;
    font-size: 1.2rem;
    text-decoration: none;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    transition: all 0.3s;
}

.social-icons a:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 20px rgba(0,0,0,0.2);
    color: #764ba2;
}

/* ===== MAIN LAYOUT ===== */
.main-layout {
    display: grid;
    grid-template-columns: 1fr 350px;
    gap: 15px;
/*
    margin-bottom: 30px;
*/
    align-items: start;
}

/* ===== MAP SECTION ===== */
.map-section {
    background: rgba(255, 255, 255, 0.0);
}

.map-controls {
    display: flex;
    gap: 10px;
}

.map-controls button {
    width: 36px;
    height: 36px;
    border: none;
    /* border-radius: 8px; */
    background: #f0f0f0;
    cursor: pointer;
    font-size: 1.2rem;
    color: #555;
    transition: all 0.3s;
}

.map-controls button:hover {
    background: #667eea;
    color: white;
}

.map-container {
    position: relative;
    width: 100%;
    height: 675px;
    /* border-radius: 15px; */
    overflow: hidden;
/*
    background: #f8f9fa;
*/
    background: rgba(255, 255, 255, 0.5)
}

iframe {
    width: 100%;
    height: 100%;
    border: none;
}

/* ===== LEGEND ===== */
.legend {
/*
    margin-top: 25px;
*/
    padding: 15px;
    background: #f8f9fa;
    border-bottom-left-radius: 12px;
    border-bottom-right-radius: 12px;
    align-items: center;
    justify-content: center;
/*
    border: 1px solid black;
*/
}

.legend h3 {
    font-family: helvetica;
    font-size: 1rem;
    color: #2c3e50;
}

.legend-items {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 20px;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 5px;
    font-family: helvetica;
    font-size: 14px;
}

.legend-item-leg {
    line-height: 1;
    display: flex;
    align-items: center;
}

.legend-color {
    width: 15px;
    height: 15px;
    border-radius: 4px;
    border: 1px solid grey;
    margin-bottom: 4px;
}


/* ===== LEGENDA - MUNICÍPIOS (9 cores) ===== */
.legend-color.perda_extrema { background: #d73027; }
.legend-color.perda_forte { background: #f46d43; }
.legend-color.perda_moderada { background: #fdae61; }
.legend-color.estabilidade { background: #ffffbf; }
.legend-color.crescimento_leve { background: #d9ef8b; }
.legend-color.crescimento_mod_baixo { background: #a6d96a; }
.legend-color.crescimento_moderado { background: #66bd63; }
.legend-color.crescimento_forte { background: #1a9850; }
.legend-color.crescimento_extremo { background: #006837; }

/* ===== LEGENDA - ESTADOS (9 cores) ===== */
.legend-color.estado_1 { background: #ffffbf; }
.legend-color.estado_2 { background: #e7f59e; }
.legend-color.estado_3 { background: #ccea83; }
.legend-color.estado_4 { background: #acdc6e; }
.legend-color.estado_5 { background: #86cb66; }
.legend-color.estado_6 { background: #5db861; }
.legend-color.estado_7 { background: #2da155; }
.legend-color.estado_8 { background: #108647; }
.legend-color.estado_9 { background: #006837; }

/* ===== LEGENDA - REGIÕES (6 cores) ===== */
.legend-color.regiao_1 { background: #ffffbf; }
.legend-color.regiao_2 { background: #d9ef8b; }
.legend-color.regiao_3 { background: #a6d96a; }
.legend-color.regiao_4 { background: #66bd63; }
.legend-color.regiao_5 { background: #1a9850; }
.legend-color.regiao_6 { background: #006837; }

/* ===== UTILITÁRIO: Esconde itens da legenda ===== */
.legend-item.oculto {
    display: none;
}



.legenda {
    display:flex;
    align-items: center;
	justify-content: space-between;
/*
    justify-content: center;
*/
    margin-bottom: 10px;
/*
    border: 1px solid black;
*/
}

.legenda span a {
    text-decoration: none;
    color: grey;
    font-family: helvetica;
    font-weight: 600;
}

.source {
    font-size: 0.85rem;
    color: #777;
    align-items: center;
    vertical-align: center;
    justify-content: space-between;
}





/* ===== SIDEBAR ===== */
.sidebar {
    display: flex;
    justify-content: end;
    flex-direction: column;
    border-radius: 15px;
/*
    margin-bottom: 0px;
*/
/*
    margin-top: 10px;
*/
    height: 100%;
/*
    margin: auto;
*/
/*
    border: 1px solid black;
*/
}

/* ===== TABS ===== */
.tabs {
    background: white;
/*
    border-radius: 15px;
*/
    border-top-left-radius: 15px;
    border-top-right-radius: 15px;
/*
    padding: 10px;
*/
    display: flex;
/*
    gap: 5px;
*/
    box-shadow: 0 5px 20px rgba(0,0,0,0.1);
    overflow: hidden;
/*
    border: 1px solid black;
*/
}

.tab {
    flex: 1;
    padding: 18px;
    border: none;
    background: transparent;
/*
    border-radius: 10px;
*/
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 600;
    color: #666;
    transition: all 0.3s;
}

.tab.active {
    background: #667eea;
    color: white;  
}

.tab:hover:not(.active) {
    background: #f0f0f0;
}



/* ===== PERIOD SELECTOR ===== */
.period-selector {
    background: white;
    padding: 20px;
    border-top: 1px solid lightgray;
    box-shadow: 0 5px 20px rgba(0,0,0,0.1);
    display: flex; /* Adiciona alinhamento horizontal */
    align-items: center; /* Centraliza verticalmente */
    justify-content: center;
    gap: 10px; /* Espaçamento entre o label e o select */
}

.period-selector label {
    font-family: helvetica;
    font-size: 17px;
    font-weight: 600;
    margin-bottom: 0;
    color: #2c3e50;
}

.period-selector select {
/*
    width: 100%;
*/
    width: 160px;
    padding: 12px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 1rem;
    cursor: pointer;
    transition: border-color 0.3s;
}

.period-selector select:focus {
    outline: none;
    border-color: #667eea;
}

.period-selector option {
    border-radius: 10px;
    text-align: center;
}


/* ===== HIGHLIGHT CARDS ===== */
.highlight-cards {
    display: flex;
    flex-direction: column;
/*
    gap: 15px;
*/
}

.highlight-card {
    background: white;
    padding: 12px;
    display: flex;
    align-items: center;
    gap: 15px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.1);
    transition: transform 0.3s;
    cursor: pointer;
}


.card-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    flex-shrink: 0;
}

.card-icon.region {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    font-size: 16px;
    color: white;
}

.card-icon.state {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
      font-size: 16px;
    color: white;
}

.card-icon.city {
    background: linear-gradient(135deg, #fa709a 0%, #fee140 100%);
      font-size: 16px;
    color: white;
}

.card-content {
    flex: 1;
    width: 100%;
}

.card-value {
    font-size: 1.2rem;
    font-weight: bold;
    color: #2c3e50;
    padding-top: 10px;
/*
    margin-bottom: 5px;
*/
    text-align:center;
}

.card-label {
    font-size: 0.9rem;
    color: #666;
    line-height: 1.3;
    text-align: center;
    padding-bottom: 5px
/*
    border: 1px solid black;
    border-radius: 6px;
*/
}

.card-label-result {
    text-align:center;
    font-family: helvetica;
    font-weight: bold;
}

.card-label-result-name {
    gap: 10px;
}

.card-arrow {
    color: #999;
    font-size: 1.2rem;
}

/* ===== GRÁFICOS ===== */
.graficos {
    background: white;
    border-bottom-left-radius: 15px;
    border-bottom-right-radius: 15px;
    padding: 20px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.1);
/*
    height: 100%;
*/
/*
    margin: auto;    
*/
}

.graficos h3 {
    font-size: 1.1rem;
    margin-bottom: 15px;
    color: #2c3e50;
}

.graficos h4 {
    padding-bottom: 5px; 
    font-family: helvetica; 
    font-weight:600
}

.graficos select {
    padding: 3px; 
    border: 1px solid lightgray; 
    border-radius: 5px; 
    width: 100%;
}

.graficos-titulo-grafico {
    text-align: center;
    padding:10px; 
    margin-bottom: -20px; 
    font-size: 14px
}

.graficos-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 12px;
    border-radius: 10px;
    margin-bottom: 10px;
    background: #f8f9fa;
    transition: background 0.3s;
}

.graficos-item:hover {
    background: #e9ecef;
}

.graficos-position {
    width: 35px;
    height: 35px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 0.9rem;
    flex-shrink: 0;
}

.graficos-position.gold {
    background: linear-gradient(135deg, #ffd700 0%, #ffed4e 100%);
    color: #333;
}

.graficos-position.silver {
    background: linear-gradient(135deg, #c0c0c0 0%, #e8e8e8 100%);
    color: #333;
}

.graficos-position.bronze {
    background: linear-gradient(135deg, #cd7f32 0%, #e89b5a 100%);
    color: white;
}

.graficos-name {
    flex: 1;
    font-weight: 600;
    color: #2c3e50;
}

.graficos-value {
    font-weight: bold;
    color: #27ae60;
    font-size: 1.1rem;
}

.grafico-responsivo {
    width: 100%;           /* Largura fluida */
    height: auto;          /* Mantém proporção */
    max-width: 1200px;     /* Limite máximo (opcional) */
/*
    display: block;
*/
    display: flex;
    padding-bottom:20px;
}

.card-pop-densi {
    padding-top: 10px; 
    padding-bottom: 10px; 
    border-top: 1px solid lightgray; 
/*
    margin: 20px 10px 0 10px;
*/
}







/* ===== FOOTER ===== */
.footer {
    text-align: center;
/*
    padding: 30px;
*/
    color: #555;
    font-size: 0.9rem;
    font-family: helvetica;
/*
    padding-top: 10px;
    padding-bottom: 10px;
*/
    padding-top: 20px;
    border-top: 1px solid lightgray;
}

.footer a {
    color: #e74c3c;
    font-weight: bold;
    text-decoration: none;
}

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

/* ===== RESPONSIVE ===== */
@media (max-width: 1024px) {
    .main-layout {
        grid-template-columns: 1fr;
        padding: 20px;
    }
    
    .map-container {
        min-height: 500px;
/*
        height: auto;
*/
    }
    
}

@media (max-width: 768px) {
    .main-layout {
        grid-template-columns: 1fr;
        padding: 5px;
    }


    .header {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }
    
    .header-content h1 {
        font-size: 1.5rem;
    }
    
    .header-content h2 {
        font-size: 0.95rem;
    }
    
    .map-container {
        height: 400px;
    }
    
    .legend-items {
        justify-content: center;
    }
    
    .card-value {
        font-size: 1.2rem;
    }
    
    .card-label {
        font-size: 0.85rem;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 20px;
    }
    
    .map-section,
    .period-selector,
    .highlight-card,
    .graficos {
/*
        padding: 15px;
*/
    }
    
    .map-container {
        height: 300px;
    }
    
    .tabs {
        flex-wrap: wrap;
    }
    
    .tab {
        padding: 10px 8px;
        font-size: 0.8rem;
    }
}







/* ===== MODAL DE INFORMAÇÕES ===== */
.modal {
    display: none;
    position: fixed;
    z-index: 10000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(5px);
    overflow-y: auto;
}

.modal-conteudo {
    background: white;
    margin: 5% auto;
    padding: 0;
    border-radius: 15px;
    width: 90%;
    max-width: 900px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: modalSlideIn 0.3s ease;
    position: relative;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fechar {
    position: absolute;
    right: 25px;
    top: 20px;
    font-size: 32px;
    font-weight: bold;
    color: #999;
    cursor: pointer;
    transition: color 0.3s;
    z-index: 10;
}

.fechar:hover {
    color: #e74c3c;
}

.modal-conteudo h2 {
    font-family: helvetica;
    font-size: 1.8rem;
    color: #2c3e50;
    padding: 30px 40px 10px 40px;
    margin: 0;
}

.modal-subtitulo {
    font-size: 1rem;
    color: #666;
    padding: 0 40px 20px 40px;
    margin: 0;
    border-bottom: 2px solid #f0f0f0;
}

/* Abas */
.abas {
    display: flex;
    gap: 5px;
    padding: 20px 40px 0 40px;
    border-bottom: 2px solid #f0f0f0;
    background: #f8f9fa;
    border-radius: 15px 15px 0 0;
}

.aba-btn {
    flex: 1;
    padding: 12px 20px;
    border: none;
    background: transparent;
    cursor: pointer;
    font-size: 0.95rem;
    font-weight: 600;
    color: #666;
    transition: all 0.3s;
    border-bottom: 3px solid transparent;
    font-family: helvetica;
}

.aba-btn:hover {
    background: #e9ecef;
}

.aba-btn.ativa {
    color: #667eea;
    border-bottom-color: #667eea;
    background: white;
}

/* Conteúdo das abas */
.aba-conteudo {
    display: none;
    padding: 30px 40px;
    animation: fadeIn 0.3s ease;
}

.aba-conteudo.ativa {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.aba-conteudo h3 {
    font-family: helvetica;
    font-size: 1.2rem;
    color: #2c3e50;
    margin-top: 25px;
    margin-bottom: 15px;
    padding-bottom: 8px;
    border-bottom: 2px solid #667eea;
}

.aba-conteudo h3:first-child {
    margin-top: 0;
}

.aba-conteudo p {
    font-size: 0.95rem;
    line-height: 1.7;
    color: #555;
    margin-bottom: 15px;
    text-align: justify;
}

.aba-conteudo ul {
    margin: 10px 0;
    padding-left: 25px;
}

.aba-conteudo ul li {
    font-size: 0.95rem;
    line-height: 1.6;
    color: #555;
    margin-bottom: 8px;
}

.aba-conteudo ul ul {
    margin-top: 8px;
    padding-left: 20px;
}



.aba-conteudo-img {
    display: flex;
    border: 2px solid lightgray;
    border-radius: 8px;
    /*position: relative;*/
    height: auto;
    width: 100%;
    overflow: hidden;
    
}



/* Tabela de dados */
.tabela-dados {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.tabela-dados thead {
    background: #667eea;
    color: white;
}

.tabela-dados th,
.tabela-dados td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid #e0e0e0;
}

.tabela-dados tbody tr:hover {
    background: #f8f9fa;
}

/* Grid de cobertura */
.grid-cobertura {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin: 25px 0;
}

.card-cobertura {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 25px;
    border-radius: 12px;
    text-align: center;
    color: white;
}

.cobertura-numero {
    font-size: 2.5rem;
    font-weight: bold;
    font-family: helvetica;
}

.cobertura-label {
    font-size: 0.9rem;
    margin-top: 8px;
    opacity: 0.9;
}

/* Lista de períodos */
.lista-periodos {
    background: #f8f9fa;
    padding: 20px 25px;
    border-radius: 8px;
    border-left: 4px solid #667eea;
}

.lista-periodos li {
    margin-bottom: 12px !important;
}

/* Grid de tecnologias */
.intro-tec {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    border-left: 4px solid #667eea;
    margin-bottom: 25px;
}

.grid-tecnologias {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-top: 25px;
}

.card-tec {
    background: white;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    padding: 25px;
    text-align: center;
    transition: all 0.3s;
}

.card-tec:hover {
    border-color: #667eea;
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(102, 126, 234, 0.15);
}

.card-tec img {
    width: 50px;
    height: 50px;
    margin-bottom: 15px;
}

.card-tec h4 {
    font-family: helvetica;
    font-size: 1.1rem;
    color: #2c3e50;
    margin-bottom: 10px;
}

.card-tec p {
    font-size: 0.85rem;
    color: #666;
    text-align: center;
    margin: 0;
}

/* Responsivo */
@media (max-width: 768px) {
    .modal-conteudo {
        margin: 10% auto;
        width: 95%;
    }
    
    .modal-conteudo h2 {
        font-size: 1.4rem;
        padding: 20px 20px 10px 20px;
    }
    
    .modal-subtitulo {
        padding: 0 20px 15px 20px;
        font-size: 0.9rem;
    }
    
    .abas {
        flex-wrap: wrap;
        padding: 15px 20px 0 20px;
    }
    
    .aba-btn {
        flex: 1 1 45%;
        padding: 10px 15px;
        font-size: 0.85rem;
    }
    
    .aba-conteudo {
        padding: 20px;
    }
    
    .grid-cobertura {
        grid-template-columns: 1fr;
    }
    
    .grid-tecnologias {
        grid-template-columns: 1fr;
    }
}
