<?php
session_start();
if (!isset($_SESSION['loggedin']) || $_SESSION['loggedin'] !== true) {
    header("Location: login.php");
    exit();
}
?>
<!DOCTYPE html>
<html>
<head>
    <title>Envato Tool</title>
    <link rel="stylesheet" href="plugins/fontawesome-free/css/all.min.css">
    <link rel="stylesheet" href="dist/css/adminlte.min.css">
    <style>
        .dashboard-container {
            text-align: center;
            margin: 20px 0;
        }
        .dashboard-link {
            display: inline-block;
            padding: 10px 20px;
            background: #4285F4;
            color: white;
            border-radius: 4px;
            text-decoration: none;
            font-weight: 500;
            box-shadow: 0 2px 4px rgba(0,0,0,0.2);
            transition: all 0.3s;
        }
        .dashboard-link:hover {
            background: #3367D6;
            box-shadow: 0 4px 8px rgba(0,0,0,0.2);
            transform: translateY(-2px);
        }
        .dashboard-link i {
            margin-right: 8px;
        }
    </style>
</head>
<body class="hold-transition sidebar-mini">
<div class="wrapper">
    <!-- Google-style Dashboard Link -->
    <div class="dashboard-container">
        <a href="dashboard.php" class="dashboard-link">
            <i class="fas fa-home"></i> Back to Dashboard
        </a>
    </div>

    <div class="content-wrapper">
        <section class="content">
            <div class="container-fluid">
                <!-- SECTION_START -->
                <div class="card card-primary">
                    <div class="card-header">
                        <h3 class="card-title">Envato Cookies</h3>
                    </div>
                    <div class="card-body">
                        <div class="form-group">
                            <label for="EnvatoUrl">URL</label>
                            <input type="text" class="form-control" id="EnvatoUrl" data-service="Envato" placeholder="URL">
                        </div>
                        <div class="form-group">
                            <label for="EnvatoCookies">Cookies</label>
                            <input type="text" class="form-control" id="EnvatoCookies" data-service="Envato" placeholder="json">
                        </div>
                    </div>
                    <div class="card-footer">
                        <button type="button" onclick="saveCookiesData('Envato')" class="btn btn-primary">Save Envato Cookies</button>
                        <div id="EnvatoSuccessMessage" style="display:none;color:green;">Envato Cookies saved successfully!</div>
                    </div>
                </div>
                <!-- SECTION_END -->
                
                <script src="plugins/jquery/jquery.min.js"></script>
                <script src="plugins/bootstrap/js/bootstrap.bundle.min.js"></script>
                <script src="dist/js/adminlte.min.js"></script>
                <script src="dist/js/pages/custom.js"></script>
            </div>
        </section>
    </div>
</div>
</body>
</html>