<?php
// Add plugin-specific colors and fonts to the custom CSS
if ( ! function_exists( 'tourimo_booked_get_css' ) ) {
	add_filter( 'tourimo_filter_get_css', 'tourimo_booked_get_css', 10, 2 );
	function tourimo_booked_get_css( $css, $args ) {

		if ( isset( $css['fonts'] ) && isset( $args['fonts'] ) ) {
			$fonts         = $args['fonts'];
			$css['fonts'] .= <<<CSS

.booked-calendar-wrap .booked-appt-list .timeslot .timeslot-people button,
body #booked-profile-page input[type="submit"],
body #booked-profile-page button,
body .booked-list-view input[type="submit"],
body .booked-list-view button,
body table.booked-calendar input[type="submit"],
body table.booked-calendar button,
body .booked-modal input[type="submit"],
body .booked-modal button {
	{$fonts['button_font-family']}
	{$fonts['button_font-size']}
	{$fonts['button_font-weight']}
	{$fonts['button_font-style']}
	{$fonts['button_line-height']}
	{$fonts['button_text-decoration']}
	{$fonts['button_text-transform']}
	{$fonts['button_letter-spacing']}
}

body table.booked-calendar tr.days th,
body table.booked-calendar thead th .monthName,
.wp-widget-booked_calendar .widget_title,
.booked_calendar.widget .widget_title,
body table.booked-calendar td .date .number {
	{$fonts['p_font-family']}
}

aside#wp-widget-booked_calendar h5.widget_title {
	{$fonts['p_font-family']}
	{$fonts['p_font-size']}
	{$fonts['p_font-style']}	
}


CSS;
		}

		if ( isset( $css['vars'] ) && isset( $args['vars'] ) ) {
			$vars         = $args['vars'];
			$css['vars'] .= <<<CSS

body table.booked-calendar thead tr:not(.days) th {
	-webkit-border-radius: {$vars['rad']} {$vars['rad']} 0 0;
	    -ms-border-radius: {$vars['rad']} {$vars['rad']} 0 0;
			border-radius: {$vars['rad']} {$vars['rad']} 0 0;
}
body table.booked-calendar thead tr.days th:first-child {
	-webkit-border-radius: 0 0 0 {$vars['rad']};
	    -ms-border-radius: 0 0 0 {$vars['rad']};
			border-radius: 0 0 0 {$vars['rad']};
}
body table.booked-calendar thead tr.days th:last-child {
	-webkit-border-radius: 0 0 {$vars['rad']} 0;
	    -ms-border-radius: 0 0 {$vars['rad']} 0;
			border-radius: 0 0 {$vars['rad']} 0;
}
body table.booked-calendar tbody td:first-child {
	-webkit-border-radius: {$vars['rad']} 0 0 {$vars['rad']};
	    -ms-border-radius: {$vars['rad']} 0 0 {$vars['rad']};
			border-radius: {$vars['rad']} 0 0 {$vars['rad']};
}
body table.booked-calendar tbody td:last-child {
	-webkit-border-radius: 0 {$vars['rad']} {$vars['rad']} 0;
	    -ms-border-radius: 0 {$vars['rad']} {$vars['rad']} 0;
			border-radius: 0 {$vars['rad']} {$vars['rad']} 0;
}
.booked_calendar.widget .widget_title,
.wp-widget-booked_calendar .widget_title,
body table.booked-calendar td.today .date:before,
body .booked-calendar-wrap .booked-appt-list .timeslot .timeslot-people button,
.booked-calendar-wrap .booked-appt-list .timeslot .timeslot-people button,
body #booked-profile-page input[type="submit"],
body #booked-profile-page button,
body .booked-list-view input[type="submit"],
body .booked-list-view button,
body table.booked-calendar input[type="submit"],
body table.booked-calendar button,
body .booked-modal input[type="submit"],
body .booked-modal button,
body table.booked-calendar td .date .number,
body table.booked-calendar tbody tr.entryBlock td {
	-webkit-border-radius: {$vars['rad']};
	    -ms-border-radius: {$vars['rad']};
			border-radius: {$vars['rad']};
}

CSS;
		}

		if ( isset( $css['colors'] ) && isset( $args['colors'] ) ) {
			$colors         = $args['colors'];
			$css['colors'] .= <<<CSS


/* Profile page and tabs */
#booked-page-form {
	color: {$colors['text']};
	border-color: {$colors['bd_color']};
}
#booked-profile-page .booked-profile-header {
	background-color: {$colors['bg_color']} !important;
	border-color: transparent !important;
	color: {$colors['text']};
}
#booked-profile-page .booked-user h3 {
	color: {$colors['text_dark']};
}
#booked-profile-page .booked-profile-header .booked-logout-button:hover {
	color: {$colors['text_link']};
}
#booked-profile-page .booked-tabs {
	border-color: {$colors['alter_bd_color']} !important;
}
.booked-calendarSwitcher.calendar,
.booked-calendarSwitcher.calendar select,
#booked-profile-page .booked-tabs {
	background-color: {$colors['bg_color']} !important;
}
#booked-profile-page .booked-tabs li a {
	color: {$colors['text_dark']};
}
#booked-profile-page .booked-tabs li a i {
	color: {$colors['text_dark']};
}
#booked-profile-page .booked-tabs li.active a,
#booked-profile-page .booked-tabs li.active a:hover,
#booked-profile-page .booked-tabs li a:hover {
	color: {$colors['text_dark']} !important;
	background-color: {$colors['bg_color']} !important;
}
#booked-profile-page .booked-tab-content {
	background-color: {$colors['bg_color']};
	border-color: {$colors['bd_color']};
}

/* Calendar */
.booked_calendar.widget .widget_title,
.wp-widget-booked_calendar .widget_title {
	color: {$colors['extra_dark']};
	background-color: {$colors['extra_bg_color']};
}
.booked_calendar.widget .widget_title:before,
.wp-widget-booked_calendar .widget_title:before {
	border-color: {$colors['extra_bg_color']} transparent transparent;
}

table.booked-calendar thead tr th {
	color: {$colors['bg_color']} !important;
	background-color: {$colors['alter_dark']} !important;
}
table.booked-calendar thead th i {
	color: {$colors['bg_color_02']} !important;
}
table.booked-calendar thead th i:hover {
	color: {$colors['alter_hover']} !important;
}
table.booked-calendar thead th .monthName a {
	color: {$colors['alter_light']};
}
table.booked-calendar thead th .monthName a:hover {
	color: {$colors['alter_hover']};
}
table.booked-calendar thead tr.days th {
	color: {$colors['extra_link2']} !important;
	background-color: {$colors['extra_bd_color']} !important;
}

table.booked-calendar tbody tr {
	background-color: {$colors['bg_color']} !important;
}
table.booked-calendar tbody tr td,
table.booked-calendar tbody tr:hover td,
table.booked-calendar tr.week td.active .date {
	background-color: transparent !important;
}
table.booked-calendar tbody tr td,
table.booked-calendar tbody tr td.next-month {
	color: {$colors['alter_dark']};
}
table.booked-calendar tbody tr td.prev-date, 
table.booked-calendar tbody tr td.prev-month {
	color: {$colors['alter_dark_05']};
}
table.booked-calendar td.today .date span {
	color: {$colors['extra_dark']} !important;
}
table.booked-calendar td.today .date:before {
	background-color: {$colors['extra_bg_color']} !important;
}
table.booked-calendar td.today.prev-date .date span {
	color: {$colors['extra_dark']} !important;
}
table.booked-calendar tr.entryBlock { 
	background-color: {$colors['alter_bg_hover_05']} !important;
}

.booked-calendar-wrap table.booked-calendar tr.week td.active .date, 
.booked-calendar-wrap table.booked-calendar td.today.active:hover .date span,
.booked-calendar-wrap.small table.booked-calendar tr.week td.active .date, 
.booked-calendar-wrap.small table.booked-calendar td.today.active:hover .date span {
	background-color: {$colors['alter_bg_hover_05']} !important;
}
.booked-calendar-wrap table.booked-calendar tr.week td.active .date .number,
.booked-calendar-wrap.small table.booked-calendar tr.week td.active .date .number {
	color: {$colors['alter_dark']};
}
.booked-calendar-wrap .booked-appt-list h2 {
	color: {$colors['alter_dark']};
}
.booked-calendar-wrap .booked-appt-list .timeslot {
	border-color: {$colors['alter_bd_color']};	
}
.booked-calendar-wrap .booked-appt-list .timeslot .timeslot-people button:hover {
	background-color: {$colors['extra_dark']} !important; 
	color: {$colors['extra_hover']} !important; 
	border-color: {$colors['extra_hover']} !important; 
}
.booked-calendar-wrap .booked-appt-list .timeslot .timeslot-title {
	color: {$colors['alter_link']};
}
.booked-calendar-wrap .booked-appt-list .timeslot .timeslot-time {
	color: {$colors['alter_dark']};
}

.booked-modal .bm-window p.booked-title-bar {
	color: {$colors['bg_color']} !important;
	background-color: {$colors['alter_dark']} !important;
}
.booked-modal .bm-window .close i {
	color: {$colors['bg_color']};
}
.booked-modal .bm-window .booked-scrollable {
	color: {$colors['alter_text']};
	background-color: {$colors['bg_color']} !important;
}
.booked-modal .bm-window .booked-scrollable em {
	color: {$colors['alter_link']};
}
.booked-form .booked-appointments {
	color: {$colors['alter_text']};
}
.booked-modal .bm-window p.appointment-title {
	color: {$colors['alter_dark']};	
}
.booked-modal button.cancel {
	color: {$colors['extra_dark']} !important;
	border-color: {$colors['extra_bg_color']} !important;
	background-color: {$colors['extra_bg_color']} !important;
}
.booked-modal button.cancel:hover,
.booked-modal button.cancel:focus,
.booked-modal input[type=submit].button-primary:hover,
.booked-modal input[type=submit].button-primary:focus {
	color: {$colors['extra_bg_color']} !important;
	border-color: {$colors['extra_bg_color']} !important;
	background-color: transparent !important;
}

CSS;
		}

		return $css;
	}
}

