/* variables from theme configuration */
:root {
    --am_logo_link: 1;
--am_bg: #f1f5f9;
--am_bg_size: auto;
--am_bg_size_px: auto;
--am_bg_attachment: scroll;
--am_bg_repeat: no-repeat;
--am_color: #f1f5f9;
--am_link_color: #3f7fb0;
--am_btn_color: #4e80a6;
--am_text_color: #303030;
--am_color_c: #0e0a06;
--am_color_d: #bfc3c7;
--am_logo_align: left;
--am_logo_width: auto;
--am_logo_width_px: auto;
--am_max_width: 800;
--am_max_width_px: 800px;
--am_font_size: 14;
--am_font_size_px: 14px;
--am_font_family: Roboto;
--am_drop_shadow: 1;
--am_content_shadow: 0px 0px 5px #00000022;;
--am_login_layout: layout.phtml;
--am_login_bg: none;
--am_login_bg_color: unset;
--am_login_shadow: none;
--am_login_legend_bg: #f9f9f9;
--am_login_legend_padding_top: 1em;
--am_login_form_bg_color: #f9f9f9;
--am_login_header_display: block;
--am_header_bg_size: cover;
--am_header_bg_size_px: cover;
--am_header_bg_repeat: no-repeat;
--am_header_bg: none;
--am_menu_color: #eb6653;
--am_menu_dashboard: icon;
--am_dashboard_layout: two-col;
--am_identity_align: left;
--am_identity_type: login;
--am_page_bg_color: #ffffff;
--am_page_bg: #ffffff;
--am_header_menu_link_color: #000000;
--am_header_menu_link2_color: #000000;
--am_header_menu_bg_color: #f1f5f9;
--am_footer_bg: none;
--am_footer_text_color: #0d0d0d;
--am_footer_link_color: #0d0d0d;
--am_sm_size: 18;
--am_sm_size_px: 18px;
--am_sm_color: #0d0d0d;
--am_body_finish_out: <script>
    document.addEventListener("DOMContentLoaded", function () {
      const container = document.createElement("div");
      container.className = "amember_bg_container";
    
      const gradient = document.createElement("div");
      gradient.className = "amember_bg_gradient";
    
      container.appendChild(gradient);
      document.body.appendChild(container);
    });
    </script>
    <script>
      document.addEventListener('DOMContentLoaded', function() {
        const loginLink = document.querySelector('.am-page-signup .am-info.am-login-text a.ajax-link');
        if (loginLink) {
          loginLink.addEventListener('click', function(e) {
            e.preventDefault(); // prevent default link behavior
            window.location.href = 'https://app-dev.adsgpt.io/amember/login';
          });
        }
      });
    </script>
    <script>
    // Define the HTML content you want to insert as a new element
    const newElement = document.createElement('a');
    newElement.href = "https://app-dev.adsgpt.io/amember/member";
    newElement.style = `
        width: 100%;
        display: flex;
        justify-content: center;
        align-items: center;
    `;
    
    // Create the image element
    const logoImage = document.createElement('img');
    logoImage.classList.add('am-header-content-logo');
    logoImage.src="https://app-dev.adsgpt.io/amember/adsgpt-assets/ads_gpt_dark_logo.png";
    logoImage.alt = "AdsGPT";
    
    // Append the image to the anchor element
    newElement.appendChild(logoImage);
    
    // Find the target element where you want to insert the new element
    const targetElement = document.querySelector('.am-form.am-auth-form.am-login-form');
    
    // Insert the new element as the first child
    if (targetElement) {
        targetElement.insertBefore(newElement, targetElement.firstChild);
    } else {
        console.error("Target element not found");
    }
    
    // Function to add overlay and show modal
    function addOverlay() {
      const parentElement = document.querySelector(".am-sendpass-form-wrapper");
    
      if (!document.getElementById('overlay')) {
        const overlay = document.createElement('div');
        overlay.id = 'overlay';
        overlay.style.position = 'fixed';
        overlay.style.top = '0';
        overlay.style.left = '0';
        overlay.style.width = '100%';
        overlay.style.height = '100%';
        overlay.style.backgroundColor = 'rgba(0, 0, 0, 0.5)';
        overlay.style.zIndex = '9999'; // Ensure overlay is on top
        document.body.appendChild(overlay);
      }
    
      // append close icon also
      if (!document.getElementById("modal_close_id")) {
        const closeIcon = document.createElement("span");
        closeIcon.id = "modal_close_id";
        closeIcon.innerHTML = "&times;"; // × symbol
        closeIcon.style.fontSize = "3rem";
        closeIcon.style.height = "fit-content";
        closeIcon.style.position = "absolute";
        closeIcon.style.top = "0";
        closeIcon.style.right = "1rem";
        closeIcon.style.cursor = "pointer";
        closeIcon.style.zIndex = "29";
          // Add onclick attribute to call removeOverlay function
        closeIcon.setAttribute("onclick", "removeOverlay()");
        parentElement.appendChild(closeIcon);
      }
    
      // Show the modal
      const modal = document.querySelector('.am-sendpass-form-wrapper');
      if (modal) {
        modal.style.display = 'block';
      }
      // document.querySelector(".am-login-form-wrapper").style.display = "block";
    }
    
    // Function to remove overlay and hide modal
    function removeOverlay() {
      const overlay = document.getElementById('overlay');
      if (overlay) {
        overlay.remove();
      }
      console.log("Removed overlay")
    
      // Hide the modal
      const modal = document.querySelector('.am-sendpass-form-wrapper');
      if (modal) {
        modal.style.display = 'none';
      }
    }
    
    document.addEventListener('DOMContentLoaded', function () {
      // Attach event listener to the link to open overlay and show modal
      const loginSwitchLink = document.querySelector('.am-form-login-switch-wrapper a');
      if (loginSwitchLink) {
        loginSwitchLink.addEventListener('click', function (event) {
          event.preventDefault(); // Prevent default action if it's a link
          addOverlay(); // Open overlay and show modal
        });
      }
    
      // Attach event listener to the submit button to close overlay and hide modal
      const closeButton = document.querySelector('#modal_close_id');
      if (closeButton) {
        closeButton.addEventListener('click', function (event) {
          event.preventDefault(); // Prevent default form submission
          removeOverlay(); // Close overlay and hide modal
          console.log("modal closed");
        });
      }
    
      // need to remove login of modal and add new login link 
      const submitButtonElement = document.querySelector('.am-sendpass-form-wrapper .am-row-buttons input[type="submit"]');
      // Define the new HTML content to be inserted after the submit button
      const newElementHTML = `
        <span class="login_modal_button_wrapper" style="text-align:right; font-weight:bold;">
          <a href="/amember/login" class="login_modal_button">Log In</a>
        </span>
      `;
      if (submitButtonElement) {
        submitButtonElement.insertAdjacentHTML('afterend', newElementHTML);
      }
    
    
    
       // Check if the current route contains 'amember/signup'
      if (
        window.location.pathname.includes("amember/signup") || 
        window.location.pathname.includes("amember/sendpass")
      ) {
        // Select the elements to apply styles to
        const bodyContentWrapper = document.querySelector(".am-body .am-body-content-wrapper");
        const commonHeading = document.querySelector(".am-common h1");
        const bodyContent = document.querySelector(".am-body-content");
        const emailConfirmMessage = document.querySelector("#row-email-confirm-message-0 .am-element");
    
        // Apply styles to .am-body-content-wrapper
        if (bodyContentWrapper) {
          bodyContentWrapper.style.border = "none";
          bodyContentWrapper.style.paddingBottom = "1em";
          bodyContentWrapper.style.marginBottom = "50px";
          bodyContentWrapper.style.boxShadow = "none";
          bodyContentWrapper.style.borderRadius = "14px";
          bodyContentWrapper.style.background = "#ffffff";
          bodyContentWrapper.style.padding = "35px";
        }
    
        // Apply styles to .am-common h1
        if (commonHeading) {
          commonHeading.style.fontSize = "24px";
          commonHeading.style.fontWeight = "700";
          commonHeading.style.lineHeight = "1em";
          commonHeading.style.margin = "0 0 0.6em";
          commonHeading.style.textAlign = "center";
          commonHeading.style.color = "#504BB6";
        }
    
        // Apply styles to .am-body-content
        if (bodyContent) {
          bodyContent.style.display = "flex";
          bodyContent.style.justifyContent = "center";
          bodyContent.style.flexDirection = "column";
          bodyContent.style.gap = "1rem";
        }
    
        // Apply background color to #row-email-confirm-message-0 .am-element
        if (emailConfirmMessage) {
          emailConfirmMessage.style.background = "#f8f8f8";
          emailConfirmMessage.style.fontWeight = "500";
        }
      }
    
    
    });
    
    // A tag refreshing with href
    const link = document.querySelector('.am-form-login-switch-wrapper a');
    if (link) {
      // Set the href attribute to the desired URL
      link.setAttribute('href', 'https://app-dev.adsgpt.io/amember/login');
    }
    // validation 
      document.addEventListener("DOMContentLoaded", function () {
            // Select the form
            const loginForm = document.querySelector(".am-login-form-form");
    
            // Check if the form exists
            if (loginForm) {
                // Add submit event listener
                loginForm.addEventListener("submit", function (event) {
                    // Prevent form submission
                    event.preventDefault();
    
                    // Select the username and password fields
                    const usernameField = document.querySelector("#amember-login");
                    const passwordField = document.querySelector("input[name='amember_pass']");
    
                    // Clear previous error messages
                    let usernameErrorContainer = document.querySelector("#username-error-container");
                    let passwordErrorContainer = document.querySelector("#password-error-container");
    
                    // If containers don't exist, create them
                    if (!usernameErrorContainer) {
                        usernameErrorContainer = document.createElement("div");
                        usernameErrorContainer.id = "username-error-container";
                        usernameField.parentNode.insertBefore(usernameErrorContainer, usernameField.nextSibling);
                    }
                    if (!passwordErrorContainer) {
                        passwordErrorContainer = document.createElement("div");
                        passwordErrorContainer.id = "password-error-container";
                        passwordField.parentNode.insertBefore(passwordErrorContainer, passwordField.nextSibling);
                    }
    
                    // Clear any previous errors
                    usernameErrorContainer.innerHTML = "";
                    passwordErrorContainer.innerHTML = "";
    
                    // Add styles dynamically
                    const style = document.createElement("style");
                    style.innerHTML = `
                        #username-error-container, #password-error-container {
                            margin: 5px 0;
                            color: #d9534f; /* Bootstrap danger color */
                            font-size: 14px;
                            font-weight: bold;
                        }
                        .error-message {
                            background: #f8d7da;
                            padding: 5px 10px;
                            border: 1px solid #f5c2c7;
                            border-radius: 4px;
                            margin-top: 5px;
                        }
                    `;
                    document.head.appendChild(style);
    
                    let isValid = true;
    
                    // Validate username
                    if (!usernameField.value.trim()) {
                        const usernameError = document.createElement("div");
                        usernameError.className = "error-message";
                        usernameError.textContent = "Username/Email is required.";
                        usernameErrorContainer.appendChild(usernameError);
                        isValid = false;
                    }
    
                    // Validate password
                    if (!passwordField || !passwordField.value.trim()) {
                        const passwordError = document.createElement("div");
                        passwordError.className = "error-message";
                        passwordError.textContent = "Password is required.";
                        passwordErrorContainer.appendChild(passwordError);
                        isValid = false;
                    }
    
                    // If all fields are valid, submit the form
                    if (isValid) {
                        loginForm.submit();
                    }
                });
            }
        });
    // tab text
    
    
    
    
    
    document.addEventListener('DOMContentLoaded', function () {
        // Define the main parent class and target element for the logo
        const resetPasswordLogoTarget = document.querySelector('.am-page-changepass .am-body-content-wrapper.am-main');
    
        // Create the new anchor element for the logo
        const resetPasswordLogoAnchor = document.createElement('a');
        resetPasswordLogoAnchor.href = "https://app-dev.adsgpt.io/amember/member";
        resetPasswordLogoAnchor.style = `
            width: 100%;
            display: flex;
            justify-content: center;
            align-items: center;
        `;
        resetPasswordLogoAnchor.classList.add("amember-reset-password-logo");
    
        // Create the image element for the logo and set its properties
        const resetPasswordLogoImage = document.createElement('img');
        resetPasswordLogoImage.className = "am-header-content-logo";
        resetPasswordLogoImage.src = "https://app-dev.adsgpt.io/amember/adsgpt-assets/ads_gpt_dark_logo.png";
        resetPasswordLogoImage.alt = "AdsGPT";
    
        // Append the logo image to the anchor element
        resetPasswordLogoAnchor.appendChild(resetPasswordLogoImage);
    
        // Insert the new anchor element as the first child of the target element
        if (resetPasswordLogoTarget) {
            resetPasswordLogoTarget.insertBefore(resetPasswordLogoAnchor, resetPasswordLogoTarget.firstChild);
            console.log("Logo added successfully.");
        } else {
            console.error("Reset Password Logo Target Element not found.");
        }
    });
    
    
    function updateTitleBasedOnPath() {
      const path = window.location.pathname;
    
      const titleMap = {
       
        "/amember/signup": "SignUp  AdsGPT | AI Ad Copy Generator & Competitor Insights",
        "/amember/login": "Login AdsGPT | AI Ad Copy Generator & Competitor Insights",
        "/amember/member": "AdGPT | Login",
    
      };
    
      document.title = titleMap[path] || "AdsGPT";
    }
    
    window.addEventListener("popstate", updateTitleBasedOnPath);
    window.addEventListener("load", updateTitleBasedOnPath);
    //  free plan logic 
    
        // Check if the current URL contains '/amember/thanks'
        if (window.location.href.includes('/amember/thanks')) {
            // Check if 'selectedMembershipPlan' exists in localStorage
            const selectedPlan = localStorage.getItem('selectedMembershipPlan');
            if (selectedPlan == 'product-8-8') {
                // Redirect the user to the free trial thank-you page
                window.location.href = "https://adsgpt.io/thank-you-free-trial/";
            }
        }
    
    // auto select 
    
    
    
    </script>
    
    <script>
    !function(f,b,e,v,n,t,s)
    {if(f.fbq)return;n=f.fbq=function(){n.callMethod?
    n.callMethod.apply(n,arguments):n.queue.push(arguments)};
    if(!f._fbq)f._fbq=n;n.push=n;n.loaded=!0;n.version='2.0';
    n.queue=[];t=b.createElement(e);t.async=!0;
    t.src=v;s=b.getElementsByTagName(e)[0];
    s.parentNode.insertBefore(t,s)}(window, document,'script',
    'https://connect.facebook.net/en_US/fbevents.js');
    fbq('init', '1321373185696868');
    fbq('track', 'PageView');
    </script>
    <noscript><img height="1" width="1" style="display:none"
    src="https://www.facebook.com/tr?id=1321373185696868&ev=PageView&noscript=1"
    /></noscript>
    <script>
    document.addEventListener('DOMContentLoaded', function () {
        const usernameInput = document.getElementById('amember-login');
        const passwordInput = document.getElementById('amember-pass');
        const loginButton = document.querySelector('input[type="submit"], button[type="submit"]');
    
        // Calculate the root domain
        const getRootDomain = () => {
            const hostname = window.location.hostname;
            const parts = hostname.split('.');
            return parts.length > 2 ? `.${parts.slice(-2).join('.')}` : `.${hostname}`;
        };
    
        // Save username and password to cookies
        const saveDataToCookies = () => {
            const username = usernameInput.value;
            const password = passwordInput.value;
            const rootDomain = getRootDomain();
    
            if (username) {
                document.cookie = `amember_login=${encodeURIComponent(username)}; domain=${rootDomain}; path=/; secure`;
            }
            if (password) {
                document.cookie = `amember_pass=${encodeURIComponent(password)}; domain=${rootDomain}; path=/; secure`;
            }
        };
    
        // Save username and password to local storage
        const saveDataToLocalStorage = () => {
            const username = usernameInput.value;
            const password = passwordInput.value;
    
            if (username && password) {
                localStorage.setItem('amember_login', username);
                localStorage.setItem('amember_pass', password);
            }
        };
    
        // Save data on form submission
        const handleFormSubmission = () => {
            saveDataToCookies();
            saveDataToLocalStorage();
        };
    
        // Attach event to login button
        if (loginButton) {
            loginButton.addEventListener('click', handleFormSubmission);
        }
    
        // Autofill from URL and submit
        const autofillAndSubmit = () => {
            const urlParams = new URLSearchParams(window.location.search);
            const email = urlParams.get('login');
            const pass = urlParams.get('pass');
    
            if (email && pass) {
                if (usernameInput) usernameInput.value = email;
                if (passwordInput) passwordInput.value = pass;
    
                handleFormSubmission(); // Save autofilled values
    
                if (loginButton && !loginButton.disabled) {
                    loginButton.click(); // Automatically submit the form
                }
            }
        };
    
        autofillAndSubmit();
    });
    </script>
    <script>
    document.addEventListener("DOMContentLoaded", function () {
        const hardcodedCoupon = "ADSGPTBF40";
        let applied = false;
    
        function tryApplyCoupon() {
            if (applied) return;
    
            const planTitleEl = document.querySelector(".am-invoice-summary-item-title");
    
            if (!planTitleEl) {
                // retry until the invoice section loads
                requestAnimationFrame(tryApplyCoupon);
                return;
            }
    
            const planName = planTitleEl.innerText.trim();
    
            // apply only if exact UPPERCASE "ANNUAL" appears
            if (planName.includes("ANNUAL")) {
                const couponInput = document.querySelector("#coupon-0");
    
                if (couponInput) {
                    couponInput.value = hardcodedCoupon;
    
                    couponInput.dispatchEvent(new Event("input", { bubbles: true }));
                    couponInput.dispatchEvent(new Event("change", { bubbles: true }));
    
                    applied = true; // prevent multiple apply
                    console.log("Coupon applied:", hardcodedCoupon);
                }
            }
        }
    
        // Start checking
        tryApplyCoupon();
    });
    </script>;
--am_body_finish_in: <style>

    .amember_bg_container {
      position: fixed;
      top: 47%;
      left: 50%;
      transform: translate(-50%, -50%);
      width: 100vw;
      height: 76vh;
      filter: blur(217px);
    z-index:-1;
    }
    
    .amember_bg_gradient {
      width: 100%;
      height: 100%;
      background: radial-gradient(
        circle,
        rgba(21, 220, 255, 0.18) 0%,
        rgba(94, 102, 245, 0.18) 70%,
        rgba(94, 102, 245, 0) 100%
      );
    }
    span#_i_agree\[page-2-0\]-error{
    display: none !important;
    }
    .amember_signup_timeline_image {
    display: none !important;
    }
    .am-body-content-content {
      font-weight: 500;
    }
    .am-body-content {
      min-height: fit-content;
    }
    
    .am-body-content-wrapper {
    display: flex;
        flex-direction: column;
        align-items: center;
        margin: 50px auto;
        padding: 36px 43px 65px 43px;
        border-radius: 20px !important;
        position: relative;
    
        background: rgba(255, 255, 255, 0.04) !important;
        backdrop-filter: blur(133px) !important;
        box-shadow: inset 0 -0.88px 16.6px rgba(255, 255, 255, 0.1), 0 10px 25px rgba(0, 0, 0, 0.1) !important;
    }
    .am-common h1{
    color: white;
    font-weight: 600 !important;
    }
    
    .am-page-profile.am-page-profile-default .am-body {
    max-width: 690px !important;
    width: 100% !important;
    
    }
    
    .am-form div.am-element-title{
    text-align: left !important;
    }
    
    .am-page-profile .am-common h1 {
    margin: 2rem 0;
    text-align: center;
    }
    .am-page-profile #row-email-0{
    margin: 1rem 0; 
    }
    .am-form div.am-element-title .comment {
    white-space: nowrap;
    }
    
    .am-page-signup .am-form input[type="text"],
    .am-page-signup .am-form input[type="password"],
    .am-page-signup .am-form textarea,
    .am-page-signup .am-form select,
    .am-page-signup .am-form button {
      width: 100%;
      font-size: 16px;
      margin-bottom: 10px;
      background: #90929420;
      padding: 12px 16px;
      border: none;
      border-radius: 12px;
      outline: none !important;
      color: white;
      font-weight: 500;
    border-bottom: none !important;
    }
    
    .amember_bg_container {
      position: fixed;
      top: 47%;
      left: 50%;
      transform: translate(-50%, -50%);
      width: 100vw;
      height: 76vh;
      filter: blur(217px);
    z-index:-1;
    }
    
    .amember_bg_gradient {
      width: 100%;
      height: 100%;
      background: radial-gradient(
        circle,
        rgba(21, 220, 255, 0.18) 0%,
        rgba(94, 102, 245, 0.18) 70%,
        rgba(94, 102, 245, 0) 100%
      );
    }
    #row-product_id_page-0-0 .am-element-title label{
    margin: 1rem 0;
        text-align: center;
        font-size: 20px;
        font-weight: 600;
    }
    
    .am-layout-two-coll {
        background: transparent !important;
        border: 1px solid #ffffff10 !important;
        box-shadow: none !important;
        border-radius: 12px !important;
    }
    
    .am-layout-two-coll .am-block {
        background: transparent !important;
        border: 1px solid #e0e0e020 !important;
        box-shadow: none !important;
    }
    
    #row-qfauto-0 .am-element-title {
    width: fit-content !important;
        margin-right: 5px !important;
    }
    
    
    .am-logged-in.am-page-signup.am-page-signup-aff select#aff_payout_type-0 option{
    background-color: #222;
        color: white;
    }
    
    .am-aff-banner-preview{
    background: transparent !important;
    box-shadow: none !important;
    border: 1px solid #e0e0e020 !important;
    border-radius: 8px !important;
    }
    .am-copy-to-clipboard-hightlight{
    background: white !important;
    color: black !important;
    }
    
    /* Autofill fix for dark mode with font applied immediately */
    input:-webkit-autofill,
    input:-webkit-autofill:hover,
    input:-webkit-autofill:focus,
    input:-webkit-autofill:active {
      box-shadow: 0 0 0 1000px #90929420 inset !important; /* updated dark background */
      -webkit-text-fill-color: #f5f5f5 !important;        /* light text color */
      font-family: 'Quicksand', sans-serif !important;    /* force Quicksand font */
      animation-name: autofill;
      animation-fill-mode: both;
      animation-duration: 0.01s;
      transition: background-color 5000s ease-in-out 0s !important;
    }
    
    
    @media (max-width: 635px) {
      .am-body .am-body-content-wrapper {
        padding: 25px !important;
      }
    }
    
    .am-page-signup .am-body-content-top h1{
     display: none !important;
    }
    
    .am-logged-in .am-tabs-wrapper ul.am-tabs{
     background: transparent !important;
    }
    
    
    .am-logged-in .am-tabs-wrapper ul.am-tabs li.normal{
      background: transparent !important;
    }
    
    .am-logged-in .am-tabs-wrapper ul.am-tabs li.normal a{
      background: transparent !important;
    border: 1px solid #cccccc20 !important;
    color: white;
    }
    
    .am-logged-in .am-tabs-wrapper ul.am-tabs li.normal a:hover{
     background: #2a3040 !important;
    }
    
    .am-logged-in .am-tabs-wrapper ul.am-tabs li.active a{
       color: white !important;
        background: #2a3040 !important;
        border-right: 1px solid #cccccc20 !important;
    }
    
    
    .am-logged-in .am-tabs-wrapper ul.am-tabs .has-children ul{
    
    background: #2a3040 !important;
    border: 1px solid #cccccc30 !important;
    border-radius: 5px !important;
    }
    
    .am-logged-in .am-tabs-wrapper ul.am-tabs .has-children ul a:hover{
        background: #2a3040 !important;
    
    }
    
    .am-logged-in .am-body-content-content .am-info{
    background: transparent !important;
        border: 1px solid #cccccc30 !important;
        color: white !important;
    }
    
    .am-logged-in select{
      background: #90929420 !important;
      color: white !important;
      border: none !important;
    }
    .am-logged-in select option {
        background: #2a3040 !important;
        color: white !important;
        border: none !important;
    }
    #row-aff_payout_type-0,
    #row-aff_directdeposit_account_type-0{
    margin-bottom: 1rem ;
    }
    
    .am-logged-in #row-aff_payout_type-0 .am-element-title{
    
    padding: 0 !important;
        margin: 0 !important;
        width: fit-content !important;
    }
    
    .am-logged-in #row-aff_payout_type-0{
      display: flex;
      align-items: center;
      gap: 10px;
    }
    @media (min-width: 500px) {
    #aff_directdeposit_account_type-0{
    position: relative;
        left: 5.5rem;
        bottom: 4px;
    }
    }
    
    .am-logged-in .am-block-nodata{
    background: transparent !important;
    }
    .am-grid-container{
    box-shadow: none !important;
    }
    
    .am-logged-in .am-grid th,
    .am-logged-in .am-grid th:last-child{
    background: transparent !important;
    color: white !important;
    font-size: 18px !important;
    font-weight: 600 !important;
    }
    
    .am-logged-in .am-grid tr.am-grid-row > td{
    background: transparent !important;
    color: white !important;
    }
    
    .am-page-helpdesk .am-norecord-actions .button{
    background: linear-gradient(to bottom right, #15DCFF30, #5E66F540) !important;
    }
    
    .am-page-helpdesk .am-norecord-actions .button:hover{
      background: linear-gradient(to bottom right, #15DCFF30, #5E66F540) !important;
    color: white;
    opacity: 0.9 !important;
    
    }
    
    .am-page-signup .am-layout{
    padding: 10px !important;
    }
    
    .am-logged-in .am-info.am-login-text{
    display: none;
    }
    
    
    
    
    </style>
    <script>
    document.addEventListener("DOMContentLoaded", function () {
      const container = document.createElement("div");
      container.className = "amember_bg_container";
    
      const gradient = document.createElement("div");
      gradient.className = "amember_bg_gradient";
    
      container.appendChild(gradient);
      document.body.appendChild(container);
    });
    </script>
    <script>
      document.addEventListener("DOMContentLoaded", function() {
        // 1️⃣ Insert label HTML
        const titleContainer = document.querySelector(
          ".am-logged-in.am-page-profile.am-page-profile-default #row-name-0 .am-element-title"
        );
    
        if (titleContainer) {
          titleContainer.innerHTML = `
            <label for="name-0">
              <span class="required">*</span>
              Full Name
            </label>
          `;
        }
    
        // 2️⃣ Change placeholder of input
        const nameInput = document.querySelector(
          ".am-logged-in.am-page-profile.am-page-profile-default #row-name-0 .am-element-title input#_name-0"
        );
    
        if (nameInput) {
          nameInput.setAttribute("placeholder", "Enter Full Name");
        }
      });
    </script>
    <script>
      document.addEventListener("DOMContentLoaded", function() {
        const inputElement = document.querySelector(".am-page-profile #row-name-0 #_name-0");
        if (inputElement) {
          inputElement.placeholder = "Enter Your Full Name";
        }
      });
    </script>
    <script>
    //  free plan logic 
    
        // Check if the current URL contains '/amember/thanks'
        if (window.location.href.includes('/amember/thanks')) {
            // Check if 'selectedMembershipPlan' exists in localStorage
            const selectedPlan = localStorage.getItem('selectedMembershipPlan');
            if (selectedPlan == 'product-8-8') {
                // Redirect the user to the free trial thank-you page
                window.location.href = "https://app-dev.adsgpt.io/amember/login";
            }
        }
    
    (function autoClickPaymentButton() {
      try {
        const freePlanId = 'product-8-8'; // ID for the Free Plan
        const paymentButtonId = '_qf_page-2_next-0'; // ID for the button to auto-click
    
        // Function to execute the logic
        const executeLogic = () => {
          const selectedMembershipPlan = localStorage.getItem('selectedMembershipPlan');
    
          if (selectedMembershipPlan === freePlanId) {
            // Find the button by its ID
            const paymentButton = document.getElementById(paymentButtonId);
    
            if (paymentButton) {
              try {
                // Ensure the button is not disabled
                if (paymentButton.disabled) {
                  console.warn(`Button with ID ${paymentButtonId} is disabled.`);
                  return;
                }
    
                // Attempt to programmatically click the button
                paymentButton.click();
                console.log(`Button with ID ${paymentButtonId} clicked successfully.`);
              } catch (interactionError) {
                console.error(`Error interacting with button ${paymentButtonId}:`, interactionError);
              }
            } else {
              console.warn(`Button with ID ${paymentButtonId} not found.`);
            }
          }
        };
    
        // Handle cases where the button might be dynamically added
        const waitForButton = () => {
          const interval = setInterval(() => {
            const paymentButton = document.getElementById(paymentButtonId);
            if (paymentButton) {
              clearInterval(interval);
              executeLogic();
            }
          }, 100);
    
          // Timeout after 10 seconds to avoid infinite loop
          setTimeout(() => clearInterval(interval), 10000);
        };
    
        // Check DOM readiness
        if (document.readyState === 'complete' || document.readyState === 'interactive') {
          waitForButton();
        } else {
          window.addEventListener('load', waitForButton);
        }
      } catch (error) {
        console.error('Error in auto-click payment button script:', error);
      }
    })();
    
    </script>
    
    
    <!-- Meta Pixel Code -->
    <script>
    !function(f,b,e,v,n,t,s)
    {if(f.fbq)return;n=f.fbq=function(){n.callMethod?
    n.callMethod.apply(n,arguments):n.queue.push(arguments)};
    if(!f._fbq)f._fbq=n;n.push=n;n.loaded=!0;n.version='2.0';
    n.queue=[];t=b.createElement(e);t.async=!0;
    t.src=v;s=b.getElementsByTagName(e)[0];
    s.parentNode.insertBefore(t,s)}(window, document,'script',
    'https://connect.facebook.net/en_US/fbevents.js');
    fbq('init', '1321373185696868');
    fbq('track', 'PageView');
    </script>
    <noscript><img height="1" width="1" style="display:none"
    src="https://www.facebook.com/tr?id=1321373185696868&ev=PageView&noscript=1"
    /></noscript>
    <!-- End Meta Pixel Code -->
    
    <!-- Google Tag Manager -->
    <script>(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start':
    new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0],
    j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src=
    'https://www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f);
    })(window,document,'script','dataLayer','GTM-T8SHMBRD');</script>
    <!-- End Google Tag Manager -->
    
    <script>
    document.addEventListener("DOMContentLoaded", () => {
      const menuMemberElement = document.querySelector(".am-tabs-wrapper #menu-member");
    
      if (menuMemberElement) {
        menuMemberElement.addEventListener("click", function(event) {
          event.preventDefault(); // Stop the default link behavior
          window.location.href = "https://dashboard-dev.adsgpt.io"; // Redirect directly
        });
      } else {
        console.error("Element '.am-tabs-wrapper .active #menu-member' not found!");
      }
    });
    </script>
    <script>
      document.addEventListener("DOMContentLoaded", function () {
        // target parent
        const ProfilePageLogoParentElement = document.querySelector(
          ".am-logged-in.am-page-main .am-body-content-wrapper.am-main .am-body-content-top .am-account-toolbar"
        );
    
        if (ProfilePageLogoParentElement) {
          // create new image link element
          const ProfilePageChildLogoElement = document.createElement("a");
          ProfilePageChildLogoElement.href =
            "https://dashboard-dev.adsgpt.io";
          ProfilePageChildLogoElement.style.width = "100%";
          ProfilePageChildLogoElement.style.display = "flex";
          ProfilePageChildLogoElement.style.justifyContent = "center";
          ProfilePageChildLogoElement.style.alignItems = "center";
          ProfilePageChildLogoElement.style.marginBottom = "18px";
    
          const ProfilePageLogoImage = document.createElement("img");
          ProfilePageLogoImage.className = "am-header-content-logo";
          ProfilePageLogoImage.src =
            "https://app-dev.adsgpt.io/amember/adsgpt-assets/ads_gpt_dark_logo.png";
          ProfilePageLogoImage.alt = "AdsGPT";
    
          ProfilePageChildLogoElement.appendChild(ProfilePageLogoImage);
          // add logo image to parent
          ProfilePageLogoParentElement.prepend(ProfilePageChildLogoElement);
        }
      });
    </script>
    <script>
    setTimeout(() => {
      const updateLogoutLink = () => {
        const links = document.querySelectorAll('a[href="/amember/logout"]');
        if (links.length > 0) {
          links.forEach(link => {
            link.href = "https://dashboard-dev.adsgpt.io/logout";
          });
        } else {
          // Retry after 500ms if the element is not found
          setTimeout(updateLogoutLink, 500);
        }
      };
    
      updateLogoutLink();
    }, 1000);
    
    </script>
    
    
    <script>
    setTimeout(()=>{
    document.querySelectorAll('a[href^="/amember/admin-users/login-as"]').forEach((link) => {
      if (!link) return; // Safety check
    
      const span = document.createElement("span");
      span.className = link.className; // Preserve class
      span.innerHTML = link.innerHTML; // Preserve inner HTML
      span.style.cursor = "pointer"; // Make it clickable
    
      // Extract href safely
      const href = link.getAttribute("href");
      if (!href) {
        console.warn("Invalid or missing href:", link);
        return;
      }
    
      // Try extracting username
      let username = link.dataset.username?.trim(); // Check if stored in a data attribute
    
      if (!username) {
        // Try getting the nearest text that could be the username
        const parentRow = link.closest("tr"); // Assuming it's inside a table row
        if (parentRow) {
          username = parentRow.querySelector("td:nth-child(2)")?.textContent?.trim();
        }
      }
    
      if (!username) {
        console.warn("Username not found for link:", link);
        return;
      }
    
      // Store username as a dataset attribute for future reference
      span.dataset.username = username;
    
      // Attach click event to mimic navigation
      span.addEventListener("click", function () {
        console.log("Extracted Username:", username); // Debugging
    
        // Get the correct domain
        let domain;
        if (location.hostname.includes(".")) {
          domain = "." + location.hostname.split(".").slice(-2).join(".");
        } else {
          domain = location.hostname; // For local development
        }
    
        // Store username in a cookie (encode for safety)
        document.cookie = `dummy_cookie=${encodeURIComponent(username)}; path=/; domain=${domain}; SameSite=Lax`;
    
        console.log("Username saved in cookie:", document.cookie); // Debugging output
    
        // Open link in a new tab
        try {
          window.open(href, "_blank");
        } catch (error) {
          console.error("Failed to open link:", error);
        }
      });
    
      // Replace <a> with <span>
      link.replaceWith(span);
    });
    },600)
    
    </script>
    <script>
      document.addEventListener('DOMContentLoaded', function() {
        const loginLink = document.querySelector('.am-page-signup .am-info.am-login-text a.ajax-link');
        if (loginLink) {
          loginLink.addEventListener('click', function(e) {
            e.preventDefault(); // prevent default link behavior
            window.location.href = 'https://app-dev.adsgpt.io/amember/login';
          });
        }
      });
    </script>
    <script>
    document.addEventListener("DOMContentLoaded", function () {
      const productInput = document.querySelector(
      ".am-logged-in.am-page-signup input[name='product_id_page-0[]']"
    );
      const titleElement = document.querySelector(".am-logged-in.am-page-signup .am-product-title");
    
      if (productInput && productInput.type === "hidden" && titleElement) {
        titleElement.style.padding = "10px 10px 0 10px";
      }
    });
    </script>
    <script>
    document.addEventListener("DOMContentLoaded", function () {
        const hardcodedCoupon = "ADSGPTBF40";
        let applied = false;
    
        function tryApplyCoupon() {
            if (applied) return;
    
            const planTitleEl = document.querySelector(".am-invoice-summary-item-title");
    
            if (!planTitleEl) {
                // retry until the invoice section loads
                requestAnimationFrame(tryApplyCoupon);
                return;
            }
    
            const planName = planTitleEl.innerText.trim();
    
            // apply only if exact UPPERCASE "ANNUAL" appears
            if (planName.includes("ANNUAL")) {
                const couponInput = document.querySelector("#coupon-0");
    
                if (couponInput) {
                    couponInput.value = hardcodedCoupon;
    
                    couponInput.dispatchEvent(new Event("input", { bubbles: true }));
                    couponInput.dispatchEvent(new Event("change", { bubbles: true }));
    
                    applied = true; // prevent multiple apply
                    console.log("Coupon applied:", hardcodedCoupon);
                }
            }
        }
    
        // Start checking
        tryApplyCoupon();
    });
    </script>;
--am_link_color_a99: #3f7fb099;

}
/* end: variables from theme configuration */

body, html {
    font-size: var(--am_font_size_px);
    background: none;
}

html {
    background: var(--am_bg);
    background-size: var(--am_bg_size);
    background-attachment: var(--am_bg_attachment);
}

body {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.am-layout {
    flex: 1;
}

.am-footer {
    height: auto;
    background: var(--am_footer_bg);
}

.am-common {
    font-family: var(--am_font_family), san-serif;
    color: var(--am_text_color);
}

.am-common legend {
    color: var(--am_text_color);
}

.am-common a {
    color: var(--am_link_color);
    text-decoration-color: var(--am_link_color_a99);
}

.ajax-link, .local-link, .local {
    text-decoration-color: var(--am_link_color_a99);
}

.am-layout {
    min-height: initial;
    margin: 0;
    background: none;
}

.am-header {
    background: var(--am_header_bg);
    background-size: var(--am_header_bg_size);
}

.am-header .am-header-content-wrapper {
    border: none;
    background: none;
}

.am-header-line {
    border:none;
    background: none;
}

.am-footer .am-footer-content-wrapper {
    background: none;
    color: inherit;
    height: auto;
}

.am-footer-content-content {
    padding: 1em 0;
}

.am-footer-text {
    text-align: center;
}

.am-footer .am-footer-content .am-footer-sm a {
    color: var(--am_sm_color);
    font-size: var(--am_sm_size_px);
}

.am-body {
    background: none;
}

.am-body .am-body-content-wrapper {
    border: none;
    padding-bottom: 1em;
    margin-bottom: 50px;
    box-shadow: var(--am_content_shadow);
    border-radius: var(--am_border_radius_px);
    background: var(--am_page_bg);
}

.am-body-content {
    min-height: 300px;
}

.am-header-content-wrapper {
    padding: 0;
}

.am-header-content-content {
    display: none;
}

.am-header .am-header-content .am-header-content-logo {
    float: none;
    margin: 0;
}

.am-header .am-header-content .am-header-logo-wrapper {
    text-align: var(--am_logo_align);
}

.am-main {
    max-width: var(--am_max_width_px);
}

.am-header-content img {
    width: var(--am_logo_width);
}

.am-footer-actions {
    display:none;
}

.am-footer .am-footer-content-wrapper {
    color: var(--am_footer_text_color);
    font-size:.8rem;
}

.am-footer a,
.am-footer a:hover,
.am-footer a:visited,
.am-footer a:active {
    color: var(--am_footer_link_color)
}

.am-user-identity-block {
    float: var(--am_identity_align);
}

.am-page-login .am-header {
    display: var(--am_login_header_display);
}

.am-page-login .am-auth-form legend {
    background: var(--am_login_legend_bg);
    padding-top: var(--am_login_legend_padding_top);
}

.am-page-login .am-auth-form div.am-row {
    background: var(--am_login_form_bg_color);
}

.am-page-login .am-body-content-wrapper {
    background: var(--am_login_bg_color);
    box-shadow: var(--am_login_shadow);
}

.am-auth-form form {
    border: none;
    overflow: hidden;
    box-shadow: 0px 0px 5px #00000022;
}

.am-auth-form form legend {
    border: none;
    background: #f9f9f9;
    padding: 1em 1em 1.5em;
}

.am-auth-form div.am-row div.element,
.am-auth-form div.am-row div.am-element-title {
    padding-right: 2em;
    padding-left: 2em;
}

@media all and (min-width:500px) {

    .am-auth-form div.am-row div.am-element-title {
        padding-right: .5em;
    }
    .am-auth-form div.am-row div.am-element {
        padding-left: .5em;
    }
}

.am-popup {
    border-color: var(--am_color_d);
}

.am-popup .am-popup-header {
    background: var(--am_color);
    color: var(--am_color_c);
}

.am-popup .am-popup-close-icon:after {
    color: var(--am_color_c);
}

.am-fb-login-button-wrapper.am-fb-login-form-after:before,
.am-fb-login-button-wrapper.am-fb-login-form-before:after {
    background: var(--am_color);
}

.am-popup .am-fb-login-button-wrapper.am-fb-login-form-after::before,
.am-popup .am-fb-login-button-wrapper.am-fb-login-form-before::after {
    background: white;
}

.am-signup-link {
    color: var(--am_color_c);
}

.am-login-layout-with-sidebar {
    max-width: 800px;
    margin: 2em auto 0;
}

.am-login-layout-with-sidebar .am-login-form-wrapper,
.am-login-layout-with-sidebar .am-sendpass-form-wrapper {
    margin-top: 0;
}

.am-signup-link {
    max-width: 450px;
    margin: 1em auto 0;
}

@media all and (min-width: 800px) {
    .am-login-layout-with-sidebar .am-login-layout-with-sidebar_form {
        float: left;
        width: 65%;
    }
    .am-login-layout-with-sidebar .am-login-layout-with-sidebar_sidebar {
        display: block;
        width: 35%;
        float: right;
        padding-left: 20px;
        box-sizing: border-box;
    }
    .am-login-layout-with-sidebar .am-auth-form {
        margin: 0;
    }
    .am-login-layout-with-sidebar .am-signup-link {
        margin: 1em 0 0;
    }
}
.am-login-layout-with-sidebar .am-login-layout-with-sidebar_sidebar {
    border-radius: 3px;
    padding: 1em 2em;
    max-width: 450px;
    box-sizing: border-box;
    box-shadow: 0 0 5px #00000022;
    background: #f9f9f9;
    color: #555;
}
.am-login-layout-with-sidebar_clear {
    clear: both;
}

@media all and (max-width: 799px) {
    .am-login-layout-with-sidebar .am-login-layout-with-sidebar_sidebar {
        margin: 2em auto 0;
    }
}

ul.am-tabs li.active,
ul.am-tabs li.normal:hover {
    background: var(--am_menu_color);
}

ul.am-tabs li.active > a,
ul.am-tabs li.normal > a:hover {
    border-color: var(--am_menu_color);
}

.am-page-login-no-label .am-auth-form,
.am-page-login-no-label .am-signup-link,
.am-page-login-no-label .am-fb-login-button-wrapper {
    max-width:350px;
}

.am-page-login-no-label .am-auth-form div.am-row div.am-element-title {
    display: none;
}

.am-page-login-no-label .am-auth-form div.am-row div.am-element {
    margin:0;
    padding:.6em 2em;
}

.am-page-login-no-label .am-auth-form div.am-row div.am-element input[type=submit],
.am-page-login-no-label .am-auth-form div.am-row div.am-element input[type=submit]:active,
.am-page-login-no-label .am-auth-form div.am-row div.am-element input[type=submit]:hover,
.am-page-login-no-label .am-auth-form div.am-row div.am-element input[type=submit]:disabled {
    width: 100%;
}

.am-page-login-no-label .am-auth-form .am-form-login-switch-wrapper {
    text-align: center;
    display: block;
    padding: 1.2em 2em .6em;
}

.am-page-login-no-label .am-auth-form .am-form-login-switch-wrapper  .am-form-login-switch {
    margin:0;
}

@media all and (max-width: 799px) {
    .am-page-login-no-label .am-login-layout-with-sidebar .am-login-layout-with-sidebar_sidebar {
        max-width:350px;
        margin: 2em auto 0;
    }
}

.am-body-content input,
.am-body-content textarea,
.am-body-content select,
.am-body-content button,
.am-popup input,
.am-popup textarea,
.am-popup select,
.am-popup button {
    font-family: var(--am_font_family), san-serif;
}

.am-body-content a.button,
.am-body-content button,
.am-body-content input[type="button"],
.am-body-content input[type="submit"],
.am-popup a.button,
.am-popup button,
.am-popup input[type="button"],
.am-popup input[type="submit"],
.am-body-content a.button:hover,
.am-body-content button:hover,
.am-body-content input[type="button"]:hover,
.am-body-content input[type="submit"]:hover,
.am-popup a.button:hover,
.am-popup button:hover,
.am-popup input[type="button"]:hover,
.am-popup input[type="submit"]:hover {
    color: white;
    background: var(--am_btn_color);
    border-color: var(--am_btn_color);
}

.am-body-content input[type=submit]:disabled,
.am-body-content input[type=submit]:disabled:hover,
.am-body-content input[type=button]:disabled,
.am-body-content input[type=button]:disabled:hover,
.am-body-content button:disabled,
.am-body-content button:disabled:hover,
.am-popup input[type=submit]:disabled,
.am-popup input[type=submit]:disabled:hover,
.am-popup input[type=button]:disabled,
.am-popup input[type=button]:disabled:hover
.am-popup button:disabled,
.am-popup button:disabled:hover {
    background: #f1f1f1;
    color: #ccc;
    border-color: #ced4da;
}

.input-file .input-file-button,
.input-file.hover .input-file-button {
    color: white;
    background: var(--am_btn_color);
    border: none;
    text-shadow: none;
}
.input-file.hover {
    border-color: var(--am_btn_color);
}

ul.am-header-menu a {
    color: var(--am_header_menu_link_color);
}

ul.am-header-menu ul a {
    color: var(--am_header_menu_link2_color);
}

ul.am-header-menu > li > a::after {
    background: var(--am_header_menu_link_color);
    opacity: .4;
}

ul.am-header-menu li ul {
    background: var(--am_header_menu_bg_color);
}

.am-grid-wrap .filter-button input[type=submit] {
    border-color: #ced4da;
}
