/* I valori delle custom property --aclimo-* sono iniettati a runtime da
   theme_css_vars() (R/theme.R), unica fonte della palette: qui si consumano
   soltanto con var(), niente hex duplicati. */

.skin-green .main-header .logo,
.skin-green .main-header .navbar,
.skin-green .main-sidebar,
.skin-green .left-side {
  background-color: var(--aclimo-primary);
}

.skin-green .sidebar-menu > li.active > a,
.skin-green .sidebar-menu > li:hover > a {
  border-left-color: var(--aclimo-accent);
  background-color: var(--aclimo-primary-dark);
}

.lang-switcher {
  align-items: center;
  display: flex;
  float: right;
  gap: 6px;
  height: 50px;
}

.lang-switcher .lang-option {
  color: rgba(255, 255, 255, 0.65);
  font-weight: 600;
  padding: 4px 2px;
  text-decoration: none;
}

.lang-switcher .lang-option:hover,
.lang-switcher .lang-option:focus {
  color: #fff;
  text-decoration: none;
}

.lang-switcher .lang-option.lang-active {
  border-bottom: 2px solid var(--aclimo-accent);
  color: #fff;
}

.lang-switcher .lang-sep {
  color: rgba(255, 255, 255, 0.4);
}

.content-wrapper,
.right-side {
  background-color: var(--aclimo-bg);
}

a,
a:visited {
  color: var(--aclimo-primary);
}

a:hover,
a:focus {
  color: var(--aclimo-primary-dark);
}

.btn-primary {
  background-color: var(--aclimo-primary);
  border-color: var(--aclimo-primary-dark);
}

.btn-primary:hover,
.btn-primary:focus {
  background-color: var(--aclimo-primary-dark);
  border-color: var(--aclimo-primary-dark);
}

.irs--shiny .irs-bar,
.irs--shiny .irs-single,
.irs--shiny .irs-from,
.irs--shiny .irs-to {
  background: var(--aclimo-primary);
  border-color: var(--aclimo-primary);
}

.irs--shiny .irs-handle > i:first-child {
  background-color: var(--aclimo-primary-dark);
}

.bootstrap-select .dropdown-menu li.selected a,
.bootstrap-select .dropdown-menu li.active a,
.dropdown-menu > .active > a,
.dropdown-menu > .active > a:hover,
.dropdown-menu > .active > a:focus {
  background-color: var(--aclimo-primary) !important;
  color: #fff !important;
}

.dataTables_wrapper .pagination > .active > a,
.dataTables_wrapper .pagination > .active > span {
  background-color: var(--aclimo-primary) !important;
  border-color: var(--aclimo-primary) !important;
}

.form-control:focus,
.selectize-input.focus {
  border-color: var(--aclimo-primary);
  box-shadow: 0 0 0 0.15rem var(--aclimo-primary-light);
}

.sidebar-partner-logos {
  border-top: 1px solid rgba(255, 255, 255, 0.15);
  align-items: center;
  display: flex;
  gap: 14px;
  margin-top: 18px;
  padding: 18px 24px 22px;
}

.sidebar-partner-logo {
  display: block;
  flex: 1 1 0;
  height: auto;
  min-width: 0;
  width: 100%;
}

.sidebar-interreg-logo {
  display: block;
  height: auto;
  margin: 14px auto 0;
  max-width: 92%;
  width: auto;
}

.welcome-page {
  margin: 0 auto;
  max-width: 760px;
  padding: 32px 20px 60px;
}

.welcome-page h1 {
  color: var(--aclimo-primary-dark);
  font-size: 26px;
  font-weight: 700;
  line-height: 1.3;
  margin-bottom: 18px;
}

.welcome-page > p {
  color: var(--aclimo-text);
  font-size: 16px;
  line-height: 1.6;
}

.welcome-credits {
  border-top: 1px solid var(--aclimo-border);
  color: var(--aclimo-text-muted);
  font-size: 13px;
  line-height: 1.6;
  margin-top: 48px;
  padding-top: 18px;
}

.app-title {
  font-weight: 700;
  letter-spacing: 0;
}

.box.box-solid.box-success > .box-header {
  background-color: var(--aclimo-primary);
}

.box.box-success {
  border-top-color: var(--aclimo-primary);
}

.help-text {
  color: var(--aclimo-text-muted);
  line-height: 1.45;
}

.sidebar-logo-wrap {
  padding: 24px 24px 0;
}

.sidebar-logo-wrap a {
  display: block;
  text-decoration: none;
}

.sidebar-aclimo-logo {
  display: block;
  height: auto;
  margin: 0 auto;
  max-width: 175px;
  width: 78%;
}

.btn-default,
.btn-primary,
.btn-success,
.shiny-download-link {
  border-radius: 6px;
}

.shiny-input-container {
  width: 100%;
}

.dataTables_wrapper {
  font-size: 13px;
}

.leaflet-container {
  border-radius: 4px;
}

.home-map-page {
  height: calc(100vh - 50px);
  margin: -15px;
  min-height: 560px;
  overflow: hidden;
  position: relative;
}

.home-map-page .leaflet {
  height: 100% !important;
}

.home-map-page .leaflet-container {
  border-radius: 0;
}

.home-info-bar {
  bottom: 18px;
  left: 18px;
  position: absolute;
  right: 18px;
  z-index: 500;
}

.home-info-bar .small-box {
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.24);
  margin-bottom: 0;
}

.satellite-details {
  display: grid;
  gap: 4px 10px;
  grid-template-columns: minmax(80px, 0.8fr) minmax(0, 1.2fr);
  margin: 12px 0;
}

.satellite-details dt {
  color: var(--aclimo-text-muted);
  font-weight: 600;
}

.satellite-details dd {
  margin: 0;
  overflow-wrap: anywhere;
}

.satellite-carousel {
  align-items: center;
  display: grid;
  gap: 8px;
  grid-template-columns: 38px minmax(0, 1fr) 38px;
  margin: -4px 0 14px;
}

.satellite-arrow.btn {
  align-items: center;
  display: inline-flex;
  height: 38px;
  justify-content: center;
  padding: 0;
  width: 38px;
}

.satellite-position {
  color: var(--aclimo-text-muted);
  display: block;
  font-weight: 600;
  line-height: 38px;
  text-align: center;
}

.satellite-empty {
  align-items: center;
  background: var(--aclimo-primary-light);
  border: 1px solid var(--aclimo-border);
  border-radius: 4px;
  color: var(--aclimo-text-muted);
  display: flex;
  min-height: 590px;
  justify-content: center;
  text-align: center;
}

.satellite-preview-wrap {
  align-items: center;
  background: #111;
  border-radius: 4px;
  display: flex;
  justify-content: center;
  min-height: 590px;
  overflow: auto;
}

.satellite-preview-image {
  display: block;
  height: auto;
  max-height: 590px;
  max-width: 100%;
  object-fit: contain;
}

@media (max-width: 767px) {
  .home-map-page {
    height: calc(100vh - 50px);
    min-height: 720px;
  }

  .home-info-bar {
    bottom: 8px;
    left: 8px;
    right: 8px;
  }

  .home-info-bar .small-box {
    margin-bottom: 8px;
  }
}

/* ROI phenocam disegnate sulla foto di riferimento (tab Phenocam GCC). */
.roi-overlay-hint {
  color: var(--aclimo-text-muted);
  margin-bottom: 10px;
}

.roi-overlay-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

.roi-overlay-caption {
  color: var(--aclimo-text);
  font-weight: 600;
  margin-bottom: 4px;
}

.roi-overlay {
  background: #111;
  border-radius: 4px;
  display: block;
  height: auto;
  width: 100%;
}

.roi-shape polygon {
  fill: rgba(255, 255, 255, 0.08);
  stroke: #fff;
  stroke-dasharray: 6 4;
  stroke-width: 2px;
  vector-effect: non-scaling-stroke;
}

.roi-shape[data-roi] {
  cursor: pointer;
}

.roi-shape[data-roi]:hover polygon,
.roi-shape[data-roi]:focus polygon {
  fill: rgba(255, 255, 255, 0.25);
  outline: none;
}

.roi-shape.is-selected polygon {
  fill: var(--roi-color);
  fill-opacity: 0.35;
  stroke: var(--roi-color);
  stroke-dasharray: none;
  stroke-width: 3px;
}

.roi-label {
  fill: #fff;
  font-weight: 700;
  paint-order: stroke;
  pointer-events: none;
  stroke: rgba(0, 0, 0, 0.75);
  stroke-width: 3px;
  text-anchor: middle;
  dominant-baseline: middle;
  vector-effect: non-scaling-stroke;
}
