<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>GST Reconciliation Tool | GSTR-2A vs Books</title>
    <link href="https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700&display=swap" rel="stylesheet">
    <style>
        :root {
            --primary: #4361ee;
            --primary-light: #4cc9f0;
            --secondary: #7209b7;
            --success: #06d6a0;
            --danger: #ef476f;
            --warning: #ffd166;
            --dark: #1a1a2e;
            --light: #f8f9fa;
            --gray: #6c757d;
            --gray-light: #e9ecef;
        }

        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
        }

        body {
            font-family: 'Poppins', sans-serif;
            background-color: #f5f7fa;
            color: #333;
            line-height: 1.6;
        }

        .container {
            max-width: 1200px;
            margin: 0 auto;
            padding: 0 20px;
        }

        header {
            background: linear-gradient(135deg, var(--primary), var(--secondary));
            color: white;
            padding: 20px 0;
            box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
        }

        .header-content {
            display: flex;
            justify-content: space-between;
            align-items: center;
        }

        .logo {
            font-size: 24px;
            font-weight: 700;
            display: flex;
            align-items: center;
        }

        .logo-icon {
            margin-right: 10px;
            font-size: 28px;
        }

        nav ul {
            display: flex;
            list-style: none;
        }

        nav ul li {
            margin-left: 30px;
        }

        nav ul li a {
            color: white;
            text-decoration: none;
            font-weight: 500;
            transition: all 0.3s;
            position: relative;
        }

        nav ul li a:hover {
            color: var(--warning);
        }

        nav ul li a::after {
            content: '';
            position: absolute;
            bottom: -5px;
            left: 0;
            width: 0;
            height: 2px;
            background-color: var(--warning);
            transition: width 0.3s;
        }

        nav ul li a:hover::after {
            width: 100%;
        }

        .main {
            padding: 40px 0;
        }

        .card {
            background-color: white;
            border-radius: 12px;
            box-shadow: 0 4px 25px rgba(0, 0, 0, 0.05);
            padding: 30px;
            margin-bottom: 30px;
            transition: transform 0.3s, box-shadow 0.3s;
        }

        .card:hover {
            transform: translateY(-5px);
            box-shadow: 0 8px 30px rgba(0, 0, 0, 0.1);
        }

        .section-title {
            font-size: 24px;
            font-weight: 600;
            color: var(--dark);
            margin-bottom: 20px;
            position: relative;
            padding-bottom: 10px;
        }

        .section-title::after {
            content: "";
            position: absolute;
            left: 0;
            bottom: 0;
            width: 60px;
            height: 3px;
            background: linear-gradient(to right, var(--primary), var(--secondary));
            border-radius: 3px;
        }

        .upload-section {
            display: flex;
            justify-content: space-between;
            margin-bottom: 30px;
        }

        .upload-box {
            flex: 0 0 48%;
            background-color: var(--light);
            border: 2px dashed var(--gray);
            border-radius: 10px;
            padding: 30px;
            text-align: center;
            transition: all 0.3s;
        }

        .upload-box:hover {
            border-color: var(--primary);
        }

        .upload-icon {
            font-size: 48px;
            color: var(--primary);
            margin-bottom: 15px;
        }

        .upload-title {
            font-size: 18px;
            font-weight: 600;
            margin-bottom: 10px;
        }

        .upload-desc {
            color: var(--gray);
            margin-bottom: 20px;
        }

        .btn {
            display: inline-block;
            background-color: var(--primary);
            color: white;
            font-weight: 500;
            padding: 12px 30px;
            border-radius: 6px;
            cursor: pointer;
            transition: all 0.3s;
            border: none;
            font-size: 16px;
        }

        .btn:hover {
            background-color: var(--secondary);
            transform: translateY(-2px);
            box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
        }

        .btn-outline {
            background-color: transparent;
            border: 2px solid var(--primary);
            color: var(--primary);
        }

        .btn-outline:hover {
            background-color: var(--primary);
            color: white;
        }

        .result-section {
            display: none;
        }

        .summary-grid {
            display: grid;
            grid-template-columns: repeat(3, 1fr);
            gap: 20px;
            margin-bottom: 30px;
        }

        .summary-box {
            background: white;
            border-radius: 10px;
            padding: 20px;
            box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
            text-align: center;
            transition: all 0.3s;
        }

        .summary-box:hover {
            transform: translateY(-5px);
            box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
        }

        .summary-box.matched {
            border-left: 5px solid var(--success);
        }

        .summary-box.unmatched-gstr {
            border-left: 5px solid var(--danger);
        }

        .summary-box.unmatched-books {
            border-left: 5px solid var(--warning);
        }

        .summary-title {
            font-size: 16px;
            font-weight: 500;
            color: var(--gray);
            margin-bottom: 10px;
        }

        .summary-value {
            font-size: 28px;
            font-weight: 700;
            margin-bottom: 5px;
        }

        .summary-box.matched .summary-value {
            color: var(--success);
        }

        .summary-box.unmatched-gstr .summary-value {
            color: var(--danger);
        }

        .summary-box.unmatched-books .summary-value {
            color: var(--warning);
        }

        .tabs {
            display: flex;
            border-bottom: 1px solid var(--gray-light);
            margin-bottom: 20px;
        }

        .tab {
            padding: 12px 25px;
            font-weight: 500;
            cursor: pointer;
            color: var(--gray);
            position: relative;
            transition: all 0.3s;
        }

        .tab.active {
            color: var(--primary);
        }

        .tab.active::after {
            content: "";
            position: absolute;
            bottom: -1px;
            left: 0;
            width: 100%;
            height: 3px;
            background-color: var(--primary);
            border-radius: 3px 3px 0 0;
        }

        .tab-content {
            display: none;
        }

        .tab-content.active {
            display: block;
        }

        table {
            width: 100%;
            border-collapse: collapse;
            margin-bottom: 20px;
            table-layout: fixed;
        }

        th, td {
            padding: 15px;
            text-align: left;
            border-bottom: 1px solid var(--gray-light);
        }

        th {
            background-color: var(--light);
            color: var(--dark);
            font-weight: 600;
            white-space: nowrap;
        }

        tbody tr {
            transition: background-color 0.3s;
        }

        tbody tr:hover {
            background-color: rgba(67, 97, 238, 0.05);
        }

        .status-badge {
            display: inline-block;
            padding: 6px 12px;
            border-radius: 20px;
            font-size: 12px;
            font-weight: 600;
            text-transform: uppercase;
        }

        .status-matched {
            background-color: rgba(6, 214, 160, 0.1);
            color: var(--success);
        }

        .status-unmatched {
            background-color: rgba(239, 71, 111, 0.1);
            color: var(--danger);
        }

        .status-missing {
            background-color: rgba(255, 209, 102, 0.1);
            color: var(--warning);
        }

        .actions {
            display: flex;
            justify-content: flex-end;
            gap: 10px;
            margin-top: 20px;
        }

        .search-box {
            position: relative;
            margin-bottom: 20px;
        }

        .search-input {
            width: 100%;
            padding: 12px 20px;
            border: 1px solid var(--gray-light);
            border-radius: 6px;
            font-size: 16px;
            transition: all 0.3s;
            padding-left: 45px;
        }

        .search-input:focus {
            border-color: var(--primary);
            box-shadow: 0 0 0 3px rgba(67, 97, 238, 0.1);
            outline: none;
        }

        .search-icon {
            position: absolute;
            left: 15px;
            top: 50%;
            transform: translateY(-50%);
            color: var(--gray);
            font-size: 20px;
        }

        .loader {
            display: none;
            text-align: center;
            padding: 30px;
        }

        .loader-spinner {
            border: 5px solid var(--gray-light);
            border-radius: 50%;
            border-top: 5px solid var(--primary);
            width: 50px;
            height: 50px;
            margin: 0 auto 20px;
            animation: spin 1s linear infinite;
        }

        @keyframes spin {
            0% { transform: rotate(0deg); }
            100% { transform: rotate(360deg); }
        }

        .file-input {
            display: none;
        }

        .tooltip {
            position: relative;
            display: inline-block;
            cursor: pointer;
            margin-left: 5px;
            color: var(--gray);
        }

        .tooltip .tooltip-text {
            visibility: hidden;
            width: 250px;
            background-color: var(--dark);
            color: white;
            text-align: center;
            border-radius: 6px;
            padding: 10px;
            position: absolute;
            z-index: 1;
            bottom: 125%;
            left: 50%;
            transform: translateX(-50%);
            opacity: 0;
            transition: opacity 0.3s;
            font-size: 14px;
            font-weight: normal;
        }

        .tooltip:hover .tooltip-text {
            visibility: visible;
            opacity: 1;
        }

        .progress-container {
            margin: 20px 0;
            display: none;
        }

        .progress-bar {
            height: 8px;
            background-color: var(--gray-light);
            border-radius: 10px;
            overflow: hidden;
            position: relative;
        }

        .progress {
            height: 100%;
            background: linear-gradient(to right, var(--primary), var(--primary-light));
            border-radius: 10px;
            width: 0;
            transition: width 0.3s;
        }

        .progress-text {
            text-align: center;
            margin-top: 10px;
            font-size: 14px;
            color: var(--gray);
        }

        .empty-state {
            text-align: center;
            padding: 40px 0;
            color: var(--gray);
        }

        .empty-icon {
            font-size: 60px;
            margin-bottom: 20px;
            color: var(--gray-light);
        }

        .filter-section {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 20px;
        }

        .filter-group {
            display: flex;
            gap: 10px;
        }

        .filter-select {
            padding: 10px 15px;
            border: 1px solid var(--gray-light);
            border-radius: 6px;
            background-color: white;
            color: var(--dark);
            cursor: pointer;
            transition: all 0.3s;
        }

        .filter-select:focus {
            border-color: var(--primary);
            outline: none;
        }

        footer {
            background-color: var(--dark);
            color: white;
            padding: 40px 0;
            margin-top: 50px;
        }

        .footer-content {
            display: flex;
            justify-content: space-between;
            align-items: center;
        }

        .footer-logo {
            font-size: 24px;
            font-weight: 700;
        }

        .footer-links ul {
            display: flex;
            list-style: none;
            gap: 20px;
        }

        .footer-links a {
            color: white;
            text-decoration: none;
            transition: color 0.3s;
        }

        .footer-links a:hover {
            color: var(--primary-light);
        }

        .copyright {
            text-align: center;
            padding-top: 30px;
            border-top: 1px solid rgba(255, 255, 255, 0.1);
            margin-top: 30px;
            color: var(--gray-light);
            font-size: 14px;
        }

        @media (max-width: 992px) {
            .upload-section {
                flex-direction: column;
                gap: 20px;
            }
            
            .upload-box {
                flex: 0 0 100%;
            }
            
            .summary-grid {
                grid-template-columns: repeat(1, 1fr);
            }

            nav ul li {
                margin-left: 15px;
            }
        }

        @media (max-width: 768px) {
            .header-content {
                flex-direction: column;
                text-align: center;
            }
            
            nav ul {
                margin-top: 20px;
                justify-content: center;
            }
            
            .footer-content {
                flex-direction: column;
                text-align: center;
                gap: 20px;
            }
            
            .footer-links ul {
                justify-content: center;
            }
            
            table {
                display: block;
                overflow-x: auto;
            }
        }
    </style>
</head>
<body>
    <header>
        <div class="container">
            <div class="header-content">
                <div class="logo">
                    <span class="logo-icon">📊</span>
                    GST Reconciliation Tool
                </div>
                <nav>
                    <ul>
                        <li><a href="#">Home</a></li>
                        <li><a href="#">How It Works</a></li>
                        <li><a href="#">FAQs</a></li>
                        <li><a href="#">Contact</a></li>
                    </ul>
                </nav>
            </div>
        </div>
    </header>

    <main class="main">
        <div class="container">
            <div class="card">
                <h2 class="section-title">Reconcile GSTR-2A vs Books</h2>
                <p>Upload your GSTR-2A Excel/CSV file and your Books data to automatically reconcile and identify discrepancies.</p>

                <div class="upload-section">
                    <div class="upload-box">
                        <div class="upload-icon">📥</div>
                        <h3 class="upload-title">GSTR-2A Data</h3>
                        <p class="upload-desc">Upload GSTR-2A data downloaded from GST Portal (Excel/CSV format)</p>
                        <input type="file" id="gstr2a-file" class="file-input" accept=".xlsx,.xls,.csv">
                        <button class="btn" id="gstr2a-upload-btn">Upload GSTR-2A File</button>
                        <div class="tooltip">ⓘ
                            <span class="tooltip-text">Download GSTR-2A from the GST Portal and upload the file here without modifying its structure.</span>
                        </div>
                    </div>
                    <div class="upload-box">
                        <div class="upload-icon">📊</div>
                        <h3 class="upload-title">Books Data</h3>
                        <p class="upload-desc">Upload your accounting books data (Excel/CSV format)</p>
                        <input type="file" id="books-file" class="file-input" accept=".xlsx,.xls,.csv">
                        <button class="btn" id="books-upload-btn">Upload Books File</button>
                        <div class="tooltip">ⓘ
                            <span class="tooltip-text">Ensure your books data contains Invoice Number, Date, GSTIN, and Tax Amount columns for proper reconciliation.</span>
                        </div>
                    </div>
                </div>

                <div class="progress-container" id="progress-container">
                    <div class="progress-bar">
                        <div class="progress" id="progress-bar"></div>
                    </div>
                    <div class="progress-text" id="progress-text">Processing files...</div>
                </div>

                <div class="actions">
                    <button class="btn btn-outline" id="reset-btn">Reset</button>
                    <button class="btn" id="reconcile-btn">Reconcile Data</button>
                </div>

                <div class="loader" id="loader">
                    <div class="loader-spinner"></div>
                    <p>Processing your data. This may take a moment...</p>
                </div>
            </div>

            <div class="result-section" id="result-section">
                <div class="card">
                    <h2 class="section-title">Reconciliation Results</h2>

                    <div class="summary-grid">
                        <div class="summary-box matched">
                            <h3 class="summary-title">Matched Invoices</h3>
                            <div class="summary-value" id="matched-count">0</div>
                            <div class="summary-desc">Total Amount: ₹<span id="matched-amount">0.00</span></div>
                        </div>
                        <div class="summary-box unmatched-gstr">
                            <h3 class="summary-title">In GSTR-2A but not in Books</h3>
                            <div class="summary-value" id="unmatched-gstr-count">0</div>
                            <div class="summary-desc">Total Amount: ₹<span id="unmatched-gstr-amount">0.00</span></div>
                        </div>
                        <div class="summary-box unmatched-books">
                            <h3 class="summary-title">In Books but not in GSTR-2A</h3>
                            <div class="summary-value" id="unmatched-books-count">0</div>
                            <div class="summary-desc">Total Amount: ₹<span id="unmatched-books-amount">0.00</span></div>
                        </div>
                    </div>

                    <div class="search-box">
                        <span class="search-icon">🔍</span>
                        <input type="text" class="search-input" id="search-input" placeholder="Search by Invoice No, GSTIN, Supplier...">
                    </div>

                    <div class="filter-section">
                        <div class="filter-group">
                            <select class="filter-select" id="status-filter">
                                <option value="all">All Status</option>
                                <option value="matched">Matched</option>
                                <option value="gstr-only">In GSTR-2A Only</option>
                                <option value="books-only">In Books Only</option>
                            </select>
                            <select class="filter-select" id="date-filter">
                                <option value="all">All Dates</option>
                                <option value="current-month">Current Month</option>
                                <option value="last-month">Last Month</option>
                                <option value="custom">Custom Range</option>
                            </select>
                            <select class="filter-select" id="amount-filter">
                                <option value="all">All Amounts</option>
                                <option value="high-to-low">High to Low</option>
                                <option value="low-to-high">Low to High</option>
                            </select>
                        </div>
                        <button class="btn btn-outline" id="export-btn">Export Results</button>
                    </div>

                    <div class="tabs">
                        <div class="tab active" data-tab="all">All Invoices</div>
                        <div class="tab" data-tab="matched">Matched</div>
                        <div class="tab" data-tab="unmatched-gstr">In GSTR-2A Only</div>
                        <div class="tab" data-tab="unmatched-books">In Books Only</div>
                    </div>

                    <div class="tab-content active" id="all-tab">
                        <table>
                            <thead>
                                <tr>
                                    <th>Status</th>
                                    <th>Invoice No</th>
                                    <th>Date</th>
                                    <th>Supplier GSTIN</th>
                                    <th>Supplier Name</th>
                                    <th>Taxable Value</th>
                                    <th>IGST</th>
                                    <th>CGST</th>
                                    <th>SGST</th>
                                    <th>Total Tax</th>
                                </tr>
                            </thead>
                            <tbody id="all-table-body">
                                <!-- Table rows will be dynamically added here -->
                            </tbody>
                        </table>
                        <div class="empty-state" id="all-empty-state">
                            <div class="empty-icon">📄</div>
                            <h3>No Data Available</h3>
                            <p>Upload and reconcile your GSTR-2A and Books data to see results here.</p>
                        </div>
                    </div>

                    <div class="tab-content" id="matched-tab">
                        <table>
                            <thead>
                                <tr>
                                    <th>Invoice No</th>
                                    <th>Date</th>
                                    <th>Supplier GSTIN</th>
                                    <th>Supplier Name</th>
                                    <th>Taxable Value</th>
                                    <th>IGST</th>
                                    <th>CGST</th>
                                    <th>SGST</th>
                                    <th>Total Tax</th>
                                </tr>
                            </thead>
                            <tbody id="matched-table-body">
                                <!-- Table rows will be dynamically added here -->
                            </tbody>
                        </table>
                        <div class="empty-state" id="matched-empty-state">
                            <div class="empty-icon">✓</div>
                            <h3>No Matched Invoices</h3>
                            <p>No invoices were found to match between your GSTR-2A and Books data.</p>
                        </div>
                    </div>

                    <div class="tab-content" id="unmatched-gstr-tab">
                        <table>
                            <thead>
                                <tr>
                                    <th>Invoice No</th>
                                    <th>Date</th>
                                    <th>Supplier GSTIN</th>
                                    <th>Supplier Name</th>
                                    <th>Taxable Value</th>
                                    <th>IGST</th>
                                    <th>CGST</th>
                                    <th>SGST</th>
                                    <th>Total Tax</th>
                                </tr>
                            </thead>
                            <tbody id="unmatched-gstr-table-body">
                                <!-- Table rows will be dynamically added here -->
                            </tbody>
                        </table>
                        <div class="empty-state" id="unmatched-gstr-empty-state">
                            <div class="empty-icon">📋</div>
                            <h3>No Discrepancies Found</h3>
                            <p>All invoices in your GSTR-2A are properly recorded in your Books.</p>
                        </div>
                    </div>

                    <div class="tab-content" id="unmatched-books-tab">
                        <table>
                            <thead>
                                <tr>
                                    <th>Invoice No</th>
                                    <th>Date</th>
                                    <th>Supplier GSTIN</th>
                                    <th>Supplier Name</th>
                                    <th>Taxable Value</th>
                                    <th>IGST</th>
                                    <th>CGST</th>
                                    <th>SGST</th>
                                    <th>Total Tax</th>
                                </tr>
                            </thead>
                            <tbody id="unmatched-books-table-body">
                                <!-- Table rows will be dynamically added here -->
                            </tbody>
                        </table>
                        <div class="empty-state" id="unmatched-books-empty-state">
                            <div class="empty-icon">📚</div>
                            <h3>No Discrepancies Found</h3>
                            <p>All invoices in your Books are properly reflected in your GSTR-2A.</p>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </main>

    <footer>
        <div class="container">
            <div class="footer-content">
                <div class="footer-logo">GST Reconciliation Tool</div>
                <div class="footer-links">
                    <ul>
                        <li><a href="#">Terms of Service</a></li>
                        <li><a href="#">Privacy Policy</a></li>
                        <li><a href="#">Help & Support</a></li>
                        <li><a href="#">Contact Us</a></li>
                    </ul>
                </div>
            </div>
            <div class="copyright">
                &copy; 2023 GST Reconciliation Tool. All rights reserved.
            </div>
        </div>
    </footer>

    <script>
        document.addEventListener('DOMContentLoaded', function() {
            // DOM Elements
            const gstr2aFileInput = document.getElementById('gstr2a-file');
            const booksFileInput = document.getElementById('books-file');
            const gstr2aUploadBtn = document.getElementById('gstr2a-upload-btn');
            const booksUploadBtn = document.getElementById('books-upload-btn');
            const reconcileBtn = document.getElementById('reconcile-btn');
            const resetBtn = document.getElementById('reset-btn');
            const exportBtn = document.getElementById('export-btn');
            const resultSection = document.getElementById('result-section');
            const loader = document.getElementById('loader');
            const tabs = document.querySelectorAll('.tab');
            const tabContents = document.querySelectorAll('.tab-content');
            const searchInput = document.getElementById('search-input');
            const statusFilter = document.getElementById('status-filter');
            const dateFilter = document.getElementById('date-filter');
            const amountFilter = document.getElementById('amount-filter');
            const progressContainer = document.getElementById('progress-container');
            const progressBar = document.getElementById('progress-bar');
            const progressText = document.getElementById('progress-text');

            // Summary elements
            const matchedCount = document.getElementById('matched-count');
            const unMatchedGstrCount = document.getElementById('unmatched-gstr-count');
            const unMatchedBooksCount = document.getElementById('unmatched-books-count');
            const matchedAmount = document.getElementById('matched-amount');
            const unMatchedGstrAmount = document.getElementById('unmatched-gstr-  Complete Above code