/* Primary */
body,
ul#side-menu.nav a,
.console,
.alert,
.form-control,
.dropdown-menu > li > a,
.theme-color-primary,
{
    color: theme("primary");
}
.theme-border-primary{
    border-color: theme("primary");
}
.tooltip{
	.tooltip-inner{
		background-color: theme("primary");
	}
	&.left .tooltip-arrow{ border-left-color: theme("primary"); }
	&.top .tooltip-arrow{ border-top-color: theme("primary"); }
	&.bottom .tooltip-arrow{ border-bottom-color: theme("primary"); }
	&.right .tooltip-arrow{ border-right-color: theme("primary"); }
}
.theme-fill-primary{
    fill: theme("primary");
}
.theme-stroke-primary{
    stroke: theme("primary");
}

/* Secondary */
body,
.navbar-default,
.console,
.alert,
.modal-content,
.form-control,
.dropdown-menu,
.theme-secondary
{
	background-color: theme("secondary");
}

.tooltip > .tooltip-inner{
	color: theme("secondary");
}

.alert{
    .close:hover, .close:focus{
        color: complementary(theme("secondary"));
    }
}

.pagination li > a,
.pagination .disabled > a,
.pagination .disabled > a:hover, .pagination .disabled > a:focus{
	color: scaleby(theme("primary"), 0.7);
	background-color: theme("secondary");
	border-color: scaleby(theme("secondary"), 0.7);
}
.pagination li > a{
	color: theme("primary");
}

.btn-secondary, .btn-secondary:active, .btn-secondary.active, .open>.dropdown-toggle.btn-secondary{
	background-color: theme("secondary");
	border-color: theme("secondary");
	color: theme("primary");

	&:hover, &:active, &:focus{
		background-color: scalebyiv(theme("secondary"), 0.90);
		border-color: scalebyiv(theme("secondary"), 0.90);
		color: theme("primary");
	}
}

/* Tertiary */
a, a:hover, a:focus{
	color: theme("tertiary");
}
.progress-bar-success{
    background-color: theme("tertiary");
}

/* Button primary */
#navbar-top .navbar-top-links,{
	a:hover,a:focus,.open > a{
		background-color: theme("button_primary");
		color: theme("secondary");
	}
}

#navbar-top ul#side-menu a:focus{
    background-color: inherit;
    color: inherit;
}

#navbar-top ul#side-menu a:hover, #navbar-top ul#side-menu a.active:hover{
	background-color: theme("button_primary");
	color: theme("secondary");
}

.btn-primary, .btn-primary:active, .btn-primary.active, .open>.dropdown-toggle.btn-primary{
	background-color: theme("button_primary");
	border-color: theme("button_primary");
	color: theme("secondary");

	&:hover, &:active, &:focus, &[disabled]:hover, &[disabled]:focus, &[disabled]:active{
		background-color: scalebyiv(theme("button_primary"), 0.90);
		border-color: scalebyiv(theme("button_primary"), 0.90);
		color: theme("secondary");
	}
}

/* Button default */
.btn-default, .btn-default:active, .btn-default.active, .open>.dropdown-toggle.btn-default{
	background-color: theme("button_default");
	border-color: theme("button_default");
	color: theme("secondary");

	&:hover, &:active, &:focus, &[disabled]:hover, &[disabled]:focus, &[disabled]:active{
		background-color: scalebyiv(theme("button_default"), 0.90);
		border-color: scalebyiv(theme("button_default"), 0.90);
		color: theme("secondary");
	}
}

.pagination>.active>a, .pagination>.active>span, .pagination>.active>a:hover, .pagination>.active>span:hover, .pagination>.active>a:focus, .pagination>.active>span:focus,
.pagination .active > a:hover, .pagination .active > a:focus,
.pagination li > a:hover, .pagination li > a:focus{
	background-color: theme("button_default");
	color: theme("secondary");
}

/* Button danger */
.btn-danger, .btn-danger:active, .btn-danger.active, .open>.dropdown-toggle.btn-danger{
	background-color: theme("button_danger");
	border-color: theme("button_danger");
	color: theme("secondary");

	&:hover, &:active, &:focus, &[disabled]:hover, &[disabled]:focus, &[disabled]:active {
		background-color: scalebyiv(theme("button_danger"), 0.90);
		border-color: scalebyiv(theme("button_danger"), 0.90);
		color: theme("secondary");
	}
}

.theme-color-button-danger{
    color: theme("button_danger");
}

.theme-color-button-primary{
    color: theme("button_primary");
}

/* Header background */
#navbar-top{
	background-color: theme("header_background");
}

/* Header primary */
.navbar-default .navbar-link,
#navbar-top .navbar-top-links a.dropdown-toggle{
	color: theme("header_primary");

	&:hover{
		color: theme("secondary");
	}
}

/* Border */
.sidebar ul li,
.project-list-item,
#page-wrapper,
table-bordered>thead>tr>th, .table-bordered>thead>tr>th, table-bordered>tbody>tr>th, .table-bordered>tbody>tr>th, table-bordered>tfoot>tr>th, .table-bordered>tfoot>tr>th, table-bordered>thead>tr>td, .table-bordered>thead>tr>td, table-bordered>tbody>tr>td, .table-bordered>tbody>tr>td, table-bordered>tfoot>tr>td, .table-bordered>tfoot>tr>td,
footer,
.modal-content,
.modal-header,
.modal-footer,
.dropdown-menu
{
	border-color: theme("border");
}
.dropdown-menu .divider{
	background-color: theme("border");
}
.popover-title{
	border-bottom-color: theme("border");
}
.theme-border{
    border-color: theme("border");
}

/* Highlight */
.task-list-item:nth-child(odd),
.table-striped>tbody>tr:nth-of-type(odd),
select.form-control option[disabled],
.theme-background-highlight{
	background-color: theme("highlight");
}
.dropdown-menu > li > a{
	&:hover, &:focus{
		background-color: theme("highlight");
		color: theme("primary");
	}
}
pre.prettyprint,
.form-control{
	border-color: theme('highlight');
	&:focus{
		border-color: scalebyiv(theme('highlight'), 0.7);
	}
}

/* Dialog warning */
.alert-warning{
	border-color: theme("dialog_warning");
}

/* Success */
.task-list-item .status-label.done, .theme-background-success{
	background-color: theme("success");
}

/* Failed */
.task-list-item .status-label.error, .theme-background-failed{
	background-color: theme("failed");
}

/* ModelView.jsx specific */
.model-view #potree_sidebar_container {
	.dropdown-menu > li > a{
		color: theme("primary");
	}
}

/* MapView.jsx specific */
.leaflet-bar a, .leaflet-control > a{
	background-color: theme("secondary") !important;
	border-color: theme("secondary") !important;
	color: theme("primary") !important;

	&:hover{
		background-color: scalebyiv(theme("secondary"), 0.90) !important;
		border-color: scalebyiv(theme("secondary"), 0.90) !important;
	}
}

.leaflet-popup-content-wrapper{
	background-color: theme("secondary") !important;
	color: theme("primary") !important;
	a{
		color: theme("tertiary") !important;
	}
}

.leaflet-container{
	a.leaflet-popup-close-button{
		color: theme("primary") !important;
		&:hover{
			color: complementary(theme("secondary")) !important;
		}
	}
}