
@mixin keyframes($name) {
	@-o-keyframes #{$name} {
		@content;
	}

	@-moz-keyframes #{$name} {
		@content;
	}

	@-webkit-keyframes #{$name} {
		@content;
	}

	@keyframes #{$name} {
		@content;
	}
}

@include keyframes(shakeNotificationCount) {
	0% {
		@include transform(rotate(5deg));
	}
	25% {
		@include transform(translate(3px, -4px), rotate(0deg));
	}
	50% {
		@include transform(rotate(-5deg));
	}
	75% {
		@include transform(rotate(0deg));
	}
	100% {
		@include transform(translate(0, 0), rotate(5deg));
	}
}

.dockbar-user-notifications, .notifications-portlet {
	.user-notifications-count {
		background-color: #0066B3;
		border: 1px solid #0066B3;
		display: block;
		line-height: 1.25em;
		margin: 4px 0;
		padding: 2px 6px;
		position: relative;

		&.alert {
			background-color: #FAA732;
			border: 1px solid #FAA732;
			color: #FFF;

			@include experimental(animation, shakeNotificationCount 0.8s linear infinite);
			@include experimental(animation-iteration-count, 2);
			@include experimental(transform-origin, 50% 50%);
		}
	}

	.dropdown-menu {
		width: 350px;
	}

	.user-notifications-list {
		list-style: none;

		.message {
			text-align: center;

			.left-nav {
				float: left;
				padding: 0 10px;
			}

			.right-nav {
				float: right;
				padding: 0 10px;
			}

			a:hover {
				text-decoration: none;
			}

			.disabled a {
				color: #FFF;
				cursor: default;
			}
		}

		.user-notification {
			background: #FFF;

			@include border-radius(4px);

			margin-bottom: 10px;
			padding: 10px;

			&:hover, &.hover {
				background: #FAFAFA;
				cursor: pointer;
			}

			.btn {
				margin-right: 10px;
			}

			.icon-remove-circle {
				left: 330px;
				position: relative;
				top: 20px;
			}

			.sender {
				float: left;
				position: relative;

				.user-thumbnail img {
					@include border-radius(50%);
					@include box-shadow(0 0 0 2px #5594E0);

					margin: 5px 10px 0 0;
					width: 30px;
				}

				.portlet-icon {
					bottom: 0;
					left: 0;
					position: absolute;
				}
			}

			.read {
				float: right;
				font-size: 11px;
			}

			.timestamp {
				display: inline;
				font-size: 11px;
			}

			.content {
				margin-left: 40px;
			}

			.body {
				color: #222;
				overflow: hidden;
				text-overflow: ellipsis;
			}
		}
	}
}

.notifications-portlet {
	.user-notifications-sidebar {
		float: left;
		padding: 0 10px 0 0;
		width: 18%;
	}

	.nav {
		margin-bottom: 10px;

		a {
			display: block;
			padding: 5px 10px;

			.title {
				float: left;
			}

			.count {
				float: right;
			}

			&:hover {
				text-decoration: none;
			}
		}

		a:hover, a.selected {
			background-color: #0A85E4;
			color: #FFF;
		}
	}

	.user-notifications-list-container {
		border: 1px solid #D5D5D5;
		float: left;
		width: 80%;

		.loading-mask {
			min-height: 30px;
		}
	}

	.user-notifications-list {
		.user-notification {
			color: #000;

			&:hover {
				color: #FFF;
			}

			&.unread {
				background-color: #FAFAFA;

				&:hover {
					background: #2FA4F5;
				}
			}

			a {
				color: #009AE5;
			}
		}

		.message.top {
			border-bottom: 1px solid #D5D5D5;
		}
	}

	.manage-notifications {
		padding: 5px;

		.title {
			margin-bottom: 10px;

			.notification-delivery {
				font-size: 16px;
				font-weight: bold;
				margin-bottom: 10px;
			}
		}

		.notification-deliveries {
			caption {
				font-size: 14px;
				font-weight: bold;
				margin-bottom: 10px 0;
				text-align: left;
			}
		}
	}
}

/* ---------- Extras ---------- */

.dockbar-user-notifications .user-notifications-count, .notifications-portlet .nav a:hover, .notifications-portlet .nav a.selected, .notifications-portlet .user-notifications-list-container {
	@include border-radius(4px);
}

.aui {
	li.user-notification {
		line-height: 20px;
	}

	.dockbar .nav li.dropdown.dockbar-user-notifications .dropdown-menu {
		left: auto;
		max-height: none;
		padding: 10px;
		right: 0;

		&.pull-right:after {
			right: 20px;
		}
	}
}