@import "theme.css";

html {
	box-sizing: border-box;
}

*,
*:before,
*:after {
	box-sizing: inherit;
}

body {
	margin: 0px;
}

[onClick] {
	cursor: pointer;
}


[onclick] {
	cursor: pointer;
}

label {
	user-select: none;
}

#content {
	font-family: 'nexa-bold';

	&.day-calendar>div {
		display: grid;
		grid-template-columns: 1fr 400px;

	}

	&:not(.day-calendar)>div {
		#app-day-calendar {
			display: none;
		}
	}
}

#app-day-calendar {
	margin-bottom: 16px;

	.time-stats {
		display: grid;
		grid-template-columns: 0.5fr 0.5fr;
		grid-gap: 0px 32px;

		.header {
			font-weight: bold;
			color: #aaa;
			margin-top: 16px;
		}

		.time-today,
		.time-week {
			display: grid;
			grid-template-columns: 0.5fr 0.5fr;
			color: #fff;
			font-size: 1.5em;
			margin-top: 8px;

			div:last-child {
				justify-self: end;
			}
		}

		.time-today-progress,
		.time-week-progress {
			margin-bottom: 32px;

			progress {
				accent-color: #ffe200;
			}
		}
	}
}

.timer-calendar {
	padding-right: 16px;

	.fc-header-toolbar {
		margin-top: 16px;
		margin-right: 8px;

		.fc-toolbar-title {
			font-size: 1.25em;
			color: #ccc;
			padding-top: 8px;
		}
	}

	.fc-button-primary {
		background-color: #ffe200 !important;
		color: #515151 !important;
	}

	colgroup {
		col {
			width: 80px !important;
		}
	}

	.fc-timegrid-slot-label-frame {
		display: grid;
		justify-items: center;
		align-items: center;

		.fc-timegrid-slot-label-cushion {
			color: #ccc;
		}
	}

	table .fc-timegrid-slot {
		border-top: 1px solid #a8a8a8 !important;
		border-bottom: unset !important;
	}

	table tbody .fc-timegrid-slot-minor {
		border-top: 1px solid #555 !important;
	}

	.fc-timegrid-axis,
	.fc-scrollgrid-sync-inner,
	.fc-timegrid-slot {
		color: #ccc;
		background-color: #444 !important;
		border-bottom: 1px solid #666 !important;
	}

	.fc-timegrid-axis {
		border-bottom: 1px solid #fff !important;
	}

	.fc-timegrid-slot {
		height: 2em !important;
	}

	.fc-event-title {
		font-size: 1em !important;
		font-weight: normal;
		font-family: sans-serif;

		/*
		.title {
		}
		*/

		.description {
			font-weight: bold;
		}
	}

	.fc-event-time {
		display: none;
	}

	.fc-timegrid-event {
		margin-left: 6px;
	}

	.fc .fc-toolbar-chunk button:focus,
	.fc .fc-toolbar-chunk button:active {
		outline: none !important;
		box-shadow: none !important;
	}

	.fc-event-main-frame {
		&.report-created {
			background-color: #adadad;
		}
	}
}

@keyframes pulsating {
	to {
		background-color: #7d1c1c;
	}

	from {
		background-color: #c92d2d;
	}
}

#background {
	position: fixed;
	z-index: -100;
	left: 0px;
	top: 0px;
	right: 0px;
	bottom: 0px;
	background: #515151;

	&.pulsating {
		animation-name: pulsating;
		animation-duration: 350ms;
		animation-direction: alternate;
		animation-iteration-count: infinite;
	}

	//background: linear-gradient(180deg, rgba(79,18,78,1) 0%, rgba(37,17,78,1) 100%);
}

#app-timers {
	padding: 32px;
}

#refresh,
#new-timer,
#new-timer-from-ticket,
#help {
	background: #fff;
	color: #000;
	padding: 16px 32px;
	border-radius: 8px;
	margin-bottom: 16px;
}

#error-container {
	display: none;
	justify-content: center;
	align-items: center;

	&.show {
		display: grid;
	}

	position: fixed;
	top: 0px;
	bottom: 0px;
	left: 0px;
	right: 0px;
	background: rgba(0, 0, 0, 0.75);

	#error {
		width: 300px;
		background: #d00;
		color: #fff;
		padding: 32px;
	}
}

#actions-settings {
	display: grid;
	justify-items: center;
	color: #fff;
	white-space: nowrap;
	margin-bottom: 32px;
	cursor: pointer;
	user-select: none;

	.actions {
		display: grid;
		grid-template-columns: repeat(4, min-content);
		grid-gap: 0px 12px;
		align-items: center;
	}

	.settings {
		display: grid;
		grid-template-columns: repeat(8, min-content);
		grid-gap: 0px 12px;
		align-items: center;
	}
}

#help-timers {
	outline: none;

	&::backdrop {
		background-color: rgba(0, 0, 0, 0.65);
	}

	div,
	td,
	li {
		font-weight: normal;
		font-family: sans-serif;
	}

	td b {
		font-family: monospace;
	}

	table {
		margin: 16px 0px;
	}

	table td:first-child {
		padding-right: 8px;
	}

	button {
		padding: 8px 16px;
	}
}

#customers {
	display: grid;
	grid-template-columns: repeat(auto-fill, 400px);
	grid-gap: 32px;

	&.individual-height {
		.customer {
			height: min-content;
		}
	}

}

.customer {
	font-size: 20px;
	font-weight: bold;
	padding: 16px 24px 16px 24px;
	box-shadow: 4px 4px 24px 0px rgba(0, 0, 0, 0.75);

	background: #fff;
	border-radius: 16px;

	&.collapsed {
		.timer {
			display: none;
		}
	}

	&.unacknowledged {
		.name {
			background: #b22;
			color: #fff;

			.star {
				filter: brightness(1000%);
			}
		}
	}

	.name {
		display: grid;
		grid-template-columns: 1fr min-content min-content;

		background: #ffe200;
		color: #515151;
		padding: 12px 8px 8px 12px;
		border-radius: 8px;
		margin: 0px -8px 0 -8px;
		word-break: break-word;
		user-select: none;
		cursor: pointer;
		align-items: center;

		.num-items {
			font-size: 0.7em;
			margin-left: auto;
			margin-right: 4px;
			white-space: nowrap;
		}

		.star img {
			height: 14px;
			margin-left: 4px;
		}

	}

	.timer {
		margin-top: 24px;
		font-size: 20px;
		color: #aaa;
		padding-bottom: 20px;
		border-bottom: 1px solid #aaa;

		&:last-child {
			padding-bottom: 0px;
			border-bottom: none;
		}

		.description {
			display: grid;
			grid-template-columns: 1fr min-content;
			align-items: center;
			margin-bottom: 8px;
			color: #222;
			word-break: break-word;
			user-select: none;
			cursor: pointer;
		}

		&.unacknowledged {
			.description {
				color: #fff;
				background: #b22;
				border-radius: 4px;
				padding: 8px;
				font-size: 0.85em;
			}
		}

		.ticket-link {
			&.show {
				display: block;
			}

			&.hide {
				display: none;
			}

			margin-top: 10px;
			margin-bottom: 20px;
			font-size: 0.85em;

			a {
				text-decoration: none;
				color: #fff;
				background-color: #92a059;
				padding: 6px 8px 3px 8px;
				border-radius: 4px;
			}
		}

		.duration {
			display: grid;
			grid-template-columns: min-content 1fr min-content;
			align-items: center;
			font-size: 32px;
			user-select: none;
			position: relative;

			&.active {
				color: #fff543;

				img.deactivated {
					display: none
				}

				img.active {
					display: block
				}

				.time {
					background: #515151;
				}
			}

			&.focused:before {
				content: "";
				position: absolute;
				display: block;
				width: 8px;
				height: 8px;
				border-radius: 8px;
				background: #ccc;
				left: -14px;
				top: 25px;
				font-size: 16px;
			}

			.request-sent {
				color: #ddd
			}

			.time {
				margin-left: 8px;
				width: min-content;
				margin-top: 4px;
				margin-right: 4px;
				padding: 8px 8px 2px 8px;
				border-radius: 8px;
			}

			img {
				display: none;
				height: 50px;

				&.deactivated {
					display: block;
				}
			}

			img.intervals {
				display: block;
				height: 20px;
				padding-top: 6px;
				cursor: pointer;
			}

			img.intervals[x-intervals="0"] {
				display: none;
			}

		}

		.intervals {
			display: none;
			align-items: center;
			grid-template-columns:
				min-content min-content min-content 1fr min-content;
			grid-gap: 12px 8px;
			margin-top: 8px;
			margin-bottom: 8px;
			color: #333;
			user-select: none;
			font-family: monospace;
			font-size: 0.9em;

			.date {
				grid-column: 1 / -1;
				display: inline-block;
				padding: 6px;
				margin-top: 12px;
				border-radius: 4px;
				font-size: 0.8em;
				background: #555;
				color: #fff;

			}

			.time {
				display: grid;
				grid-template-columns: repeat(3, min-content);
				align-items: center;
				cursor: pointer;

				.overlap-day {
					white-space: nowrap;
					padding: 4px;
					border-radius: 4px;
					background: #a00;
					color: #fff;
					font-size: 12px;
					margin-left: 8px;
				}
			}

			.separator {
				grid-column: 1 / -1;
				border-bottom: 1px dotted #aaa;
			}

			.date+.separator {
				display: none;
			}

			.delete {
				cursor: pointer;
				padding-top: 4px;
				padding-bottom: 4px;
				height: 24px;
			}

			.comments {
				display: block;
				padding-top: 1px;
				margin-left: 8px;
				height: 16px;
			}
		}

		&.show-intervals {
			.intervals {
				display: grid;
			}

		}

	}
}

#timer-editor {
	display: grid;
	justify-content: center;
	align-items: center;

	position: fixed;
	top: 0px;
	bottom: 0px;
	left: 0px;
	right: 0px;
	background: rgba(0, 0, 0, 0.5);

	.dialog {
		display: grid;
		grid-template-columns: min-content 1fr;
		grid-gap: 8px 16px;
		box-shadow: 4px 4px 24px 0px rgba(0, 0, 0, 0.75);
		width: 400px;
		align-items: center;

		background: #fff;
		padding: 16px;
		border-radius: 8px;
		font-size: 16px;

		input[type="text"],
		select {
			width: 100%;
			box-sizing: border-box;
			font-size: 16px;
			padding: 6px;
		}

		.wide {
			grid-column: 1 / -1;

			.header {
				margin-top: 16px;
			}

			.center {
				display: grid;
				justify-items: center;
			}
		}

		textarea {
			width: 100%;
		}

		button {
			padding: 4px 16px;
			margin-top: 8px;
			font-size: 16px;
		}
	}
}

#timer-from-ticket-editor {
	display: grid;
	justify-content: center;
	align-items: center;

	position: fixed;
	top: 0px;
	bottom: 0px;
	left: 0px;
	right: 0px;
	background: rgba(0, 0, 0, 0.5);

	.dialog {
		display: grid;
		grid-template-columns: min-content 1fr;
		grid-gap: 8px 16px;
		box-shadow: 4px 4px 24px 0px rgba(0, 0, 0, 0.75);
		width: 400px;
		align-items: center;

		background: #fff;
		padding: 16px;
		border-radius: 8px;
		font-size: 16px;
		white-space: nowrap;

		input[type="text"],
		select {
			width: 100%;
			box-sizing: border-box;
			font-size: 16px;
			padding: 6px;
		}

		button {
			padding: 4px 16px;
			margin-top: 8px;
			font-size: 16px;
		}
	}
}

#interval-editor {
	display: grid;
	justify-content: center;
	align-items: center;

	position: fixed;
	top: 0px;
	bottom: 0px;
	left: 0px;
	right: 0px;
	background: rgba(0, 0, 0, 0.5);

	.dialog {
		display: grid;
		grid-template-columns: min-content 1fr;
		grid-gap: 4px 16px;
		box-shadow: 4px 4px 24px 0px rgba(0, 0, 0, 0.75);
		width: 500px;

		background: #fff;
		padding: 16px;
		border-radius: 8px;
		font-size: 16px;

		input[type="datetime-local"] {
			min-width: 100px;
			font-size: 16px;
			padding: 6px;

			&:invalid {
				background: #ffd5d5;
			}
		}

		.center {
			grid-column: 1 / -1;
			display: grid;
			justify-items: center;
		}

		textarea {
			width: 100%;
			box-sizing: border-box;
		}

		button {
			padding: 4px 16px;
			margin-top: 8px;
			font-size: 16px;
		}
	}
}


#menu-finish-timer {
	.menu {
		display: grid;
		margin-bottom: 16px;
		border: 1px solid #ccc;
		background: #fff;
		font-size: 16px;
		color: #333;

		div {
			padding: 16px;
			user-select: none;
			border-bottom: 1px solid #ccc;
		}

		div:last-child {
			border-bottom: none;
		}

		div:hover {
			background: #eee;
		}
	}

}

@media only screen and (max-width: 600px) {
	#timer-editor {
		grid-template-columns: 1fr;

		.dialog {
			margin: 32px;
			width: inherit;
		}
	}

	#interval-editor {
		grid-template-columns: 1fr;

		.dialog {
			margin: 32px;
			width: inherit;
		}
	}
}

@media only screen and (max-width: 450px) {
	#customers {
		grid-template-columns: inherit;
	}
}
