<section>
  <div class="header">
    <img
      class="item-img"
      src="{{item.img}}"
      data-edit="img"
      data-action="editImage"
      data-tooltip="{{item.name}}"
    />
    {{formInput fields.name value=source.name}}
  </div>

  {{! Navigation des onglets }}
  <nav class="sheet-tabs tabs" data-group="primary">
    <a class="item {{tabs.details.cssClass}}" data-tab="details">{{localize
        "PRISMRPG.Label.details"
      }}</a>
    <a
      class="item {{tabs.description.cssClass}}"
      data-tab="description"
    >{{localize "PRISMRPG.Label.description"}}</a>
    <a class="item {{tabs.effects.cssClass}}" data-tab="effects">{{localize
        "PRISMRPG.Label.effects"
      }}</a>
  </nav>

  {{! Onglet Details }}
  <div
    class="tab {{tabs.details.cssClass}}"
    data-group="primary"
    data-tab="details"
  >
    {{! Prism RPG: Miracle Type }}
    {{formField
      systemFields.miracleType
      value=system.miracleType
      localize=true
      label="PRISMRPG.Label.miracleType"
    }}

    {{! Prism RPG: APC (Action Point Cost) }}
    {{formField
      systemFields.apc
      value=system.apc
      localize=true
      label="PRISMRPG.Label.apc"
    }}

    {{! Prism RPG: Faith Cost }}
    {{formField
      systemFields.faithCost
      value=system.faithCost
      localize=true
      label="PRISMRPG.Label.faithCost"
    }}

    {{! Prism RPG: Divine Favor }}
    {{formField
      systemFields.divineFavor
      value=system.divineFavor
      localize=true
      label="PRISMRPG.Label.divineFavor"
    }}

    {{! Miracle Components (includes Religious) }}
    <fieldset class="miracle-components">
      <legend>{{localize "PRISMRPG.Label.components"}}</legend>
      <div class="shift-right">
        {{formField
          systemFields.components.fields.verbal
          value=system.components.verbal
          localize=true
          label="PRISMRPG.Label.verbal"
        }}
        {{formField
          systemFields.components.fields.somatic
          value=system.components.somatic
          localize=true
          label="PRISMRPG.Label.somatic"
        }}
        {{formField
          systemFields.components.fields.material
          value=system.components.material
          localize=true
          label="PRISMRPG.Label.material"
        }}
        {{formField
          systemFields.components.fields.catalyst
          value=system.components.catalyst
          localize=true
          label="PRISMRPG.Label.catalyst"
        }}
        {{formField
          systemFields.components.fields.religious
          value=system.components.religious
          localize=true
          label="PRISMRPG.Label.religious"
        }}
      </div>
      {{formField
        systemFields.materialComponent
        value=system.materialComponent
        localize=true
        label="PRISMRPG.Label.materialComponent"
      }}
      {{formField
        systemFields.catalyst
        value=system.catalyst
        localize=true
        label="PRISMRPG.Label.catalystDetails"
      }}
    </fieldset>

    {{! Miracle Properties }}
    {{formField
      systemFields.prayerTime
      value=system.prayerTime
      localize=true
      label="PRISMRPG.Label.prayerTime"
    }}
    {{formField
      systemFields.miracleRange
      value=system.miracleRange
      localize=true
      label="PRISMRPG.Label.range"
    }}
    {{formField
      systemFields.areaAffected
      value=system.areaAffected
      localize=true
      label="PRISMRPG.Label.areaAffected"
    }}
    {{formField
      systemFields.duration
      value=system.duration
      localize=true
      label="PRISMRPG.Label.duration"
    }}
    {{formField
      systemFields.savingThrow
      value=system.savingThrow
      localize=true
      label="PRISMRPG.Label.savingThrow"
    }}

    {{! Legacy Level field }}
    {{formField
      systemFields.level
      value=system.level
      localize=true
      label="PRISMRPG.Label.level"
    }}

    {{! Prism RPG: Miracle Augment }}
    <fieldset class="miracle-augment">
      <legend>{{localize "PRISMRPG.Label.miracleAugment"}}</legend>
      {{formField
        systemFields.augment
        value=system.augment
        localize=true
        label="PRISMRPG.Label.augmentName"
      }}
      <div class="form-group">
        <label>{{localize "PRISMRPG.Label.augmentDescription"}}</label>
        {{formInput
          systemFields.augmentDescription
          enriched=enrichedAugmentDescription
          value=system.augmentDescription
          name="system.augmentDescription"
          toggled=true
        }}
      </div>
    </fieldset>
  </div>

  {{! Onglet Description }}
  <div
    class="tab {{tabs.description.cssClass}}"
    data-group="primary"
    data-tab="description"
  >
    <fieldset>
      <legend>{{localize "PRISMRPG.Label.description"}}</legend>
      {{formInput
        systemFields.description
        enriched=enrichedDescription
        value=system.description
        name="system.description"
        toggled=true
      }}
    </fieldset>
  </div>

  {{! Onglet Effects }}
  <div
    class="tab {{tabs.effects.cssClass}}"
    data-group="primary"
    data-tab="effects"
  >
    {{> systems/fvtt-prism-rpg/templates/partial-item-effects.hbs}}
  </div>

</section>