<div class="action-complexe-container">
  <div class="action-complexe-header">
    <button type="button" data-action="createAction">
      <i class="fas fa-plus"></i> {{localize "HAMALRON.ActionComplexe.CreateAction"}}
    </button>
  </div>

  {{#if hasActions}}
    <div class="action-complexe-list">
      {{#each actions}}
        <div class="action-card {{#if isComplete}}action-complete{{/if}}">
          <div class="action-header">
            <span class="action-name">{{name}}</span>
            <span class="action-symbole"><i class="fas {{symboleIcon}}"></i></span>
          </div>

          <div class="action-progress">
            <div class="progress-bar">
              <div class="progress-fill" style="--pct: {{pct}}"></div>
            </div>
            <span class="progress-text">{{currentSuccesses}} / {{resistance}}</span>
          </div>

          <div class="action-stats">
            <span class="stat-success"><i class="fas fa-check-circle"></i> {{currentSuccesses}}</span>
            <span class="stat-failure"><i class="fas fa-times-circle"></i> {{failures}}</span>
          </div>

          {{#if notes}}
            <div class="action-notes">{{notes}}</div>
          {{/if}}

          <div class="action-controls">
            {{#unless isComplete}}
              <button type="button" data-action="recordSuccess" data-action-id="{{id}}" class="btn-success">
                <i class="fas fa-check"></i> {{localize "HAMALRON.ActionComplexe.Success"}}
              </button>
              <button type="button" data-action="recordFailure" data-action-id="{{id}}" class="btn-failure">
                <i class="fas fa-times"></i> {{localize "HAMALRON.ActionComplexe.Failure"}}
              </button>
            {{/unless}}
            <button type="button" data-action="resetAction" data-action-id="{{id}}" class="btn-reset">
              <i class="fas fa-undo"></i>
            </button>
            <button type="button" data-action="deleteAction" data-action-id="{{id}}" class="btn-delete">
              <i class="fas fa-trash"></i>
            </button>
          </div>
        </div>
      {{/each}}
    </div>
  {{else}}
    <div class="action-empty">
      <i class="fas fa-tasks fa-3x"></i>
      <p>{{localize "HAMALRON.ActionComplexe.NoActions"}}</p>
    </div>
  {{/if}}
</div>
