/** Calculate luma as it is also used in OCA\Theming\Util::calculateLuma */
/*@import "layui/css/layui.scss";*/
.layui-btn, .layui-edge, .layui-inline, img {
    vertical-align:middle
}
.layui-nav {
    position:relative;
    padding:0 20px;
    background-color:#393D49;
    color:#fff;
    border-radius:2px;
    font-size:0;
    box-sizing:border-box
}
.layui-nav * {
    font-size:14px
}
.layui-nav dd{
    padding: 0px;
}
.layui-nav .layui-nav-item {
    position:relative;
    display:inline-block;
    *display:inline;
    *zoom:1;
    vertical-align:middle;
    line-height:60px
}
.layui-nav .layui-nav-item a {
    display:block;
    padding:0 20px;
    color:#fff;
    color:rgba(255, 255, 255, .7);
    transition:all .3s;
    -webkit-transition:all .3s
}
.layui-nav .layui-this:after, .layui-nav-bar, .layui-nav-tree .layui-nav-itemed:after {
    position:absolute;
    left:0;
    top:0;
    width:0;
    height:5px;
    background-color:#5FB878;
    transition:all .2s;
    -webkit-transition:all .2s
}
.layui-nav-bar {
    z-index:1000
}
.layui-nav .layui-nav-item a:hover, .layui-nav .layui-this a {
    color:#fff
}
.layui-nav .layui-this:after {
    content:'';
    top:auto;
    bottom:0;
    width:100%
}
.layui-nav-img {
    width:30px;
    height:30px;
    margin-right:10px;
    border-radius:50%
}
.layui-nav .layui-nav-more {
    content:'';
    width:0;
    height:0;
    border-style:solid dashed dashed;
    border-color:#333 transparent transparent;
    overflow:hidden;
    cursor:pointer;
    transition:all .2s;
    -webkit-transition:all .2s;
    position:absolute;
    top:50%;
    right:3px;
    margin-top:-3px;
    border-width:6px;
    border-top-color:rgba(153,153,153, .7)
}
.layui-nav .layui-nav-mored, .layui-nav-itemed>a .layui-nav-more {
    margin-top:-9px;
    border-style:dashed dashed solid;
    border-color:transparent transparent #999
}
.layui-nav-child {
    display:none;
    position:absolute;
    left:0;
    top:45px;
    min-width:100%;
    line-height:36px;
    padding:5px 0;
    box-shadow:0 2px 4px rgba(0, 0, 0, .12);
    border:1px solid #d2d2d2;
    background-color:#fff;
    z-index:100;
    border-radius:2px;
    white-space:nowrap
}
.layui-nav .layui-nav-child a {
    color:#333
}
.layui-nav .layui-nav-child a:hover {
    background-color:#f2f2f2;
    color:#000
}
.layui-nav-child dd {
    position:relative
}
.layui-nav .layui-nav-child dd.layui-this a, .layui-nav-child dd.layui-this {
    background-color:#5FB878;
    color:#fff
}
.layui-nav-child dd.layui-this:after {
    display:none
}
.layui-nav-tree {
    width:200px;
    padding:0
}
.layui-nav-tree .layui-nav-item {
    display:block;
    width:100%;
    line-height:45px
}
.layui-nav-tree .layui-nav-item a {
    position:relative;
    height:45px;
    line-height:45px;
    text-overflow:ellipsis;
    overflow:hidden;
    white-space:nowrap
}
.layui-nav-tree .layui-nav-item a:hover {
    background-color:#4E5465
}
.layui-nav-tree .layui-nav-bar {
    width:5px;
    height:0;
    background-color:#009688
}
.layui-nav-tree .layui-nav-child dd.layui-this, .layui-nav-tree .layui-nav-child dd.layui-this a, .layui-nav-tree .layui-this, .layui-nav-tree .layui-this>a, .layui-nav-tree .layui-this>a:hover {
    background-color:#009688;
    color:#fff
}
.layui-nav-tree .layui-this:after {
    display:none
}
.layui-nav-itemed>a, .layui-nav-tree .layui-nav-title a, .layui-nav-tree .layui-nav-title a:hover {
    color:#fff!important
}
.layui-nav-tree .layui-nav-child {
    position:relative;
    z-index:0;
    top:0;
    border:none;
    box-shadow:none
}
.layui-nav-tree .layui-nav-child a {
    height:40px;
    line-height:40px;
    color:#fff;
    color:rgba(255, 255, 255, .7)
}
.layui-nav-tree .layui-nav-child, .layui-nav-tree .layui-nav-child a:hover {
    background:0 0;
    color:#fff
}
.layui-nav-tree .layui-nav-more {
    right:10px
}
.layui-nav-itemed>.layui-nav-child {
    display:block;
    padding:0;
    background-color:rgba(0, 0, 0, .3)!important
}
.layui-nav-itemed>.layui-nav-child>.layui-this>.layui-nav-child {
    display:block
}
.layui-nav-side {
    position:fixed;
    top:0;
    bottom:0;
    left:0;
    overflow-x:hidden;
    z-index:999
}
@import "tonicon.scss";

@function luma($c) {
	$-local-red: red(rgba($c, 1.0));
	$-local-green: green(rgba($c, 1.0));
	$-local-blue: blue(rgba($c, 1.0));

	@return (0.2126 * $-local-red  + 0.7152 * $-local-green + 0.0722 * $-local-blue) / 255;
}

$has-custom-logo: variable_exists('theming-logo-mime') and $theming-logo-mime != '';
$invert: luma($color-primary) > 0.6;

@if ($has-custom-logo == false) {
	@if ($invert) {
		$image-logo: url(icon-color-path('logo', 'logo', #000000, 1, true));
	} @else {
		$image-logo: url(icon-color-path('logo', 'logo', #ffffff, 1, true));
	}
}

.nc-theming-main-background {
	background-color: $color-primary;
}

.nc-theming-main-text {
	color: $color-primary-text;
}

.nc-theming-contrast {
	color: $color-primary-text;
}

@if ($invert) {
	#appmenu:not(.inverted) svg {
		filter: invert(1);
	}
	#appmenu.inverted svg {
		filter: none;
	}
	.searchbox input[type="search"] {
		background-repeat: no-repeat;
		background-position: 6px center;
		background-color: transparent;
		@include icon-color('search', 'actions', $color-black, 1, true);
	}
	#contactsmenu .icon-contacts {
		@include icon-color('contacts', 'places', $color-black, 1, true);
	}
	#settings .icon-settings-white {
		@include icon-color('settings', 'actions', $color-black, 1, true);
	}
	#appmenu .icon-more-white {
		@include icon-color('more', 'actions', $color-black, 1, true);
	}

	#body-login {

		input,
		#alternative-logins li a {
			border: 1px solid nc-lighten($color-primary-text, 50%);
		}
		input.primary,
		#alternative-logins li a {
			background-color: $color-primary;
		}
		a,
		label,
		p,
		#alternative-logins legend {
			color: var(--color-primary-text);
		}
		input[type='checkbox'].checkbox--white + label:before {
			border-color: nc-darken($color-primary-element, 40%) !important;
		}
		input[type='checkbox'].checkbox--white:not(:disabled):not(:checked) + label:hover:before,
		input[type='checkbox'].checkbox--white:focus + label:before {
			border-color: nc-darken($color-primary-element, 30%) !important;
		}
		input[type='checkbox'].checkbox--white:checked + label:before {
			border-color: nc-darken($color-primary-element, 30%) !important;
			background-color: nc-darken($color-primary-element, 30%) !important;
			@include icon-color('checkbox-mark', 'actions', $color-white, 1, true);
		}
	}
	/* Always give primary button a border for light primary colors */
	.primary {
		border-color: var(--color-border) !important;
	}
} @else {
	#appmenu:not(.inverted) svg {
		filter: none;
	}
	#appmenu.inverted svg {
		filter: invert(1);
	}
}

/* Colorized svg images */
.icon-file, .icon-filetype-text {
	background-image: url(./img/core/filetypes/text.svg?v=#{$theming-cachebuster});
}

.icon-folder, .icon-filetype-folder {
	background-image: url(./img/core/filetypes/folder.svg?v=#{$theming-cachebuster});
}

.icon-filetype-folder-drag-accept {
	background-image: url(./img/core/filetypes/folder-drag-accept.svg?v=#{$theming-cachebuster}) !important;
}

#theming-preview-logo,
#header .logo {
	background-image: $image-logo;
}

/* override styles for login screen in guest.css */
@if ($has-custom-logo) {
	// custom logo
	#theming-preview-logo,
	#header .logo {
		background-size: contain;
	}

	#body-login #header .logo {
		margin-bottom: 22px;
	}
} @else {
	// default logo
	@if ($invert) {
		#theming-preview-logo,
		#header .logo {
			opacity: .6;
		}
	}
}

@if variable_exists('theming-background-mime') and $theming-background-mime != ''  {
	#body-login,
	#firstrunwizard .firstrunwizard-header,
	#theming-preview {
		background-image: $image-login-background;
		background-color: $color-primary;
	}
} @else {
	  #theming-preview {
		  background-image: $image-login-background;
		  background-color: $color-primary;
	  }
}

@if variable_exists('theming-logoheader-mime') and $theming-logoheader-mime != '' {
	#theming .advanced-option-logoheader .image-preview,
	body:not(#body-login) #header .logo {
		background-image: url(#{$image-logoheader});
	}
} @else {
	#theming .advanced-option-favicon .image-preview {
		background-image: none;
	}
}

@if variable_exists('theming-favicon-mime') and $theming-favicon-mime != '' {
	#theming .advanced-option-favicon .image-preview {
		background-image: url(#{$image-favicon});
	}
} @else {
	#theming .advanced-option-favicon .image-preview {
		background-image: none;
	}
}

input.primary,
#alternative-logins li a {
	background-color: $color-primary-element;
	border: 1px solid $color-primary-text;
	color: $color-primary-text;
}

@if ($invert) {
	#body-login #submit-wrapper .icon-confirm-white {
		background-image: url('../../../core/img/actions/confirm.svg');
	}
}

// plain background color for login page
@if $image-login-plain == 'true' {
	#body-login, #firstrunwizard .firstrunwizard-header, #theming-preview {
		background-image: none !important;
		background-color: $color-primary;
	}
	#body-login {

		a, label, p {
			color: var(--color-primary-text);
		}

	}
} @else {
	#body-login {
		/*background-color: $color-primary;*/
	}
}

@if ($color-primary == #ffffff) {
	/* show grey border below header */
	#body-user #header,
	#body-settings #header,
	#body-public #header {
		border-bottom: 1px solid #ebebeb;
	}

	/* show triangle in header in grey */
	#appmenu li a.active:before,
	.header-right #settings #expand:before {
		border-bottom-color:#ebebeb;
	}

	/* show border around quota bar in files app */
	.app-files #quota .quota-container {
		border: 1px solid #ebebeb;
	}
}

@if ($has-legal-links == 'true') {
	footer {
		height: 92px;
	}
}

@import "xfplay.third.scss";
@import "mobile.scss";


