// RedmineX Theme
// Copyright 2020 RedmineX
// For license, see https://www.redmine-x.com
// Created by Michael Staněk
// Created without vendor prefixes, "AutoPrefixed" by PrePros v5 (https://prepros.io)
 
// Media Queries to Copy / Paste:
 
// 380px
// @include media-breakpoint-up(xxs) {}

// 480px
// @include media-breakpoint-up(xs) {}

// 576px
// @include media-breakpoint-up(sm) {}

// 768px
// @include media-breakpoint-up(md) {}

// 899px
// @include media-breakpoint-up(redmine-mobile) {}

// 992px
// @include media-breakpoint-up(lg) {}

// 1200px
// @include media-breakpoint-up(xl) {}

// 1500px
// @include media-breakpoint-up(hd) {}

// 1900px
// @include media-breakpoint-up(2k) {}
 
/* ==========================================================================
   Dark Theme
   ========================================================================== */

/* The emerging W3C standard 
   that is currently Firefox-only */
* {
  scrollbar-width: thin;
  scrollbar-color: $gray-500 $gray-200;
}

body:not(.theme-dark) {
	background: $body-bg;
	color: $body-color;
	
	/*
	 * type.scss
	 */
	
	@for $j from 1 through 6 {
		h#{$j},
		.h#{$j} {
			color: $headings-color;
			
			&[class*="icon-"]:before {
				color: $fa-font-color;
			}
		}
	}
	
	#header>h1 {
		
		a {
			color: $text-color;
			
			&:hover {
				color: $link-color;
			}
		}
	}
	
	/*
	 * ui-widget.scss
	 */
	
	/*
	 * form.scss
	 */
	
	select,
	input([type="checkbox"]), 
	input([type="radio"]),
	textarea,
	input:not([type="submit"]):not([type="checkbox"]):not([type="radio"]):not([type="file"]):not([type="button"]),  {
		background: $white;
	}
	
	form {
		
		.tabular,
		.box {
			background: $query-form-bg;
			box-shadow: none;
			
			@include media-breakpoint-up(lg) {
				border: 1px solid $border-color-light;
			}
		}
	}
	
	.box {
		
		input:not([type="submit"]):not([type="checkbox"]):not([type="radio"]):not([type="file"]):not([type="button"]),
		textarea {
			background: $input-bg;
		}
	}
	
	textarea {
		border: 1px solid $border-color-light;
		color: $text-color;
	}
	
	input[type="text"],
	input[type="date"],
	input[type="datetime-local"],
	input[type="email"],
	input[type="month"],
	input[type="number"],
	input[type="password"],
	input[type="range"],
	input[type="search"],
	input[type="tel"],
	input[type="time"],
	input[type="url"],
	input[type="week"],
	input[type="text"],
	input[type="text"],
	input[type="text"],
	input[type="text"],
	select {
		border: 1px solid $border-color-light;
		color: $text-color;
	}
	
	#query_form_content {
		
		select, 
		input:not([type="submit"]):not([type="file"]):not([type="button"]) {
			background-color: $white;
		}
	}
	
	#quick-search {
		
		input {
			
			@include media-breakpoint-up(xl) {
				background-color: darken($body-bg, 2%);
			}
		}
	}
	
	/*
	 * header.scss
	 */
	 
	.drdn-content {
		@include dropdown;
		background: $white;
		color: $text-color;
			
		a {
			color: $text-color;
			background-image: none;
			
			&:hover,
			&:focus,
			&:active {
				background: $query-form-bg;
			}
		}
		
		.all-projects {
			border-top: 1px solid $border-color-light;
			
			a:hover,
			a:focus,
			a:active {
				background: none;
			}
		}
	}
	
	#header, 
	.flyout-menu {
		
		#project-jump {
			
			.drdn-trigger {
			    border: 1px solid $border-color-light;
				background-repeat: no-repeat;
				background-position: center right;
				background: $select-background;
				
				@include media-breakpoint-up(xl) {
					background: $select-background-query;
				}
			}
		}
	}
	
	#quick-search {
		
		#q,
		#project-jump .drdn-trigger {
			border: 1px solid $border-color-light;
			
		}
	}
	
	#main-menu,
	#main-menu2 {
		
		&>ul>li>a,
		#expanded-menu {
			color: $text-color;
			
			&:not(.new-object) {
				border: 1px solid $border-color-light;
			}
			
			&.selected {
				background: $link-color;
				color: $white;
				border-color: $link-color;
			}
			
			&:not(.new-object):not(.selected):hover {
				background: $white;
			}
		}
	}	
	
	/*
	 * layout.scss
	 */
	 
	#sidebar {
		
		&.d-none {
			border: 1px solid $body-bg;
		}
	}
	
	#hide-sidebar {
		background: $border-color-light;
		color: $headings-color;	
	}
	
	/*
	 * list.scss
	 */
	
	.tabs:not(#main-menu):not(#main-menu2) {
		
		li a {
			color: $text-color;
			background: transparent;
			border: 1px solid $border-color-light;
						
			&.selected,
			&:hover {
				background: $white;
				color: $text-color;
			}
		}
	} 
	
	/*
	 * table.scss
	 */
	
	.attachments:not(.box) table,
	table.list:not(.issues),
	table.contacts, 
	.wiki table {
		
		&>tbody {
			
			tr {
				border-top: 1px solid $border-color-light;
				
				&:hover {
					background: $table-bg-hover;
					
					table.progress td.todo {
						background: darken($border-color-light, 10%);
					}
				}
			}
			
			&>tr {
				background: $table-bg;
			}
		}
	}
	
	table.list.issues {
		
		&>tbody {
			
			tr[id*="issue-"] {
				border-top: 1px solid $border-color-light;
				
				&:hover {
					background: $table-bg-hover;
					
					table.progress td.todo {
						background: darken($border-color-light, 10%);
					}
				}
			}
			
			&>tr {
				background: $table-bg;
			}
		}
	}
	
	table.progress {
		
		td.todo {
			background: darken($border-color-light, 10%);
		}
	}
	
	
	.table-list {
		
		.ui-sortable>div {
			background: $table-bg;
			border-bottom: 1px solid $border-color-light;
		}
		
		.ui-sortable .ui-sortable>div {
			border-top: 1px solid $border-color-light;
		}
	}
	
	/*
	 * general.scss
	 */
	
	.menu-children {
			
		a {
			color: $text-color;
		
			&:hover,
			&.selected {
				background: $query-form-bg;
			}
		}
	}
	
	#query_form_content {
		background: $query-form-bg;
		border: 1px solid $border-color-light;
	}
	
	#query-form {
		
		&>.box {
			background: $query-form-bg;
		}
	}
	
	.version-article,
	.news-article {
		background: $white;
		@include box-shadow-container;
		border: 1px solid lighten($border-color-light, 5%);
	}
	
	.tooltip span.tip {
	    background-color: $table-bg;
	}
	
	#content #context-menu a {
		color: $headings-color;
	}
	
	/*
	 * activity.scss
	 */
	 
	#activity {
		position: relative;
		
		&:before {
			content: '';
			width: 1px;
			height: 100%;
			position: absolute;
			left: 8px;
			top: 0;
			background: $border-color-light;
			z-index: 90;
		}
	
		dl {
			background: $table-bg;
			position: relative;
			@include box-shadow-container;
			border: 1px solid lighten($border-color-light, 5%);
		}
		
		h3 {
			
			&:before {
				background: $body-bg;
			}
		}
	}
	
	&.controller-my.action-page {
		
		#activity h3:before {
			background: $white;
		}
	}
	
	/*
	 * admin.scss
	 */
	 
	#admin-index {
		
		#admin-menu li {
			
			&:hover {
				@include box-shadow-container-hover;
				border: 1px solid $primary;
			}
		}
	}
	
	/*
	 * calendar.scss
	 */
	 
	table.cal {
		border: 1px solid $border-color-light;
		background: $white;
		
		thead {
			
			th {
				background-color: $input-bg;
			}
			
			td {
				border: 1px solid $border-color-light;
			}
		}
		
		td {
	        border: 1px solid $border-color-light;
			
			&:hover {
				background: $table-bg-hover;
			}
	        
			&.week-number {
	            background-color: $input-bg;
	        }
	        
			&.odd p.day-num {
	            color: $text-color;
	        }
	        
			&.today {
	            background: lighten($brand-yellow, 5%);
	        }
	    }
	}
	
	/*
	 * gantt.scss
	 */
	 
	#gantt_area {
	
		&>.gantt_hdr:first-child {
			background: $border-color-light !important;
			border-bottom: 1px solid $border-color-light;
		}
		
		.gantt_hdr {
			border-left: none;
			border-right: 1px solid $border-color-light;
		}
	}
	
	.gantt_subjects_container {
		border-right: 1px solid $border-color-light;
		border-bottom: 1px solid $border-color-light;
		border-left: 1px solid $border-color-light;
		
		&>.gantt_hdr:first-child {
			background: $border-color-light !important;
		}
	}
	
	/*
	 * issue.scss
	 */
	
	.edit_issue>.box {
		background: $query-form-bg;
	}
	
	#content>.issue.details {
		background: $white;
		@include box-shadow-container;
		border: 1px solid lighten($border-color-light, 5%);
	}
	
	&.controller-issues.action-show {
		
		.issue .attributes .splitcontent:first-of-type {
			
			.attribute {
			}
		}
	}
	
	#issue_tree,
	#relations,
	#invoices {
		
		&>p {
			border-bottom: 1px dashed darken($border-color-light, 10%);
		}
	}
	
	/* New Issue + Update Issue + Wiki */
	 
	.controller-wiki.action-show,
	.controller-issues.action-new,
	#update  {
		
		.jstEditor textarea {
			border: 1px solid $border-color-light;
			background: $input-bg;
		}
	}
	
	/*
	 * login.scss
	 */
	 
	&.controller-account.action-login {
		
		#login-form {
			
			@include media-breakpoint-up(redmine-mobile) {
				background: $white;
			}
		}
	}
	
	/*
	 * project.scss
	 */
	 
	#projects-index {
		
		div.root { /*div specified because there's li.root*/
			background: $table-bg;
			border-top: 1px solid $border-color-light;
			
			&:hover {
				background: $table-bg-hover;
			}
		}
		
		&>ul.projects>li:first-child div.root {
			border-top: none;
		}
		
		&>ul>li:last-child div.root {
			border-bottom: none;
		}
	}
}