/**
 * IRP Patrimonial - Print CSS
 * Estilos para impresión y exportación
 */

#map-export-overlay {
  position: absolute;
  inset: 0;
  display: none;
  pointer-events: none;
  z-index: 1200;
  font-family: Roboto, -apple-system, BlinkMacSystemFont, sans-serif;
}

.map-export-grid {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
}

body.printing #map-export-overlay,
body.export-capturing #map-export-overlay {
  display: block;
}

.map-export-north,
.map-export-scale,
.map-export-date {
  position: absolute;
  background: rgba(255, 255, 255, 0.88);
  border: 1px solid rgba(17, 24, 39, 0.18);
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.12);
}

.map-export-logo {
  position: absolute;
}

.map-export-north {
  top: 34px;
  left: 34px;
  width: 42px;
  height: 88px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2px;
}

.map-export-north-svg {
  width: 100%;
  height: 100%;
}

.map-export-north-svg text {
  font-size: 24px;
  font-weight: 700;
  fill: #111827;
}

.map-export-north-svg path {
  fill: #111827;
  stroke: #111827;
  stroke-width: 2;
}

.map-export-logo {
  top: 34px;
  right: 34px;
}

.map-export-logo img {
  display: block;
  width: 108px;
  height: auto;
}

.map-export-scale {
  left: 34px;
  bottom: 34px;
  padding: 4px 7px 5px;
  border-radius: 10px;
}

.map-export-scale-bar {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  height: 12px;
  border: 1px solid #111827;
}

.map-export-scale-bar .seg {
  display: block;
}

.map-export-scale-bar .seg-dark {
  background: #111827;
}

.map-export-scale-bar .seg-light {
  background: #ffffff;
}

.map-export-scale-labels {
  display: flex;
  justify-content: space-between;
  margin-top: 5px;
  font-size: 10px;
  font-weight: 700;
  color: #111827;
}

.map-export-date {
  right: 34px;
  bottom: 34px;
  padding: 3px 6px;
  border-radius: 10px;
  font-size: 10px;
  font-weight: 700;
  color: #111827;
}

.map-export-grid-line {
  fill: none;
  stroke: rgba(236, 240, 241, 0.62);
  stroke-width: 1;
  vector-effect: non-scaling-stroke;
}

.map-export-grid-label {
  font-size: 11px;
  font-weight: 700;
  fill: #ecf0f1;
  stroke: rgba(21, 27, 32, 0.9);
  stroke-width: 3px;
  paint-order: stroke fill;
  letter-spacing: 0.3px;
}

.map-export-grid-label-y {
  dominant-baseline: middle;
}

body.export-capturing #layer-switcher,
body.export-capturing #mincul-switcher,
body.export-capturing #riotinto-pdf-switcher,
body.export-capturing #basemap-flyout,
body.export-capturing #hillshade-control,
body.export-capturing #wayback-controls,
body.export-capturing .leaflet-control-zoom,
body.export-capturing .leaflet-control-attribution,
body.export-capturing .leaflet-control-layers,
body.export-capturing .zoom-controls,
body.export-capturing #map-scale,
body.export-capturing #teck-corner-logo,
body.export-capturing #riotinto-corner-logo,
body.export-capturing #unused-corner-logo,
body.export-capturing .print-only {
  display: none !important;
  visibility: hidden !important;
}

.print-only {
  display: none !important;
}

@media print {
  * {
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }

  #header,
  #statusbar,
  #toolbar,
  #layer-switcher,
  #mincul-switcher,
  #riotinto-pdf-switcher,
  #basemap-flyout,
  #hillshade-control,
  #utm-panel,
  #search-panel,
  #polygon-controls,
  #elements-list,
  #toast-container,
  #map-scale,
  #teck-corner-logo,
  #riotinto-corner-logo,
  #unused-corner-logo,
  .panel,
  .mobile-toggle,
  .zoom-controls,
  .modal-overlay,
  .iframe-overlay,
  #splash,
  .leaflet-control-zoom,
  .leaflet-control-attribution,
  .leaflet-control-layers,
  .print-only {
    display: none !important;
    visibility: hidden !important;
  }

  html, body {
    background: white !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow: visible !important;
  }

  #app,
  #main-content {
    height: auto !important;
    overflow: visible !important;
  }

  #map-container,
  #map {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    z-index: 0 !important;
  }

  body.printing #map-export-overlay {
    display: block !important;
  }

  .leaflet-tooltip {
    background: rgba(255, 255, 255, 0.95) !important;
    color: #333 !important;
    border: 1px solid #999 !important;
    font-size: 9px !important;
    padding: 3px 6px !important;
  }
}

@page {
  size: A4 landscape;
  margin: 10mm;
}
