<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <title>Reconic Report</title>
    <style>
      /* Base Styling */
      body {
        font-family: "Roboto", "Arial", sans-serif;
        color: #444;
        background-color: #f5f5f5;
        margin: 0 auto;
        padding: 20px;
        max-width: 1200px; /* Prevents full-width stretch on larger screens */
        line-height: 1.6;
      }

      h1,
      h2 {
        font-weight: normal;
        color: #333;
      }

      h1 {
        margin-bottom: 0.5em;
      }

      h2 {
        margin-top: 1.5em;
        margin-bottom: 0.75em;
        color: #555; /* Subdued compared to initial design */
        border-bottom: 1px solid #eaeaea;
        padding-bottom: 3px;
      }

      /* Table styling for improved readability and professionalism */
      table {
        width: 100%;
        border-collapse: collapse;
        background-color: #fff;
        margin-top: 20px;
        box-shadow: 0 0 5px rgba(0, 0, 0, 0.1);
      }

      th,
      td {
        padding: 10px 15px;
        text-align: left;
        border: 1px solid #ddd;
      }

      th {
        background-color: #e9ecef; /* Lighter and less intense than initial design */
        color: #333;
        font-weight: 600;
      }

      td {
        font-size: 0.95em;
      }

      /* Adjusting link styling for better visual comfort */
      a {
        color: #333; /* Using a slightly less intense blue */
        text-decoration: none;
      }

      a:hover {
        color: black;
        text-decoration: underline;
      }

      /* Responsive design adjustments */
      @media screen and (max-width: 768px) {
        body {
          padding: 10px;
        }

        table,
        thead,
        tbody,
        th,
        td,
        tr {
          display: block;
        }

        thead tr {
          position: absolute;
          top: -9999px;
          left: -9999px;
        }

        tr {
          border: 1px solid #eaeaea;
        }

        td {
          border: none;
          border-bottom: 1px solid #eee;
          position: relative;
          padding-left: 50%;
          text-align: right;
        }

        td:before {
          position: absolute;
          top: 12px;
          left: 10px;
          width: 45%;
          padding-right: 10px;
          white-space: nowrap;
          text-align: left;
          content: attr(data-label);
          font-weight: 600;
          color: #333;
        }
      }
    </style>
  </head>
  <body>
    <!-- Github Follow Ribbon-->
    <iframe
      src="https://ghbtns.com/github-btn.html?user=fkkarakurt&type=follow&count=true"
      frameborder="0"
      scrolling="0"
      width="170"
      height="20"
    ></iframe>
    <!-- Github Star Ribbon-->
    <iframe
      src="https://ghbtns.com/github-btn.html?user=fkkarakurt&repo=reconic&type=star&count=true"
      frameborder="0"
      scrolling="0"
      width="170"
      height="20"
    ></iframe>

    <h1>
      Recon Scan Results |
      <a href="https://github.com/fkkarakurt/reconic" target="_blank"
        >Reconic</a
      >
    </h1>
    <p>Report Date: {{ date }}</p>

    <!-- Whois Results -->
    {% if results.get('Whois') %}
    <h2>Whois Results</h2>
    <table>
      <tr>
        <th>Field</th>
        <th>Value</th>
      </tr>
      {% for key, value in results['Whois'].items() %}
      <tr>
        <td>{{ key }}</td>
        <td>{{ value }}</td>
      </tr>
      {% endfor %}
    </table>
    {% endif %}

    <!-- DNS Results -->
    {% if results.get('DNS') %}
    <h2>DNS Results</h2>
    <table>
      {% for record_type, records in results['DNS'].items() %}
      <tr>
        <th colspan="2">{{ record_type }} Records</th>
      </tr>
      {% for record in records %}
      <tr>
        <td colspan="2">{{ record }}</td>
      </tr>
      {% endfor %} {% endfor %}
    </table>
    {% endif %}

    <!-- SSL Results -->
    {% if results.get('SSL') %}
    <h2>SSL Certificate Information</h2>
    <table>
      <tr>
        <th>Field</th>
        <th>Value</th>
      </tr>
      {% for key, value in results['SSL'].items() %}
      <tr>
        <td>{{ key }}</td>
        <td>{{ value }}</td>
      </tr>
      {% endfor %}
    </table>
    {% endif %}

    <!-- HTTP Headers Results -->
    {% if results.get('HTTP Headers') %}
    <h2>HTTP Headers Results</h2>
    <table>
      <tr>
        <th>Header</th>
        <th>Value</th>
      </tr>
      {% for header, value in results['HTTP Headers'].items() %}
      <tr>
        <td>{{ header }}</td>
        <td>{{ value }}</td>
      </tr>
      {% endfor %}
    </table>
    {% endif %}

    <!-- Port Scan Results -->
    {% if results.get('Port Scanner') %}
    <h2>Port Scan Results</h2>
    <table>
      <tr>
        <th>Port</th>
        <th>Service</th>
      </tr>
      {% for port, service in results['Port Scanner'] %}
      <tr>
        <td>{{ port }}</td>
        <td>{{ service }}</td>
      </tr>
      {% endfor %}
    </table>
    {% endif %}

    <!-- Subdomain Scan Results -->
    {% if results.get('Subdomain') %}
    <h2>Subdomain Scan Results</h2>
    <table>
      <tr>
        <th>Subdomain</th>
      </tr>
      {% for subdomain in results.get('Subdomain') %}
      <tr>
        <td>
          {% if subdomain['subdomain'].startswith('http://') or
          subdomain['subdomain'].startswith('https://') %}
          <a href="{{ subdomain['subdomain'] }}" target="_blank"
            >{{ subdomain['subdomain'] }}</a
          >
          {% else %}
          <a href="http://{{ subdomain['subdomain'] }}" target="_blank"
            >{{ subdomain['subdomain'] }}</a
          >
          {% endif %}
        </td>
      </tr>
      {% endfor %}
    </table>
    {% endif %}

    <!-- Directory Scan Results -->
    {% if results.get('Directories') %}
    <h2>Directory Scan Results</h2>
    <table>
      <tr>
        <th>Found Directories</th>
      </tr>
      {% for directory in results['Directories'] %}
      <tr>
        <td><a href="{{directory}}" target="_blank">{{ directory }}</a></td>
      </tr>
      {% endfor %}
    </table>
    {% endif %}

    <!-- JavaScript Files -->
    {% if results.get('JavaScriptFiles') %}
    <h2>JavaScript Files</h2>
    <table>
      <tr>
        <th>File URL</th>
      </tr>
      {% for js_file in results['JavaScriptFiles'] %}
      <tr>
        <td><a href="{{js_file}}" target="_blank">{{ js_file }}</a></td>
      </tr>
      {% endfor %}
    </table>
    {% endif %}
  </body>
</html>
