// RedmineX Theme
// Copyright 2020 RedmineX
// For license, see https://www.projectino.cz
// 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) {}

/* ==========================================================================
   Mega Calendar
   ========================================================================== */

#calendar {
	padding: 0 !important; 
	margin-top: 1rem;
	
	td.fc-event-container {
		padding: 0.25rem;
	}
	
	.calendar_event {
		color: $white !important;
	}
	
	.fc-today-button {
		background: $border-color-light !important;
		box-shadow: none;
		text-shadow: none;
	}
	
	.fc-button-group {
		
		button {
			border: 1px solid $border-color-light;
			
			&.fc-state-default {
				background: transparent !important;
				box-shadow: none;
				text-shadow: none;
				color: $text-color;
			}
			
			&.fc-state-active {
				box-shadow: none;
				background: $border-color-light !important;
			}
		}
	}
	
	.fc-basic-view .fc-body .fc-row {
		min-height: 100px;
		height: auto !important;
		
		@include media-breakpoint-up(redmine-mobile) {
			min-height: 200px;
		}
	}
	
	.fc-center h2 {
		font-size: 1rem;
	}
	
	.fc-toolbar>[class*="fc-"] {
		@include media-breakpoint-down(xxs) {
			display: block;
			clear: both;
			margin-bottom: 0.25rem;
		}
	}
}

.fc-view-container {
	
	.fc-widget-header,
	.fc-widget-content {
		padding: 0 !important;
	}
	
	.fc-view>table {
		background: $table-bg;
	}
	
	.fc-day-number {
		padding-right: 0.5rem;
	}
}

#calendar_filter {
	@include rounded;
	background: $query-form-bg;
	border: 1px solid $query-form-border;
	margin-top: 1.5rem;
	
	&.open {
		border: 1px solid $query-form-border !important;
	}
	
	table {
		width: auto;
	}
	
	hr {
		border-top: 1px solid $border-color-light;
		border-left: none;
		border-right: none;
		visibility: visible;
		margin: 1rem 0;
	}
	
	select:not([multiple]) {
		width: 160px !important;
	}
	
	fieldset {
		background: none;
		padding: 0 1rem !important;
		
		&>div {
			padding: 1rem;
		}
		
		legend {
			background: none;
			width: 100%;
		}
	}
	
	.icon-reload,
	.icon-del,
	.icon-checked,
	.icon-save {
		@include btn;
	}
	
	.icon-checked,
	.icon-save {
		@include btn-primary;
	}
	
	.icon-reload,
	.icon-del {
		@include btn-tetriary;
	}
	
	table:not(.gantt-table):not(.cal):not(.ui-datepicker-calendar) th:not(:empty), 
	table:not(.gantt-table):not(.cal):not(.ui-datepicker-calendar) td:not(:empty) {
		padding: 0.25rem;
	}
}

.controller-holidays {
	
	&.action-index,
	&.action-show {
	
		table {
			height: auto !important;
			margin-bottom: 1rem;
			
			tbody>tr:not(:first-child) {
				background: $table-bg;
				border-bottom: 1px solid $border-color-light;
			}
		}
		
		table tbody>tr>td:last-child a {
			margin-right: 0.5rem;
		}
		
		table+a,
		table+a+a,
		table+a+a+a {
			@include btn;
		}
		
		table+a,
		table+a+a {
			@include btn-primary;
		}
		
		table+a+a {
			@include btn-danger;
		}
		
		table+a+a+a {
			@include btn-tetriary;
		}
	}
	
	&.action-new,
	&.action-edit {
		
		#content>form {
			max-width: 600px;
		}
		
		#content>form>table {
			background: $query-form-bg;
			border: 1px solid $query-form-border;
			margin-bottom: 1rem;
			
			td {
				padding: 0.5rem;
			}
			
			tr:first-child td {
				padding-top: 1.5rem;
			}
			
			tr:last-child td {
				padding-bottom: 1.5rem;
			}
			
			td:first-child {
				text-align: right;
				width: 130px;
			}
		}
	}
}

.xdsoft_calendar {
	
	table {
			table-layout: fixed;
	}
	
	td,
	th {
		padding: 0 !important;
	}
}

.xdsoft_datetimepicker {
	@include rounded;
	border-color: $border-color-light !important;
	
	.xdsoft_datepicker {
		width: 316px !important;
	}
}

.controller-calendar,
.controller-my {
	
	.qtip-default {
		@include dropdown;
		background: $white;
		border: none;
		
		table td {
			padding: 0.375rem !important;
		}
	}
}

#calendar-print-btn {
	margin-left: 1rem;
}


@media print {
	
	.controller-calendar {
		
		#content>.contextual {
			display: none;
		}
		
		#calendar .fc-event {
			border-color: primary !important;
		}
		
		#calendar .fc-content,
		#calendar .fc-event {
			background: $primary !important;
		}
		
		.fc-scroller {
			height: auto !important;
		}
	}
}