<?php
function bongdako_shortcode_favorite($atts)
{
    $atts = shortcode_atts(
        array(
            'leagues' => null,
            'nations' => null,
        ),
        $atts
    );
    $leagues = $atts['leagues'];
    $nations = $atts['nations'];

    $saved_bgcolor_result = get_option('bg_color_result');
    $saved_textcolor1_result = get_option('text_color1_result');
    $assets = plugin_dir_url(__FILE__) . '/';
    $assets_root = trailingslashit(dirname(dirname(dirname(plugin_dir_url(__FILE__))))) . 'assets/';
    $font = get_option('typography_main_result', []);
    $bg_iframe = get_option('background_color_result');
    ob_start();
    ?>
    <?php
        static $sport_plugin_result_existed = false;


        echo genDefaultFilterValue($leagues, $nations);

        if (!$sport_plugin_result_existed) {
             ?>
            <link rel="preload" as="style" href="<?= BONGDAKO_BUILD ?>css/assets/css/iframe_favorite.css?v=<?= ASSETS_VERSION ?>" />
            <link rel="stylesheet" href="<?= BONGDAKO_BUILD ?>css/assets/css/iframe_favorite.css?v=<?= ASSETS_VERSION ?>" />
            <script>const d = new Date();d.setTime(d.getTime() + (24 * 60 * 60 * 1000));document.cookie = `six_in_one_type=1; expires=${d.toUTCString()}; path=/`;</script>
           
           
           <?php
            bongdako_banner_assets();
            bongdako_layout_assets();
            add_action('wp_footer', function($assets) {
                $colsHide = 0;
                $colsHid2 = 0;
                if (true == get_option('hide_goc_result', false)) {
                    $colsHide += 1;
                    $colsHid2 += 1;
                }
                if (true == get_option('hide_star_result', false)) {
                    $colsHide += 1;
                }
                bongdako_assets_js();
               ?>
                <script type="module" src="<?= BONGDAKO_BUILD ?>favorite_iframe/assets/js/index.js?v=<?= ASSETS_VERSION ?>" defer></script>
                <script src="<?= BONGDAKO_PLUGIN_DIR_URL ?>/layouts/shortcode/favorite/common.js?v=<?= ASSETS_VERSION ?>" defer></script>
                <script src="<?= BONGDAKO_PLUGIN_DIR_URL ?>/layouts/shortcode/favorite/hide.js?v=<?= ASSETS_VERSION ?>" defer></script>
                <script>
                    document.addEventListener('DOMContentLoaded', function() {
                        setInterval(function () {
                            $("#table_live:not(.euro-view) td.upper-live-title-football.rs.td-bdr").attr("colspan", <?php echo 5 - $colsHide ?>);
                            $("#table_live:not(.euro-view) td.league-title.league-title-ht-title.t").attr("colspan", <?php echo ((true == get_option('Checkbox_hide_action_sp', false)) ? 11:12)  - $colsHide ?>);
                            $("#table_live:not(.euro-view) td.league-title.league-title-ht-title.t").attr("colspan", <?php echo ((true == get_option('Checkbox_hide_action_sp', false)) ? 10:11) - $colsHid2 ?>);
                        }, 1000); // Chờ 1 giây rồi cập nhật
                    });
                </script>
               <?php
            });
    
            $sport_plugin_result_existed = true;
        }
    ?>

    <link href="<?= $assets ?>style.css?v=<?= ASSETS_VERSION ?>" rel="stylesheet">

    <style>
        <?php if ($saved_bgcolor_result): ?>
        #scrollIframe.resultIframe {
            background-color: <?php echo esc_attr($saved_bgcolor_result); ?> !important;
        }

        #scrollIframe.resultIframe #tools {
            background-color: <?php echo esc_attr($saved_bgcolor_result); ?> !important;
        }

        #scrollIframe.resultIframe #mintable {
            background-color: <?php echo esc_attr($saved_bgcolor_result); ?> !important;
        }

        #scrollIframe.resultIframe #appHome {
            background-color: <?php echo esc_attr($saved_bgcolor_result); ?> !important;
        }

        <?php else : ?>
       

        <?php endif; ?>

        <?php if ($saved_textcolor1_result): ?>
        #scrollIframe.resultIframe .football-team-name {
            color: <?php echo esc_attr($saved_textcolor1_result); ?> !important;
        }

        <?php else: ?>
        #scrollIframe.resultIframe .football-team-name {
            color: #070f03 !important;
        }

        <?php endif; ?>
    </style>
    <style>
        #scrollIframe .filterLi2.xz .dropdown-toggle{
            border:0!important;
        }
        #scrollIframe #min .tools{
            padding-top: 1px;
        }
      
        #scrollIframe.wrap-iframe-result *, #scrollIframe.wrap-iframe-result input::placeholder {
            font-family: <?php echo $font['font-family'] ?? ""; ?> !important;
        }


        body #scrollIframe.wrap-iframe-result #min .tools li.filterLi2.xz .dropdown-toggle {
            background: transparent;
        }

        body #scrollIframe.wrap-iframe-result.wrap-iframe,
        body #scrollIframe.wrap-iframe-result .match-list-head,
        body #scrollIframe.wrap-iframe-result.resultIframe #tools,
        body #scrollIframe.wrap-iframe-result.fixture-iframe #tools,
        body #scrollIframe.wrap-iframe-result .Leaguestitle,
        body #scrollIframe.wrap-iframe-result.fixture-iframe #appHome,
        body #scrollIframe.wrap-iframe-result.rate_iframe #appHome,
        body #scrollIframe.wrap-iframe-result.resultIframe #mintable,
        body #scrollIframe.wrap-iframe-result.resultIframe #appHome,
        body #scrollIframe.wrap-iframe-result.fixture-iframe #mintable {
            background: <?php echo !empty($bg_iframe) ? $bg_iframe : '#e6e6e6' ?> !important;
            background-color: <?php echo !empty($bg_iframe) ? $bg_iframe : '#e6e6e6' ?> !important;
        }

        body #scrollIframe.wrap-iframe-result .button-df.active,
        body #scrollIframe.wrap-iframe-result #app6in1 .custom-select-02.show.button-df {
            border: 1px solid <?php echo get_option('background_main_color_result'); ?> !important;
            background: <?php echo get_option('background_main_color_result'); ?> !important;
        }

        body #scrollIframe.wrap-iframe-result .btn-item-now.active,
        body #scrollIframe.wrap-iframe-result .tools .switch-view-btn span.on,
        body #scrollIframe.wrap-iframe-result #min .tools ul li#li_ShowAll.on,
        body #scrollIframe.wrap-iframe-result #min .tools ul li#li_FilterHot.on,
        body #scrollIframe.wrap-iframe-result #min .tools ul li#li_FilterLea.on,
        body #scrollIframe.wrap-iframe-result #min .tools ul li#li_FilterCdi.on,
        body #scrollIframe.wrap-iframe-result #min .tools ul li#li_FilterCdi.active,
        body #scrollIframe.wrap-iframe-result #min .tools ul li#li_ShowAll:hover,
        body #scrollIframe.wrap-iframe-result #min .tools ul li#li_FilterHot:hover,
        body #scrollIframe.wrap-iframe-result #min .tools ul li#li_FilterLea:hover,
        body #scrollIframe.wrap-iframe-result #min .tools ul li#li_FilterCdi:hover,
        body #scrollIframe.wrap-iframe-result #min .tools ul li.on,
        body #scrollIframe.wrap-iframe-result #min .tools ul li.active,
        body #scrollIframe.wrap-iframe-result #min .tools ul li:hover {
            background-color: <?php echo get_option('background_main_color_result'); ?> !important;
        }

        body #scrollIframe.wrap-iframe-result #showFilterBox .rbl .el-radio > input[type=radio]:checked + .el-radio-style {
            background: <?php echo get_option('background_main_color_result'); ?> !important;
        }

        body #scrollIframe.wrap-iframe-result #showoptional2 .bts:nth-of-type(3) span input:checked + label {
            border: 1px solid <?php echo get_option('background_main_color_result'); ?> !important;
            color: <?php echo get_option('background_main_color_result'); ?> !important;
        }

        body #scrollIframe.wrap-iframe-result #table_live tr.tds td .match-state,
        body #scrollIframe.wrap-iframe-result .time-bx,
        body #scrollIframe.wrap-iframe-result #main .idx-homepage td .scored-s.no-score {
            /*color: var(--text_sub_result, #888) !important;*/
        }

        body #scrollIframe.wrap-iframe-result .cup-match-tags a {
            background-color: <?php echo get_option('background_league_color_result'); ?> !important;
            color: <?php echo get_option('text_league_color_result'); ?> !important;
        }

        body #scrollIframe.wrap-iframe-result #app6in1 .button-df:hover {
            border: 1px solid <?php echo get_option('background_main_color_result'); ?> !important;
            background: <?php echo get_option('background_main_color_result'); ?> !important;
        }

        body #scrollIframe.wrap-iframe-result .filter-select-rate,
        body #scrollIframe.wrap-iframe-result .filter-select-company {
            border: 1px solid <?php echo get_option('background_main_color_result'); ?> !important;
        }

        #scrollIframe .tools .switch-view-btn span,
        #scrollIframe.wrap-iframe-result #showoptional2 .bts:nth-of-type(3) span input:checked + label {
            color: <?php echo get_option('background_main_color_result'); ?> !important;
        }

        #scrollIframe.wrap-iframe-result #showoptional2 .bts:nth-of-type(3) span input:checked + label {
            border: 1px solid <?php echo get_option('background_main_color_result'); ?> !important;
        }

        #scrollIframe .tools .switch-view-btn span.on {
            color: #ffffff !important;
        }

        body #scrollIframe.wrap-iframe-result .live-match .odds.normal,
        body #scrollIframe.wrap-iframe-result .bet-match-item-repeated:nth-child(2n) .bet-match-item .odds.normal,
        body #scrollIframe.wrap-iframe-result #table_live .odds1,
        body #scrollIframe.wrap-iframe-result #table_live .odds2,
        body #scrollIframe.wrap-iframe-result #table_live .odds3,
        body #scrollIframe.wrap-iframe-result #homepage .game-rate #game-rate .container-sp .table-core-odds-value .odds-number,
        body #scrollIframe.wrap-iframe-result .odds-bg.odds-normal > span,
        body #scrollIframe.wrap-iframe-result #game-rate .odds-number,
        body #scrollIframe.wrap-iframe-result .odds.normal {
            background: <?php echo get_option('background_odd_color_result'); ?> !important;
            background-color: <?php echo get_option('background_odd_color_result'); ?> !important;
        }

        body #scrollIframe.wrap-iframe-result .odds:hover {
            background: <?php echo get_option('background_odd_hover_result'); ?> !important;
        }

        body #scrollIframe.wrap-iframe-result .btn-item-now.active,
        body #scrollIframe.wrap-iframe-result #min .tools ul li:hover span,
        body #scrollIframe.wrap-iframe-result #filter-box-on-pc .filter-third > div #selectLeague:hover .custom-select,
        body #scrollIframe.wrap-iframe-result #filter-box-on-pc .filter-third > div.custom-select-02:hover .custom-select {
            color: #ffffff !important;
        }

        body #scrollIframe.wrap-iframe-result .odds.down,
        body #scrollIframe.wrap-iframe-result #table_live .odds1.resultColor,
        body #scrollIframe.wrap-iframe-result #table_live .odds2.resultColor,
        body #scrollIframe.wrap-iframe-result .odds2 > span.down,
        body #scrollIframe.wrap-iframe-result .odds-bg.odds-normal > span.down,
        body #scrollIframe.wrap-iframe-result #table_live .new-home-tr .odds1.odds-down,
        body #scrollIframe.wrap-iframe-result #table_live .new_oddsChangePopup .popup-odds-change .odds-down,
        body #scrollIframe.wrap-iframe-result #homepage .game-rate #game-rate .container-sp .table-core-odds-value .odds-number.odds-down,
        body #scrollIframe.wrap-iframe-result #game-rate .odds-number.odds-down {
            background: <?php echo get_option('background_odd_down_result'); ?> !important;
            background-color: <?php echo get_option('background_odd_down_result'); ?> !important;
        }

        html body #scrollIframe.wrap-iframe-result.wrap-iframe .mcontent .table-view .league-item .bet-match-list .bet-match-item-repeated .bet-match-item .bet-match-item-child .odds-title-item .odds.normal.down:hover {
            background: <?php echo get_option('background_odd_down_hover_result'); ?> !important;
        }

        body #scrollIframe.wrap-iframe-result .odds.up,
        body #scrollIframe.wrap-iframe-result #table_live .odds3.resultColor,
        body #scrollIframe.wrap-iframe-result .odds-bg.odds-normal > span.up,
        body #scrollIframe.wrap-iframe-result #table_live .new-home-tr .odds1.odds-up,
        body #scrollIframe.wrap-iframe-result #homepage .game-rate #game-rate .container-sp .table-core-odds-value .odds-number.odds-up,
        body #scrollIframe.wrap-iframe-result #table_live .new_oddsChangePopup .popup-odds-change .odds-up,
        body #scrollIframe.wrap-iframe-result .odds2 > span.up,
        body #scrollIframe.wrap-iframe-result #game-rate .odds-number.odds-up {
            background: <?php echo get_option('background_odd_up_result'); ?> !important;
            background-color: <?php echo get_option('background_odd_up_result'); ?> !important;
        }

        html body #scrollIframe.wrap-iframe-result.wrap-iframe .mcontent .table-view .league-item .bet-match-list .bet-match-item-repeated .bet-match-item .bet-match-item-child .odds-title-item .odds.normal.up:hover {
            background: <?php echo get_option('background_odd_up_hover_result'); ?> !important;
        }

        body #scrollIframe.wrap-iframe-result .live-status {
            color: <?php echo get_option('text_live_color_result'); ?> !important;
        }

        body #scrollIframe.wrap-iframe-result .score-lst .score,
        body #scrollIframe.wrap-iframe-result .handpoint.score-color b.match-finished,
        body #scrollIframe.wrap-iframe-result #main .idx-homepage td.score-color b,
        body #scrollIframe.wrap-iframe-result #main .idx-homepage .handpoint.score-color b.match-not-finished {
            color: <?php echo get_option('text_score_color_result'); ?> !important;
        }

        body #scrollIframe.wrap-iframe-result .match-during-time.running {
            color: <?php echo get_option('text_time_color_result'); ?> !important;
        }

        body #scrollIframe.wrap-iframe-result .toggle-bet {
            background: <?php echo get_option('background_button_more_bet_color_result'); ?> !important;
        }

        body #scrollIframe.wrap-iframe-result .toggle-bet > div,
        body #scrollIframe.wrap-iframe-result .toggle-bet span {
            color: <?php echo get_option('background_main_color_result'); ?> !important;
        }

        #scrollIframe.wrap-iframe-result .toggle-bet.active > div, #scrollIframe.wrap-iframe-result .toggle-bet.active span {
            color: #fff !important;
        }

        #scrollIframe.wrap-iframe-result #min .tools li span,
        body #scrollIframe.wrap-iframe-result.wrap-iframe,
        #scrollIframe.wrap-iframe-result #mintable td.inclfuded-ht-title .custom-select-02 .custom-options .custom-option,
        body #scrollIframe.wrap-iframe-result .odds-title-item,
        body #scrollIframe.wrap-iframe-result .team-box > a,
        body #scrollIframe.wrap-iframe-result #table_live .upper-live-titlez td,
        body #scrollIframe.wrap-iframe-result #table_live tr.upper-live-title td,
        body #scrollIframe.wrap-iframe-result #table_live #CompanySel #dropSelect,
        body #scrollIframe.wrap-iframe-result #table_live tr td,
        body #scrollIframe.wrap-iframe-result #table_live tr:not(.Leaguestitle):not(.scoretitle) td[name="timeData"],
        body #scrollIframe.wrap-iframe-result .filterLi2.xz .dropdown-toggle,
        body #scrollIframe.wrap-iframe-result #table_live tr.scoretitle td,
        body #scrollIframe.wrap-iframe-result #min .tools li,
        body #scrollIframe.wrap-iframe-result #game-rate .table-score-container .odds-name,
        body #scrollIframe.wrap-iframe-result #game-rate span.text-uppercase,
        body #scrollIframe.wrap-iframe-result #main #table_live tr[id^=tr1_] td.toolimg span,
        body #scrollIframe.wrap-iframe-result #table_live .status-time-match span,
        body #scrollIframe.wrap-iframe-result #main #table_live tr[id^=tr1_].tds td[id^=ht_] a,
        body #scrollIframe.wrap-iframe-result #main #table_live tr[id^=tr1_].tds td[id^=gt_] a,
        body #scrollIframe.wrap-iframe-result.fixture-iframe #table_live tr.tds td,
        body #scrollIframe.wrap-iframe-result #fixture_iframe .team-name,
        body #scrollIframe.wrap-iframe-result #main #tableCoreSP .status-time-match {
            color: <?php echo get_option('text_main_color_result'); ?> !important;
        }

        body #scrollIframe.wrap-iframe-result .odds,
        body #scrollIframe.wrap-iframe-result #table_live .odds1,
        body #scrollIframe.wrap-iframe-result #table_live .odds2,
        body #scrollIframe.wrap-iframe-result #table_live .odds3,
        body #scrollIframe.wrap-iframe-result #homepage .game-rate #game-rate .container-sp .table-core-odds-value .odds-number,
        body #scrollIframe.wrap-iframe-result .odds-bg.odds-normal > span,
        body #scrollIframe.wrap-iframe-result #table_live .new-home-tr .odds1.odds-down,
        body #scrollIframe.wrap-iframe-result #table_live .new-home-tr .odds1.odds-up,
        body #scrollIframe.wrap-iframe-result #table_live .new_oddsChangePopup .popup-odds-change .odds-up,
        body #scrollIframe.wrap-iframe-result #table_live .new_oddsChangePopup .popup-odds-change .odds-down,
        body #scrollIframe.wrap-iframe-result #game-rate .odds-number {
            color: <?php echo get_option('text_odd_color_result'); ?> !important;
        }

        #scrollIframe #min .tools ul li.on span {
            color: #ffffff !important;
        }

        body #scrollIframe.wrap-iframe-result .league-name,
        body #scrollIframe.wrap-iframe-result.resultIframe .football-team-name,
        body #scrollIframe.wrap-iframe-result.fixture-iframe .football-team-name,
        body #scrollIframe.wrap-iframe-result .football-team-name,
        body #scrollIframe.wrap-iframe-result .LGname,
        body #scrollIframe.wrap-iframe-result.rate_iframe .football-team-name {
            color: <?php echo get_option('text_title_league_color_result'); ?> !important;
        }

        body #scrollIframe.wrap-iframe-result #homepage .game-rate #live #tr_upper-live-title td {
            background: <?php echo get_option('background_item_2_color_result'); ?> !important;
        }

        body #scrollIframe.wrap-iframe-result .wrap-loadmore .load-more-btn {
            background-color: <?php echo get_option('background_main_color_result'); ?> !important;
            background-image: url('/wp-content/plugins/sport-plugin/assets/images/double-alt-arrow-down.svg');
            background-repeat: no-repeat;
            background-position: right 20px top 6px;
        }

        body #scrollIframe.wrap-iframe-result .ods-detail-item {
            background: <?php echo get_option('background_more_bet_color_result'); ?> !important;
        }

        body #scrollIframe.wrap-iframe-result .toggle-bet.active,
        body #scrollIframe.wrap-iframe-result #game-rate .btn-live-chanel,
        body #scrollIframe.wrap-iframe-result #homepage .game-rate #live .btn-live {
            background: <?php echo get_option('background_main_color_result'); ?> !important;
        }

        body .score-detail .secont-half,
        body #scrollIframe.wrap-iframe-result #table_live .corner-text {
            color: <?php echo get_option('text_score_corner_color_result'); ?> !important;
        }

        body #scrollIframe.wrap-iframe-result #table_live tr.tds td,
        body #scrollIframe.wrap-iframe-result #table_live tr:not(.Leaguestitle):not(.scoretitle),
        body #scrollIframe.wrap-iframe-result .league-item-head,
        body #scrollIframe.wrap-iframe-result .bet-match-item-repeated .bet-match-item,
        body #scrollIframe.wrap-iframe-result #table_live .upper-live-titlez,
        body #scrollIframe.wrap-iframe-result #table_live tr.scoretitle td,
        body #scrollIframe.wrap-iframe-result #game-rate .core-container,
        body #scrollIframe.wrap-iframe-result #game-rate #tableCore,
        body #scrollIframe.wrap-iframe-result #main #table_live tr[id^=tr1_],
        body #scrollIframe.wrap-iframe-result .match-box {
            background-color: <?php echo get_option('background_item_color_result'); ?> !important;
            background: <?php echo get_option('background_item_color_result'); ?> !important;
        }

        body #scrollIframe.wrap-iframe-result .bet-match-item-repeated:nth-child(2n) .bet-match-item,
        body #scrollIframe.wrap-iframe-result #main .idx-homepage #table_live tr[id^=tr1_] .league-detail-mobile,
        body #scrollIframe.wrap-iframe-result #main .idx-favorite #table_live tr[id^=tr1_] .league-detail-mobile {
            background: <?php echo get_option('background_item_2_color_result'); ?> !important;
            background-color: <?php echo get_option('background_item_2_color_result'); ?> !important;
        }

        body #scrollIframe.wrap-iframe-result .grey,
        body #scrollIframe.wrap-iframe-result .odds.no-bg,
        body #scrollIframe.wrap-iframe-result .odds.no-bg.down {
            color: <?php echo get_option('text_odd_option_color_result'); ?> !important;
        }

        body #scrollIframe.wrap-iframe-result .team-hg, #scrollIframe .bftab .rank,
        body #scrollIframe.wrap-iframe-result #main #table_live .new-home-tr .odds1::before,
        body #scrollIframe.wrap-iframe-result #homepage .game-rate #game-rate .container-sp .table-core-odds-value .odds-number::before,
        body #scrollIframe.wrap-iframe-result #main #table_live tr[id^=tr1_].tds .status-time-sched {
            color: <?php echo get_option('text_sub_color_result'); ?> !important;
        }

        #scrollIframe .filterLi2.xz .dropdown-menu .dropdown-menu-inner .option.active, #scrollIframe .filterLi2.xz .dropdown-menu .dropdown-menu-inner .option:hover {
            color: <?php echo get_option('text_drop_color_result'); ?> !important;
            background-color: <?php echo get_option('background_drop_color_result'); ?> !important;
        }

        @media (min-width: 1001px) {
        <?php if (get_option('tags_cup_result') === "medium"){?>
            #scrollIframe .cup-match-tags a {
                font-size: 13px;
                line-height: 16px;
                padding: 6px 9px;
            }

        <?php }?>
        <?php if (get_option('tags_cup_result') === "small"){?>
            #scrollIframe .cup-match-tags a {
                font-size: 12px;
                line-height: 14px;
                padding: 5px 7px;
            }

        <?php }?>

        <?php if (get_option('search_team_result') === "medium"){?>
            #scrollIframe #iframe_6in1 .filter-box .filter-search-row .filter-search-name input {
                padding: 6px 12px 5px;
            }

            #scrollIframe .filter-search-name input {
                padding: 12px;
                line-height: 16px;
                font-size: 12px;
            }

        <?php }?>
        <?php if (get_option('search_team_result') === "small"){?>

            #scrollIframe #iframe_6in1 .filter-box .filter-search-row .filter-search-name input {
                padding: 5px 10px;
            }

            #scrollIframe .filter-search-name input {
                padding: 10px;
                line-height: 14px;
                font-size: 10px;
            }

        <?php }?>

        <?php if (get_option('search_league_result') === "medium"){?>
            #scrollIframe #iframe_6in1 .filter-box .filter-search-row .filter-cup-match .filter-cup-match-box {
                height: 28px;
                padding: 5px 10px;
            }

            #scrollIframe .filter-cup-match .custom-select-02 .custom-select {
                font-size: 12px;
            }

            #scrollIframe .sixmix-container .filter-box #sixinoneFilterLeague {
                top: 32px;

            }

        <?php }?>
        <?php if (get_option('search_league_result') === "small"){?>

            #scrollIframe #iframe_6in1 .filter-box .filter-search-row .filter-cup-match .filter-cup-match-box {
                height: 26px;
                padding: 5px 10px;
            }

            #scrollIframe .filter-cup-match .custom-select-02 .custom-select {
                font-size: 10px;
            }

            #scrollIframe .sixmix-container .filter-box #sixinoneFilterLeague {
                top: 30px;

            }

        <?php }?>

        <?php if (get_option('odd_1_1_result') > 0){?>
            #scrollIframe #result_iframe #table_live tr.tds td {
                min-width: <?php echo get_option('odd_1_1_result') ?>px;
            }

        <?php }?>
            #scrollIframe #table_live tr {
                height: <?php echo get_option('league-item-head_result');?>
            }

        <?php if (get_option('filter_date_result') === "medium"){?>
            #scrollIframe .btn-item-now, #scrollIframe .btn-item-now.ttnow {
                padding: 6px;
            }

            #scrollIframe .filter-select-rate, #scrollIframe .filter-select-company {

                font-size: 12px;

                line-height: 22px;
                padding: 6px 10px;

            }

        <?php }?>
        <?php if (get_option('filter_date_result') === "small"){?>

            #scrollIframe .btn-item-now, #scrollIframe .btn-item-now.ttnow {
                padding: 4px;
                min-height: 20px;
            }

            #scrollIframe .filter-select-rate, #scrollIframe .filter-select-company {
                font-size: 10px;
                line-height: 18px;
                padding: 5px 8px;

            }

        <?php }?>
        <?php if (get_option('team_home_result')){?>
            #scrollIframe.wrap-iframe [id^="ht_"], #scrollIframe.wrap-iframe [id^="ht_"] .team-box {
                max-width: <?php echo get_option('team_home_result')?>px !important;
                min-width: <?php echo get_option('team_home_result')?>px !important;
                width: <?php echo get_option('team_home_result')?>px !important;
            }

        <?php }?>
        <?php if (get_option('team_guest_result')){?>
            #scrollIframe.wrap-iframe [id^="gt_"], #scrollIframe.wrap-iframe [id^="gt_"] .team-box {
                max-width: <?php echo get_option('team_guest_result')?>px !important;
                min-width: <?php echo get_option('team_guest_result')?>px !important;
                width: <?php echo get_option('team_guest_result')?>px !important;
            }

        <?php }?>
        <?php if (get_option('tg_result')){?>
            #scrollIframe #main .idx-resultpage .status-time-sched span {
                font-size: <?php echo get_option('tg_result')?> !important;
            }

        <?php }?>
        <?php if (get_option('ti_so_result')){?>
            #scrollIframe td.score-color b {
                font-size: <?php echo get_option('ti_so_result')?> !important;
            }

        <?php }?>
        <?php if (get_option('goc_result')){?>
            #scrollIframe .secont-half.text-center.w-100-i {
                font-size: <?php echo get_option('goc_result')?> !important;
            }

        <?php }?>
        <?php if (get_option('gd_result')){?>
            #scrollIframe .football-team-name {
                font-size: <?php echo get_option('gd_result')?> !important;
            }

        <?php }?>
        <?php if (get_option('action_size_result') === "lager"){?>
            #scrollIframe .icon-14 {
                width: 18px;
                height: 18px;
            }

            #scrollIframe .icon-16 {
                width: 20px;
                height: 20px;
            }

            #scrollIframe #table_live .analyze-icon::before, #scrollIframe #table_live .Detail-icon::before, #scrollIframe #table_live .analyze-icon::before {
                background-size: 20px;
            }

        <?php }?>
        <?php if (get_option('action_size_result') === "small"){?>

            #scrollIframe .icon-14 {
                width: 12px;
                height: 12px;
            }

            #scrollIframe .icon-16 {
                width: 14px;
                height: 14px;
            }

            #scrollIframe #table_live .analyze-icon::before, #scrollIframe #table_live .Detail-icon::before, #scrollIframe #table_live .analyze-icon::before {
                background-size: 14px;
            }

        <?php }?>


        <?php if ( true == get_option( 'hide_star_result', false ) ) : ?>
            body #scrollIframe.wrap-iframe-result #main #table_live:not(.euro-view) tr[id^=tr1_] > td:first-child,
            body #scrollIframe.wrap-iframe-result #table_live:not(.euro-view) .Leaguestitle > td:first-child,
            #scrollIframe.wrap-iframe-result #table_live:not(.euro-view) tr:not(.Leaguestitle):not(.scoretitle):not(.tr-banner):not(.upper-live-title) > td:first-child {
                display: none !important;
            }

        <?php endif; ?>

        <?php if ( true == get_option( 'hide_goc_result', false ) ) : ?>
            body #scrollIframe.wrap-iframe-result #main #table_live:not(.euro-view) tr[id^=tr1_] > td:nth-child(7),
            body #scrollIframe.wrap-iframe-result #table_live:not(.euro-view) .upper-live-titlez > td:nth-child(5) {
                display: none !important;
            }

        <?php endif; ?>
        }

        #scrollIframe #showFilterBox .rbl .el-radio {
            width: 50%;
        }

        #scrollIframe .hidden-info-match:hover:after {
            content: "<?php esc_html_e('Ẩn lại giải đấu này', 'sport') ?>";
        }

        #scrollIframe .show-info-match:hover:after {
            content: "<?php esc_html_e('Hiển thị giải đấu này', 'sport') ?>";
        }

        /*body #scrollIframe .idx-resultpage #table_live .action-table.toolimg.be-change-ht-title span {*/
        /*    pointer-events: none;*/
        /*}*/

        #scrollIframe .add-info-l:hover:after, #scrollIframe .add-info:hover:after, #scrollIframe .remove-league-icon:hover:after {
            display: none !important;
        }

        .select-all {
            min-width: 135px !important;
        }

        
        body #scrollIframe.wrap-iframe-result .filterLi2.xz .dropdown-toggle:hover {
                background: unset !important;
        }

    </style>
    <?php
    $timestamp = time();
    $url_api_result = DB_DOMAIN.'/gf/data/finish/bf_th1.js?' . $timestamp;
    $matches = bongdako_fetch_and_merge_data($url_api_result);
    $maxOption = get_option('max_leagues_result');
    $number_match = !empty($maxOption) ? $maxOption : 10;
    ?>
    <div id="scrollIframe" class="wrap-iframe resultIframe page-has-tool wrap-iframe-result tm_12-scroll tm_12-result-wrapper">
        <div id="soccer" class="tm_12-soccer">
            <div id="homepage" class="mcontent tm_12-homepage tm_12-content">
                <div id="main" class="main-home-page-mobile tm_12-main tm_12-mobile">
                    <div id="appHome" class="w-100 mx-auto tm_12-appHome tm_12-center">
                        <div id="favorite_iframe" class="index idx-resultpage css-home-page home-page-mobile ac2-<?php echo (int)(true == get_option('Checkbox_hide_action_sp', false)); ?> tm_12-favorite tm_12-iframe tm_12-result">
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>


    <?php
    $content = ob_get_contents();
    ob_end_clean();
    return $content;
}

add_shortcode('bongdako_favorite', 'bongdako_shortcode_favorite');