/* ── Forecasts page layout ──────────────────────────────────────────────── */

#forecasts-page {
  position: relative;
  display: flex;
  flex-direction: column;
  height: calc(100vh - 60px);
  background: #111;
  font-family: inherit;
}

/* ── Map ─────────────────────────────────────────────────────────────────── */

#fc-map {
  flex: 1;
  width: 100%;
  min-height: 0;
  max-height: calc(100vh - 160px);
}

/* ── Info box (top-left, overlaid on map) ───────────────────────────────── */

#fc-info-box {
  position: absolute;
  top: 12px;
  left: 12px;
  z-index: 1000;
  background: rgba(18, 18, 18, 0.88);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 8px;
  padding: 10px 14px;
  max-width: 300px;
  color: #e0e0e0;
  font-size: 0.8rem;
  line-height: 1.5;
  backdrop-filter: blur(4px);
  pointer-events: auto;
}

#fc-info-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: #ffffff;
  margin-bottom: 4px;
  letter-spacing: 0.02em;
}

#fc-model-wrapper {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}

#fc-model-wrapper label {
  font-weight: 600;
  color: #bdbdbd;
  white-space: nowrap;
  font-size: 0.78rem;
}

#fc-model-select {
  background: #1e1e1e;
  border: 1px solid rgba(255,255,255,0.18);
  border-radius: 5px;
  color: #e0e0e0;
  padding: 3px 6px;
  font-size: 0.78rem;
  cursor: pointer;
  outline: none;
  flex: 1;
}
#fc-model-select:focus {
  border-color: #26a69a;
}

#fc-info-resolution {
  color: #9e9e9e;
  font-size: 0.73rem;
  margin-bottom: 6px;
}

#fc-info-credit {
  font-size: 0.68rem;
  color: #757575;
  border-top: 1px solid rgba(255,255,255,0.08);
  padding-top: 5px;
  margin-top: 2px;
}

#fc-info-credit a {
  color: #80cbc4;
  text-decoration: none;
}
#fc-info-credit a:hover {
  text-decoration: underline;
}

/* ── Map tile contrast boost ────────────────────────────────────────────── */

.fc-map-tiles {
  filter: brightness(1.7) contrast(1.15);
}

/* ── Click hint ─────────────────────────────────────────────────────────── */

#fc-click-hint {
  position: absolute;
  bottom: 40px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1001;
  background: rgba(10, 10, 10, 0.82);
  border: 1px solid rgba(255,255,255,0.35);
  border-radius: 20px;
  padding: 10px 26px;
  color: #ffffff;
  font-size: 0.88rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  backdrop-filter: blur(6px);
  box-shadow: 0 2px 12px rgba(0,0,0,0.5);
  pointer-events: none;
  animation: fc-hint-pulse 2.5s ease-in-out infinite;
}

@keyframes fc-hint-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.6; }
}

/* ── Spinner ─────────────────────────────────────────────────────────────── */

.fc-spin-ring {
  width: 18px;
  height: 18px;
  border: 3px solid rgba(255,255,255,0.15);
  border-top-color: #26a69a;
  border-radius: 50%;
  animation: fc-spin 0.7s linear infinite;
}
@keyframes fc-spin { to { transform: rotate(360deg); } }

.hidden { display: none !important; }

/* ── Forecast panel (bottom overlay) ────────────────────────────────────── */

#fc-forecast-panel {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1000;
  background: rgba(18, 18, 18, 0.96);
  border-top: 2px solid rgba(255,255,255,0.15);
  display: flex;
  flex-direction: column;
  backdrop-filter: blur(6px);
  max-height: 55vh;
}

#fc-forecast-panel.fc-panel-ensemble {
  max-height: 68vh;
}

#fc-forecast-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 16px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  flex-shrink: 0;
  gap: 8px;
  min-width: 0;
}

#fc-forecast-header-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

#fc-unit-toggle,
#fc-tz-toggle {
  background: rgba(38, 166, 154, 0.15);
  border: 1px solid rgba(38, 166, 154, 0.5);
  border-radius: 4px;
  color: #80cbc4;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  padding: 2px 8px;
  line-height: 1.4;
}
#fc-unit-toggle:hover,
#fc-tz-toggle:hover {
  background: rgba(38, 166, 154, 0.3);
  color: #fff;
}

#fc-forecast-location {
  font-size: 0.82rem;
  color: #80cbc4;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
  flex: 1;
}

#fc-forecast-close {
  background: transparent;
  border: none;
  color: #9e9e9e;
  font-size: 1.2rem;
  cursor: pointer;
  padding: 2px 6px;
  line-height: 1;
  border-radius: 4px;
}
#fc-forecast-close:hover {
  color: #fff;
  background: rgba(255,255,255,0.08);
}

/* Loading state */

#fc-forecast-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 24px 16px;
  color: #bdbdbd;
  font-size: 0.85rem;
}

/* Scrollable table area */

#fc-forecast-scroll {
  overflow-x: auto;
  overflow-y: hidden;
  flex: 1;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,0.2) transparent;
}

/* Ensemble charts scroll area */

#fc-ensemble-scroll {
  overflow-x: hidden;
  overflow-y: auto;
  flex: 1;
  padding: 8px 14px 12px;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,0.2) transparent;
}

#fc-ensemble-scroll::-webkit-scrollbar {
  width: 5px;
}
#fc-ensemble-scroll::-webkit-scrollbar-track {
  background: transparent;
}
#fc-ensemble-scroll::-webkit-scrollbar-thumb {
  background: rgba(255,255,255,0.2);
  border-radius: 3px;
}

.fc-ens-chart {
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 6px;
  padding: 6px 4px 2px;
  margin-bottom: 8px;
}

#fc-forecast-scroll::-webkit-scrollbar {
  height: 6px;
}
#fc-forecast-scroll::-webkit-scrollbar-track {
  background: transparent;
}
#fc-forecast-scroll::-webkit-scrollbar-thumb {
  background: rgba(255,255,255,0.2);
  border-radius: 3px;
}

/* ── Forecast table ─────────────────────────────────────────────────────── */

#fc-forecast-table {
  border-collapse: collapse;
  white-space: nowrap;
  width: max-content;
}

#fc-forecast-table td {
  padding: 5px 0;
  text-align: center;
  font-size: 0.78rem;
  color: #e0e0e0;
  min-width: 44px;
  border-bottom: 1px solid rgba(255,255,255,0.05);
}

/* Fixed label column */

.fc-label {
  position: sticky;
  left: 0;
  z-index: 10;
  background: rgba(18, 18, 18, 0.98);
  padding: 5px 12px !important;
  text-align: right !important;
  font-weight: 600;
  color: #9e9e9e;
  white-space: nowrap;
  min-width: 72px !important;
  border-right: 1px solid rgba(255,255,255,0.08);
  font-size: 0.72rem !important;
}

/* Day header row */

.fc-row-days td {
  border-bottom: 2px solid rgba(255,255,255,0.12) !important;
}

.fc-day-cell {
  font-weight: 700;
  color: #ffffff !important;
  font-size: 0.82rem !important;
  letter-spacing: 0.02em;
}

/* Hours row */

.fc-row-hours td {
  font-size: 0.72rem !important;
  color: #bdbdbd !important;
  padding: 3px 0 !important;
}

/* Icon row */

.fc-row-icons td {
  font-size: 1.05rem !important;
  padding: 2px 0 !important;
  line-height: 1.2;
}

/* Temperature row */

.fc-temp-cell {
  font-weight: 700 !important;
  font-size: 0.82rem !important;
}

/* Rain row */

.fc-rain-cell {
  font-size: 0.72rem !important;
}

/* Wind row */

.fc-wind-cell {
  vertical-align: middle;
}

.fc-wind-cell svg {
  display: block;
  margin: 0 auto 1px;
}

.fc-wind-cell span {
  display: block;
  font-size: 0.68rem;
  color: #bdbdbd;
}

/* Gust row */

.fc-gust-cell {
  font-size: 0.72rem !important;
  font-weight: 600;
  opacity: 0.85;
}

/* ── Responsive ─────────────────────────────────────────────────────────── */

@media (max-width: 640px) {
  #fc-info-box {
    max-width: 220px;
    padding: 8px 10px;
  }
  #fc-model-wrapper {
    flex-wrap: wrap;
  }
  #fc-model-select {
    max-width: 100%;
    width: 100%;
  }
  #fc-map {
    max-height: 55vh;
  }
  #fc-click-hint {
    bottom: auto;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 0.82rem;
    padding: 10px 18px;
    text-align: center;
    white-space: normal;
    max-width: 80vw;
  }
  #fc-forecast-panel {
    max-height: 65vh;
  }
  #fc-forecast-panel.fc-panel-ensemble {
    max-height: 85vh;
  }
  #fc-forecast-header {
    padding: 6px 10px;
  }
  #fc-forecast-header-right {
    gap: 5px;
    flex-shrink: 0;
  }
  #fc-forecast-location {
    font-size: 0.74rem;
  }
  #fc-unit-toggle,
  #fc-tz-toggle {
    padding: 2px 6px;
    font-size: 0.71rem;
  }
  #fc-forecast-close {
    font-size: 1rem;
    padding: 2px 5px;
  }
  #fc-forecast-table td {
    min-width: 38px;
  }
  #fc-ensemble-scroll {
    padding: 6px 8px 10px;
  }
}
