@import url('fonts.css');
@import url('metro-theme.css');

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-font-smoothing: antialiased;
}

body {
  font-family: var(--font-metro);
  background-color: var(--metro-bg-light);
  color: var(--metro-text-primary);
  overflow: hidden;
  height: 100vh;
  width: 100vw;
  display: flex;
  flex-direction: column;
  user-select: none;
}

/* ===== TOPBAR ===== */
.topbar {
  height: 52px;
  background-color: var(--metro-bg-card);
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 14px;
  z-index: 100;
  gap: 12px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.03);
}

[data-theme="dark"] .topbar {
  border-bottom-color: rgba(255, 255, 255, 0.08);
  box-shadow: 0 1px 6px rgba(0, 0, 0, 0.3);
}

.brand-section {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.logo-mapeando {
  height: 26px;
  width: auto;
  cursor: pointer;
}

.brand-divider {
  width: 1px;
  height: 22px;
  background-color: rgba(0, 0, 0, 0.08);
}

[data-theme="dark"] .brand-divider {
  background-color: rgba(255, 255, 255, 0.1);
}

.brand-info {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
}

.brand-main-row {
  display: flex;
  align-items: center;
  gap: 5px;
}

.brand-app-title {
  font-family: var(--font-metro-rounded);
  font-size: 12.5px;
  font-weight: 800;
  color: var(--metro-text-primary);
  letter-spacing: -0.1px;
  white-space: nowrap;
}

.brand-badge {
  font-family: var(--font-metro-rounded);
  font-size: 9.5px;
  font-weight: 800;
  background: linear-gradient(135deg, #19159d, #ec3138);
  color: #fff;
  padding: 1px 5px;
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  line-height: 1.2;
}

.brand-social-link {
  font-size: 11px;
  font-weight: 700;
  color: #d92d7b !important;
  text-decoration: none !important;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  opacity: 0.9;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.brand-social-link:hover {
  opacity: 1;
  color: #19159d !important;
  transform: translateY(-0.5px);
}

/* Modos de Navegação Central */
.mode-selector {
  display: inline-flex;
  align-items: center;
  background-color: var(--metro-bg-light);
  border: 1px solid rgba(0, 0, 0, 0.06);
  border-radius: 999px;
  padding: 3px;
  gap: 2px;
  flex-shrink: 0;
}

[data-theme="dark"] .mode-selector {
  background-color: #0d1117;
  border-color: rgba(255, 255, 255, 0.08);
}

.mode-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border: none;
  background: transparent;
  color: var(--metro-text-secondary);
  font-family: var(--font-metro-rounded);
  font-size: 12px;
  font-weight: 700;
  border-radius: 999px;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.mode-btn:hover {
  color: var(--metro-text-primary);
  background-color: rgba(0, 0, 0, 0.04);
}

[data-theme="dark"] .mode-btn:hover {
  background-color: rgba(255, 255, 255, 0.05);
}

.mode-btn.active {
  background-color: var(--metro-bg-card);
  color: #19159d;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  font-weight: 800;
}

[data-theme="dark"] .mode-btn.active {
  color: #fcc918;
  background-color: #21262d;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

/* Barra de Ações Rápidas à Direita */
.actions-section {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.actions-group-files {
  display: flex;
  align-items: center;
  gap: 4px;
}

.actions-divider {
  width: 1px;
  height: 20px;
  background-color: rgba(0, 0, 0, 0.08);
  margin: 0 2px;
}

[data-theme="dark"] .actions-divider {
  background-color: rgba(255, 255, 255, 0.1);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 6px 12px;
  border-radius: 6px;
  font-family: var(--font-metro-rounded);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s ease;
  border: 1px solid transparent;
  white-space: nowrap;
}

.btn-compact {
  padding: 5px 9px;
  font-size: 11.5px;
}

.btn-primary {
  background: linear-gradient(135deg, #19159d, #2d26d8);
  color: #ffffff;
  box-shadow: 0 1px 4px rgba(25, 21, 157, 0.2);
}

.btn-primary:hover {
  background: linear-gradient(135deg, #130f7e, #231ebd);
  transform: translateY(-0.5px);
  box-shadow: 0 2px 6px rgba(25, 21, 157, 0.3);
}

.btn-secondary {
  background-color: var(--metro-bg-light);
  border-color: rgba(0, 0, 0, 0.08);
  color: var(--metro-text-primary);
}

[data-theme="dark"] .btn-secondary {
  background-color: #21262d;
  border-color: rgba(255, 255, 255, 0.1);
}

.btn-secondary:hover {
  background-color: rgba(0, 0, 0, 0.06);
  border-color: rgba(0, 0, 0, 0.15);
}

[data-theme="dark"] .btn-secondary:hover {
  background-color: #30363d;
  border-color: rgba(255, 255, 255, 0.2);
}

.btn-icon {
  width: 30px;
  height: 30px;
  padding: 0;
  border-radius: 6px;
  background-color: var(--metro-bg-light);
  border: 1px solid rgba(0, 0, 0, 0.08);
  color: var(--metro-text-primary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 13px;
  transition: all 0.15s ease;
}

[data-theme="dark"] .btn-icon {
  background-color: #21262d;
  border-color: rgba(255, 255, 255, 0.1);
}

.btn-icon:hover {
  transform: scale(1.06);
}

/* Responsividade do Menu Superior */
@media (max-width: 1024px) {
  .actions-group-files .btn-text {
    display: none;
  }
  .brand-social-link {
    display: none;
  }
}

/* ===== WORKSPACE (MAIN CONTAINER) ===== */
.app-workspace {
  position: relative;
  flex: 1;
  display: flex;
  overflow: hidden;
}

/* Canvas / SVG Viewport */
.map-viewport {
  flex: 1;
  position: relative;
  background-color: var(--metro-bg-light);
  overflow: hidden;
  cursor: grab;
}

.map-viewport.panning {
  cursor: grabbing;
}

.map-viewport.drawing {
  cursor: crosshair;
}

#map-svg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  transform-origin: 0 0;
  will-change: transform;
}

/* ===== ESTILO DOS NOMES DE ESTAÇÃO (SEM BRILHO EXCESSIVO NO MODO NOTURNO) ===== */
.station-label {
  pointer-events: none;
  font-family: var(--font-metro-rounded), 'Helvetica-Rounded-Bold', 'Arial Rounded MT Bold', sans-serif;
  font-size: 12px;
  font-weight: bold;
  fill: var(--metro-text-primary);
  text-shadow: var(--station-label-halo);
  transition: fill 0.2s ease, text-shadow 0.2s ease;
}

/* Floating Controls (Zoom, Reset, Compass) */
.map-floating-controls {
  position: absolute;
  top: 16px;
  right: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 50;
}

.floating-btn-group {
  background-color: var(--metro-bg-card);
  border-radius: 8px;
  border: 1px solid rgba(0, 0, 0, 0.1);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.floating-btn-group button {
  width: 38px;
  height: 38px;
  border: none;
  background: transparent;
  color: var(--metro-text-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 16px;
  transition: background 0.15s;
}

.floating-btn-group button:hover {
  background-color: var(--metro-bg-light);
}

.floating-btn-group button:not(:last-child) {
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

.north-indicator-btn {
  background-color: var(--metro-bg-card);
  border-radius: 8px;
  border: 1px solid rgba(0, 0, 0, 0.1);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  width: 38px;
  height: 38px;
  padding: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

/* Floating Search Bar */
.map-search-bar {
  position: absolute;
  top: 16px;
  left: 16px;
  z-index: 50;
  width: 280px;
  background-color: var(--metro-bg-card);
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  display: flex;
  align-items: center;
  padding: 6px 10px;
  gap: 8px;
}

.map-search-bar input {
  border: none;
  background: transparent;
  outline: none;
  font-family: var(--font-metro);
  font-size: 13px;
  width: 100%;
  color: var(--metro-text-primary);
}

.search-results-dropdown {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  width: 100%;
  background-color: var(--metro-bg-card);
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: 8px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
  max-height: 260px;
  overflow-y: auto;
  display: none;
}

.search-results-dropdown.active {
  display: block;
}

.search-item {
  padding: 8px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  font-size: 13px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.04);
}

.search-item:hover {
  background-color: var(--metro-bg-light);
}

/* ===== SIDEBAR DO EDITOR ===== */
.editor-sidebar {
  width: 320px;
  background-color: var(--metro-bg-card);
  border-left: 1px solid rgba(0, 0, 0, 0.08);
  display: flex;
  flex-direction: column;
  z-index: 60;
  transition: transform 0.25s ease;
  box-shadow: -2px 0 8px rgba(0, 0, 0, 0.03);
  overflow-y: auto;
  max-height: calc(100vh - 56px);
}

.editor-sidebar.hidden {
  display: none;
}

.sidebar-header {
  padding: 14px 16px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.sidebar-title {
  font-family: var(--font-metro-rounded);
  font-size: 15px;
  font-weight: bold;
  display: flex;
  align-items: center;
  gap: 8px;
}

.sidebar-tabs {
  display: flex;
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

.sidebar-tab {
  flex: 1;
  padding: 10px;
  text-align: center;
  font-family: var(--font-metro-rounded);
  font-size: 12px;
  font-weight: bold;
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--metro-text-secondary);
  cursor: pointer;
}

.sidebar-tab.active {
  color: #19159d;
  border-bottom-color: #19159d;
}

.sidebar-content {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.editor-tool-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}

.tool-card {
  padding: 10px;
  border-radius: 8px;
  border: 1px solid rgba(0, 0, 0, 0.1);
  background-color: var(--metro-bg-light);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  transition: all 0.15s ease;
  text-align: center;
}

.tool-card:hover {
  border-color: #19159d;
  background-color: rgba(25, 21, 157, 0.04);
}

.tool-card.active {
  border-color: #19159d;
  background-color: #19159d;
  color: #ffffff;
}

.tool-card.active svg {
  stroke: #ffffff;
}

.tool-card span {
  font-family: var(--font-metro-rounded);
  font-size: 11px;
  font-weight: bold;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-group label {
  font-family: var(--font-metro-rounded);
  font-size: 12px;
  font-weight: bold;
  color: var(--metro-text-secondary);
}

.form-input, .form-select {
  padding: 8px 10px;
  border-radius: 6px;
  border: 1px solid rgba(0, 0, 0, 0.15);
  font-family: var(--font-metro);
  font-size: 13px;
  background-color: var(--metro-bg-card);
  color: var(--metro-text-primary);
  outline: none;
}

.form-input:focus, .form-select:focus {
  border-color: #19159d;
}

.color-palette-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 6px;
}

.color-swatch {
  width: 100%;
  aspect-ratio: 1;
  border-radius: 6px;
  cursor: pointer;
  border: 2px solid transparent;
  transition: transform 0.1s;
}

.color-swatch:hover {
  transform: scale(1.1);
}

.color-swatch.active {
  border-color: #000;
  box-shadow: 0 0 0 2px #fff inset;
}

/* ===== LINHA DO TEMPO (BOTTOM BAR) ===== */
.timeline-bar {
  background-color: var(--metro-bg-card);
  border-top: 1px solid rgba(0, 0, 0, 0.08);
  padding: 12px 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 90;
  box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.04);
}

.timeline-bar.hidden {
  display: none;
}

.timeline-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.timeline-info {
  display: flex;
  align-items: baseline;
  gap: 12px;
}

.timeline-year {
  font-family: var(--font-metro-rounded);
  font-size: 28px;
  font-weight: bold;
  color: #19159d;
  line-height: 1;
}

.timeline-event-title {
  font-family: var(--font-metro-rounded);
  font-size: 13.5px;
  font-weight: bold;
  color: var(--metro-text-primary);
  line-height: 1.3;
  transition: color 0.15s ease;
}

.timeline-event-title:hover {
  color: #19159d;
}

[data-theme="dark"] .timeline-event-title:hover {
  color: #fcc918;
}

.timeline-stats {
  display: flex;
  align-items: center;
  gap: 16px;
  font-size: 12px;
  color: var(--metro-text-secondary);
}

.stat-item strong {
  font-family: var(--font-metro-rounded);
  color: var(--metro-text-primary);
  font-size: 13px;
}

.timeline-controls-row {
  display: flex;
  align-items: center;
  gap: 16px;
}

.playback-controls {
  display: flex;
  align-items: center;
  gap: 6px;
}

.timeline-slider-container {
  flex: 1;
  display: flex;
  flex-direction: column;
  position: relative;
}

.timeline-slider {
  width: 100%;
  -webkit-appearance: none;
  height: 6px;
  border-radius: 3px;
  background: #e1e4e8;
  outline: none;
  cursor: pointer;
}

.timeline-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #19159d;
  border: 2px solid #fff;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.25);
  cursor: pointer;
  transition: transform 0.1s;
}

.timeline-slider::-webkit-slider-thumb:hover {
  transform: scale(1.2);
}

.timeline-ticks {
  display: flex;
  justify-content: space-between;
  font-size: 10px;
  font-family: var(--font-metro-rounded);
  color: var(--metro-text-secondary);
  margin-top: 4px;
}

/* ===== TOOLTIP FLUTUANTE DA ESTAÇÃO ===== */
.station-tooltip {
  position: absolute;
  background-color: var(--metro-bg-card);
  border: 1px solid rgba(0, 0, 0, 0.12);
  border-radius: 8px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
  padding: 10px 14px;
  pointer-events: none;
  z-index: 200;
  display: none;
  min-width: 180px;
  max-width: 260px;
  transform: translate(-50%, -100%) translateY(-12px);
  animation: fadeInTooltip 0.15s ease;
}

@keyframes fadeInTooltip {
  from { opacity: 0; transform: translate(-50%, -95%) translateY(-12px); }
  to { opacity: 1; transform: translate(-50%, -100%) translateY(-12px); }
}

.tooltip-station-name {
  font-family: var(--font-metro-rounded);
  font-size: 14px;
  font-weight: bold;
  margin-bottom: 4px;
}

.tooltip-lines {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-bottom: 6px;
}

.tooltip-year {
  font-size: 11px;
  color: var(--metro-text-secondary);
}

.tooltip-amenities {
  display: flex;
  gap: 6px;
  margin-top: 6px;
  padding-top: 6px;
  border-top: 1px solid rgba(0, 0, 0, 0.06);
}

/* ===== MODAL / DIALOGS ===== */
.modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background-color: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 300;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.modal-backdrop.active {
  opacity: 1;
  pointer-events: auto;
}

.modal-box {
  background-color: var(--metro-bg-card);
  border-radius: 12px;
  width: 90%;
  max-width: 480px;
  padding: 24px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
  display: flex;
  flex-direction: column;
  gap: 16px;
  transform: scale(0.95);
  transition: transform 0.2s ease;
}

.modal-backdrop.active .modal-box {
  transform: scale(1);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-title {
  font-family: var(--font-metro-rounded);
  font-size: 18px;
  font-weight: bold;
}

.modal-close-btn {
  background: transparent;
  border: none;
  font-size: 20px;
  cursor: pointer;
  color: var(--metro-text-secondary);
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 8px;
}

/* Notificações Toast */
.toast-container {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 400;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.toast {
  background-color: #1e2229;
  color: #fff;
  padding: 10px 16px;
  border-radius: 8px;
  font-size: 13px;
  font-family: var(--font-metro-rounded);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
  display: flex;
  align-items: center;
  gap: 8px;
  animation: slideInToast 0.2s ease;
}

@keyframes slideInToast {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ===== ELEMENTOS DO EDITOR INTERATIVO (DRAG & DROP) ===== */
.map-viewport.dragging-node {
  cursor: grabbing !important;
}

.map-viewport.dragging-node * {
  cursor: grabbing !important;
}

.editor-guide-line {
  stroke: #0284c7;
  stroke-width: 1.8;
  stroke-dasharray: 4 4;
  opacity: 0.85;
  pointer-events: none;
  animation: guidePulse 1s infinite alternate;
}

@keyframes guidePulse {
  from { opacity: 0.6; }
  to { opacity: 1; }
}

.editor-compass-pin {
  transition: transform 0.12s ease;
}

.editor-compass-pin:hover circle {
  transform: scale(1.35);
  transform-origin: center;
  fill: #1d4ed8 !important;
  stroke: #ffffff !important;
}

.line-segment-handle:hover {
  opacity: 1;
  transform: scale(1.25);
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.25));
}

/* ===== REGRAS DE IMPRESSÃO DE ALTA RESOLUÇÃO (@media print) ===== */
@media print {
  @page {
    size: landscape;
    margin: 8mm;
  }

  body {
    background: #ffffff !important;
    color: #000000 !important;
    overflow: visible !important;
    height: auto !important;
    width: auto !important;
  }

  .topbar,
  .editor-sidebar,
  .timeline-bar,
  .map-search-bar,
  .map-floating-controls,
  .station-tooltip,
  .modal-backdrop,
  .toast-container,
  #layer-grid,
  #layer-editor {
    display: none !important;
  }

  .app-workspace {
    position: static !important;
    width: 100% !important;
    height: 100% !important;
    overflow: visible !important;
  }

  .map-viewport {
    background: #ffffff !important;
    width: 100vw !important;
    height: 96vh !important;
    position: static !important;
  }

}

/* ===== BOTÃO E MODAL DE APOIO AO PROJETO ===== */
.btn-support {
  background: linear-gradient(135deg, #ff4d6d, #dc4f00) !important;
  color: #ffffff !important;
  border: none !important;
  box-shadow: 0 2px 6px rgba(220, 79, 0, 0.25);
  transition: all 0.2s ease;
}

.btn-support:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 10px rgba(220, 79, 0, 0.35);
  filter: brightness(1.08);
}

.support-options-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin: 16px 0;
}

@media (max-width: 680px) {
  .support-options-grid {
    grid-template-columns: 1fr;
  }
}

.support-card {
  border: 1px solid rgba(0, 0, 0, 0.1);
  background: var(--metro-bg-light);
  border-radius: 8px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 10px;
}

[data-theme="dark"] .support-card {
  border-color: rgba(255, 255, 255, 0.12);
  background: #161b22;
}

.support-card-header {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: bold;
  font-size: 14px;
}

.support-pix-box {
  background: var(--metro-bg-card);
  border: 1px dashed rgba(0, 0, 0, 0.18);
  border-radius: 6px;
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: center;
  text-align: center;
}

[data-theme="dark"] .support-pix-box {
  border-color: rgba(255, 255, 255, 0.2);
}

.pix-key-display {
  font-family: monospace;
  font-size: 12px;
  background: rgba(0, 0, 0, 0.05);
  padding: 4px 8px;
  border-radius: 4px;
  word-break: break-all;
  user-select: all;
  width: 100%;
}

[data-theme="dark"] .pix-key-display {
  background: rgba(255, 255, 255, 0.08);
}

/* ===== SLOTS DE PUBLICIDADE E PATROCÍNIO (ADS) ===== */
.ad-banner-slot {
  position: relative;
  border: 1px dashed rgba(0, 0, 0, 0.14);
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.02);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  transition: all 0.2s ease;
}

[data-theme="dark"] .ad-banner-slot {
  border-color: rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.02);
}

.ad-badge {
  position: absolute;
  top: 4px;
  right: 6px;
  font-size: 8px;
  font-weight: 800;
  letter-spacing: 0.5px;
  color: var(--metro-text-secondary);
  opacity: 0.6;
  text-transform: uppercase;
  pointer-events: none;
}

.ad-placeholder-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 16px;
  width: 100%;
}

.ad-placeholder-content.compact {
  padding: 8px 12px;
}

.ad-placeholder-content.vertical {
  flex-direction: column;
  text-align: center;
  padding: 12px;
  gap: 8px;
}

.ad-icon {
  font-size: 24px;
  flex-shrink: 0;
}

.ad-text-wrap {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
  font-size: 12px;
}

.ad-text-wrap strong {
  font-size: 13px;
  color: var(--metro-text-primary);
}

.ad-text-wrap span {
  color: var(--metro-text-secondary);
  font-size: 11px;
}

.ad-action-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 6px 12px;
  border-radius: 6px;
  background: var(--metro-text-primary);
  color: var(--metro-bg-card) !important;
  font-size: 12px;
  font-weight: bold;
  text-decoration: none !important;
  border: none;
  cursor: pointer;
  white-space: nowrap;
  transition: opacity 0.2s ease;
}

.ad-action-btn:hover {
  opacity: 0.88;
}

/* Posicionamentos Específicos */
.ad-banner-footer {
  margin: 0 16px 8px 16px;
  max-width: 900px;
  align-self: center;
}

.ad-banner-modal {
  margin-top: 14px;
  background: var(--metro-bg-light);
}

.ad-banner-sidebar {
  margin: 16px 0 8px 0;
}

/* ===== COMPATIBILIDADE MOBILE E AJUSTES RESPONSIVOS (INSTAGRAM BROWSER E SMARTPHONES) ===== */

/* Botão Flutuante Mobile do Editor */
.btn-toggle-editor-mobile {
  display: none;
  position: fixed;
  bottom: 24px;
  right: 20px;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: linear-gradient(135deg, #19159d, #2d26d8);
  color: white;
  border: none;
  font-size: 24px;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.3);
  cursor: pointer;
  z-index: 150;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

[data-theme="dark"] .btn-toggle-editor-mobile {
  background: linear-gradient(135deg, #fcc918, #f5a623);
  color: #161b22;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.5);
}

.btn-toggle-editor-mobile:hover {
  transform: scale(1.06);
}

.btn-toggle-editor-mobile.active {
  transform: rotate(45deg);
  background: linear-gradient(135deg, #ec3138, #dc2d2d);
  color: white;
}

/* Modificações responsivas gerais */
@media (max-width: 768px) {
  /* Layout principal flex em coluna */
  .app-workspace {
    flex-direction: column !important;
    position: relative;
    overflow: hidden;
  }

  .map-viewport {
    height: 100% !important;
    width: 100% !important;
  }

  /* Exibe o botão flutuante apenas no modo editor */
  body.mode-editor-active .btn-toggle-editor-mobile {
    display: flex;
  }

  /* Transformar a Sidebar em um Bottom Sheet */
  .editor-sidebar {
    width: 100% !important;
    height: 55vh !important;
    max-height: 55vh !important;
    position: absolute !important;
    bottom: 0 !important;
    left: 0 !important;
    top: auto !important;
    right: auto !important;
    border-left: none !important;
    border-top: 1px solid rgba(0, 0, 0, 0.12) !important;
    border-radius: 16px 16px 0 0 !important;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.16) !important;
    z-index: 140 !important;
    background-color: var(--metro-bg-card) !important;
    display: flex !important;
    transform: translateY(100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
  }

  [data-theme="dark"] .editor-sidebar {
    border-top-color: rgba(255, 255, 255, 0.12);
    box-shadow: 0 -4px 24px rgba(0, 0, 0, 0.5) !important;
  }

  .editor-sidebar.visible-mobile {
    transform: translateY(0) !important;
  }

  .editor-sidebar.hidden {
    display: flex !important;
    transform: translateY(100%);
  }

  /* Topbar Mobile */
  .topbar {
    height: 48px !important;
    padding: 0 8px !important;
    gap: 8px !important;
  }

  .brand-divider,
  .brand-social-link,
  .brand-badge,
  .brand-app-title {
    display: none !important; /* Esconde elementos para caber em telas estreitas */
  }

  /* Mantém a logo mapeando visível no mobile */
  .brand-section {
    gap: 0 !important;
  }
  .logo-mapeando {
    height: 24px !important;
  }

  /* Modos de navegação central compactados (Apenas Ícones) */
  .mode-selector {
    padding: 2px !important;
    gap: 2px !important;
  }

  .mode-btn {
    padding: 4px 8px !important;
    font-size: 11px !important;
    gap: 2px !important;
  }

  .mode-btn .btn-text {
    display: none !important; /* Oculta textos no mobile (ex: Visualizador -> 👁️) */
  }

  /* Ações da direita compactadas */
  .actions-group-files {
    display: none !important; /* Oculta novo/salvar/importar do topo no mobile */
  }

  .actions-divider {
    display: none !important;
  }

  .btn {
    padding: 5px 8px !important;
    font-size: 11px !important;
  }

  .btn .btn-text {
    display: none !important; /* Transforma botões em ícones */
  }

  /* Ajustes dos Controles Flutuantes do Mapa */
  .map-floating-controls {
    top: 8px !important;
    right: 8px !important;
  }

  /* Ajustes da Barra Inferior da Linha do Tempo */
  .timeline-bar {
    padding: 8px 12px !important;
    gap: 6px !important;
  }

  .timeline-header {
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 6px !important;
  }

  .timeline-info {
    gap: 8px !important;
    width: 100% !important;
  }

  .timeline-year {
    font-size: 22px !important;
  }

  .timeline-event-title {
    font-size: 12px !important;
    line-height: 1.2 !important;
  }

  .timeline-stats {
    width: 100% !important;
    justify-content: space-between !important;
    border-top: 1px dashed rgba(0, 0, 0, 0.08);
    padding-top: 4px;
  }

  [data-theme="dark"] .timeline-stats {
    border-top-color: rgba(255, 255, 255, 0.1);
  }

  .timeline-ticks span:not(:first-child):not(:last-child) {
    display: none !important; /* Esconde anos intermediários para não encavalar texto */
  }

  /* Modais mais compactos no mobile */
  .modal-box {
    width: 95% !important;
    padding: 16px !important;
    gap: 12px !important;
  }

  .support-options-grid {
    grid-template-columns: 1fr !important;
    gap: 10px !important;
  }
}

