<div class="std-settings-each-section" data-tab="custom" style="display:none;">
    <div class="std-field-wrap">
        <label><?php esc_html_e('Enable Custom Styles', 'subscribe-to-download'); ?></label>
        <div class="std-field">
            <input type="checkbox" name="form_details[custom][custom_style]" value="1" <?php echo (!empty($form_details['custom']['custom_style'])) ? 'checked="checked"' : ''; ?> class="std-checkbox-toggle-trigger" data-toggle-class="std-custom-style-enabled"/>
        </div>
    </div>
    <?php $custom_style_enable = (!empty($form_details['custom']['custom_style'])) ? 1 : 0; ?>
    <div class="std-custom-style-enabled" <?php $this->display_none($custom_style_enable, 1); ?>>
        <div class="std-field-wrap">
            <label><?php esc_html_e('Text Color', 'subscribe-to-download'); ?></label>
            <div class="std-field">
                <input class="std-color-picker" type="text" name="form_details[custom][text_color]" value="<?php echo (!empty($form_details['custom']['text_color'])) ? esc_attr($form_details['custom']['text_color']) : ''; ?>"/>
            </div>
        </div>
        <div class="std-field-wrap">
            <label><?php esc_html_e('Button Background Color', 'subscribe-to-download'); ?></label>
            <div class="std-field">
                <input class="std-color-picker" type="text" name="form_details[custom][button_background_color]" value="<?php echo (!empty($form_details['custom']['button_background_color'])) ? esc_attr($form_details['custom']['button_background_color']) : ''; ?>"/>
            </div>
        </div>
        <div class="std-field-wrap">
            <label><?php esc_html_e('Button Text Color', 'subscribe-to-download'); ?></label>
            <div class="std-field">
                <input class="std-color-picker" type="text" name="form_details[custom][button_text_color]" value="<?php echo (!empty($form_details['custom']['button_text_color'])) ? esc_attr($form_details['custom']['button_text_color']) : ''; ?>"/>
            </div>
        </div>
        <div class="std-field-wrap">
            <label><?php esc_html_e('Button Hover Color', 'subscribe-to-download'); ?></label>
            <div class="std-field">
                <input class="std-color-picker" type="text" name="form_details[custom][button_hover_color]" value="<?php echo (!empty($form_details['custom']['button_hover_color'])) ? esc_attr($form_details['custom']['button_hover_color']) : ''; ?>"/>
            </div>
        </div>

        <div class="std-field-wrap">
            <label><?php esc_html_e('Button Hover Text Color', 'subscribe-to-download'); ?></label>
            <div class="std-field">
                <input class="std-color-picker" type="text" name="form_details[custom][button_hover_text_color]" value="<?php echo (!empty($form_details['custom']['button_hover_text_color'])) ? esc_attr($form_details['custom']['button_hover_text_color']) : ''; ?>"/>
            </div>
        </div>
        <div class="std-field-wrap">
            <label><?php esc_html_e('Loader Color', 'subscribe-to-download'); ?></label>
            <div class="std-field">
                <input class="std-color-picker" type="text" name="form_details[custom][loader_color]" value="<?php echo (!empty($form_details['custom']['loader_color'])) ? esc_attr($form_details['custom']['loader_color']) : ''; ?>"/>
            </div>
        </div>
        <div class="std-field-wrap">
            <label><?php esc_html_e('Background Type', 'subscribe-to-download'); ?></label>
            <div class="std-field">
                <select name="form_details[custom][background_type]" data-toggle-class='std-background-ref' class="std-toggle-trigger">
                    <?php $selected_background_type = (!empty($form_details['custom']['background_type'])) ? $form_details['custom']['background_type'] : ''; ?>
                    <option value=""><?php esc_html_e('Default', 'subscribe-to-download'); ?></option>
                    <option value="color" <?php selected($selected_background_type, 'color'); ?>><?php esc_html_e('Color', 'subscribe-to-download'); ?></option>
                    <option value="image" <?php selected($selected_background_type, 'image'); ?>><?php esc_html_e('Image', 'subscribe-to-download'); ?></option>
                </select>
            </div>
        </div>
        <div class="std-field-wrap std-background-ref" data-toggle-ref='color' <?php $this->display_none($selected_background_type, 'color'); ?>>
            <label><?php esc_html_e('Background Color', 'subscribe-to-download'); ?></label>
            <div class="std-field">
                <input type="text" name="form_details[custom][background_color]" class="std-color-picker" value="<?php echo (!empty($form_details['custom']['background_color'])) ? esc_attr($form_details['custom']['background_color']) : ''; ?>"/>
            </div>
        </div>
        <div class="std-background-ref" data-toggle-ref='image' <?php $this->display_none($selected_background_type, 'image'); ?>>
            <div class="std-field-wrap">
                <label><?php esc_html_e('Background Image', 'subscribe-to-download'); ?></label>
                <div class="std-field">
                    <input type="text" name="form_details[custom][background_image]" value="<?php echo (!empty($form_details['custom']['background_image'])) ? esc_url($form_details['custom']['background_image']) : ''; ?>"/>
                    <input type="hidden" name="form_details[custom][background_image_id]" value="<?php echo (!empty($form_details['custom']['background_image_id'])) ? intval($form_details['custom']['background_image_id']) : ''; ?>"/>
                    <input type="button" class="button-secondary std-file-uploader" value="<?php esc_html_e('Upload Image', 'subscribe-to-download'); ?>"/>
                    <div class="std-image-preview"><?php
                        if (!empty($form_details['custom']['background_image']) && !empty($form_details['custom']['background_image_id'])) {
                            $thumb_url = wp_get_attachment_thumb_url($form_details['custom']['background_image_id']);
                            ?>
                            <img src="<?php echo esc_url($thumb_url) ?>"/>
                            <?php
                        }
                        ?>
                    </div>
                </div>
            </div>
        </div>
        <div class="std-display-type" data-toggle-ref='popup' <?php $this->display_none($selected_display_type, 'popup') ?>>
            <div class="std-field-wrap">
                <label><?php esc_html_e('Popup Button Text Color', 'subscribe-to-download'); ?></label>
                <div class="std-field">
                    <input class="std-color-picker" type="text" name="form_details[custom][popup_button_text_color]" value="<?php echo (!empty($form_details['custom']['popup_button_text_color'])) ? esc_attr($form_details['custom']['popup_button_text_color']) : ''; ?>"/>
                </div>
            </div>
            <div class="std-field-wrap">
                <label><?php esc_html_e('Popup Button Background Color', 'subscribe-to-download'); ?></label>
                <div class="std-field">
                    <input class="std-color-picker" type="text" name="form_details[custom][popup_button_background_color]" value="<?php echo (!empty($form_details['custom']['popup_button_background_color'])) ? esc_attr($form_details['custom']['popup_button_background_color']) : ''; ?>"/>
                </div>
            </div>
            <div class="std-field-wrap">
                <label><?php esc_html_e('Popup Button Hover Color', 'subscribe-to-download'); ?></label>
                <div class="std-field">
                    <input class="std-color-picker" type="text" name="form_details[custom][popup_button_hover_color]" value="<?php echo (!empty($form_details['custom']['popup_button_hover_color'])) ? esc_attr($form_details['custom']['popup_button_hover_color']) : ''; ?>"/>
                </div>
            </div>
            <div class="std-field-wrap">
                <label><?php esc_html_e('Popup Button Hover Background Color', 'subscribe-to-download'); ?></label>
                <div class="std-field">
                    <input class="std-color-picker" type="text" name="form_details[custom][popup_button_hover_background_color]" value="<?php echo (!empty($form_details['custom']['popup_button_hover_background_color'])) ? esc_attr($form_details['custom']['popup_button_hover_background_color']) : ''; ?>"/>
                </div>
            </div>
        </div>
    </div>
    <div class="std-field-wrap">
        <label><?php esc_html_e('Custom CSS', 'subscribe-to-download'); ?></label>
        <div class="std-field">
            <textarea name="form_details[custom][custom_css]"><?php echo (!empty($form_details['custom']['custom_css'])) ? $this->output_converting_br($form_details['custom']['custom_css']) : ''; ?></textarea>
        </div>
    </div>
</div>
