@import url("./app-climate.css");

html,
body {
  height: 100%;
  overflow: hidden;
}

.layout {
  grid-template-columns: minmax(320px, 365px) 1fr;
}

.map-main {
  position: relative;
  min-width: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  border: 1px solid rgba(255, 255, 255, .08);
  border-radius: 20px;
  background: rgba(8, 8, 8, .92);
}

#map {
  flex: 1;
  min-height: 0;
  width: 100%;
  background: #111;
}

#heatCanvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: calc(100% - 180px);
  pointer-events: none;
  z-index: 400;
}

.leaflet-control-zoom a {
  background: rgba(8, 8, 8, .88) !important;
  border-color: rgba(255, 255, 255, .08) !important;
  color: #fff !important;
}

.leaflet-popup-content-wrapper,
.leaflet-popup-tip {
  background: #111;
  color: rgba(255, 255, 255, .82);
}

.click-hint {
  display: flex;
  align-items: center;
  gap: .55rem;
  color: rgba(255, 255, 255, .62);
  font-family: var(--f-mono);
  font-size: .66rem;
  line-height: 1.45;
}

.pulse-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #FACC15;
  box-shadow: 0 0 0 4px rgba(249, 115, 22, .14);
  flex: 0 0 auto;
}

.sl-row {
  display: grid;
  grid-template-columns: 82px minmax(0, 1fr) 74px;
  align-items: center;
  gap: .65rem;
  padding: .42rem 0;
}

.sl-lbl {
  color: rgba(255, 255, 255, .68);
  font-family: var(--f-mono);
  font-size: .66rem;
  line-height: 1.35;
}

.sl-val {
  color: #FACC15;
  font-family: var(--f-mono);
  font-size: .62rem;
  text-align: right;
}

.sl-row input[type="range"] {
  accent-color: #EAB308;
  min-width: 0;
}

.reset-btn {
  min-height: 36px;
  border: 1px solid rgba(255, 255, 255, .08);
  border-radius: 12px;
  background: rgba(255, 255, 255, .035);
  color: rgba(255, 255, 255, .72);
  cursor: pointer;
  font-family: var(--f-mono);
  font-size: .66rem;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.reset-btn:hover {
  border-color: rgba(249, 115, 22, .36);
  color: #fff;
}

.src-list {
  display: flex;
  flex-direction: column;
  gap: .35rem;
  overflow-y: auto;
  max-height: 130px;
}

.src-item {
  min-height: 30px;
  display: flex;
  align-items: center;
  gap: .5rem;
  color: rgba(255, 255, 255, .58);
  font-family: var(--f-mono);
  font-size: .64rem;
}

.src-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex: 0 0 auto;
}

.src-remove {
  margin-left: auto;
  color: rgba(255, 255, 255, .34);
  cursor: pointer;
}

.src-remove:hover {
  color: #FACC15;
}

.map-hint {
  position: absolute;
  bottom: 196px;
  left: 50%;
  z-index: 500;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: .5rem;
  max-width: calc(100% - 2rem);
  padding: .42rem .9rem;
  border: 1px solid rgba(255, 255, 255, .08);
  border-radius: 999px;
  background: rgba(8, 8, 8, .82);
  color: rgba(255, 255, 255, .64);
  font-family: var(--f-mono);
  font-size: .62rem;
  letter-spacing: .04em;
  white-space: nowrap;
  backdrop-filter: blur(8px);
}

.map-ctrl {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 500;
  display: flex;
  flex-direction: column;
  gap: .55rem;
}

.ctrl-card {
  min-width: 190px;
  padding: .9rem 1rem;
  border: 1px solid rgba(255, 255, 255, .08);
  border-radius: 16px;
  background: rgba(8, 8, 8, .84);
  backdrop-filter: blur(10px);
}

.ctrl-title,
.bp-title {
  color: rgba(255, 255, 255, .42);
  font-family: var(--f-mono);
  font-size: .58rem;
  letter-spacing: .16em;
  text-transform: uppercase;
}

.colorscale {
  height: 8px;
  border-radius: 999px;
  margin: .65rem 0 .4rem;
  background: linear-gradient(to right, #2060A0, rgba(245,240,232,.85), #D45A08);
}

.colorscale-labels,
.leg-lbl {
  color: rgba(255, 255, 255, .58);
  font-family: var(--f-mono);
  font-size: .58rem;
}

.colorscale-labels {
  display: flex;
  justify-content: space-between;
  gap: .75rem;
}

.legend-row {
  display: flex;
  align-items: center;
  gap: .5rem;
  margin-top: .45rem;
}

.leg-swatch {
  width: 18px;
  height: 4px;
  border-radius: 2px;
  flex: 0 0 auto;
}

.leg-lbl strong {
  color: rgba(255, 255, 255, .86);
}

.bottom-panel {
  height: 180px;
  flex: 0 0 180px;
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 1px;
  border-top: 1px solid rgba(255, 255, 255, .08);
  background: rgba(255, 255, 255, .08);
}

.bp-cell {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: .35rem;
  overflow: hidden;
  padding: .9rem 1.05rem;
  background: rgba(8, 8, 8, .92);
}

.fresnel-table {
  width: 100%;
  border-collapse: collapse;
}

.fresnel-table td {
  padding: .22rem .1rem;
  color: rgba(255, 255, 255, .72);
  font-family: var(--f-mono);
  font-size: .66rem;
  vertical-align: middle;
}

.fresnel-table td:last-child {
  text-align: right;
  color: #FACC15;
  font-weight: 700;
}

.fz-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-right: .4rem;
  vertical-align: middle;
}

.stat-num {
  color: #fff;
  font-family: var(--f-ui);
  font-size: 1.45rem;
  font-weight: 800;
  line-height: 1;
}

.stat-num.orange {
  color: #FACC15;
}

.stat-num.blue {
  color: #60a5fa;
}

.stat-unit {
  margin-top: .25rem;
  color: rgba(255, 255, 255, .42);
  font-family: var(--f-mono);
  font-size: .58rem;
}

.bp-chart-wrap {
  position: relative;
  flex: 1;
  min-height: 0;
}

@media (max-width: 1180px) {
  .bottom-panel {
    grid-template-columns: 1fr;
    height: auto;
    flex-basis: auto;
  }

  #heatCanvas {
    height: 100%;
  }
}

@media (max-width: 980px) {
  body {
    overflow: auto;
  }

  .map-main {
    min-height: 720px;
  }
}
