/* ==================================================
   RESET GLOBAL
================================================== */

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html, body {
  height: 100%;
  background: #0c0f14;
  font-family: Arial, Helvetica, sans-serif;
  color: #eee;
  overflow: hidden;
  
}

/* ==================================================
   APP ROOT
================================================== */

#mapa-app {
  height: 100dvh;
  display: flex;
  flex-direction: column;
   width: 100%;
  
}

/* ==================================================
   HEADER — REFINADO
================================================== */

#mapa-header {
  background: linear-gradient(
    to bottom,
    #111111 0%,
    #080808 100%
  );

  border-bottom: 1px solid rgba(255, 46, 46, 0.55);

  box-shadow:
    0 3px 18px rgba(255, 0, 0, 0.08),
    inset 0 -1px 0 rgba(255, 255, 255, 0.03);

  padding: 14px 20px;

  display: grid;
  grid-template-columns: auto auto 1fr auto;
  align-items: center;
  gap: 16px;

  position: relative;
  z-index: 4000;
}

.logo-area h1 {
  font-size: 19px;
  font-weight: 600;
  letter-spacing: 1px;
  color: #ff2e2e;
  margin: 0;
}

.logo-area span {
  font-size: 11px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: #bbb;
  opacity: 0.75;
}

/* Posicionamento correto dos elementos */

.drawer-btn { grid-column: 1; }
.btn-voltar { grid-column: 2; }
.logo-area { grid-column: 3; }
.filtros-topo {
  grid-column: 4;
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}

/* ==================================================
   MAIN LAYOUT
================================================== */

#mapa-main {
  flex: 1;
  display: flex;
  min-height: 0;
}

#mapa-container {
  flex: 1;
  height: 100%;
  position: relative;
  
}

/* ==================================================
   MAPA
================================================== */

#map {
  width: 100%;
  height: 100%;
  position: relative;
  overflow: hidden;

  border-radius: 18px;

  box-shadow:
    0 0 0 1px rgba(255,46,46,0.10),
    0 20px 60px rgba(0,0,0,0.75);
}


.leaflet-container {
 background-color: #0a0d11;
}

/* ==================================================
   SIDEBAR DESKTOP
================================================== */

#mapa-sidebar {
  width: 340px;
  min-width: 340px;
  background: linear-gradient(to bottom, #111, #0c0c0c);
  border-right: 1px solid #1f1f1f;
  padding: 15px;
  overflow-y: auto;
  box-shadow: inset -10px 0 30px rgba(255,0,0,0.04);
}

/* ==================================================
   COMPONENTES SIDEBAR — REFINADO
================================================== */

.sidebar-titulo {
  color: #ff2e2e;
  font-size: 13px;
  margin-bottom: 14px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  opacity: 0.85;
}

/* ================= ESTADO ================= */

.estado-card {
  border: 1px solid #1e1e1e;
  border-radius: 8px;
  margin-bottom: 12px;
  background: linear-gradient(
    145deg,
    rgba(22,22,22,0.95),
    rgba(14,14,14,0.95)
  );
  overflow: hidden;
  transition: all 0.2s ease;
}

.estado-card:hover {
  border-color: #2a2a2a;
  transform: translateY(-1px);
}

.estado-header {
  padding: 11px 14px;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-weight: 600;
  font-size: 13px;
  background: rgba(28,28,28,0.9);
  transition: all 0.2s ease;
}

.estado-header:hover {
  background: rgba(35,35,35,0.95);
}

/* ================= CORPO ESTADO ================= */

.estado-body {
  display: none;
  padding: 10px 12px;
  border-top: 1px solid #222;
  background: rgba(12,12,12,0.9);
}

/* ================= CIDADE ================= */

.cidade-header {
  cursor: pointer;
  font-size: 12px;
  padding: 7px 10px;
  background: rgba(30,30,30,0.9);
  border-radius: 5px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: all 0.2s ease;
  color: #ccc;
}

.cidade-header:hover {
  background: rgba(45,45,45,0.95);
  color: #fff;
}

/* ================= REGISTROS ================= */

.registro {
  font-size: 12px;
  padding: 5px 8px;
  margin-bottom: 4px;
  cursor: pointer;
  border-radius: 4px;
  transition: all 0.15s ease;
  color: #9e9e9e;
}

.registro:hover {
  background: rgba(255,46,46,0.08);
  color: #fff;
}

/* ================= BADGE ================= */

.badge {
  background: #c10000;
  color: #fff;
  font-size: 11px;
  padding: 3px 8px;
  border-radius: 12px;
  font-weight: 600;
  box-shadow: 0 0 6px rgba(255,0,0,0.35);
}

/* ==================================================
   BOTÃO VOLTAR
================================================== */

.btn-voltar {
  color: #ddd;
  border: 1px solid #444;
  padding: 6px 12px;
  text-decoration: none;
  font-size: 12px;
  border-radius: 4px;
  transition: 0.2s;
  background: #111;
}

.btn-voltar:hover {
  background: #1b1b1b;
  border-color: #c10000;
  color: #fff;
}

/* ==================================================
   FILTROS
================================================== */

.btn-filtro {
  background: #111;
  border: 1px solid #333;
  color: #aaa;
  padding: 6px 14px;
  font-size: 13px;
  border-radius: 20px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-filtro:hover {
  border-color: #ff2e2e;
  color: #fff;
}

.btn-filtro.ativo {
  background: linear-gradient(135deg, #8b0000, #ff2e2e);
  border: 1px solid #ff2e2e;
  color: #fff;
  box-shadow: 0 0 10px rgba(255, 46, 46, 0.6);
}

/* ==================================================
   BOTÃO DRAWER BASE
================================================== */

.drawer-btn {
  display: none;
  background: transparent;
  border: 1px solid #ff0000;
  color: #ff0000;
  padding: 6px 10px;
  font-size: 18px;
  border-radius: 6px;
  cursor: pointer;
}

/* ===============================
   MOBILE AJUSTES COMPLETOS
=============================== */

@media (max-width: 768px) {

  /* ================= HEADER FIXO MOBILE ================= */

  #mapa-header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;

    grid-template-columns: auto 1fr;
    grid-template-rows: auto auto;
    gap: 10px;
  }

  /* empurra conteúdo abaixo do header */
  #mapa-main {
    margin-top: 95px; /* ajuste fino se necessário */
  }

  /* primeira linha */
  .drawer-btn { grid-column: 1; }

  .btn-voltar {
    grid-column: 2;
    justify-self: start;
    width: fit-content;
    max-width: 150px;
    white-space: nowrap;
    padding: 5px 10px;
    font-size: 11px;
  }

  /* segunda linha */
  .logo-area {
    grid-column: 1 / 3;
  }

  .filtros-topo {
    grid-column: 1 / 3;
    justify-content: flex-start;
    overflow-x: auto;
    padding-top: 6px;
    gap: 6px;
  }

  .filtros-topo::-webkit-scrollbar {
    display: none;
  }

  /* ================= DRAWER ================= */

  .drawer-btn {
    display: inline-block;
    position: relative;
    z-index: 4500;
  }

  #mapa-sidebar {
  position: fixed;
  top: 119px; /* ajuste real do seu header */
  left: 0;
  width: 85%;
  max-width: 340px;
  height: calc(100dvh - 119px);
  background: #0b0f14;
  transform: translateX(-100%);
  transition: transform 0.25s ease;
  z-index: 3000;
  overflow-y: auto;
}
  #mapa-sidebar.active {
    transform: translateX(0);
  }

  .drawer-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.6);
    z-index: 2500;
    display: none;
  }

  .drawer-overlay.active {
    display: block;
  }
}

/* BLOQUEIA SCROLL */
body.drawer-open {
  overflow: hidden;
}


/* ===============================
   MARCADOR CUSTOM — REFINADO
=============================== */

.marker-custom {
  display: flex;
  align-items: center;
  justify-content: center;
}

.marker-inner {
  width: 12px;
  height: 12px;
  border-radius: 50%;

  background: radial-gradient(
    circle at 35% 35%,
    #ff6a6a 0%,
    #ff2e2e 45%,
    #8a0000 100%
  );

  border: 1px solid rgba(0, 0, 0, 0.6);

  box-shadow:
    0 0 6px rgba(255, 46, 46, 0.55),
    0 0 12px rgba(255, 0, 0, 0.22);

  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.marker-inner:hover {
  transform: scale(1.18);

  box-shadow:
    0 0 10px rgba(255, 46, 46, 0.85),
    0 0 18px rgba(255, 0, 0, 0.32);
}

/* ===============================
   POPUP MOTOROCKINK — CLEAN DARK
=============================== */

/* ===============================
   POPUP MOTOROCKINK — PRO LEVEL
=============================== */

.leaflet-popup-content-wrapper {

  background: linear-gradient(
    180deg,
    #0f0f0f 0%,
    #0a0a0a 100%
  ) !important;

  color: #e5e5e5 !important;

  border: 1px solid rgba(255,46,46,0.25) !important;

  border-radius: 8px !important;

  box-shadow:
    0 0 0 1px rgba(255,46,46,0.08),
    0 8px 24px rgba(0,0,0,0.85),
    0 0 18px rgba(255,46,46,0.08) !important;

}

/* ponteiro */
.leaflet-popup-tip {
  background: #0a0a0a !important;
}

/* conteúdo */
.leaflet-popup-content {
  margin: 12px 16px !important;
  font-size: 13px !important;
  line-height: 1.5 !important;
}

/* título */
.leaflet-popup-content strong {
  color: #ffffff !important;
  font-weight: 600 !important;
}

/* subtítulo */
.leaflet-popup-content small {
  color: #8a8a8a !important;
}

/* botão fechar */
.leaflet-container a.leaflet-popup-close-button {

  color: #666 !important;

  transition: all 0.15s ease;

}

.leaflet-container a.leaflet-popup-close-button:hover {

  color: #ff2e2e !important;

  transform: scale(1.15);

}


/* ===============================
   SIDEBAR — ESTADOS SEM REGISTRO
=============================== */

.estado-vazio {
  opacity: 0.35;
}

.estado-vazio .estado-header {
  cursor: default;
}

/* ===============================
   SIDEBAR — REGIÕES
=============================== */

.regiao-titulo {
  font-size: 11px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: #666;
  margin: 18px 0 8px;
  font-weight: 600;
}

/* ===============================
   SIDEBAR — REGIÕES ACORDEÃO
=============================== */

.regiao-header {
  display: flex;
  align-items: center;
  gap: 6px;

  font-size: 12px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: #888;
  margin: 18px 0 8px;
  font-weight: 600;
  cursor: pointer;
  transition: 0.2s;
}

.regiao-header:hover {
  color: #fff;
}

/* Indicador visual */
.regiao-header::before {
  content: "+";
  color: #ff2e2e;
  font-weight: 700;
  width: 14px;
  display: inline-block;
  text-align: center;
}

/* Quando aberta */
.regiao-header.aberta::before {
  content: "–";
}

.regiao-body {
  margin-bottom: 10px;
}

/* ===============================
   BOTÃO VOLTAR BRASIL (LEAFLET)
=============================== */

.botao-brasil {
  background: #111;
  border: 1px solid #333;
  color: #ddd;
  padding: 6px 10px;
  font-size: 12px;
  cursor: pointer;
  border-radius: 4px;
  transition: all 0.2s ease;
}

.botao-brasil:hover {
  border-color: #ff2e2e;
  color: #fff;
  background: #1a1a1a;
}

.botao-brasil {
  box-shadow: 0 0 8px rgba(255,46,46,0.2);
}

/* melhora definição das bordas dos estados */
.leaflet-overlay-pane svg path {

  filter: drop-shadow(0 0 1px rgba(0,0,0,0.9))
          drop-shadow(0 0 2px rgba(0,0,0,0.6));

  transition: filter 0.2s ease;

}


/* container dos controles */
.leaflet-control-zoom {
  border: none !important;
  box-shadow: 0 0 10px rgba(0,0,0,0.6);
}

/* botões */
.leaflet-control-zoom a {

  background-color: #0b0b0b !important;
  color: #ccc !important;

  border: 1px solid #1f1f1f !important;

  width: 30px;
  height: 30px;
  line-height: 30px;

  font-size: 16px;
  font-weight: bold;

  transition: all 0.15s ease;

}

/* hover */
.leaflet-control-zoom a:hover {

  background-color: #151515 !important;
  color: #fff !important;

  border-color: #ff2e2e !important;

  box-shadow:
    0 0 6px rgba(255,46,46,0.35);

}


/* ===============================
   AJUSTE NOTEBOOK
=============================== */

@media (max-width: 1366px) {
  #mapa-sidebar {
    width: 300px;
    min-width: 300px;
  }
}
