<style>
  canvas {
    width: 100% !important;
    max-height: 300px;
  }

  .stat-item {
    background-color: #fff;
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.05);
    text-align: center;
  }

  .stat-icon {
    font-size: 2rem;
    color: #0d6efd;
    margin-bottom: 10px;
  }

  .chart-card {
    background: #fff;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 0 8px rgba(0, 0, 0, 0.05);
    margin-bottom: 20px;
  }

  .select2-container .select2-selection--single {
    height: 38px;
    padding: 6px 12px;
    border-radius: 5px;
    border: 1px solid #ced4da;
  }

  .select2-container .select2-search--inline .select2-search__field {
    min-height: 27px;
    display: flex;
    align-items: center;
    padding-top: 4px;
    padding-bottom: 4px;
  }

  .select2-container--default .select2-selection--multiple .select2-selection__choice__display {
    color: #444;
  }


  .chart-container {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
  }

  .chart-wrapper {
    flex: 1;
    min-width: 300px;
  }

  .search-bg {
    background-image: url('https://polymertubing.in/aipma2025/assets/img/bg-banner2.jpg ');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    min-height: 300px;
    padding: 20px;
    color: white;     
  }
</style>  
<main class="main">  
  <!-- Hero Section -->
  <section id="hero" class="hero section pt-0">  
    <div class="search-bg">
      <div class="container">
        <div class="row">
          <div class="col-md-9">

            <h5 class="fs-5 fw-bold text-dark-blue">Import from the world by the USA, and India's share of exports to
              the USA in
              both value and percentage.</h5>
          </div>
          <div class="col-md-3 text-center">
            <img src="<?= DOC_ROOT ?>assets/img/logo.png" class="img-fluid w-50" alt="Logo" />
          </div>
        </div>
        <!-- <div class="text-center mb-5">
          <h2 class="fw-bold text-dark">Import Dashboard usama</h2>
          <p class="text-muted">Imports by Country, Share %, Monthly Trends, and Growth</p>  
        </div> -->
        <div class="mb-2">
          <!-- Your Search Form -->
          <form action="hsn-code-rajiv.php" method="post">
            <div class="row gy-2 align-items-center">
              <!-- HSN Code -->

              <div class="col-md-6">
                <label class="text-dark-blue  fw-bold" for="sel_chapeter">Select Chapter No:</label>
                <select id="sel_chapeter" name="chapeter_code" class="form-select">
                  <?=getHSNCodeChapter()?>
                </select>
              </div>
              <div class="col-md-6">
                <label class="text-dark-blue  fw-bold" for="sel_hscncode">Select HSN Code:</label>

                <select id="sel_hscncode" name="hsn_code" class="form-select">
                  <?=getHSNCode($hsn_code)?>
                </select>
              </div>



              <!-- To Country -->
              <div class="col-md-6">
                <label class="text-dark-blue  fw-bold" for="to_country">Exports To Country:</label>
                <select id="to_country" name="to_country" class="form-select">
                  <?=getToCountry($to_country) ?>
                </select>
              </div>


              <!-- <div class="col-md-4">
                <label class="text-dark-blue  fw-bold" for="to_country">From country:</label>
                <select id="from_country" name="from_country[]" class="form-select" multiple="multiple">
                </select>
              </div> -->

              <!-- Submit Button -->





            </div>
            <div class="col-md-2 text-end ms-auto">
              <button type="submit" name="btnsearch" class="btn btn-primary me-0 me-sm-2 mx-1">
                <i class="fas fa-search me-1"></i> Search
              </button>
            </div>
          </form>
        </div>
      </div>
    </div>
    <div class="container py-4">
      <div class="row">

        <div class="col-md-12">

          <?php  if($searchdatacount > 0){  ?>

          <div class="chart-container">
            <div class="chart-wrapper chart-card">
              <canvas id="barChart"></canvas>
            </div>
            <div class="chart-wrapper chart-card">
              <canvas id="pieChart"></canvas>
            </div>
          </div>


          <div class="chart-card mb-4">
            <!-- <canvas id="barChart"></canvas> -->
            <div class="table-responsive">
              <table class="table table-bordered table-sm text-center align-middle small table-hover">

                <thead class="table-primary">
                  <?=$header?>
                </thead>
                <tbody>
                  <?=$row?>
                </tbody>
              </table>
            </div>
          </div>
          <?php  }else if(isset($searchdatacount))  { ?>
          <h1> No records found for the selected filter.</h1>
          <?php  } ?>



        </div>
      </div>
    </div>
  </section>
</main>