<!DOCTYPE html>
<html th:lang="${#locale.language}" th:dir="#{language.direction}" th:data-language="${#locale.toString()}"
  xmlns:th="https://www.thymeleaf.org">

<head>
  <th:block th:insert="~{fragments/common :: head(title=#{compress.title}, header=#{compress.header})}"></th:block>
</head>

<body>
  <th:block th:insert="~{fragments/common :: game}"></th:block>
  <div id="page-container">
    <div id="content-wrap">
      <th:block th:insert="~{fragments/navbar.html :: navbar}"></th:block>
      <br><br>
      <div class="container">
        <div class="row justify-content-center">
          <div class="col-md-6 bg-card">
            <div class="tool-header">
              <span class="material-symbols-rounded tool-header-icon advance">zoom_in_map</span>
              <span class="tool-header-text" th:text="#{compress.header}"></span>
            </div>
            <form action="#" th:action="@{'/api/v1/misc/compress-pdf'}" method="post" enctype="multipart/form-data">
              <div
                th:replace="~{fragments/common :: fileSelector(name='fileInput', multipleInputsForSingleRequest=false, accept='application/pdf')}">
              </div>
              <div class="card mb-3">
                <div class="card-body">
                  <h4 th:text="#{compress.selectText.1}"></h4>
                  <p th:text="#{compress.selectText.1.1}"></p>
                  <label for="optimizeLevel" th:text="#{compress.selectText.2}"></label>
                  <select name="optimizeLevel" id="optimizeLevel" class="form-control">
                    <option value="1">1</option>
                    <option value="2">2</option>
                    <option value="3">3</option>
                    <option value="4">4</option>
                    <option value="5" selected>5</option>
                    <option value="6">6</option>
                    <option value="7">7</option>
                    <option value="8">8</option>
                    <option value="9">9</option>
                  </select>

                  <div class="form-check mt-3">
                    <input class="form-check-input" type="checkbox" name="grayscale" id="grayscaleCheck" value="true">
                    <label class="form-check-label" for="grayscaleCheck" th:text="#{compress.grayscale.label}">
                        Convert images to grayscale for better compression
                    </label>
                </div>
                </div>
              </div>
              <div class="card mb-3">
                <div class="card-body">
                  <h4 th:text="#{compress.selectText.4}"></h4>
                  <label for="expectedOutputSize" th:text="#{compress.selectText.5}"></label>
                  <input type="text" name="expectedOutputSize" id="expectedOutputSize" class="form-control">
                </div>
              </div>
              <button type="submit" id="submitBtn" class="btn btn-primary" th:text="#{compress.submit}"></button>
            </form>
          </div>
        </div>
      </div>
    </div>
    <th:block th:insert="~{fragments/footer.html :: footer}"></th:block>
  </div>
</body>

</html>
