@import 'atlas-variables';

.calendar-booking-invitations {
	min-height: 110px;

	.calendar-list-empty-message {
		margin: 4px 0 0 4px;
	}

	.field-label {
		margin-left: 15px;
	}
}

.calendar-booking-reminders .calendar-portlet-reminder-section {
	.reminder-duration {
		margin-bottom: 7px;
	}

	.reminder-type {
		margin: 0 6px 11px 0;
		padding: 4px 6px;
	}
}

.calendar-change-recurring-event-modal-content {
	.action-description {
		margin-bottom: 0;
		margin-top: 5px;
	}

	button {
		display: block;
		margin-bottom: 5px;
		width: 100%;
	}

	table {
		margin-top: 18px;
	}

	td {
		vertical-align: top;
	}

	tr {
		td:first-child {
			padding-right: 10px;
		}
	}
}

.calendar-list-empty-message {
	color: #666;
	margin-top: 4px;
}

.calendar-list-item {
	color: #222;
	cursor: pointer;
	display: block;
	line-height: 35px;
	overflow: hidden;
	padding: 0 5px;
	position: relative;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.calendar-list-item-hover,
.calendar-list-item-active {
	background-color: #dce3ea;
	white-space: -moz-pre-wrap;
	white-space: pre-line;
	white-space: pre-wrap;
	white-space: pre;
	word-wrap: break-word;

	.calendar-list-item-arrow {
		display: block;
	}
}

.calendar-list-item-arrow {
	background-color: #fff;
	border: 1px solid #b5b5b5;
	color: #656565;
	line-height: 1em;
	position: absolute;
	right: 5px;
	top: 9px;

	&:hover {
		background-color: #f0f0f0;
		color: #333;
	}

	.icon-caret-down {
		padding: 0 3px;
	}

	@include media-breakpoint-down(md) {
		font-size: 1.75em;
		top: 4px;

		.icon-caret-down {
			padding: 0 6px;
		}
	}
}

.calendar-list-item-color {
	border: 1px solid #dcdcdc;
	display: inline-block;
	height: 11px;
	margin-right: 4px;
	position: relative;
	top: 2px;
	width: 11px;
}

.calendar-list-item-label {
	line-height: 13px;
}

.calendar-list-item-hidden .calendar-list-item-label {
	color: #555;
}

.calendar-portlet {
	.allday-class-active .lfr-input-time {
		display: none;
	}

	.calendar-create-event-btn-row {
		margin: 0 0 1em;
		text-align: center;
	}

	@include media-breakpoint-between(md, lg) {
		.calendar-portlet-column-parent {
			.calendar-portlet-column-grid,
			.calendar-portlet-column-options {
				float: none;
				margin: 0;
				width: 100%;
			}
		}
	}

	.calendar-portlet-column-grid {
		position: relative;

		.calendar-portlet-column-toggler {
			bottom: 0;
			margin-left: -10px;
			position: absolute;
			top: 0;
			width: 10px;

			&:hover {
				background: #e9e9e9;
				cursor: pointer;
			}

			.lexicon-icon-caret-left,
			.lexicon-icon-caret-right {
				left: 50%;
				margin: -14px 0 0 -7px;
				position: absolute;
				top: 50%;
			}
		}

		.scheduler-event {
			z-index: 300;
		}
	}

	.lfr-discussion-reply-container {
		.button-holder.dialog-footer {
			bottom: 0;
			display: block;
			left: unset;
			padding: 10px 0;

			.btn {
				margin-left: 0;
			}

			.btn-cancel {
				margin-left: 1rem;
			}
		}
	}

	.modal-title {
		text-transform: capitalize;
	}

	.header-title {
		margin-top: 1rem;
	}

	.popover.scheduler-event-recorder-popover {
		max-width: none;
		padding: 10px 15px 0;

		.popover-content .close {
			position: absolute;
			right: 10px;
			top: 5px;
		}
	}

	.scheduler-event-content,
	.scheduler-event-title {
		font-family: inherit;
		font-size: inherit;
		line-height: inherit;
		padding: 2px 4px;
	}

	.popover.scheduler-event-recorder-popover {
		max-width: none;
	}

	.scheduler-view-agenda-info-container {
		font-size: 1em;

		.scheduler-view-agenda-info {
			.scheduler-view-agenda-info-biggie {
				padding: 0 8px;
			}

			.scheduler-view-agenda-info-label {
				padding: 10px 0 10px 8px;
			}
		}
	}
}

.calendar-event-answer {
	font-weight: bold;

	&.calendar-event-answer-false {
		&,
		&:hover {
			color: #555;
			cursor: default;
			text-decoration: none;
		}
	}
}

.calendar-portlet-add-calendars-input {
	max-width: 90%;
}

.calendar-portlet-availability {
	margin: 0 30px;
}

.calendar-portlet-calendar-list {
	margin-left: 11px;

	.calendar-portlet-add-calendars-input {
		margin: 2px 0 5px;
		padding: 5px 4px;
		width: 200px;
	}
}

.calendar-portlet-colors {
	width: 240px;
}

.calendar-portlet-color-box {
	display: inline-block;
	height: 80%;
	vertical-align: middle;
	width: 80%;
}

.calendar-portlet-confirmation-text {
	padding: 5px;
}

.calendar-portlet-event-loading {
	opacity: 0.5;
}

.calendar-portlet-event-draft,
.calendar-portlet-event-denied,
.calendar-portlet-event-maybe,
.calendar-portlet-event-pending {
	opacity: 0.8;
}

.calendar-portlet-event-denied .scheduler-event-content {
	text-decoration: line-through;
}

.calendar-portlet-event-recorder {
	table td {
		padding: 5px;
	}
}

.calendar-portlet-field-date {
	white-space: nowrap;

	.calendar-portlet-field-datepicker {
		display: inline-block;
	}
}

.calendar-portlet-import-container {
	.portlet-msg-error,
	.portlet-msg-help,
	.portlet-msg-success {
		margin: 10px 0;
		width: 420px;
	}

	.field-input-text {
		width: 454px;
	}
}

.calendar-portlet-invite-resources-input {
	margin: 2px 0;
	width: 350px;
}

.calendar-portlet-list {
	position: relative;
}

.calendar-portlet-list-arrow {
	background: url(@theme_image_path@/aui/icon_sprite.png) -34px -18px;
	display: inline-block;
	height: 13px;
	vertical-align: middle;
	width: 12px;
}

.calendar-portlet-list-header {
	color: #222;
	cursor: pointer;
	display: block;
	font-weight: normal;
	line-height: 35px;
	margin: 10px 0 0;
	padding: 2px 0;
	position: relative;
	text-decoration: none;

	&:hover {
		background-color: #dce3ea;
		color: #222;
	}

	.calendar-list-item-arrow {
		top: 12px;

		@include media-breakpoint-down(md) {
			top: 6px;
		}
	}
}

.calendar-portlet-list-text {
	vertical-align: middle;
}

.calendar-portlet-recurrence-container {
	.field-content,
	.field-wrapper-content {
		margin: 2px;
	}

	table {
		width: 100%;
	}
}

.calendar-portlet-recurrence-content {
	.calendar-portlet-recurrence-limit {
		input[type='text'] {
			max-width: 40%;
		}

		label,
		input {
			display: inline-block;
			margin: 0 4px 0 0;
		}

		&.control-group {
			margin-bottom: 10px;
		}

		&.field-wrapper {
			margin-bottom: 5px;
			margin-top: 10px;
		}
	}

	&.calendar-recurrence-weekday-checkbox {
		padding-top: 10px;

		label {
			display: inline-block;
		}
	}
}

.calendar-portlet-recurrence-summary {
	display: block;
	font-weight: bold;
	margin-top: 8px;
	text-transform: capitalize;

	span {
		text-transform: none;
	}
}

.calendar-portlet-recurrence-title {
	font-weight: bold;
	margin-right: 10px;
	padding: 10px 10px 0;
	text-align: right;
	vertical-align: top;
	width: 33%;
}

.calendar-portlet-time-zone-field .field .field-content {
	margin: 0;
}

.calendar-portlet-wrapper {
	background: #fff;

	.scheduler-event-all-day .scheduler-event-title {
		display: none;
	}

	.scheduler-event-disabled {
		opacity: 0.8;
	}
}

.col-md-4 .calendar-portlet .popover.scheduler-event-recorder-popover {
	max-width: 232px;
}
.dropdown-menu.clay-color-dropdown-menu {
	z-index: 1021;
}
.portal-popup .calendar-portlet .fieldset {
	margin-bottom: 2em;
}

.rss-time-interval {
	margin-top: -1em;
}

.scheduler-base-controls {
	flex: 0 0 100%;
	max-width: 100%;
	width: 50%;

	.btn-group {
		button {
			margin-left: 0 !important;
		}

		button:not(:last-child) {
			border-right: 1px;
		}

		.calendar-add-event-btn {
			margin-right: 3px;

			@include media-breakpoint-down(sm) {
				width: 100%;
			}
		}
	}
}

.scheduler-base-hd .scheduler-base-views {
	align-items: start;
	flex: 0 0 100%;
	max-width: 100%;

	button {
		border-color: #cdced9;
		border-right: 1px;
		color: #6b6c7e;
		margin-left: 0 !important;

		&:hover,
		&:focus,
		&:hover,
		&.active {
			background-color: #f1f2f5;
			color: inherit;
		}

		&.btn:last-of-type {
			border-bottom-right-radius: 4px;
			border-right: solid 1px #cdced9;
			border-top-right-radius: 4px;
		}
	}
}

.scheduler-base-icon-next span,
.scheduler-base-icon-prev span {
	font-size: 16px;
}

.scheduler-event-past {
	opacity: 0.4;
}

.scheduler-event-recorder-body select {
	max-width: 340px;
	width: 100%;
}

.scheduler-event-recorder-header .scheduler-event-recorder-content {
	background: #fafafa;
	border: 1px solid #c4c4c4;
	outline-width: 0;
	padding: 7px;
	width: 90%;

	&:hover {
		background: #ffc;
		border-color: #fc0;
	}
}

.scheduler-event-recorder-popover .popover-content .close {
	position: absolute;
	right: 10px;
	top: 5px;
}

.scheduler-view-agenda {
	margin-top: -13px;
}

.scheduler-view-day .scheduler-view-table .scheduler-view-table-data-col {
	padding-top: 5px;
}

.scheduler-view-day-content .yui3-widget-hd {
	padding-top: 4px;
}

.scheduler-view-day-header-day a {
	padding: 2px;
}

.scheduler-view-day-header-view-label {
	color: $gray-700;
}

.scheduler-view-table-data-event {
	padding: 0 3px;
}

.scheduler-view-table-events-overlay-node {
	max-height: 500px;
	overflow-y: auto;
}

.simple-menu {
	position: absolute;

	.simple-menu-content {
		background: none repeat scroll 0 0 #fff;
		border: 1px solid rgba(0, 0, 0, 0.2);
		margin: 0;
		outline: medium none;
		padding: 6px 0;
	}
}

.simple-menu-hidden {
	display: none;
}

.simple-menu-item {
	color: #333;
	cursor: pointer;
	list-style-type: none;
	overflow: hidden;
	padding: 6px 30px;
	text-overflow: ellipsis;
	white-space: nowrap;

	&:hover {
		background-color: #eee;
		border: dotted #eee;
		border-width: 1px 0;
		padding-bottom: 5px;
		padding-top: 5px;
	}

	i {
		float: left;
		margin-left: -1.4em;
		padding-top: 7px;
	}
}

.simple-menu-separator {
	border-top: 1px solid #ebebeb;
	font-size: 0;
	height: 0;
	margin: 6px 0;
}

.simple-menu-item-hidden {
	display: none;
}

.simple-color-picker {
	white-space: normal;
}

.simple-color-picker-item {
	border: 1px solid;
	cursor: pointer;
	display: inline-block;
	height: 14px;
	margin: 0 4px 4px 0;
	width: 14px;

	@include media-breakpoint-down(md) {
		height: 18px;
		width: 18px;
	}
}

.simple-color-picker-item:hover,
.simple-color-picker-item-selected {
	border-color: #000 !important;
}

.toggler-header-expanded .calendar-portlet-list-arrow {
	background-position: -66px -18px;
}

.yui3-skin-sam .calendar-portlet-mini-calendar .yui3-calendar-content {
	background: #fff !important;
	border: 1px solid #ddd;
}

// ---------- YUI calendar ----------

.yui3-skin-sam .calendar-portlet-mini-calendar {
	.yui3-calendar-day,
	.yui3-calendar-header-label,
	.yui3-calendar-weekday {
		font-weight: 200;
	}

	.yui3-calendar-day,
	.yui3-calendar-prevmonth-day,
	.yui3-calendar-nextmonth-day,
	.yui3-calendar-content {
		border-width: 0;
	}

	.yui3-calendar-weekday {
		color: $primary-d2;
	}

	.yui3-calendar-day {
		padding: 5px 0 10px;
		width: 14.286%;

		&:hover,
		&.yui3-calendar-day-selected:hover,
		&.yui3-calendar-day-selected.lfr-busy-day:hover {
			background: #bbb;
			color: #fff;
		}

		&.yui3-calendar-day-selected,
		&.yui3-calendar-day-selected.lfr-busy-day {
			background-color: #f2f2f2;
		}

		&.lfr-busy-day,
		&.yui3-calendar-day-selected.lfr-busy-day {
			font-weight: bold;
			padding-bottom: 0;
		}

		&.lfr-current-day {
			background-color: #009be6 !important;
			color: #fff !important;
		}
	}

	.lfr-busy-day:after {
		content: '\25CF';
		display: block;
		font-size: 0.8em;
		margin-top: -9px;
	}

	.yui3-aclist-list {
		margin: 0;
	}
}

// ---------- Extras ----------

.scheduler-event-recorder-content {
	background-image: linear-gradient(to bottom, #f7f7f7, #fff);
	box-shadow: inset 0 1px 2px #ddd;

	@include transition(background 0.3s ease-in, border-color 0.3s ease-out);
}

.calendar-portlet .yui3-calendar-day,
.scheduler-event-recorder-content {
	border-radius: 2px;
}

.calendar-portlet-wrapper {
	border-radius: 5px;
}

.calendar-list-item .calendar-list-item-color,
.calendar-list-item-arrow,
.calendar-list-item-arrow .icon-caret-down {
	border-radius: 3px;
}

.simple-color-picker-item {
	border-radius: 1px;

	@include transition(border-color 0.13s);
}

.simple-menu-content {
	box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.simple-menu-item {
	@include transition(background 0.13s);

	&:hover {
		@include transition(background 0s);
	}
}

.simple-color-picker-item:hover,
.simple-color-picker-item-selected {
	@include transition(border-color 0s);
}

@include media-breakpoint-down(md) {
	.scheduler-view-table-header-day div {
		overflow: hidden;
	}
}

@include media-breakpoint-down(sm) {
	.scheduler-base-content {
		.scheduler-base-controls,
		.scheduler-base-controls .btn-group,
		.scheduler-base-hd .scheduler-base-views,
		.scheduler-base-view-date {
			text-align: center;
			width: 100%;
		}

		.scheduler-base-hd {
			.scheduler-base-controls .btn-group {
				&:nth-child(2),
				.scheduler-base-views {
					margin-top: 5px;
				}
			}
		}
	}

	.scheduler-base-controls .btn-group {
		button {
			max-height: 40px;
		}

		.scheduler-base-today {
			width: 50%;
		}
	}

	.scheduler-base-hd .btn-group button {
		width: 25%;
	}

	.scheduler-base-views button {
		float: none;
	}

	.scheduler-view-day-header-day-weekday {
		font-size: 0;

		&:first-letter {
			font-size: 14px;
		}
	}
}

@mixin col-md-4 {
	.calendar-portlet-column-parent {
		.calendar-list-item-arrow {
			font-size: 1.75em;
			top: 4px;

			.icon-caret-down {
				padding: 0 6px;
			}
		}

		.calendar-portlet-column-grid,
		.calendar-portlet-column-options {
			flex: 0 0 100%;
			max-width: 100%;
			width: 100%;
		}

		.calendar-portlet-list-header .calendar-list-item-arrow {
			top: 6px;
		}

		.scheduler-base-content {
			.scheduler-base-hd .scheduler-base-views {
				margin-top: 4px;

				button {
					padding-left: 2px;
					padding-right: 2px;
				}
			}

			.scheduler-base-controls,
			.scheduler-base-controls .btn-group,
			.scheduler-base-hd .scheduler-base-views,
			.scheduler-base-view-date {
				text-align: center;
				width: 100%;
			}
		}

		.scheduler-base-controls .btn-group {
			.calendar-add-event-btn {
				margin-bottom: 5px;
				width: 100%;
			}

			.scheduler-base-today {
				width: 50%;
			}
		}

		.scheduler-base-hd .btn-group button {
			width: 25%;
		}

		.scheduler-view-day-header-day-weekday {
			font-size: 0;

			&:first-letter {
				font-size: 14px;
			}
		}

		.scheduler-view-table-header-day div {
			overflow: hidden;
		}

		.simple-color-picker-item {
			height: 18px;
			width: 18px;
		}
	}
}

@mixin col-md-6 {
	.calendar-portlet-column-parent {
		.calendar-portlet-column-grid {
			flex: 0 0 60%;
			max-width: 60%;
			width: 60%;

			&.col-md-12 {
				flex-basis: 100%;
				max-width: 100%;
				width: 100%;
			}

			.scheduler-base-content .scheduler-base-hd {
				.scheduler-base-controls {
					width: 100%;

					.btn-group {
						&:nth-child(1) {
							margin-right: 3px;
							width: 49%;

							.calendar-add-event-btn {
								width: 100%;
							}
						}

						&:nth-child(2) {
							float: right;
							width: 49%;

							button {
								&:nth-child(1),
								&:nth-child(3) {
									padding-left: 10px;
									padding-right: 10px;
									width: 25%;
								}

								&:nth-child(2) {
									width: 50%;
								}
							}
						}
					}
				}

				.scheduler-base-views {
					width: 100%;

					button {
						width: 25%;

						&.scheduler-base-view-agenda {
							padding-left: 2px;
							padding-right: 2px;
						}
					}
				}
			}
		}

		.calendar-portlet-column-options {
			flex: 0 0 40%;
			max-width: 40%;
			width: 40%;
		}
	}
}

@mixin col-md-8 {
	.calendar-portlet-column-parent {
		.calendar-portlet-column-grid {
			flex: 0 0 65%;
			max-width: 65%;
			width: 65%;

			&.col-md-12 {
				flex-basis: 100%;
				max-width: 100%;
				width: 100%;
			}

			.scheduler-base-content .scheduler-base-hd {
				.scheduler-base-controls {
					width: 100%;

					.btn-group {
						&:nth-child(1) {
							margin-right: 3px;
							width: 46%;

							.calendar-add-event-btn {
								width: 100%;
							}
						}

						&:nth-child(2) {
							float: right;
							width: 46%;

							button {
								&:nth-child(1),
								&:nth-child(3) {
									width: 30%;
								}

								&:nth-child(2) {
									padding-left: 2px;
									padding-right: 2px;
									width: 40%;
								}
							}
						}
					}
				}

				.scheduler-base-views {
					margin-top: 5px;
					width: 100%;

					button {
						width: 25%;
					}
				}
			}
		}

		.calendar-portlet-column-options {
			flex: 0 0 35%;
			max-width: 35%;
			width: 35%;
		}
	}
}

@include media-breakpoint-up(md) {
	.col-md-4,
	.col-md-6 {
		@include col-md-4;
	}

	.col-md-8 {
		@include col-md-8;
	}
}

@include media-breakpoint-up(lg) {
	.col-md-4 {
		@include col-md-4;
	}

	.col-md-6 {
		@include col-md-6;
	}

	.col-md-8 {
		@include col-md-8;
	}
}

@media (max-width: 1279px) and (min-width: 767px) {
	.scheduler-base-views {
		margin-bottom: 20px;
		margin-top: 20px;
	}
}

@media (min-width: 767px) {
	.portal-popup .calendar-portlet .dialog-footer {
		position: relative;
	}
}
