/* style.css */

body { 
    background-color: #f4f7f6; 
    padding: 10px; 
    overflow-x: hidden; 
}

/* --- Cabeçalho com Logomarca --- */
.header-container {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 15px;
    gap: 20px;
}
.logo-header { 
    height: 65px; 
    width: auto; 
}
.main-title { 
    color: #1a1a1a; 
    margin: 0; 
    padding: 5px; 
    font-size: 1.3rem; 
}

/* --- Cores e Botões Institucionais --- */
.btn-primary {
    background-color: #00387a !important;
    border-color: #00387a !important;
}
.btn-primary:hover {
    background-color: #002654 !important;
}

/* --- Container do Mapa --- */
.map-wrapper { 
    position: relative; 
    background: white; 
    border-radius: 12px; 
}
#map { 
    height: 78vh; 
    width: 100%; 
    border-radius: 12px; 
}

/* Comportamento Fullscreen do Leaflet */
:fullscreen #map { height: 100vh; border-radius: 0; }
:-webkit-full-screen #map { height: 100vh; border-radius: 0; }

/* Botão Tela Cheia (Fixo no Mapa) */
.btn-fullscreen {
    position: absolute;
    top: 15px;
    right: 15px;
    z-index: 1000;
    background: white;
    border: 1px solid #ccc;
    border-radius: 6px;
    padding: 6px 12px;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.85rem;
    box-shadow: 0 2px 6px rgba(0,0,0,0.2);
}

/* Botão de Informações (Abaixo do Tela Cheia no Mobile) */
.btn-info-modal {
    position: absolute;
    top: 60px; 
    right: 15px;
    z-index: 1000;
    background: #00387a;
    color: white;
    border: 1px solid #002654;
    border-radius: 6px;
    padding: 6px 12px;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.85rem;
    box-shadow: 0 2px 6px rgba(0,0,0,0.3);
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 5px;
}
.btn-info-modal:hover {
    background: #002654;
    color: white;
}

/* --- Sidebar (Desktop) --- */
.card-custom { 
    border: none; 
    border-radius: 12px; 
    height: 78vh; 
    overflow-y: auto; 
}
.img-sidebar {
    width: 130px;
    float: left;
    margin-right: 15px;
    margin-bottom: 5px;
    border-radius: 8px;
}

/* --- Tooltips do Mapa (Nomes das Cidades) --- */
.city-label {
    background: rgba(255, 255, 255, 0);
    border: none;
    box-shadow: none;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    color: #1a1a1a;
    font-weight: 700;
    font-size: 11px;
    text-transform: none; 
    text-shadow: 1px 1px 2px white;
    pointer-events: none;
}

/* --- Lista de Municípios --- */
.city-list, .lista-municipios {
    column-width: 130px; 
    column-gap: 20px;
    margin-top: 15px;
    padding: 0;
    list-style-type: none;
    box-sizing: border-box; 
}
.lista-municipios li {
    break-inside: avoid;
    margin-bottom: 6px;
    display: flex;
    align-items: center;
    padding: 2px 4px;
    transition: background 0.2s;
    border-radius: 4px;
}
.lista-municipios li::before {
    content: "";
    display: inline-block;
    width: 8px;          
    height: 8px;         
    background-color: #003574; 
    border-radius: 50%;
    margin-right: 12px;   
    flex-shrink: 0;
}
.lista-municipios li a {
    text-decoration: none;
    color: #333;
    font-size: 15px;
    width: 100%;
}
.lista-municipios li:hover { background-color: #bfcaf3; }

/* --- Legenda do Mapa --- */
.info.legend {
    padding: 8px;                 
    background: rgba(255, 255, 255, 0.9);
    box-shadow: 0 0 10px rgba(0,0,0,0.2);
    border-radius: 5px;
    font-size: 8px;              
}
.info.legend i {
    width: 10px; height: 10px; float: left;
    margin-right: 6px; margin-top: 4px; border: 1px solid #999;
}

/* --- Navegação e Dropdown --- */
.custom-dropdown-scroll { scrollbar-width: thin; }
.btn-white { background: white; color: #007bff; }
#dropdownConsorcios { color: #00357d !important; }

.btn-nav-small { 
    width: 35px; height: 35px; font-size: 1.8rem;
    display: inline-flex; align-items: center; justify-content: center;
    border-radius: 4px; padding-bottom: 12px;
}


#btn-back-to-top:hover {
    background-color: #002654 !important;
    transform: scale(1.1);
}

/* Garante que o ícone fique centralizado */
#btn-back-to-top i {
    font-size: 1.8rem;
    line-height: 1;
}

/* --- MODAL FULLSCREEN (Mobile) --- */
.modal-left .modal-dialog.modal-fullscreen {
    margin: 0;
    width: 100vw;
    height: 100vh;
}
.modal-left .modal-content {
    border-radius: 0;
    border: none;
    height: 100%;
}
/* Efeito de deslizar da esquerda */
.modal-left.fade .modal-dialog { transform: translate(-100%, 0); }
.modal-left.show .modal-dialog { transform: translate(0, 0); }

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

/* Desktop */
@media (min-width: 992px) {
    .col-custom-map { width: 70%; }
    .col-custom-sidebar { width: 28%; }
}

/* Tablet e Smartphone */
@media (max-width: 991px) {
    #map { height: 70vh; }
    .header-container { flex-direction: column; text-align: center; }
    .col-custom-sidebar { display: none !important; }
    
    /* Lista em 2 colunas no modal/mobile */
    .city-list, .lista-municipios {
        column-count: 2 !important;
        column-gap: 15px;
        column-width: auto;
    }
    .lista-municipios li a { font-size: 13px; }
    .lista-municipios li::before { width: 6px; height: 6px; margin-right: 6px; }

    /* Modal Fullscreen Body */
    .modal-fullscreen .modal-body {
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }
}

@media (max-width: 576px) {
    #dropdownConsorcios { min-width: 160px !important; font-size: 0.8rem; }
    #btn-back-to-top { bottom: 20px; right: 20px; width: 45px; height: 45px; }
}

#modalBody {
  position: relative;
}
#btnTopModal {
  position: absolute;
  bottom: 20px;
  right: 20px;
  z-index: 10;
}

/* ==========================================================================
   Ajustes Finos para o Cabeçalho Mobile (style.css)
   ========================================================================== */

@media (max-width: 991px) {
    /* Alinha logo e título lado a lado e centralizados */
    .header-container {
        display: flex !important;
        flex-direction: row !important;
        align-items: center;
        justify-content: center;
        gap: 8px; /* Espaçamento entre o ícone/logo e o texto */
    }

    /* Reduz o título para caber em telas estreitas sem quebrar linha */
    .main-title {
        font-size: 0.99rem !important;
        white-space: nowrap;
        margin-bottom: 0 !important;
        letter-spacing: -0.2px;
        line-height: 1; /* Garante que não haja sobra de altura */
    }

    /* Ajusta o tamanho da imagem/logo para acompanhar a altura do texto */
    .logo-header-m {
        max-height: 30px;
        width: auto;
        display: block;
    }
}

/* Estilo para a PRIMEIRA linha da lista */
.todo-projects-list .todo-project-item:first-child {
    background: color-mix(in srgb, var(--accent-color), transparent 92%);
    font-weight: 600;
}

.todo-projects-list .todo-project-item:first-child a {
    color: var(--accent-color);
}

/* Ícone de seta apenas para o primeiro item (opcional, para dar charme) */
.todo-projects-list .todo-project-item:first-child a::after {
    content: "\F138"; /* bi-chevron-right */
    font-family: "bootstrap-icons";
    margin-left: auto;
    font-size: 0.7rem;
}

/* Botão do Seletor */
#dropdownConsorcios {
    min-width: 240px !important; /* Largura aumentada */
    font-size: 14px !important;   /* Fonte menor para caber tudo */
    color: #00387a;              /* Texto em azul para combinar */
}

/* Fundo da lista (cortina) */
.custom-dropdown-scroll {
    background-color: #d9d9d9 !important; /* fundo da cortina*/
    border: 1px solid rgba(255,255,255,0.2);
}

/* Estilo dos itens da lista */
.custom-dropdown-scroll .dropdown-item {
    color: #00387a !important;
    font-size: 13px; /* Itens também menores para não quebrar linha */
    padding: 8px 15px;
    transition: 0.2s;
}

/* Efeito de Hover (passar o mouse) - AJUSTADO */
.custom-dropdown-scroll .dropdown-item:hover {
    background-color: #00387a !important;
    color: #ffffff !important; /* Adicione o !important aqui */
}

/* Item Ativo (Vermelho) */
.custom-dropdown-scroll .dropdown-item.active {
    background-color: #a8d48e !important; /* active */
    color: #00387a !important;
}

/* Ajuste do divisor dentro da lista azul */
.dropdown-divider {
    border-top: 1px solid rgba(255,255,255,0.2);
}

/*--------------------------------------------------------------
# Scroll Top Button
--------------------------------------------------------------*/
.scroll-top {
  position: fixed;
  visibility: hidden;
  opacity: 0;
  right: 15px;
  bottom: -15px;
  z-index: 99999;
  background-color: var(--accent-color);
  width: 44px;
  height: 44px;
  border-radius: 50px;
  transition: all 0.4s;
}

.scroll-top i {
  font-size: 24px;
  color: var(--contrast-color);
  line-height: 0;
}

.scroll-top:hover {
  background-color: color-mix(in srgb, var(--accent-color), transparent 20%);
  color: var(--contrast-color);
}

.scroll-top.active {
  visibility: visible;
  opacity: 1;
  bottom: 15px;
}

/* Estilo para o botão Voltar no Mapa */
.btn-back-map {
    background-color: #fff;
    width: 30px;
    height: 30px;
    line-height: 30px;
    display: block;
    text-align: center;
    text-decoration: none;
    color: #333 !important;
    font-size: 14px;
    font-weight: bold;
}

.btn-back-map:hover {
    background-color: #f4f4f4;
    color: #000 !important;
}

/* Ajuste específico para o ícone do Bootstrap dentro do botão do Leaflet */
.btn-back-map i {
    display: inline-block;
    vertical-align: middle;
}