<?php
global $ref_link;
$ref_link = get_field('referral_link', 'option');
$header_logo = get_field('header_logo', "option");
$icon_flag = get_field('icon_flag', "option");
?>
<!DOCTYPE html>
<html lang="<?php echo get_locale(); ?>">

<head>
	<meta name="google-site-verification" content="5whZs6QpA8UQhD_htLU1W_IMx9cSQWnC_OUzkBoUqCs" />
    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1" />
    <meta http-equiv="x-ua-compatible" content="IE=edge" />
    <link href="<?php echo get_template_directory_uri(); ?>/assets/css/reset.css" rel="stylesheet" type="text/css" />
    <link href="<?php echo get_template_directory_uri(); ?>/assets/css/main.css" rel="stylesheet" type="text/css" />
    <link href="<?php echo get_template_directory_uri(); ?>/assets/css/responsive.css" rel="stylesheet" type="text/css" />
    <?php wp_head(); ?>
</head>

<body>
    <div class="container main__container">
        <header class="header">
            <button class="header__button-menu">
                <span class="header__navicon"></span>
            </button>
            <a href="<?php echo get_home_url() ?>" class="logo header__logo">
                <img src="<?php echo esc_url($header_logo['url']); ?>" alt="<?php echo esc_attr($header_logo['alt']); ?>" title="<?php echo esc_attr($header_logo['title']); ?>" />
            </a>
            <nav class="menu header__menu">
                <?php
                $link_bonus   = get_permalink(pll_get_post(1460, pll_current_language()));
                $title_bonus  = get_the_title(pll_get_post(1460, pll_current_language()));
                $link_free   = get_permalink(pll_get_post(1390, pll_current_language()));
                $title_free  = get_the_title(pll_get_post(1390, pll_current_language()));
                $link_app   = get_permalink(pll_get_post(1440, pll_current_language()));
                $title_app  = get_the_title(pll_get_post(1440, pll_current_language()));
                $link_games   = get_permalink(pll_get_post(717, pll_current_language()));
                $title_games  = get_the_title(pll_get_post(717, pll_current_language()));
                $link_login   = get_permalink(pll_get_post(1533, pll_current_language()));
                $title_login  = get_the_title(pll_get_post(1533, pll_current_language()));
                $link_deposit   = get_permalink(pll_get_post(1560, pll_current_language()));
                $title_deposit  = get_the_title(pll_get_post(1560, pll_current_language()));
                $link_codes   = get_permalink(pll_get_post(1475, pll_current_language()));
                $title_codes  = get_the_title(pll_get_post(1475, pll_current_language()));
                ?>
                <ul class="header-menu__list">
                    <li class="menu-item has-dropdown" id="bonusDropdown">
                        <a href="<?= $link_bonus ?>" id="bonusLink"><?= $title_bonus ?></a>
                        <img
                            class="arrow-icon"
                            src="<?php echo get_template_directory_uri(); ?>/assets/img/header/arrow-down.png"
                            alt="arrow down"
                            title="arrow down"
                            id="bonusArrow" />
                        <ul class="dropdown-menu">
                            <li> <a href="<?= $link_deposit ?>">
                                    <span><?= $title_deposit ?></span>
                                </a></li>
                            <li><a href="<?= $link_codes ?>">
                                    <span><?= $title_codes ?></span>
                                </a></li>
                        </ul>
                    </li>
                    <li>
                        <a href="<?= $link_app ?>">
                            <?= $title_app ?>
                        </a>
                    </li>
                    <li>
                        <a href="<?= $link_free ?>">
                            <?= $title_free ?>
                        </a>
                    </li>
                    <li>
                        <a href="<?= $link_login ?>">
                            <?= $title_login ?>
                        </a>
                    </li>
                </ul>
            </nav>
            <div class="header__info">
                <div class="header__lang" id="langDropdown">
                    <div class="current-lang">
                        <img src="<?php echo esc_url($icon_flag['url']); ?>" alt="<?php echo esc_attr($icon_flag['alt']); ?>" title="<?php echo esc_attr($icon_flag['title']); ?>" />
                        <p>NO</p>
                    </div>
                </div>
            </div>
            <div class="header__actions">
                <a href="<?php echo esc_url($ref_link); ?>" class="button header__button-login"><?php pll_e('Log in'); ?></a>
                <a href="<?php echo esc_url($ref_link); ?>" class="button header__button-signup"><?php pll_e('Sign Up'); ?></a>
            </div>
            <nav class="menu header__menu header__menu-mobile">
                <ul>
                    <li> <a href="<?= $link_bonus ?>">
                            <span><?= $title_bonus ?></span>
                        </a></li>
                    <li> <a href="<?= $link_deposit ?>">
                            <span><?= $title_deposit ?></span>
                        </a></li>
                    <li><a href="<?= $link_codes ?>">
                            <span><?= $title_codes ?></span>
                        </a></li>
                    <li>
                        <a href="<?= $link_app ?>">
                            <?= $title_app ?>
                        </a>
                    </li>
                    <li>
                        <a href="<?= $link_free ?>">
                            <?= $title_free ?>
                        </a>
                    </li>
                    <li>
                        <a href="<?= $link_login ?>">
                            <?= $title_login ?>
                        </a>
                    </li>
                </ul>
            </nav>
        </header>