/* ========================================= */
/* MOBILE MODALS (Centralizacao & Tamanho)   */
/* ----------------------------------------- */
/* Portado/adaptado de dev-inmap-front-master */
/* para o Geoportal Peruibe.                  */
/* Adaptacoes:                                */
/*  - Removida a regra GLOBAL .col-sm-6 do    */
/*    master (afetaria formularios existentes */
/*    do Peruibe).                            */
/*  - Removidos blocos do #swipe-config-modal */
/*    (Peruibe nao possui Comparar Camadas).  */
/* ========================================= */

/* Botao de fechar padronizado nos modais existentes do Peruibe */
#add-client-theme-layer-modal .close,
#add-server-theme-layer-modal .close,
#add-data-source-modal .close,
#modalEnvSelector .close,
#show-layer-data .close,
#show-export-layer-data .close,
#show-print-conf .close,
#system-config-panel .close,
#print-config-quick-modal .close,
#demo-btn-close-settings,
#group_btn_fechar .btn-default {
  font-size: 2.2rem !important;
  opacity: 1 !important;
  color: #000 !important;
  text-decoration: none !important;
  line-height: 1 !important;
  background: transparent !important;
  background-color: transparent !important;
  border: none !important;
  box-shadow: none !important;
}

#add-client-theme-layer-modal .close:hover,
#add-server-theme-layer-modal .close:hover,
#add-data-source-modal .close:hover,
#modalEnvSelector .close:hover,
#show-layer-data .close:hover,
#show-export-layer-data .close:hover,
#show-print-conf .close:hover,
#system-config-panel .close:hover,
#print-config-quick-modal .close:hover,
#demo-btn-close-settings:hover,
#group_btn_fechar .btn-default:hover,
#group_btn_fechar .btn-default:focus,
#group_btn_fechar .btn-default:active {
  opacity: 0.7 !important;
  transition: all 0.45s ease;
  background-color: transparent !important;
  border: none !important;
  outline: none !important;
  box-shadow: none !important;
}

/* Tamanho do icone/span dentro dos botoes de fechar */
#add-client-theme-layer-modal .close i,
#add-server-theme-layer-modal .close i,
#add-data-source-modal .close i,
#modalEnvSelector .close i,
#show-layer-data .close i,
#show-export-layer-data .close i,
#show-print-conf .close i,
#system-config-panel .close i,
#print-config-quick-modal .close i,
#demo-btn-close-settings i,
#group_btn_fechar .btn-default i {
  font-size: 2.2rem !important;
  line-height: 1 !important;
  display: inline-block !important;
}

@media (max-width: 1360px) {

  /* 1. CENTRALIZA "GERENCIAR FONTES" (Add Data Source) */
  #add-data-source-modal .modal-dialog {
    position: absolute !important;
    top: 20px !important;
    left: 50% !important;
    transform: translateX(-50%) !important;
    margin: 0 !important;
    width: 90% !important;
    max-width: 700px !important;
    height: auto !important;
    max-height: 90vh !important;
    display: block !important;
  }

  #add-data-source-modal .modal-content {
    max-height: 85vh;
    overflow-y: auto;
    padding-bottom: 80px !important;
    /* AREA SEGURA para rolagem */
  }

  /* 2. CENTRALIZA "ADICIONAR TEMA" (Tematico Simples) */
  /* Este modal tem min-width: 750px inline que quebra no mobile. */
  #add-client-theme-layer-modal .modal-dialog {
    position: absolute !important;
    top: 50% !important;
    left: 50% !important;
    transform: translate(-50%, -50%) !important;
    margin: 0 !important;
    min-width: 0 !important;
    width: 90% !important;
    max-width: 600px !important;
    display: block !important;
    height: auto !important;
    max-height: 85vh !important;
  }

  #add-client-theme-layer-modal .modal-content {
    max-height: 80vh;
    overflow-y: auto;
    padding-bottom: 80px !important;
  }

  /* 3. CENTRALIZA "ASSISTENTE DE TEMA AVANCADO" (Publicar Tema) */
  #add-server-theme-layer-modal .modal-dialog {
    position: absolute !important;
    top: 50% !important;
    left: 50% !important;
    transform: translate(-50%, -50%) !important;
    margin: 0 !important;
    min-width: 0 !important;
    width: 90% !important;
    max-width: 700px !important;
    display: block !important;
    height: auto !important;
    max-height: 85vh !important;
  }

  #add-server-theme-layer-modal .modal-content {
    max-height: 80vh;
    overflow-y: auto;
    padding-bottom: 80px !important;
  }
}

/* RESTAURA LARGURA DESKTOP do modal de tema (removida do HTML inline) */
@media (min-width: 1263px) {
  #add-client-theme-layer-modal .modal-dialog {
    min-width: 750px !important;
    width: 750px !important;
  }
}

/* =====================================================
   CONFIGURAÇÕES (system-config-panel / .demo-set)
   Responsividade mobile — centraliza e scrollifica
   ===================================================== */
@media (max-width: 1360px) {
  #system-config-panel {
    left: 10px !important;
    right: 10px !important;
    top: 65px !important;
    max-width: calc(100% - 20px) !important;
    width: auto !important;
    /* border-top e box-shadow herdados do main.css — sem duplicação */
  }

  #system-config-panel .demo-set-body {
    max-height: 75vh !important;
    overflow-y: auto !important;
  }
}

