/**
 * Elementor Alert Boxes
 */

/** ALL ALERTS **/
.elementor-widget-icon-box.iconbox-lightbulb .elementor-widget-container,
.elementor-widget-icon-box.iconbox-note .elementor-widget-container,
.elementor-widget-icon-box.iconbox-reminder .elementor-widget-container {
	padding: 20px;
	border: 0;
	box-shadow: 0 0 10px rgba(0,0,0,0.5);
}

/* Titles */
.elementor-widget-icon-box.iconbox-lightbulb .elementor-icon-box-title,
.elementor-widget-icon-box.iconbox-note .elementor-icon-box-title,
.elementor-widget-icon-box.iconbox-reminder .elementor-icon-box-title {
	margin-bottom: 8px;
}

/* Descriptions */
.elementor-widget-icon-box.iconbox-lightbulb .elementor-icon-box-content .elementor-icon-box-description,
.elementor-widget-icon-box.iconbox-note .elementor-icon-box-content .elementor-icon-box-description,
.elementor-widget-icon-box.iconbox-reminder .elementor-icon-box-content .elementor-icon-box-description {
	color: #000;
}

/* Icons */
.elementor-widget-icon-box.iconbox-lightbulb .elementor-icon,
.elementor-widget-icon-box.iconbox-note .elementor-icon,
.elementor-widget-icon-box.iconbox-reminder .elementor-icon {
	font-size: 35px;
}

/** LIGHTBULB ALERTS (blue) **/
.elementor-widget-icon-box.iconbox-lightbulb .elementor-widget-container {
	background: #0396d424;
}
.elementor-widget-icon-box.iconbox-lightbulb .elementor-icon-box-content .elementor-icon-box-title {
	color: #0396d4;
}
.elementor-widget-icon-box.iconbox-lightbulb .elementor-icon {
	fill: #0396d4;
	color: #0396d4;
	border-color: #0396d4;
}

/** REMINDER ALERTS (green) **/
.elementor-widget-icon-box.iconbox-reminder .elementor-widget-container {
	background: #00ff0618;
}
.elementor-widget-icon-box.iconbox-reminder .elementor-icon-box-content .elementor-icon-box-title {
	color: #23A455;
}
.elementor-widget-icon-box.iconbox-reminder .elementor-icon {
	fill: #23A455;
	color: #23A455;
	border-color: #23A455;
}

/** NOTE ALERTS (red) **/
.elementor-widget-icon-box.iconbox-note .elementor-widget-container {
	background: #f704041a;
}
.elementor-widget-icon-box.iconbox-note .elementor-icon-box-content .elementor-icon-box-title {
	color: #f70404;
}
.elementor-widget-icon-box.iconbox-note .elementor-icon {
	fill: #f70404;
	color: #f70404;
	border-color: #f70404;
}
/**
 * Uncanny Toolkit Pro - Enhanced Course Grid
 * Remove headings from the Course grid
 */
.uo-ultp-grid-container .uo-grid-wrapper.sfwd-lessons h3.grid-course.grid-section {
	display: none !important;
}

.learndash-wrapper .ld-breadcrumbs, .learndash-wrapper .ld-course-status.ld-course-status-enrolled {
	display: flex !important;
}

/**
 * Uncanny Toolkit Pro - Enhanced Lesson/Topic Grid
 * Add padding to the grid
 */
.uo-ultp-grid-container {
    padding-left: 25px !important;
    padding-right: 25px !important;
}

/**
 * Remove LD Focus Mode Top Navigation
 */
.ld-content-actions {
	display: none !important;
}
}

/**
 * LearnDash Auto Complete Course Lessons and Topics
 */
add_action( 'template_redirect', function() {
 
    // Comma sperated course_ids to exclude from logic;
    $excluded_courses = array();
 
    $user_id = get_current_user_id();
    if ( ! $user_id ) {
        return false;
    }
 
    /**
     * Never trust the global $post object. Too many plugins 
     * override this with no WP_Post content.
     */
    $current_step_id = get_the_ID();
    if ( empty( $current_step_id ) ) {
        return false;
    }
 
    // Get the current course step POST and make sure it is one from LD.
    $current_step_post = get_post( $current_step_id );
    if ( ( ! $current_step_post ) || ( ! is_a( $current_step_post, 'WP_Post' ) ) || ( ! in_array( $current_step_post->post_type, learndash_get_post_types( 'course_steps' ) ) ) ) {
        return false;
    }
 
    // Check that the current user has access.
    if ( ! sfwd_lms_has_access( $current_step_id, $user_id ) ) {
        return false;
    }
 
    // Get the course step
    $course_id = learndash_get_course_id(); 
    if ( ! $course_id ) {
        return false;
    }
 
    // Check that we are not excluding this course.
    if ( in_array( $course_id, $excluded_courses ) ) {
        return false;
    }
 
    /**
     * Get the Mark Complete form/button.
     * If this does NOT return empty then the mark complete
     * button would be shown on the page to the user. We use
     * that to know if we can automatically mark the step
     * complete here.
     */
    $mark_html = learndash_mark_complete( $current_step_post );
    if ( ! empty( $mark_html ) ) {
        return learndash_process_mark_complete( $user_id, $current_step_id );
    }
 
    return false;
});

add_filter( 'jetpack_blaze_enabled', '__return_false' );