// VARIABLES
$FONT: Helvetica, Arial, sans-serif;

#atom-appointment-management {
	position: relative;
	max-width: 1000px;
	min-height: 200px;
	margin: 30px auto;
	transition: all 0.5s ease;
	font-family: $FONT;

	&[data-display="calendar"] {
		background-color: #fcfcfc;
		box-shadow: 0px 0px 4px #BBB;
	}

	.atom-aam-loadingindicator {
		position: absolute;
		top: 1px;
		right: 1px;
		bottom: 1px;
		left: 1px;
		z-index: 10;
		text-align: center;
		background: rgba(255,255,255,0.6);

		img {
			width: 32px;
			height: 32px;
			display: block;
			margin: 0 auto 0 auto;
			top: calc(50% - 16px);
			position: relative;
			opacity: 0.5;
		}

		#atom-aam-loading-problem {
			position: absolute;
			bottom: 15px;
			width: 100%;
			opacity: .5;
			display: none;
		}
	}

	a {
		outline: none;
		box-shadow: none;
		border: none;
		text-decoration: none;
	}

	h1, h2 {

		&::before,
		&::after {
			display: none;
		}
	}

	#atom-aam-calendar {
		overflow: hidden;

		table {
			margin-bottom: 0;
			display: table !important;

			td {
				border-width: 1px !important;
			}
		}

		.fc-toolbar {
			padding: 10px;
			margin: 0;
			background-color: #FFF;
			position: relative;
			z-index: 20;
			border: 1px solid #ddd;

			.fc-left h2 {
				font-weight: lighter;
				padding: 3px;
				margin: 0;
				color: #666;
				font-family: $FONT;
				font-style: normal;
				font-weight: normal;
				font-size: 24px;
			}

			.fc-button {
				background: none;
				border: none;
				box-shadow: none;
				font-family: $FONT;
				color: black !important;
				font-style: normal;
				font-weight: normal;
				padding: 12px;
				font-size: 14px;
				line-height: 14px;
				width: auto !important;

				&:hover {
					background: none !important;
					color: black;
					opacity: 0.8;
				}
			}

			.fc-button[disabled], .fc-button[disabled]:hover {
				opacity: 0.2 !important;
				cursor: default !important;
				color: rgb(51, 51, 51);
				padding: 12px;
			}

		} // end fc-toolbar

		.fc-view-container {
			margin-top: -1px;
		}

		.fc-widget-header th {
			padding: 10px 0;
			font-family: $FONT;
			font-style: normal;
		}

		.fc-widget-header th:first-line {
			color: #CCC;
			font-size: 12px;
		}

		.fc-agendaWeek-view tr {
			height: 40px;
		}

		.fc-agendaDay-view tr {
			height: 30px;
		}

		.fc-ltr .fc-time-grid .fc-event-container {
			margin: 0;
		}

		td:not(.fc-axis) {
			padding: 0;
		}

		th.fc-axis {
			padding-left: 4px;
			padding-right: 4px;
		}

		.fc-time-grid-event {
			padding: 0;
			display: flex;
			align-items: center;
			justify-content: center;
			font-family: $FONT;
			font-style: normal;
			border-radius: 4px;
			border: none;
			transition: all 0.5s ease;

			&.aam-full {
				opacity: 0.2;
			}

			&:not(.aam-full) {

				&:hover {
					cursor: pointer;
					box-shadow: 0 0 10px rgba(0,0,0,0.2);
					transform: scale(1.02);
				}
			}

		}

		.fc-day-header {
			font-size: 16px;
			color: #666;
			font-weight: normal;
			font-family: $FONT;
			font-style: normal;
		}

		.fc-time {
			text-align: center;
		}

		.fc-title {
			text-align: center;
			font-size: 10px;
		}

		.fc-slats .fc-time {
			font-size: 12px;
			color: #666;
			font-family: $FONT;
			font-style: normal;
		}

	} // end #atom-calendar

	#atom-aam-modal {
		display: none;

		&.atom-aam-insert-modal {
			position: absolute;
			width: 100%;
			height: 100%;
			z-index: 30;
			overflow-x: hidden;
			overflow-y: scroll;
			-webkit-overflow-scrolling: touch;
			background-color: #cccccc;
			background-size: cover;
			background-repeat: no-repeat;
			background-position: bottom right;

			#atom-aam-modal-close {
				position: absolute;
				display: block;
				left: 60px;
				top: 16px;
				font-family: $FONT;
				font-style: normal;
				font-weight: normal;
				font-size: 16px;
				color: white;
				text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.5);

				&::before {
					content: '';
					display: inline-block;
					margin-top: 1.05em;
					margin-left: 0.6em;
					width: 14px;
					height: 14px;
					border-top: 3px solid white;
					border-right: 3px solid white;
					-moz-transform: rotate(-135deg);
					-webkit-transform: rotate(-135deg);
					transform: rotate(-135deg);
				}
			}

			.atom-modal-content {
				position: absolute;
				width: calc(100% - 120px);
				left: 60px;
				bottom: 30px;
				transform: translateY(50px);
				transition: transform 0.5s ease;
			}

			&.open {

				.atom-modal-content {
					transform: translateY(0);
				}
			}
		}

		&.atom-aam-popover-modal {
			position: fixed;
			overflow-y: scroll;
			overflow-x: hidden;
			-webkit-overflow-scrolling: touch;
			width: 100vw;
			height: 100vh;
			top: 0;
			left: 0;
			right: 0;
			bottom: 0;
			z-index: 99999999;
			background: rgba(0,0,0,0.3);

			.atom-modal-content {
				position: relative;
				width: 100%;
				max-width: 800px;
				margin: 60px auto;

				#atom-aam-modal-close {
					position: absolute;
					display: block;
					right: 0;
					top: 0;
					padding: 15px 15px 0 0;
					z-index: 999;
					font-family: $FONT;
					font-style: normal;
					font-weight: normal;
					font-size: 26px;
					line-height: 26px;
					color: black;
				}
			}
		}

		#atom-aam-modal-close:hover {
			cursor: pointer;
		}

		.atom-modal-content {
			background-color: white;
			overflow: hidden;

			.atom-modal-box {
				width: 50%;
				float: left;
				padding: 30px;
				box-sizing: border-box;

				&.left {
					background: rgba(250, 250, 250, 1);
				}

				&.right {
					position: absolute;
					top: 50%;
					transform: translateY(-50%);
					right: 0;
					max-height: 100%;
					overflow-y: scroll;
					overflow-x: hidden;
					-webkit-overflow-scrolling: touch;
					font-size: 16px;

					h2 {
						text-transform: uppercase;
						color: #222222;
						text-align: left;
					}

					ul {
						list-style: circle;
						margin: 15px 0 15px 20px;
						padding: 0;

						li {
							font-size: 16px;
						}
					}

					span {
						font-weight: bold;
						font-size: 16px;
					}

					.atom-aam-admin {
						display: none;
					}

					button {
						margin: 5px 0;
						width: 100%;
						border: none;
						color: #FFFFFF !important;
						border-radius: 4px;
						padding: 5px;
						font-size: 12px;
					}
				}
			}

			h2, h3, p {
				text-align: center;
				font-family: $FONT;
				font-style: normal;
				font-weight: normal;
				text-transform: none;
				margin: 0;
				padding: 0;
				color: #000;
				width: 100%;
				max-width: 100%;
			}

			h2 {
				font-size: 32px;
				font-weight: lighter;
			}

			h3 {
				font-size: 24px;
				font-weight: lighter;
				letter-spacing: 2px;

				span {
					display: block;
				}
			}

			p {
				color: #666;
			}

			a.atom-moreinfo {
				text-align: center;
				display: block;
				width: 100%;
				margin-top: 5px;
				font-size: 14px;
			}

			#atom-aam-form {
				position: relative;
				width: 100%;
				max-width: 360px;
				margin: 20px auto 0 auto;

				input, select, textarea {
					position: relative;
					display: block;
					margin: 10px auto;
					padding: 10px;
					width: 100%;
					font-size: 16px;
					box-sizing: border-box;
					border: 1px solid #CCC;
					box-shadow: none;
					border-radius: 4px;
					-webkit-appearance: none;
					-moz-appearance: none;
					appearance: none;
					transition: all 0.5s ease;
					font-family: $FONT;
					font-style: normal;
					font-weight: normal;
					color: black;
					background-color: white;
				}

				textarea {
					height: 80px;
				}

				select {
					background-image: url(../img/chevron-down.svg);
					background-repeat: no-repeat;
					background-size: 1em;
					background-position: calc(100% - 15px) 50%;
				}

				::placeholder { /* Chrome, Firefox, Opera, Safari 10.1+ */
					color: #444;
					opacity: 1; /* Firefox */
				}
				:-ms-input-placeholder { /* Internet Explorer 10-11 */
					color: #444;
				}

				::-ms-input-placeholder { /* Microsoft Edge */
					color: #444;
				}

				label[for=atom-aam-consent] {
					margin: 0;
					display: inline;

					input[type=checkbox] {
						width: auto;
						float: left;
						position: relative;
						margin-top: 4px;

						&:checked::before {
							display: block;
							position: absolute;
							content: '✓';
							left: 0;
							right: 0;
							top: 0;
							text-align: center;
							font-size: 18px;
							line-height: 20px;
						}
					}

					span {
						float: right;
						width: calc(100% - 30px);
						font-weight: 300;
						font-size: 14px;
						line-height: 1.4em;
						margin: 0 0 10px;
					}
				}

				a.atom-privacy-link {
					float: right;
					width: calc(100% - 30px);
					font-weight: 300;
					font-size: 14px;
					margin: -10px 0 10px;
					color: #000000;
					text-decoration: underline;

					&::after {
						display: block;
						content: '';
						clear: both;
					}
				}

				.atom-invalid-input {
					border-color: #aa1818 !important;

					&.wiggle {
						animation: shake 0.82s cubic-bezier(.36,.07,.19,.97) both;
						transform: translate3d(0, 0, 0);
						-webkit-backface-visibility: hidden;
						backface-visibility: hidden;
						perspective: 1000px;
					}

					@keyframes shake {
						10%, 90% {
						transform: translate3d(-1px, 0, 0);
						}

						20%, 80% {
						transform: translate3d(2px, 0, 0);
						}

						30%, 50%, 70% {
						transform: translate3d(-4px, 0, 0);
						}

						40%, 60% {
						transform: translate3d(4px, 0, 0);
						}
					}
				}

				input:focus {
					border-color: #50ae38 !important;
					outline-style: none;
					background: white !important;
				}

				button {
					display: block;
					margin: 10px auto;
					padding: 10px;
					width: 100%;
					border: none;
					color: #FFF !important;
					font-size: 16px;
					font-family: $FONT;
					font-style: normal;
					font-weight: normal;
					text-transform: none;
					border-radius: 4px;
					transition: all 0.5s ease;

					&:hover {
						cursor: pointer;
						opacity: 0.6;
					}
				}


			} // end #atom-form

		} // end .atom-modal-content

		#atom-aam-confirmation {
			display: none;
			background-color: white;
			padding: 0 30px;
			position: absolute;
			top: 0;
			width: 100%;
			height: 100%;
			transition: all 0.5s ease;

			.atom-confirmation-container {

				h2, h3, p {
					text-align: center;
					font-family: $FONT;
					font-style: normal;
					font-weight: normal;
					text-transform: none;
					margin: 0;
					padding: 0;
					color: #000;
					width: 100%;
					max-width: 100%;
				}

				h2 {
					margin-top: 30px;
					font-size: 32px;
					font-weight: lighter;
				}

				h3 {
					margin-bottom: 20px;
					font-size: 24px;
					font-weight: lighter;
					letter-spacing: 2px;
				}

				p {
					color: #666;
					font-size: 16px;
					line-height: 1.2em;
				}

				.atom-confirmation-ctas {
					display: flex;
					flex-flow: row;
					flex-grow: 2;
					margin: 20px -30px -1px;

					.atom-confirmation-cta {
						position: relative;
						display: block;
						transition: all 0.3s ease;
						width: 50%;
						padding-bottom: 50%;

						img {
							position: absolute;
							width: 100%;
							height: 100%;
							top: 0;
							left: 0;
							object-fit: cover;
						}

						&:hover {
							cursor: pointer;
							box-shadow: 0 0 10px rgba(0,0,0,0.2);
							transform: scale(1.02);
						}
					}
				}
			}


		} // end #atom-confirmation

	} // end #atom-modal

	&.confirmation-open {

		.atom-modal-content {
			height: calc(100% - 60px) !important;
		}
	}

	#atom-aam-list {

		.atom-aam-event {
			border-bottom: 1px solid #CCCCCC;
			padding: 15px 0 10px 0;
			transition: all 0.5s ease;
			font-family: $FONT;
			font-style: normal;
			font-weight: normal;
			font-size: 18px;

			&:first-child {
				border-top: 1px solid #CCCCCC;
			}

			&:hover {
				cursor: pointer;

				.atom-aam-category {
					width: 10px;
					margin: 0 5px 0 10px;
				}
			}

			.atom-aam-date {
				float: left;
				text-align: center;

				.atom-aam-day {
					font-size: 24px;
					line-height: 20px;
				}
			}

			.atom-aam-category {
				float: left;
				width: 5px;
				height: 46px;
				margin: 0 10px;
				transition: all 0.2s ease;
			}

			.atom-aam-info {
				float: left;
				text-align: left;

				.atom-aam-time {
					line-height: 20px;
				}

				.atom-aam-title {
					font-weight: bold;
				}
			}

			&::after {
				display: block;
				content: '';
				clear: both;
			}
		}
	}

}

// MOBILE
@media screen and (max-width: 756px) {
	#atom-appointment-management {
		margin: 0 !important;
		width: 100% !important;

		#atom-aam-calendar .fc-left, #atom-aam-calendar .fc-right {
			width: 100% !important;
			float: none !important;
		}

		#atom-aam-modal.atom-aam-insert-modal,
		#atom-aam-modal.atom-aam-popover-modal {
			background: rgba(250, 250, 250, 1) !important;

			#atom-aam-modal-close {
				position: relative;
				text-align: center;
				margin-top: 15px;
				left: auto;
				top: auto;
				color: #333;
				text-shadow: none;

				&::before {
					border-top: 3px solid #333;
					border-right: 3px solid #333;
				}
			}

			.atom-modal-content {
				position: relative !important;
				width: 100% !important;
				left: auto !important;
				bottom: auto !important;

				.atom-modal-box {
					width: 100% !important;
					float: none !important;

					&.right {
						display: none !important;
					}
				}
			}
		}

	}
}

// TABLET
@media screen and (min-width: 757px) and (max-width: 958px) {
	#atom-appointment-management {

		#atom-aam-modal.atom-aam-insert-modal,
		#atom-aam-modal.atom-aam-popover-modal {

			.atom-modal-content {
				width: calc(100% - 20px) !important;
				left: 10px !important;
				bottom: 10px !important;
			}
		}

		&.confirmation-open {

			.atom-modal-content {
				height: calc(100% - 20px) !important;
			}
		}
	}
}
