/* =============================================================================
   MW GTA V MAP - CSS SISTEMA COMPLETO v2.0
   Mobile-First, Premium Dark UI
   ============================================================================= */

/* === FONTES === */
@import url('https://fonts.googleapis.com/css2?family=Rajdhani:wght@400;500;600;700&family=Inter:wght@300;400;500;600&display=swap');

/* ============= VARIÁVEIS DE TEMA ============= */
:root {
  --cor-primaria:    #A0D925;
  --cor-secundaria:  #c6f135;
  --cor-acento:      #FFD700;
  --bg-principal:    #0a0c10;
  --bg-sidebar:      #0d1117;
  --bg-card:         #161b22;
  --bg-card-hover:   #1c2333;
  --bg-input:        #1c2333;
  --texto-primario:  #e6edf3;
  --texto-secundario: #8b949e;
  --texto-muted:     #484f58;
  --borda:           #21262d;
  --borda-hover:     #373e47;
  --sombra:          rgba(0,0,0,0.5);
  --radius:          10px;
  --topbar-h:        56px;
  --sidebar-w:       320px;
  --detalhe-h:       60vh;
  --transicao:       0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Tema Original GTA */
.theme-original {
  --cor-primaria:    #F4BE00;
  --cor-secundaria:  #ffce33;
  --cor-acento:      #ff6b35;
  --bg-principal:    #0b1320;
  --bg-sidebar:      #0e1928;
  --bg-card:         #131f30;
  --bg-card-hover:   #1a2a40;
  --bg-input:        #1a2a40;
  --texto-primario:  #d5e0ee;
  --texto-secundario: #7a90a8;
  --borda:           #1e2f44;
  --borda-hover:     #2a3f58;
}

/* Tema Night (Midnight) */
.theme-night {
  --cor-primaria:    #7c3aed;
  --cor-secundaria:  #8b5cf6;
  --cor-acento:      #e879f9;
  --bg-principal:    #07070f;
  --bg-sidebar:      #0a0a18;
  --bg-card:         #0f0f22;
  --bg-card-hover:   #15152d;
  --bg-input:        #15152d;
  --texto-primario:  #e2d9ff;
  --texto-secundario: #8b80a8;
  --borda:           #1a1a35;
  --borda-hover:     #2a2a4d;
}

/* ============= RESET & BASE ============= */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: var(--bg-principal);
  color: var(--texto-primario);
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
}

/* ============= LAYOUT PRINCIPAL ============= */
#app {
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 100%;
  position: relative;
}

/* ============= TOPBAR ============= */
#topbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 1100;
  height: var(--topbar-h);
  background: linear-gradient(135deg, var(--bg-sidebar) 0%, rgba(13,17,23,0.95) 100%);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--borda);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  gap: 12px;
}

.logo {
  font-family: 'Rajdhani', sans-serif;
  font-weight: 700;
  font-size: 1.4rem;
  color: var(--cor-primaria);
  letter-spacing: 1px;
  display: flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
}

.logo::before {
  content: '🎮';
  font-size: 1.2rem;
}

.logo span {
  color: var(--texto-secundario);
  font-weight: 400;
  font-size: 0.75rem;
  display: none;
}

/* Topbar Quick Actions */
.topbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* ============= MAPA ============= */
#map-container {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  z-index: 100;
}

#map {
  width: 100%;
  height: 100%;
  background: #0d1b2a;
}

/* Tile de fallback (antes dos tiles carregarem) */
.leaflet-container {
  background: #0d1b2a;
}

/* ============= MARCADORES CUSTOMIZADOS ============= */
.mw-marker {
  background: none !important;
  border: none !important;
  transition: transform var(--transicao), filter var(--transicao);
  cursor: pointer;
}

.mw-marker:hover svg, .mw-marker:focus svg {
  filter: brightness(1.3);
  transform: scale(1.15);
}

.mw-marker svg {
  transition: all var(--transicao);
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.6));
}

/* ============= OVERLAY (fundo escuro do sidebar mobile) ============= */
#sidebar-overlay {
  display: none;
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  z-index: 1050;
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  opacity: 0;
  transition: opacity var(--transicao);
}

#sidebar-overlay.visible {
  display: block;
  opacity: 1;
}

/* ============= SIDEBAR ============= */
#sidebar {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  z-index: 1100;
  width: var(--sidebar-w);
  max-width: 90vw;
  background: var(--bg-sidebar);
  border-right: 1px solid var(--borda);
  display: flex;
  flex-direction: column;
  transform: translateX(-100%);
  transition: transform var(--transicao);
  will-change: transform;
}

#sidebar.open {
  transform: translateX(0);
  box-shadow: 4px 0 30px rgba(0,0,0,0.5);
}

.sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  height: var(--topbar-h);
  border-bottom: 1px solid var(--borda);
  flex-shrink: 0;
  background: linear-gradient(135deg, var(--bg-sidebar), var(--bg-card));
}

.sidebar-header h2 {
  font-family: 'Rajdhani', sans-serif;
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--cor-primaria);
}

/* ============= BUSCA ============= */
.search-bar {
  position: relative;
  padding: 12px 12px 8px;
  flex-shrink: 0;
}

.search-bar input {
  width: 100%;
  padding: 10px 40px 10px 38px;
  background: var(--bg-input);
  border: 1px solid var(--borda);
  border-radius: var(--radius);
  color: var(--texto-primario);
  font-size: 13px;
  font-family: 'Inter', sans-serif;
  transition: border-color var(--transicao), box-shadow var(--transicao);
  outline: none;
}

.search-bar input:focus {
  border-color: var(--cor-primaria);
  box-shadow: 0 0 0 3px rgba(160,217,37,0.15);
}

.search-bar input::placeholder {
  color: var(--texto-muted);
}

.search-bar .search-icon {
  position: absolute;
  left: 23px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--texto-muted);
  font-size: 13px;
  pointer-events: none;
}

.search-bar #btn-clear-search {
  position: absolute;
  right: 22px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--texto-muted);
  cursor: pointer;
  padding: 4px;
  border-radius: 50%;
  transition: color var(--transicao), background var(--transicao);
  font-size: 12px;
}

.search-bar #btn-clear-search:hover {
  color: var(--texto-primario);
  background: var(--bg-card-hover);
}

/* ============= STATS ============= */
.stats-container {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  padding: 0 12px 8px;
  flex-shrink: 0;
}

.stat {
  background: var(--bg-card);
  border: 1px solid var(--borda);
  border-radius: var(--radius);
  padding: 8px;
  text-align: center;
}

.stat span:first-child {
  font-family: 'Rajdhani', sans-serif;
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--cor-primaria);
  display: block;
  line-height: 1;
}

.stat small {
  color: var(--texto-muted);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* ============= FILTROS ============= */
.filters {
  padding: 0 12px 8px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  flex-shrink: 0;
}

.toggle {
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  padding: 5px 10px;
  background: var(--bg-card);
  border: 1px solid var(--borda);
  border-radius: 20px;
  transition: all var(--transicao);
  flex: 1;
  min-width: 140px;
}

.toggle:hover {
  border-color: var(--cor-primaria);
}

.toggle input[type="checkbox"] {
  display: none;
}

.toggle-slider {
  width: 28px;
  height: 16px;
  background: var(--borda-hover);
  border-radius: 8px;
  position: relative;
  transition: background var(--transicao);
  flex-shrink: 0;
}

.toggle-slider::after {
  content: '';
  position: absolute;
  width: 12px;
  height: 12px;
  background: white;
  border-radius: 50%;
  top: 2px;
  left: 2px;
  transition: transform var(--transicao);
  box-shadow: 0 1px 3px rgba(0,0,0,0.3);
}

.toggle input:checked ~ .toggle-slider {
  background: var(--cor-primaria);
}

.toggle input:checked ~ .toggle-slider::after {
  transform: translateX(12px);
}

.toggle-label {
  font-size: 12px;
  color: var(--texto-secundario);
  white-space: nowrap;
}

/* ============= AÇÕES GLOBAIS ============= */
.global-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  padding: 0 12px 8px;
  flex-shrink: 0;
}

.action-small-btn {
  padding: 6px 10px;
  background: var(--bg-card);
  border: 1px solid var(--borda);
  border-radius: var(--radius);
  color: var(--texto-secundario);
  font-size: 11px;
  cursor: pointer;
  transition: all var(--transicao);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
}

.action-small-btn:hover {
  background: var(--bg-card-hover);
  color: var(--texto-primario);
  border-color: var(--borda-hover);
}

/* ============= TABS SIDEBAR ============= */
.sidebar-tabs {
  display: flex;
  border-bottom: 1px solid var(--borda);
  flex-shrink: 0;
}

.sidebar-tab {
  flex: 1;
  padding: 10px 8px;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--texto-muted);
  font-size: 11px;
  font-family: 'Inter', sans-serif;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  cursor: pointer;
  transition: all var(--transicao);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
}

.sidebar-tab.active {
  color: var(--cor-primaria);
  border-bottom-color: var(--cor-primaria);
  background: rgba(160,217,37,0.05);
}

.sidebar-tab:hover:not(.active) {
  color: var(--texto-secundario);
  background: var(--bg-card);
}

/* ============= CONTEÚDO SCROLLÁVEL ============= */
.sidebar-body {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  scroll-behavior: smooth;
}

.sidebar-body::-webkit-scrollbar {
  width: 4px;
}

.sidebar-body::-webkit-scrollbar-track {
  background: transparent;
}

.sidebar-body::-webkit-scrollbar-thumb {
  background: var(--borda-hover);
  border-radius: 2px;
}

/* ============= CATEGORIAS (Tab 1) ============= */
#category-list {
  padding: 8px;
}

.cat-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius);
  cursor: pointer;
  transition: all var(--transicao);
  border: 1px solid transparent;
  margin-bottom: 4px;
  position: relative;
}

.cat-item:hover {
  background: var(--bg-card-hover);
  border-color: var(--borda);
}

.cat-item.active {
  background: var(--bg-card);
  border-color: var(--cat-cor, var(--cor-primaria));
  box-shadow: 0 0 0 1px var(--cat-cor, var(--cor-primaria)) inset,
              0 2px 8px rgba(0,0,0,0.3);
}

.cat-emoji {
  font-size: 1.4rem;
  min-width: 30px;
  text-align: center;
}

.cat-info {
  flex: 1;
  min-width: 0;
}

.cat-nome {
  font-size: 13px;
  font-weight: 500;
  color: var(--texto-primario);
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cat-bar {
  height: 3px;
  background: var(--borda);
  border-radius: 2px;
  margin-top: 4px;
}

.cat-bar-fill {
  height: 100%;
  border-radius: 2px;
  transition: width 0.5s ease;
  min-width: 2px;
}

.cat-badge {
  font-size: 11px;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 10px;
  color: #000;
  white-space: nowrap;
  font-family: 'Rajdhani', sans-serif;
}

/* ============= LISTA DE LOCAIS (Tab 2) ============= */
#location-list {
  padding: 6px 8px;
}

.list-group {
  margin-bottom: 12px;
}

.list-group-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 10px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--texto-secundario);
  padding-left: 8px;
  margin-bottom: 4px;
}

.list-group-header .badge {
  background: var(--bg-card);
  border: 1px solid var(--borda);
  color: var(--texto-muted);
  padding: 1px 6px;
  border-radius: 10px;
  font-size: 10px;
}

.list-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border-radius: 8px;
  cursor: pointer;
  transition: all var(--transicao);
  border: 1px solid transparent;
  margin-bottom: 2px;
}

.list-item:hover {
  background: var(--bg-card-hover);
  border-color: var(--borda);
}

.list-item.active {
  background: var(--bg-card);
  border-color: var(--cor-primaria);
  box-shadow: 0 0 0 1px rgba(160,217,37,0.2);
}

.list-item.found .list-item-name {
  color: var(--texto-muted);
  text-decoration: line-through;
}

.list-item-emoji {
  font-size: 1.1rem;
  min-width: 24px;
  text-align: center;
}

.list-item-info {
  flex: 1;
  min-width: 0;
}

.list-item-name {
  font-size: 12px;
  font-weight: 500;
  color: var(--texto-primario);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.3;
}

.list-item-sub {
  font-size: 10px;
  color: var(--texto-muted);
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.list-item-badges {
  display: flex;
  gap: 4px;
  font-size: 11px;
  flex-shrink: 0;
}

.list-empty {
  text-align: center;
  padding: 40px 20px;
  color: var(--texto-muted);
}

.list-empty i {
  font-size: 2rem;
  margin-bottom: 12px;
  display: block;
  opacity: 0.4;
}

.list-empty p {
  font-weight: 500;
  margin-bottom: 4px;
}

.list-empty small {
  font-size: 11px;
  opacity: 0.7;
}

/* ============= SIDEBAR FOOTER ============= */
.sidebar-footer {
  border-top: 1px solid var(--borda);
  padding: 10px 12px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  flex-shrink: 0;
  background: var(--bg-sidebar);
}

/* ============= PAINEL DE DETALHES ============= */
#details-panel {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  z-index: 1200;
  background: var(--bg-sidebar);
  border-top: 1px solid var(--borda);
  border-radius: 16px 16px 0 0;
  max-height: var(--detalhe-h);
  transform: translateY(100%);
  transition: transform var(--transicao);
  will-change: transform;
  box-shadow: 0 -8px 40px rgba(0,0,0,0.6);
  display: flex;
  flex-direction: column;
}

#details-panel.visible {
  transform: translateY(0);
}

.details-drag-handle {
  width: 36px;
  height: 4px;
  background: var(--borda-hover);
  border-radius: 2px;
  margin: 12px auto 0;
  flex-shrink: 0;
}

.details-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 12px 16px 8px;
  flex-shrink: 0;
  gap: 12px;
}

#details-title {
  font-family: 'Rajdhani', sans-serif;
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--texto-primario);
  display: flex;
  align-items: center;
  gap: 8px;
  line-height: 1.3;
}

.details-icon {
  font-size: 1.4rem;
}

.details-content {
  flex: 1;
  overflow-y: auto;
  padding: 0 16px 16px;
}

.details-content::-webkit-scrollbar {
  width: 3px;
}

.details-category-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  color: var(--texto-muted);
  background: var(--bg-card);
  border: 1px solid var(--borda);
  padding: 3px 10px;
  border-radius: 20px;
  margin-bottom: 10px;
}

#details-desc {
  font-size: 13px;
  color: var(--texto-secundario);
  line-height: 1.6;
  margin-bottom: 12px;
}

/* Tags */
.details-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-bottom: 14px;
}

.tag {
  padding: 3px 10px;
  background: rgba(160,217,37,0.1);
  border: 1px solid rgba(160,217,37,0.2);
  border-radius: 20px;
  font-size: 11px;
  color: var(--cor-primaria);
  cursor: pointer;
  transition: all var(--transicao);
}

.tag:hover {
  background: rgba(160,217,37,0.2);
  border-color: var(--cor-primaria);
}

/* Coords */
.details-coords {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-card);
  border: 1px solid var(--borda);
  border-radius: var(--radius);
  padding: 8px 12px;
  margin-bottom: 12px;
}

.details-coords code {
  flex: 1;
  font-size: 12px;
  color: var(--cor-primaria);
  font-family: 'Rajdhani', monospace;
  font-weight: 600;
}

/* Botões de ação do detalhe */
.details-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 12px;
}

.custom-point-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 8px;
}

.custom-point-actions.hidden {
  display: none;
}

/* ============= CAPTURA OVERLAY ============= */
#capture-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  z-index: 2000;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  pointer-events: none;
}

#capture-overlay.hidden {
  display: none;
}

#capture-overlay .capture-msg {
  background: rgba(13,17,23,0.9);
  backdrop-filter: blur(10px);
  border: 1px solid var(--cor-primaria);
  color: var(--cor-primaria);
  padding: 12px 24px;
  border-radius: var(--radius);
  font-weight: 600;
  font-size: 14px;
  pointer-events: none;
  animation: pulse-border 1.5s ease infinite;
}

#capture-overlay #cancel-capture {
  pointer-events: all;
}

@keyframes pulse-border {
  0%, 100% { box-shadow: 0 0 0 0 rgba(160,217,37,0.4); }
  50% { box-shadow: 0 0 0 8px rgba(160,217,37,0); }
}

/* ============= BOTÕES ============= */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 16px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  cursor: pointer;
  font-size: 13px;
  font-family: 'Inter', sans-serif;
  font-weight: 500;
  transition: all var(--transicao);
  text-align: center;
  white-space: nowrap;
  position: relative;
  overflow: hidden;
}

.btn::after {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(255,255,255,0);
  transition: background var(--transicao);
}

.btn:hover::after {
  background: rgba(255,255,255,0.05);
}

.btn:active {
  transform: scale(0.97);
}

.primary-btn {
  background: var(--cor-primaria);
  color: #0a0c10;
  font-weight: 600;
}

.primary-btn:hover {
  background: var(--cor-secundaria);
  box-shadow: 0 4px 15px rgba(160,217,37,0.3);
}

.secondary-btn {
  background: var(--bg-card);
  color: var(--texto-primario);
  border-color: var(--borda);
}

.secondary-btn:hover {
  background: var(--bg-card-hover);
  border-color: var(--borda-hover);
}

.action-btn {
  background: var(--bg-card);
  color: var(--texto-secundario);
  border-color: var(--borda);
  font-size: 12px;
  padding: 8px 12px;
}

.action-btn:hover {
  background: var(--bg-card-hover);
  color: var(--texto-primario);
  border-color: var(--borda-hover);
}

.action-btn.active {
  background: rgba(160,217,37,0.15);
  color: var(--cor-primaria);
  border-color: var(--cor-primaria);
}

#btn-favorite.active {
  background: rgba(255,215,0,0.15);
  color: #FFD700;
  border-color: #FFD700;
}

.danger-btn {
  background: rgba(239,68,68,0.1);
  color: #ef4444;
  border-color: rgba(239,68,68,0.3);
}

.danger-btn:hover {
  background: rgba(239,68,68,0.2);
  border-color: #ef4444;
}

.icon-btn {
  background: var(--bg-card);
  border: 1px solid var(--borda);
  color: var(--texto-secundario);
  width: 36px;
  height: 36px;
  border-radius: var(--radius);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  transition: all var(--transicao);
  flex-shrink: 0;
}

.icon-btn:hover {
  background: var(--bg-card-hover);
  border-color: var(--borda-hover);
  color: var(--texto-primario);
}

.w-100 { width: 100%; }
.mb-10 { margin-bottom: 10px; }
.hidden { display: none !important; }

/* ============= MODAIS ============= */
.modal {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  background: rgba(0,0,0,0);
  transition: background var(--transicao);
}

.modal.visible {
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.modal.hidden {
  display: none;
}

.modal-content {
  width: 100%;
  max-width: 480px;
  background: var(--bg-sidebar);
  border-top: 1px solid var(--borda);
  border-radius: 16px 16px 0 0;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  transform: translateY(100%);
  transition: transform var(--transicao);
}

.modal.visible .modal-content {
  transform: translateY(0);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--borda);
  flex-shrink: 0;
}

.modal-header h3 {
  font-family: 'Rajdhani', sans-serif;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--texto-primario);
}

.modal-body {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
}

.modal-body::-webkit-scrollbar {
  width: 3px;
}

/* ============= FORMULÁRIOS ============= */
.form-group {
  margin-bottom: 14px;
}

.form-group label {
  display: block;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--texto-secundario);
  margin-bottom: 5px;
}

.form-control {
  width: 100%;
  padding: 10px 12px;
  background: var(--bg-input);
  border: 1px solid var(--borda);
  border-radius: var(--radius);
  color: var(--texto-primario);
  font-size: 13px;
  font-family: 'Inter', sans-serif;
  transition: border-color var(--transicao), box-shadow var(--transicao);
  outline: none;
  appearance: none;
  -webkit-appearance: none;
}

.form-control:focus {
  border-color: var(--cor-primaria);
  box-shadow: 0 0 0 3px rgba(160,217,37,0.12);
}

.form-control::placeholder {
  color: var(--texto-muted);
}

textarea.form-control {
  resize: vertical;
  min-height: 70px;
}

select.form-control {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%238b949e'%3E%3Cpath d='M7 10l5 5 5-5z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 8px center;
  background-size: 20px;
  padding-right: 30px;
  cursor: pointer;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.modal-body h4 {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--texto-muted);
  margin-bottom: 10px;
  margin-top: 14px;
}

.modal-body h4:first-child {
  margin-top: 0;
}

.modal-body p {
  font-size: 12px;
  color: var(--texto-muted);
  margin-bottom: 10px;
  line-height: 1.5;
}

.modal-body hr {
  border: none;
  border-top: 1px solid var(--borda);
  margin: 14px 0;
}

/* ============= TOAST NOTIFICATIONS ============= */
.toast {
  position: fixed;
  bottom: calc(var(--detalhe-h) + 20px);
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  z-index: 3000;
  padding: 10px 20px;
  border-radius: var(--radius);
  font-size: 13px;
  font-weight: 500;
  opacity: 0;
  transition: all 0.3s ease;
  white-space: nowrap;
  pointer-events: none;
  max-width: 90vw;
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.toast-success {
  background: rgba(34,197,94,0.9);
  color: white;
  box-shadow: 0 4px 15px rgba(34,197,94,0.3);
}

.toast-error {
  background: rgba(239,68,68,0.9);
  color: white;
  box-shadow: 0 4px 15px rgba(239,68,68,0.3);
}

.toast-info {
  background: rgba(59,130,246,0.9);
  color: white;
  box-shadow: 0 4px 15px rgba(59,130,246,0.3);
}

/* ============= LEAFLET CUSTOMIZAÇÕES ============= */
.leaflet-control-zoom {
  border: 1px solid var(--borda) !important;
  border-radius: var(--radius) !important;
  overflow: hidden;
  box-shadow: 0 4px 15px rgba(0,0,0,0.4) !important;
}

.leaflet-control-zoom a {
  background: var(--bg-sidebar) !important;
  color: var(--texto-primario) !important;
  border: none !important;
  border-bottom: 1px solid var(--borda) !important;
  width: 36px !important;
  height: 36px !important;
  line-height: 36px !important;
  font-size: 16px !important;
  transition: all var(--transicao) !important;
}

.leaflet-control-zoom a:last-child {
  border-bottom: none !important;
}

.leaflet-control-zoom a:hover {
  background: var(--bg-card-hover) !important;
  color: var(--cor-primaria) !important;
}

/* ============= BOTÃO FAB (Floating Action Button) Mobile ============= */
#fab-menu {
  position: fixed;
  bottom: 20px;
  right: 16px;
  z-index: 1050;
  display: flex;
  flex-direction: column-reverse;
  align-items: flex-end;
  gap: 10px;
}

.fab-main {
  width: 52px;
  height: 52px;
  background: var(--cor-primaria);
  border: none;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  cursor: pointer;
  box-shadow: 0 4px 20px rgba(160,217,37,0.4);
  transition: all var(--transicao);
  color: #0a0c10;
}

.fab-main:hover {
  background: var(--cor-secundaria);
  transform: scale(1.08);
}

.fab-main:active {
  transform: scale(0.95);
}

/* ============= DESKTOP ADAPTATIONS ============= */
@media (min-width: 769px) {
  #topbar {
    left: var(--sidebar-w);
  }

  #sidebar {
    transform: translateX(0);
  }

  #sidebar-overlay {
    display: none !important;
  }

  #toggle-sidebar {
    display: none;
  }

  #map-container {
    left: var(--sidebar-w);
  }

  #details-panel {
    left: var(--sidebar-w);
    right: auto;
    width: 380px;
    top: var(--topbar-h);
    bottom: auto;
    max-height: calc(100vh - var(--topbar-h));
    border-radius: 0 0 var(--radius) 0;
    border-top: none;
    border-right: 1px solid var(--borda);
    border-bottom: 1px solid var(--borda);
    transform: translateX(-100%);
  }

  #details-panel.visible {
    transform: translateX(0);
  }

  .details-drag-handle {
    display: none;
  }

  .toast {
    bottom: 20px;
    left: calc(var(--sidebar-w) + 200px);
    transform: translateX(0) translateY(20px);
  }

  .toast.show {
    transform: translateX(0) translateY(0);
  }

  .modal {
    align-items: center;
  }

  .modal-content {
    border-radius: var(--radius);
    border: 1px solid var(--borda);
    transform: scale(0.9);
    max-height: 85vh;
  }

  .modal.visible .modal-content {
    transform: scale(1);
  }

  #fab-menu {
    display: none;
  }

  .logo span {
    display: inline;
  }
}

/* ============= ANIMAÇÕES DE ENTRADA ============= */
@keyframes slideInUp {
  from { transform: translateY(20px); opacity: 0; }
  to   { transform: translateY(0);    opacity: 1; }
}

.cat-item, .list-item {
  animation: slideInUp 0.2s ease both;
}

/* Stagger */
.cat-item:nth-child(1)  { animation-delay: 0.02s; }
.cat-item:nth-child(2)  { animation-delay: 0.04s; }
.cat-item:nth-child(3)  { animation-delay: 0.06s; }
.cat-item:nth-child(4)  { animation-delay: 0.08s; }
.cat-item:nth-child(5)  { animation-delay: 0.10s; }
.cat-item:nth-child(6)  { animation-delay: 0.12s; }
.cat-item:nth-child(7)  { animation-delay: 0.14s; }
.cat-item:nth-child(8)  { animation-delay: 0.16s; }
.cat-item:nth-child(9)  { animation-delay: 0.18s; }
.cat-item:nth-child(10) { animation-delay: 0.20s; }

/* ============= LEAFLET POPUP HIDE (não usamos popup do leaflet) ============= */
.leaflet-popup { display: none !important; }

/* === v4.0 mobile first / Canvas / acessibilidade === */
html,body,#app{height:100%;height:100dvh}body{overscroll-behavior:none}button,input,select,textarea{font:inherit}button{touch-action:manipulation}[hidden]{display:none!important}.sr-only{position:absolute!important;width:1px!important;height:1px!important;padding:0!important;margin:-1px!important;overflow:hidden!important;clip:rect(0,0,0,0)!important;white-space:nowrap!important;border:0!important}
#topbar{min-height:calc(var(--topbar-h) + env(safe-area-inset-top));height:calc(var(--topbar-h) + env(safe-area-inset-top));padding-top:env(safe-area-inset-top);padding-left:max(14px,env(safe-area-inset-left));padding-right:max(14px,env(safe-area-inset-right))}.logo{text-decoration:none;min-width:0}.logo::before{display:none}.logo img{height:30px;max-width:160px;object-fit:contain}.logo span{color:var(--texto-secundario);font-size:.72rem;letter-spacing:.12em}
#sidebar{width:min(92vw,360px);max-width:none;padding-bottom:env(safe-area-inset-bottom)}.sidebar-header{min-height:calc(var(--topbar-h) + env(safe-area-inset-top));height:auto;padding-top:env(safe-area-inset-top)}.sidebar-header h2{display:flex;align-items:center;gap:8px;min-width:0}.sidebar-header h2 img{height:24px;max-width:120px;object-fit:contain}.sidebar-footer{padding-bottom:max(10px,env(safe-area-inset-bottom))}
.icon-btn{min-width:44px;min-height:44px}.search-bar input{min-height:44px;font-size:16px}.action-small-btn,.sidebar-tab,.cat-item,.list-item{min-height:44px}.cat-item,.list-item{width:100%;background:transparent;color:inherit;text-align:left;font-family:inherit}.cat-item-all .cat-badge{background:var(--cor-primaria);color:#0a0c10}.list-item-badges .fa-star{color:#FFD700}.list-item-badges .fa-check-circle{color:#10B981}.marker-dot{width:12px;height:12px;flex:0 0 12px;border-radius:50%;background:var(--marker-cor);box-shadow:0 0 0 2px rgba(255,255,255,.12),0 1px 5px rgba(0,0,0,.6)}.list-more{display:grid;gap:8px;padding:10px 4px 18px;text-align:center;color:var(--texto-muted)}
#details-panel{max-height:min(72dvh,680px);padding-bottom:env(safe-area-inset-bottom)}.details-content{padding-bottom:max(18px,env(safe-area-inset-bottom))}.details-category-dot{width:9px;height:9px;border-radius:50%;flex:0 0 9px}.details-source{display:block;color:var(--texto-muted);margin:-5px 0 12px}.details-coords{justify-content:space-between}.details-coords>div{display:grid;gap:3px;min-width:0}.details-coords small{color:var(--texto-muted);font-size:10px;text-transform:uppercase;letter-spacing:.04em}.details-coords code{word-break:break-word}.gta-coords{border-style:dashed}.tag{min-height:32px}.file-btn{cursor:pointer}.about-small{font-size:11px!important;color:var(--texto-muted)!important}
.mw-tooltip{background:rgba(10,12,16,.94)!important;color:#fff!important;border:1px solid rgba(255,255,255,.18)!important;box-shadow:0 4px 14px rgba(0,0,0,.45)!important;border-radius:8px!important;font-size:12px!important}.mw-tooltip::before{border-top-color:rgba(10,12,16,.94)!important}.leaflet-control-zoom{margin-right:max(10px,env(safe-area-inset-right))!important;margin-bottom:max(12px,env(safe-area-inset-bottom))!important}.leaflet-control-zoom a{width:44px!important;height:44px!important;line-height:44px!important}
@media(min-width:769px){:root{--sidebar-w:340px}#sidebar{width:var(--sidebar-w);padding-bottom:0}#topbar{min-height:var(--topbar-h);height:var(--topbar-h);padding-top:0}.sidebar-header{min-height:var(--topbar-h);height:var(--topbar-h);padding-top:0}#details-panel{max-height:calc(100dvh - var(--topbar-h))}}
@media(max-width:390px){.stats-container{gap:5px;padding-inline:8px}.stat{padding:7px 4px}.filters{padding-inline:8px}.toggle{min-width:0;padding-inline:8px}.toggle-label{font-size:11px}.global-actions{padding-inline:8px}.logo img{max-width:120px}}
@media(prefers-reduced-motion:reduce){*,*::before,*::after{scroll-behavior:auto!important;animation-duration:.01ms!important;animation-iteration-count:1!important;transition-duration:.01ms!important}}
