/*
Módulo Geomarketing - Estilos Modernos Bootstrap 3
*/

/* Container principal do mapa */
#geomarketing-map-container {
    position: relative;
    background: #f8f9fa;
    border: 1px solid #ddd;
    border-radius: 4px;
    overflow: hidden;
    width: 100%;
}

/* Navbar customizada */
.geomarketing-navbar {
    min-height: 50px;
    background-color: #dbdbdb !important;
    border-bottom: 1px solid #ccc;
}

.geomarketing-navbar .navbar-nav>li>a {
    color: #333 !important;
    font-weight: 500;
}

.geomarketing-navbar .navbar-nav>li>a:hover {
    background-color: #c0c0c0 !important;
}

/* Container do mapa Leaflet */
#map_canvas {
    position: relative;
    z-index: 2;
}

/* Loading spinner */
#carregando {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.loading-spinner {
    text-align: center;
    color: white;
}

.loading-spinner .mensagem {
    margin-top: 20px;
    font-size: 16px;
}

/* Estilos dos menus modais */
.geomarketing-menu-principal,
.geomarketing-menu-cidade-bairro,
.geomarketing-menu-shopping {
    padding: 20px;
    font-family: Verdana, Geneva, sans-serif;
}

.geomarketing-menu-principal h4,
.geomarketing-menu-cidade-bairro h4,
.geomarketing-menu-shopping h4 {
    margin-top: 0;
    margin-bottom: 15px;
    font-size: 14px;
    font-weight: bold;
    color: #333;
}

/* Select2 customizado */
.select2-container {
    width: 100% !important;
}

.select2-container--default .select2-selection--single {
    border: 1px solid #ddd;
    border-radius: 4px;
    height: 34px;
    padding: 6px 12px;
}

.select2-container--default .select2-selection--single .select2-selection__rendered {
    line-height: 20px;
}

.select2-container--default .select2-selection--single .select2-selection__arrow {
    height: 32px;
}

.select2-container--default .select2-selection--multiple {
    border: 1px solid #ddd;
    border-radius: 4px;
    min-height: 34px;
}

/* Multiselect customizado */
.ui-multiselect {
    width: 100% !important;
    border: 1px solid #ddd;
    border-radius: 4px;
    background: white;
}

.ui-multiselect .ui-multiselect-header {
    background: #f5f5f5;
    border-bottom: 1px solid #ddd;
    padding: 5px;
}

/* Content_var (lista de variáveis) */
#content_var p {
    cursor: pointer;
    padding: 5px;
    margin: 2px;
    font-size: 11px;
    color: #333;
}

#content_var p:hover {
    color: #000;
    font-weight: bold;
}

#content_var p.clicado {
    font-weight: bold;
    background-color: #d9edf7 !important;
    color: #31708f;
}

/* Botões de UF no setor censitário */
#sele_uf .btn {
    padding: 5px;
    margin: 2px;
    border-radius: 5px;
}

#sele_uf .btn.active {
    background-color: #337ab7;
    color: white;
}

#rd_nivel label {
    margin-left: 0px !important;

}

.modal-header::before,
.modal-header::after {
    content: initial;
}
 #legenda > *{
    color: #333;
 }
/* Radio buttons */
.radio-inline {
    margin-right: 15px;
}

/* Hot Search */
#divHotSearch {
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
    border-radius: 5px;
    padding: 10px;
}

/* Legenda */
#legenda {
    position: absolute;
    bottom: 10px;
    right: 10px;
    background: white;
    padding: 15px;
    border-radius: 5px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
    z-index: 1000;
    max-width: 250px;
}

/* Responsivo */
@media (max-width: 768px) {
    #geomarketing-map-container {
        height: 400px !important;
    }

    .geomarketing-navbar .navbar-nav {
        margin: 0;
    }
}

@media (max-width: 576px) {
    #geomarketing-map-container {
        height: 300px !important;
    }

    #legenda {
        max-width: 200px;
        font-size: 12px;
        padding: 10px;
    }
}

/* Ajustes para Leaflet */
.leaflet-container {
    font-family: inherit;
}

.leaflet-control-layers {
    background: white;
    border-radius: 4px;
}

/* Botões customizados */
.btn-primary {
    background-color: #1266F1;
    border-color: #1266F1;
}

.btn-primary:hover {
    background-color: #0d5cd9;
    border-color: #0d5cd9;
}

/* Modais Bootstrap customizadas */
.modal-dialog {
    z-index: 1060;
}

.modal-backdrop {
    z-index: 1055;
}

/* Garantir que as modais Bootstrap fiquem acima dos diálogos jQuery UI */
.modal {
    z-index: 1060;
}

/* Ocultar elementos do jQuery UI que podem conflitar */
.ui-dialog,
.ui-widget-overlay {
    display: none !important;
}

/* Mensagens de erro */
.error-message {
    color: #d9534f;
    font-size: 12px;
    margin-top: 5px;
}

/* Loading na modal */
.modal-loading {
    text-align: center;
    padding: 20px;
}

.modal-loading .fa-spinner {
    font-size: 24px;
    color: #337ab7;
}

/* Melhorar aparência dos selects */
select.form-control {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='m6 8 4 4 4-4'/%3e%3c/svg%3e");
    background-position: right 8px center;
    background-repeat: no-repeat;
    background-size: 16px;
    padding-right: 32px;
}

/* Tooltip customizado */
.tooltip {
    z-index: 1070;
}

/* Debug mode */
.debug-info {
    position: fixed;
    bottom: 10px;
    left: 10px;
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 10px;
    border-radius: 4px;
    font-size: 12px;
    z-index: 9999;
    max-width: 300px;
    word-break: break-all;
}

/* Compatibilidade jQuery UI com Bootstrap */
.ui-widget {
    font-family: inherit !important;
}

.ui-widget-content {
    border: 1px solid #ddd !important;
    background: #ffffff !important;
    color: #333333 !important;
}

.ui-widget-header {
    border: 1px solid #337ab7 !important;
    background: #337ab7 !important;
    color: #ffffff !important;
    font-weight: bold;
}

.ui-dialog {
    z-index: 1070 !important;
}

.ui-dialog-titlebar {
    text-align: center;
}

.ui-dialog-titlebar-close {
    display: none !important;
}

/* Ocultar completamente os diálogos jQuery UI quando necessário */
.ui-dialog.hidden-dialog,
.ui-widget-overlay.hidden-overlay {
    display: none !important;
    visibility: hidden !important;
}

/* Multiselect personalizado se necessário */
.ui-multiselect {
    border: 1px solid #ddd;
    background: white;
}

.ui-multiselect-header {
    background: #f5f5f5;
    border-bottom: 1px solid #ddd;
}

/* Estilos para exportação simples */
#modalExportacaoSimples .btn {
    width: 150px;
    margin: 5px;
}

#modalExportacaoSimples ul {
    font-size: 14px;
    color: #666;
}

/* Destaque do mapa para captura */
.map-highlight {
    border: 3px solid #007bff !important;
    box-shadow: 0 0 20px rgba(0, 123, 255, 0.5) !important;
    transition: all 0.3s ease !important;
}

/* Melhorar visibilidade na impressão */
@media print {

    .no-print,
    .navbar,
    .modal,
    .dropdown-menu {
        display: none !important;
    }

    #geomarketing-map-container {
        height: 100vh !important;
        border: none !important;
    }

    #map_canvas {
        position: relative !important;
        top: 0 !important;
        height: 100% !important;
    }
}

/* Estilos para nova janela */
.new-window-header {
    background: #f8f9fa;
    padding: 10px;
    text-align: center;
    border-bottom: 1px solid #ddd;
    font-size: 18px;
    font-weight: bold;
}

.new-window-map {
    width: 100%;
    height: calc(100vh - 60px);
}

/* Estilos para impressão */
@media print {
    .no-print {
        display: none !important;
    }

    .navbar,
    .panel-heading,
    .modal,
    .dropdown {
        display: none !important;
    }

    #geomarketing-map-container {
        height: auto !important;
        border: none !important;
    }

    #map_canvas {
        width: 100% !important;
        height: 80vh !important;
        position: relative !important;
    }
}

/* Destacar mapa durante exportação */
.export-highlight {
    border: 3px solid #007bff !important;
    box-shadow: 0 0 20px rgba(0, 123, 255, 0.5) !important;
    transition: all 0.3s ease;
}

/* Modal de exportação customizada */
.modal-exportacao-custom {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    z-index: 10000;
    display: none;
    overflow: auto;
}

.modal-exportacao-content {
    background-color: white;
    margin: 2% auto;
    border-radius: 10px;
    max-width: 90%;
    max-height: 90%;
    overflow: auto;
    padding: 20px;
}

.export-preview {
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 10px;
    margin: 10px 0;
    text-align: center;
}

.export-buttons {
    text-align: center;
    margin-top: 20px;
}

.export-buttons button {
    margin: 5px;
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
}