{% load static %}
<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>AI Image to Video Generator</title>
  <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/css/bootstrap.min.css">
  <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@fontsource/source-sans-3@5.0.12/index.css"
        integrity="sha256-tXJfXfp6Ewt1ilPzLDtQnJV4hclT9XuaZUKyUvmyr+Q=" crossorigin="anonymous">
  <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/overlayscrollbars@2.3.0/styles/overlayscrollbars.min.css"
        integrity="sha256-dSokZseQNT08wYEWiz5iLI8QPlKxG+TswNRD8k35cpg=" crossorigin="anonymous">
  <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap-icons@1.11.0/font/bootstrap-icons.min.css"
        integrity="sha256-Qsx5lrStHZyR9REqhUF8iQt73X06c8LGIUPzpOhwRrI=" crossorigin="anonymous">
  <link rel="stylesheet" href="{% static './css/adminlte.css' %}">
  <link href="https://cdn.jsdelivr.net/npm/select2@4.1.0-rc.0/dist/css/select2.min.css" rel="stylesheet" />
  <link rel="stylesheet" href="{% static './css/select2-bootstrap4.min.css' %}">
  <link rel="stylesheet" href="{% static 'css/custom.css' %}">

  <link rel="stylesheet" href="{% static 'css/upload.css' %}">
</head>
<body class="layout-fixed sidebar-expand-lg sidebar-mini app-loaded sidebar-collapse">
  <div class="app-wrapper"> <!--begin::Header-->
    {% include 'header.html' %}
    {% include 'sidebar.html' %}
    <main class="app-main"> <!--begin::App Content Header-->
      <div class="app-content-header"> <!--begin::Container-->
          <div class="container-fluid"> <!--begin::Row-->
              <div class="row">
                  <div class="col-sm-6">
                      <h3 class="mb-0">✨ AI Video Magic</h3>
                  </div>
                  <div class="col-sm-6">
                      <ol class="breadcrumb float-sm-end">
                          <li class="breadcrumb-item"><a href="{% url 'file-upload' %}">Home</a></li>
                          <li class="breadcrumb-item active" aria-current="page"><a href="{% url 'generate-video' %}"></a>
                              ✨ AI Video Magic</a>
                          </li>
                      </ol>
                  </div>
              </div> <!--end::Row-->
          </div> <!--end::Container-->
      </div>
      <div class="app-content-header"> <!--begin::Container-->
          <div class="container-fluid "> <!--begin::Row-->
            <div class=" video-generator" >
              <div class="hero-section">
                <h1 class="hero-title">✨ AI Video Magic</h1>
                <p class="hero-subtitle">Transform your images into stunning transition videos with cutting-edge AI technology</p>
              </div>
              
              <div class="upload-container">
                <!-- Start Frame Card -->
                <div class="upload-card" id="startCard">
                  <div class="upload-content">
                    <div class="upload-icon">🎬</div>
                    <div class="upload-label">Start Frame</div>
                    <div class="upload-hint">Click or drag to upload</div>
                  </div>
                  <div class="preview-container" id="startPreviewContainer">
                    <img id="startPreview" class="preview-img" alt="Start Preview">
                    <div id="startFileName" class="file-name"></div>
                  </div>
                  <input type="file" id="startFrame" accept="image/*">
                </div>
                
                <div class="arrow-container">
                  <div class="arrow">→</div>
                </div>
                
                <!-- End Frame Card -->
                <div class="upload-card" id="endCard">
                  <div class="upload-content">
                    <div class="upload-icon">🎞️</div>
                    <div class="upload-label">End Frame</div>
                    <div class="upload-hint">Click or drag to upload</div>
                  </div>
                  <div class="preview-container" id="endPreviewContainer">
                    <img id="endPreview" class="preview-img" alt="End Preview">
                    <div id="endFileName" class="file-name"></div>
                  </div>
                  <input type="file" id="endFrame" accept="image/*">
                </div>
              </div>
              
              <div class="action-section">
                <button class="generate-btn" id="processBtn" disabled>
                  🚀 Generate Video
                </button>
              </div>
            </div>
          </div>
      </div>
    </main>

    <!-- Video Modal -->
    <div class="modal fade" id="videoModal" tabindex="-1" aria-hidden="true">
      <div class="modal-dialog modal-dialog-centered modal-lg">
        <div class="modal-content">
          <div class="modal-header">
            <h5 class="modal-title">🎉 Your Video is Ready!</h5>
            <button type="button" class="btn-close" data-bs-dismiss="modal"></button>
          </div>
          <div class="modal-body">
            <video id="outputVideo" class="w-100" controls></video>
          </div>
        </div>
      </div>
    </div>

    {% include 'footer.html' %}
  </div>

  <script src="{% static 'js/upload.js' %}"></script>
  <script src="https://code.jquery.com/jquery-3.7.1.min.js"
        integrity="sha256-/JqT3SQfawRcv/BIHPThkBvs0OEvtFFmqPF/lYI/Cxo=" crossorigin="anonymous"></script>
    <script src="https://cdn.jsdelivr.net/npm/overlayscrollbars@2.3.0/browser/overlayscrollbars.browser.es6.min.js"
        integrity="sha256-H2VM7BKda+v2Z4+DRy69uknwxjyDRhszjXFhsL4gD3w=" crossorigin="anonymous"></script>
    <!--end::Third Party Plugin(OverlayScrollbars)--><!--begin::Required Plugin(popperjs for Bootstrap 5)-->
    <script src="https://cdn.jsdelivr.net/npm/@popperjs/core@2.11.8/dist/umd/popper.min.js"
        integrity="sha256-whL0tQWoY1Ku1iskqPFvmZ+CHsvmRWx/PIoEvIeWh4I=" crossorigin="anonymous"></script>
    <!--end::Required Plugin(popperjs for Bootstrap 5)--><!--begin::Required Plugin(Bootstrap 5)-->
    <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/js/bootstrap.min.js"
        integrity="sha256-YMa+wAM6QkVyz999odX7lPRxkoYAan8suedu4k2Zur8=" crossorigin="anonymous"></script>
    <script src="https://cdn.jsdelivr.net/npm/select2@4.1.0-rc.0/dist/js/select2.min.js"></script>
    <!--end::Required Plugin(Bootstrap 5)--><!--begin::Required Plugin(AdminLTE)-->
    <script src="{% static './js/adminlte.js' %}"></script>
    <script>
        const SELECTOR_SIDEBAR_WRAPPER = ".sidebar-wrapper";
        const Default = {
            scrollbarTheme: "os-theme-light",
            scrollbarAutoHide: "leave",
            scrollbarClickScroll: true,
        };
        document.addEventListener("DOMContentLoaded", function () {
            const sidebarWrapper = document.querySelector(SELECTOR_SIDEBAR_WRAPPER);
            if (
                sidebarWrapper &&
                typeof OverlayScrollbarsGlobal?.OverlayScrollbars !== "undefined"
            ) {
                OverlayScrollbarsGlobal.OverlayScrollbars(sidebarWrapper, {
                    scrollbars: {
                        theme: Default.scrollbarTheme,
                        autoHide: Default.scrollbarAutoHide,
                        clickScroll: Default.scrollbarClickScroll,
                    },
                });
            }
        });
        $(document).ready(function () {
            $('.select2').select2({
                theme: 'bootstrap4',
                placeholder: 'Select Competitors'
            });
        });
    </script> 
    
</body>
</html>