<div class="tab calendaria-scene-config{{#if tab.active}} active{{/if}}" data-group="{{tab.group}}" data-tab="{{tab.id}}">
  <fieldset>
    <legend>{{localize "CALENDARIA.Scene.Section.Lighting"}}</legend>
    <div class="form-group slim">
      <label>{{localize "CALENDARIA.Scene.DarknessSync.Name"}}</label>
      <select name="flags.{{moduleId}}.darknessSync">
        <option value="default" {{#if (eq darknessSync "default")}}selected{{/if}}>{{localize "CALENDARIA.Common.UseGlobal"}}</option>
        <option value="enabled" {{#if (eq darknessSync "enabled")}}selected{{/if}}>{{localize "CALENDARIA.Scene.DarknessSync.Choices.Enabled"}}</option>
        <option value="disabled" {{#if (eq darknessSync "disabled")}}selected{{/if}}>{{localize "CALENDARIA.Common.Disabled"}}</option>
      </select>
      <p class="hint">{{localize "CALENDARIA.Scene.DarknessSync.Hint"}}</p>
    </div>
    <div class="form-group slim">
      <label>{{localize "CALENDARIA.Scene.BrightnessMultiplier.Name"}}</label>
      <div class="form-fields">
        <input type="range" name="flags.{{moduleId}}.brightnessMultiplier" min="0.5" max="1.5" step="0.1"
          value="{{brightnessMultiplier}}">
        <span class="range-value">{{brightnessMultiplier}}x</span>
      </div>
      <p class="hint">{{localize "CALENDARIA.Scene.BrightnessMultiplier.Hint"}}</p>
    </div>
    <div class="form-group slim">
      <label>{{localize "CALENDARIA.Settings.DarknessWeatherSync.Name"}}</label>
      <select name="flags.{{moduleId}}.darknessWeatherSync">
        <option value="default" {{#if (eq weatherDarknessSync "default")}}selected{{/if}}>{{localize "CALENDARIA.Common.UseGlobal"}}</option>
        <option value="enabled" {{#if (eq weatherDarknessSync "enabled")}}selected{{/if}}>{{localize "CALENDARIA.Common.Enabled"}}</option>
        <option value="disabled" {{#if (eq weatherDarknessSync "disabled")}}selected{{/if}}>{{localize "CALENDARIA.Common.Disabled"}}</option>
      </select>
      <p class="hint">{{localize "CALENDARIA.Scene.SyncOverrideHint"}}</p>
    </div>
    <div class="form-group slim">
      <label>{{localize "CALENDARIA.Settings.DarknessMoonSync.Name"}}</label>
      <select name="flags.{{moduleId}}.darknessMoonSync">
        <option value="default" {{#if (eq moonDarknessSync "default")}}selected{{/if}}>{{localize "CALENDARIA.Common.UseGlobal"}}</option>
        <option value="enabled" {{#if (eq moonDarknessSync "enabled")}}selected{{/if}}>{{localize "CALENDARIA.Common.Enabled"}}</option>
        <option value="disabled" {{#if (eq moonDarknessSync "disabled")}}selected{{/if}}>{{localize "CALENDARIA.Common.Disabled"}}</option>
      </select>
      <p class="hint">{{localize "CALENDARIA.Scene.SyncOverrideHint"}}</p>
    </div>
  </fieldset>

  <fieldset>
    <legend>{{localize "CALENDARIA.Scene.Section.Ambience"}}</legend>
    <div class="form-group slim">
      <label>{{localize "CALENDARIA.Settings.AmbienceSync.Name"}}</label>
      <select name="flags.{{moduleId}}.ambienceSync">
        <option value="default" {{#if (eq ambienceSync "default")}}selected{{/if}}>{{localize "CALENDARIA.Common.UseGlobal"}}</option>
        <option value="enabled" {{#if (eq ambienceSync "enabled")}}selected{{/if}}>{{localize "CALENDARIA.Common.Enabled"}}</option>
        <option value="disabled" {{#if (eq ambienceSync "disabled")}}selected{{/if}}>{{localize "CALENDARIA.Common.Disabled"}}</option>
      </select>
      <p class="hint">{{localize "CALENDARIA.Scene.SyncOverrideHint"}}</p>
    </div>
    <div class="form-group slim">
      <label>{{localize "CALENDARIA.Settings.ColorShiftSync.Name"}}</label>
      <select name="flags.{{moduleId}}.colorShiftSync">
        <option value="default" {{#if (eq colorShiftSync "default")}}selected{{/if}}>{{localize "CALENDARIA.Common.UseGlobal"}}</option>
        <option value="enabled" {{#if (eq colorShiftSync "enabled")}}selected{{/if}}>{{localize "CALENDARIA.Common.Enabled"}}</option>
        <option value="disabled" {{#if (eq colorShiftSync "disabled")}}selected{{/if}}>{{localize "CALENDARIA.Common.Disabled"}}</option>
      </select>
      <p class="hint">{{localize "CALENDARIA.Scene.SyncOverrideHint"}}</p>
    </div>
  </fieldset>

  <fieldset>
    <legend>{{localize "CALENDARIA.Scene.Section.Weather"}}</legend>
    <div class="form-group slim">
      <label>{{localize "CALENDARIA.Scene.ClimateZoneOverride.Name"}}</label>
      <select name="flags.{{moduleId}}.climateZoneOverride" {{#unless climateZones.length}}disabled{{/unless}}>
        <option value="" {{#unless climateZoneOverride}}selected{{/unless}}>
          {{localize "CALENDARIA.Scene.ClimateZoneOverride.Choices.Default"}}
        </option>
        {{#each climateZones}}
          <option value="{{this.id}}" {{#if (eq this.id ../climateZoneOverride)}}selected{{/if}}>
            {{this.name}}
          </option>
        {{/each}}
      </select>
      {{#if climateZones.length}}
        <p class="hint">{{localize "CALENDARIA.Scene.ClimateZoneOverride.Hint"}}</p>
      {{else}}
        <p class="hint">{{localize "CALENDARIA.Scene.ClimateZoneOverride.NoZones"}}</p>
      {{/if}}
    </div>
    <div class="form-group slim">
      <label>{{localize "CALENDARIA.SceneConfig.WeatherFxOverride.Name"}}</label>
      <select name="flags.{{moduleId}}.weatherFxOverride">
        {{#each weatherFxOverrideOptions}}
          <option value="{{this.value}}" {{#if this.selected}}selected{{/if}}>{{localize this.label}}</option>
        {{/each}}
      </select>
      <p class="hint">{{localize "CALENDARIA.SceneConfig.WeatherFxOverride.Hint"}}</p>
    </div>
    <div class="form-group slim">
      <label>{{localize "CALENDARIA.Scene.FxTopDownOverride.Name"}}</label>
      <select name="flags.{{moduleId}}.fxmasterTopDownOverride">
        <option value="default" {{#if (eq fxTopDownOverride "default")}}selected{{/if}}>{{localize "CALENDARIA.Common.UseGlobal"}}</option>
        <option value="topdown" {{#if (eq fxTopDownOverride "topdown")}}selected{{/if}}>{{localize "CALENDARIA.Scene.FxTopDownOverride.Choices.TopDown"}}</option>
        <option value="sideview" {{#if (eq fxTopDownOverride "sideview")}}selected{{/if}}>{{localize "CALENDARIA.Scene.FxTopDownOverride.Choices.SideView"}}</option>
      </select>
      <p class="hint">{{localize "CALENDARIA.Scene.FxTopDownOverride.Hint"}}</p>
    </div>
    <div class="form-group slim">
      <label>{{localize "CALENDARIA.Scene.FxSplashOverride.Name"}}</label>
      <select name="flags.{{moduleId}}.fxmasterSplashOverride">
        <option value="default" {{#if (eq fxSplashOverride "default")}}selected{{/if}}>{{localize "CALENDARIA.Common.UseGlobal"}}</option>
        <option value="on" {{#if (eq fxSplashOverride "on")}}selected{{/if}}>{{localize "CALENDARIA.Scene.FxSplashOverride.Choices.On"}}</option>
        <option value="off" {{#if (eq fxSplashOverride "off")}}selected{{/if}}>{{localize "CALENDARIA.Scene.FxSplashOverride.Choices.Off"}}</option>
      </select>
      <p class="hint">{{localize "CALENDARIA.Scene.FxSplashOverride.Hint"}}</p>
    </div>
    <div class="form-group slim">
      <label>{{localize "CALENDARIA.Scene.WeatherSoundDisabled.Name"}}</label>
      <input type="checkbox" name="flags.{{moduleId}}.weatherSoundDisabled" {{#if weatherSoundDisabled}}checked{{/if}}>
      <p class="hint">{{localize "CALENDARIA.Scene.WeatherSoundDisabled.Hint"}}</p>
    </div>
    {{#if sceneLevels.length}}
      <div class="form-group slim">
        <label>{{localize "CALENDARIA.Scene.WeatherFxLevels.Name"}}</label>
        <multi-select name="flags.{{moduleId}}.weatherFxLevels">
          {{#each sceneLevels}}
            <option value="{{this.id}}" {{#if this.selected}}selected{{/if}}>{{this.name}}</option>
          {{/each}}
        </multi-select>
        <p class="hint">{{localize "CALENDARIA.Scene.WeatherFxLevels.Hint"}}</p>
      </div>
    {{/if}}
  </fieldset>

  <fieldset>
    <legend>{{localize "CALENDARIA.Scene.Section.Hud"}}</legend>
    <div class="form-group slim">
      <label>{{localize "CALENDARIA.Scene.HudHideForPlayers.Name"}}</label>
      <input type="checkbox" name="flags.{{moduleId}}.hudHideForPlayers" {{#if hudHideForPlayers}}checked{{/if}}>
      <p class="hint">{{localize "CALENDARIA.Scene.HudHideForPlayers.Hint"}}</p>
    </div>
  </fieldset>
</div>
