/* Rotta - token di marchio condivisi tra shell HTML e tema MUI (modalita' "Operate", tema chiaro) */
:root {
  --rotta-bg: #F6F7F9;
  --rotta-surface: #FFFFFF;
  --rotta-surface-2: #EEF1F4;
  --rotta-border: #E3E8EE;
  --rotta-text: #1C2733;
  --rotta-text-dim: #5B6B7C;
  --rotta-accent: #0F766E;
  --rotta-accent-strong: #115E59;
  --rotta-radius: 14px;
}

html, body {
  height: 100%;
}

body {
  margin: 0;
  padding: 0;
  background: var(--rotta-bg);
  color: var(--rotta-text);
  font-family: Inter, "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.root {
  display: flex;
  flex-direction: column;
  height: 100%;
}

/* Scrollbar coerente col tema chiaro */
* {
  scrollbar-color: rgba(28, 39, 51, 0.28) transparent;
  scrollbar-width: thin;
}

*::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

*::-webkit-scrollbar-track {
  background: transparent;
}

*::-webkit-scrollbar-thumb {
  background-color: rgba(28, 39, 51, 0.24);
  border-radius: 8px;
  border: 2px solid transparent;
  background-clip: content-box;
}

*::-webkit-scrollbar-thumb:hover {
  background-color: rgba(15, 118, 110, 0.55);
  background-clip: content-box;
}

/* Controlli MapLibre rivestiti per il tema chiaro di Rotta */
.maplibregl-ctrl-group {
  background: var(--rotta-surface) !important;
  border: 1px solid var(--rotta-border) !important;
  border-radius: var(--rotta-radius) !important;
  box-shadow: 0 2px 6px rgba(28, 39, 51, 0.08), 0 8px 24px rgba(28, 39, 51, 0.10) !important;
  overflow: hidden;
}

.maplibregl-ctrl-group button + button {
  border-top: 1px solid var(--rotta-border) !important;
}

/* Solo background-color: la shorthand `background` cancellerebbe le icone
   background-image dei pulsanti di disegno (mapbox-gl-draw). */
.maplibregl-ctrl-group button {
  background-color: transparent !important;
}

.maplibregl-ctrl-group button:hover {
  background: rgba(15, 118, 110, 0.08) !important;
}

.maplibregl-ctrl-group button:focus-visible {
  outline: 2px solid var(--rotta-accent) !important;
  outline-offset: -2px;
}

/* Icone MapLibre: tinta scura #1C2733 per il fondo bianco dei controlli */
.maplibregl-ctrl-group button .maplibregl-ctrl-icon {
  filter: invert(12%) sepia(14%) saturate(1100%) hue-rotate(170deg) brightness(95%);
}

.maplibregl-ctrl-attrib,
.maplibregl-ctrl-attrib.maplibregl-compact {
  background: rgba(255, 255, 255, 0.88) !important;
  color: var(--rotta-text-dim) !important;
  border-radius: 10px !important;
}

.maplibregl-ctrl-attrib a {
  color: var(--rotta-text-dim) !important;
}

.maplibregl-ctrl-scale {
  background: rgba(255, 255, 255, 0.88) !important;
  border-color: var(--rotta-text-dim) !important;
  color: var(--rotta-text-dim) !important;
  border-radius: 0 0 8px 8px;
}

.maplibregl-popup-content {
  background: var(--rotta-surface) !important;
  color: var(--rotta-text) !important;
  border: 1px solid var(--rotta-border);
  border-radius: var(--rotta-radius) !important;
  box-shadow: 0 2px 6px rgba(28, 39, 51, 0.10), 0 12px 32px rgba(28, 39, 51, 0.14) !important;
}

.maplibregl-popup-tip {
  border-top-color: var(--rotta-surface) !important;
  border-bottom-color: var(--rotta-surface) !important;
  border-left-color: var(--rotta-surface) !important;
  border-right-color: var(--rotta-surface) !important;
}

@media print {
  * {
    height: auto !important;
    overflow: visible !important;
  }
}
