/* WXRadar Weather Models operational UI */
/*
 * The outer button/cassette deliberately has no custom background, border,
 * radius, shadow or padding here. JS copies the native WXRadar toolbar-button
 * classes, so Weather Models uses the exact same cassette as Radar/Satellite.
 */
#wxWeatherModelsButton{
  flex:0 0 auto!important;
}
#wxWeatherModelsButton .wx-model-icon{
  width:30px;height:30px;box-sizing:border-box;
  border:0!important;border-radius:0!important;box-shadow:none!important;
  background:transparent!important;color:currentColor;
  display:inline-flex;flex-direction:column;align-items:center;justify-content:center;
  font-family:"DM Sans",ui-monospace,monospace;font-size:8.5px;font-weight:800;line-height:8px;
  letter-spacing:.2px;user-select:none;pointer-events:none
}
#wxWeatherModelsButton .wx-model-button-label{
  font-family:"DM Sans",system-ui,sans-serif;font-size:10px;font-weight:650;line-height:1.05;
  white-space:nowrap;color:inherit;pointer-events:none
}

#wxWeatherModelsPanel{
  --wm-bg:#f5f6f8;--wm-card:#fff;--wm-border:#d9dde4;--wm-text:#17191d;--wm-muted:#68707d;
  position:fixed;inset:0;z-index:100000;display:none;flex-direction:column;
  background:var(--wm-bg);color:var(--wm-text);font-family:"DM Sans",system-ui,sans-serif
}
#wxWeatherModelsPanel.wx-open{display:flex}
.wx-model-header{
  display:grid;grid-template-columns:auto minmax(0,1fr) auto;align-items:center;gap:14px;
  padding:12px 16px;background:rgba(255,255,255,.97);border-bottom:1px solid var(--wm-border);
  box-shadow:0 3px 12px rgba(16,24,40,.06);z-index:5
}
.wx-model-title{font-size:19px;font-weight:760;letter-spacing:-.3px;white-space:nowrap}
.wx-model-header-controls{
  min-width:0;display:grid;grid-template-columns:minmax(130px,.8fr) minmax(190px,1fr) minmax(220px,1.5fr);
  gap:9px;align-items:center
}
.wx-model-field{position:relative;min-width:0}
.wx-model-field:after{
  content:"";position:absolute;right:13px;top:50%;width:7px;height:7px;border-right:1.7px solid #6d7480;
  border-bottom:1.7px solid #6d7480;transform:translateY(-70%) rotate(45deg);pointer-events:none
}
.wx-model-select{
  width:100%;height:42px;padding:0 34px 0 13px;border:1px solid var(--wm-border);border-radius:11px;
  background:var(--wm-card);color:var(--wm-text);font:600 13px/1 "DM Sans",system-ui,sans-serif;
  appearance:none;outline:none;box-shadow:0 1px 2px rgba(16,24,40,.035);transition:.15s border-color,.15s box-shadow
}
.wx-model-select:hover{border-color:#b8bec8}.wx-model-select:focus{border-color:#7b8798;box-shadow:0 0 0 3px rgba(87,99,116,.12)}
.wx-model-close,.wx-model-small-button{
  border:1px solid var(--wm-border);background:var(--wm-card);color:var(--wm-text);font-family:"DM Sans",system-ui,sans-serif;
  cursor:pointer;box-shadow:0 1px 2px rgba(16,24,40,.04);transition:.14s transform,.14s background,.14s border-color
}
.wx-model-close:hover,.wx-model-small-button:hover{background:#f0f2f5;border-color:#c2c8d1}
.wx-model-close:active,.wx-model-small-button:active{transform:translateY(1px)}
.wx-model-close{width:42px;height:42px;border-radius:12px;font-size:24px;line-height:1}
.wx-model-body{min-height:0;flex:1;display:grid;grid-template-rows:auto minmax(0,1fr) auto auto auto;gap:9px;padding:11px}
.wx-model-meta{
  justify-self:center;max-width:min(1100px,96%);padding:7px 13px;border:1px solid var(--wm-border);border-radius:999px;
  background:var(--wm-card);font-size:13px;font-weight:650;box-shadow:0 1px 2px rgba(16,24,40,.03)
}
.wx-model-image-wrap{
  min-height:0;position:relative;overflow:hidden;border:1px solid #272b31;border-radius:14px;
  background:#15181d;touch-action:none;cursor:grab;box-shadow:0 8px 24px rgba(16,24,40,.12)
}
.wx-model-image-wrap.wx-dragging{cursor:grabbing}
.wx-model-image{
  position:absolute;left:50%;top:50%;max-width:none;max-height:none;transform-origin:center;
  user-select:none;-webkit-user-drag:none;will-change:transform,opacity;opacity:0;
  transition:none;backface-visibility:hidden;z-index:1
}
.wx-model-image.wx-active{opacity:1;z-index:2}
.wx-model-loading{
  position:absolute;right:12px;top:12px;display:none;align-items:center;gap:7px;padding:6px 10px;border-radius:999px;
  color:#fff;background:rgba(20,23,28,.76);font-size:11px;pointer-events:none;z-index:4;backdrop-filter:blur(4px)
}
.wx-model-image-controls{display:flex;justify-content:center;gap:6px}
.wx-model-small-button{min-width:42px;height:36px;padding:0 11px;border-radius:10px;font-size:13px;font-weight:650}
.wx-model-timeline{
  padding:8px 10px 6px;border:1px solid var(--wm-border);border-radius:13px;background:var(--wm-card);
  box-shadow:0 1px 3px rgba(16,24,40,.035)
}
.wx-model-slider-row{display:grid;grid-template-columns:44px minmax(0,1fr) 44px;gap:9px;align-items:center}
#wxWeatherModelsSlider{width:100%;min-width:0;accent-color:#303640}
.wx-model-range-labels{display:flex;justify-content:space-between;gap:12px;padding:5px 52px 0;color:var(--wm-muted);font-size:10.5px}
.wx-model-status{text-align:center;min-height:18px;font-size:11.5px;color:var(--wm-muted)}
.wx-model-small-button:disabled{opacity:.4;cursor:default}

html[data-theme="dark"] #wxWeatherModelsPanel,
body.dark #wxWeatherModelsPanel,body.dark-mode #wxWeatherModelsPanel{
  --wm-bg:#121418;--wm-card:#1d2025;--wm-border:#343942;--wm-text:#f2f3f5;--wm-muted:#aab0ba
}
html[data-theme="dark"] .wx-model-header,
body.dark .wx-model-header,body.dark-mode .wx-model-header{background:rgba(25,28,33,.97)}
html[data-theme="dark"] .wx-model-close:hover,html[data-theme="dark"] .wx-model-small-button:hover,
body.dark .wx-model-close:hover,body.dark .wx-model-small-button:hover{background:#282c33}

@media(max-width:700px){
  /* Make the native radar/settings toolbar one real horizontal row on phones.
     Do not allow Weather Models to create a second line. */
  .wx-model-toolbar-host.wx-model-native-primary-row{
    display:flex!important;
    flex-direction:row!important;
    flex-wrap:nowrap!important;
    align-items:center!important;
    justify-content:flex-start!important;
    gap:0!important;
    width:auto!important;
    max-width:100vw!important;
    overflow-x:auto!important;
    overflow-y:hidden!important;
    -webkit-overflow-scrolling:touch;
    scrollbar-width:none!important;
    white-space:nowrap!important;
  }
  .wx-model-toolbar-host.wx-model-native-primary-row::-webkit-scrollbar{display:none!important}
  .wx-model-toolbar-host.wx-model-native-primary-row > *{
    flex:0 0 auto!important;
    min-width:0!important;
  }
  #wxWeatherModelsButton{
    flex:0 0 auto!important;
    order:2147483647!important;
  }
  #wxWeatherModelsButton .wx-model-button-label{display:none!important}
  #wxWeatherModelsButton .wx-model-icon{width:30px;height:30px}
  .wx-model-header{grid-template-columns:minmax(0,1fr) auto;gap:8px;padding:8px}
  .wx-model-title{font-size:16px}
  .wx-model-header-controls{grid-column:1/-1;grid-row:2;grid-template-columns:1fr 1fr;gap:6px}
  .wx-model-field:nth-child(3){grid-column:1/-1}
  .wx-model-select{height:38px;font-size:12px;border-radius:9px}
  .wx-model-close{grid-column:2;grid-row:1;width:36px;height:36px;border-radius:10px}
  .wx-model-body{padding:6px;gap:6px}
  .wx-model-meta{font-size:11px;padding:5px 9px;max-width:98%;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
  .wx-model-image-wrap{border-radius:10px}
  .wx-model-image-controls{gap:4px}
  .wx-model-small-button{height:33px;min-width:38px;padding:0 8px;font-size:12px}
  .wx-model-timeline{padding:6px}
  .wx-model-range-labels{padding-left:46px;padding-right:46px;font-size:9.5px}
}
