<?php
$root =dirname(dirname(dirname(dirname(dirname(__FILE__)))));
if ( file_exists( $root.'/wp-load.php' ) ) {
    require_once( $root.'/wp-load.php' );
} elseif ( file_exists( $root.'/wp-config.php' ) ) {
    require_once( $root.'/wp-config.php' );
}
header("Content-type: text/css; charset=utf-8");


function hex2rgb($hex) {
   $hex = str_replace("#", "", $hex);
   if(strlen($hex) == 3) {
      $r = hexdec(substr($hex,0,1).substr($hex,0,1));
      $g = hexdec(substr($hex,1,1).substr($hex,1,1));
      $b = hexdec(substr($hex,2,1).substr($hex,2,1));
   } else {
      $r = hexdec(substr($hex,0,2));
      $g = hexdec(substr($hex,2,2));
      $b = hexdec(substr($hex,4,2));
   }
   $rgb = array($r, $g, $b);
   return $rgb; // returns an array with the rgb values
}
global $theme_option; 
$b=$theme_option['pricing-color'];
$rgba = hex2rgb($b);  

?>

/* 01 MAIN STYLES
****************************************************************************************************/
/**** Custom Background boxes ****/
.aoxhost-boxed-wrapper {background-image: url("<?php echo esc_url($theme_option['boxed_bg']['url']); ?>");}
.twitter_feed {background-image: url("<?php echo esc_url($theme_option['twitter_bg']['url']); ?>");}
.page_title {background-image: url("<?php echo esc_url($theme_option['page_title_bg']['url']); ?>");}

/**** Custom color ****/
a, .big_text1, .big_text2 i, .sideimg_list a, .site_logo h1, #mainmenu > li > a:hover,
#mainmenu li.active > a, #mainmenu li.current-menu-ancestor > a, #mainmenu li ul li a:hover,
#mainmenu > li > ul > li.active > a, .wpb_content_element .wpb_accordion_header a:hover,
.wpb_accordion .wpb_accordion_wrapper .ui-state-active a, .post-content .date-box span.day,
.ad_one h1, .ad_two h1, .sidebar_widget .recent_blogs li a:hover, .sidebar_widget ul li a:hover,
.our_support h5, .address-info a, .hosting_page_plan .price, .hosting_page_plan .price i,
.our_products h3, h3 a {
	color: <?php echo esc_attr( $theme_option['main-color'] ); ?>;
}

#wp-calendar tbody td#today, a.but_goback, a.but_hand_right, .button.small.colorchan,
.btn-price.small.colorchan, .pricing-tables-helight-two .price,
a.knowmore_but, a.ordernow_but, .whmcs-widget input[type=submit], #bridge input[type=submit],
#bridge input[type=reset], #footer .newsletter .newsletter-submit, .search-form #searchsubmit,
.post-content .date-box span.month, .wpb_accordion .wpb_accordion_wrapper .ui-state-active .ui-icon
{
	background-color: <?php echo esc_attr( $theme_option['main-color'] ); ?>;
} 
#footer .newsletter .newsletter-submit:hover, a.knowmore_but:hover, a.ordernow_but:hover {background-color: <?php echo esc_attr( $theme_option['main-color'] ); ?>;opacity:0.7;}
#mainmenu > li > ul, #mainmenu > li ul ul {border-color: <?php echo esc_attr( $theme_option['main-color'] ); ?>;}
.pricing-tables-helight .title {
	background-color: rgba(<?php echo esc_attr( $rgba[0] ); ?>, <?php echo esc_attr( $rgba[1] ); ?>, <?php echo esc_attr( $rgba[2] ); ?>, 0.9);
	border-top: 3px solid rgba(<?php echo esc_attr( $rgba[0] ); ?>, <?php echo esc_attr( $rgba[1] ); ?>, <?php echo esc_attr( $rgba[2] ); ?>, 1);
    border-bottom: 1px solid rgba(<?php echo esc_attr( $rgba[0] ); ?>, <?php echo esc_attr( $rgba[1] ); ?>, <?php echo esc_attr( $rgba[2] ); ?>, 0.2);
}
.pricing-tables-helight .price {
	background-color: rgba(<?php echo esc_attr( $rgba[0] ); ?>, <?php echo esc_attr( $rgba[1] ); ?>, <?php echo esc_attr( $rgba[2] ); ?>, 0.8);
}
.punchline_text_box, .punchline_text_box2, blockquote {border-left: 5px solid <?php echo esc_attr( $theme_option['main-color'] ); ?>;}
.features_section .sections:hover {border-bottom: 2px solid <?php echo esc_attr( $theme_option['main-color'] ); ?>;}

<?php if($theme_option['background_footer'] !=''){ ?>
#footer{
  background: <?php echo esc_attr( $theme_option['background_footer'] ); ?>;
}
<?php } ?>
.subfooter{
  background-color: <?php echo esc_attr( $theme_option['sub_footer'] ); ?>;
}