// ------------------------------------------------------------------
//
// UI
//
// 01. Base
// 02. Zindex
// 03. Fullscreen
// 04. Placeholder
// 05. Editor
// 06. Utility
// 07. Accessibility
// 08. Toolbar
// 09. Air
// 10. Toolbar & Air
// 11. Tooltip
// 12. Structure
// 13. Upload
// 14. Progress
// 15. Animation
//
// ------------------------------------------------------------------


// =Base
// ------------------------------------------------------------------
.redactor-box {
	position: relative;
	overflow: visible;
}
.redactor-layer,
.redactor-box {
	background: #fff;
}


// =Zindex
// ------------------------------------------------------------------
.redactor-layer,
.redactor-box,
.redactor-box textarea {
	z-index: auto;
}
.redactor-link-tooltip {
    z-index: 99;
}
.redactor-toolbar {
	z-index: 100;
}
.redactor-box-fullscreen {
	z-index: 1051;
}
.redactor-air,
.redactor-dropdown {
	z-index: 1052;
}
#redactor-modal-overlay,
#redactor-modal-box,
#redactor-modal {
	z-index: 1053;
}
.redactor-body-fullscreen .redactor-link-tooltip {
	z-index: 1099;
}


// =Fullscreen
// ------------------------------------------------------------------
.redactor-box-fullscreen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
}


// =Placeholder
// ------------------------------------------------------------------
.redactor-placeholder:after {
	position: absolute;
	top: 20px;
	left: 20px;
	content: attr(placeholder);
	display: block;
	color: rgba(0, 0, 0, .3);
	font-weight: normal !important;
}


// =Editor
// ------------------------------------------------------------------
.redactor-layer {
	position: relative;
	overflow: auto;
	margin: 0;
	padding: 24px 20px;
	padding-top: 20px;
	outline: none;
	white-space: normal;
    border: 1px solid rgba(0, 0, 0, .07);
}
.redactor-relative {
	position: relative;
}
.redactor-in {
	cursor: text;
}
.redactor-layer:focus,
.redactor-in:focus {
    outline: none;
}


// =Utility
// ------------------------------------------------------------------
.redactor-scrollbar-measure {
	position: absolute;
	top: -9999px;
	width: 50px;
	height: 50px;
	overflow: scroll;
}
.redactor-script-tag {
	display: none;
}
.redactor-layer-img-edit img {
	cursor: pointer;
}

// Accessibility
// ------------------------------------------------------------------
.redactor-voice-label {
	display: none;
}

.redactor-voice-alert {
	position: absolute;
	left: -3000px;
}


// =Toolbar
// ------------------------------------------------------------------
.redactor-toolbar {

	@include clearfix;

	position: relative;
	padding: 0 !important;
	background: #fff;
	border: none;
	box-shadow: 0 1px 2px rgba(0, 0, 0, .25);
}
.redactor-toolbar li a {
	color: rgba(0, 0, 0, .8);

	&:hover {
		outline: none;
		background-color: #3d79f2;
		color: #fff;
	}
	&:active,
	&.redactor-act {
		outline: none;
		background-color: #eee;
		color: #444;
	}
}
.redactor-toolbar li a.redactor-button-disabled {
	opacity: 0.3;
	&:hover {
		color: #333;
		outline: none;
		background-color: transparent !important;
		cursor: default;
	}
}
.redactor-toolbar li a.redactor-button-focus {
	color: #fff;
	background: #000;
}
.redactor-toolbar.redactor-toolbar-external {
	z-index: 999;
    border: 1px solid rgba(0, 0, 0, .1);
    box-shadow: none;
}


// =Air
// ------------------------------------------------------------------
.redactor-air {

	position: absolute;
	background: rgba(0, 0, 0, .9);
	padding: 0;
	max-width: 576px;
	min-width: 200px;
	border-radius: 4px;
	border: none;
}
.redactor-air li a {
	color: rgba(255, 255, 255, .75);

	&:hover {
		outline: none;
		background-color: rgba(31,120,216,1);
		color: #fff;
	}
	&:active,
	&.redactor-act {
		outline: none;
		background-color: #333;
		color: rgba(255, 255, 255, .5);
	}
}
.redactor-air li a.redactor-button-disabled {
	opacity: .3;
	&:hover {
		color: rgba(255, 255, 255, .3);
		outline: none;
		background-color: transparent !important;
		cursor: default;
	}
}
.redactor-air li a.redactor-button-focus {
	color: #333;
	background: #eee;
}


// =Toolbar & Air
// ------------------------------------------------------------------
.redactor-air,
.redactor-toolbar {
	font-family: $ui-font-family;
	margin: 0 !important;
	list-style: none !important;
	line-height: 1 !important;
}
.redactor-air li,
.redactor-toolbar li {
	vertical-align: top;
	display: inline-block;
	margin: 0 !important;
	padding: 0 !important;
	outline: none;
	list-style: none !important;
}
.redactor-air li a,
.redactor-toolbar li a {
    box-sizing: border-box;
	font-size: 14px;
	display: block;
	text-align: center;
	line-height: 48px;
	height: 48px;
	padding: 16px;
	padding-top: 17px;
	padding-bottom: 15px;
	cursor: pointer;
	outline: none;
	border: none;
	line-height: 1;
	text-decoration: none;
	cursor: pointer;
	zoom: 1;
	position: relative;

	&.re-button-icon {
    	padding: 16px;
    	font-size: 16px;
	}
	& .re-button-tooltip {
    	display: none;
    	position: absolute;
    	white-space: nowrap;
    	left: 50%;
        bottom: -18px;
        background: rgba(0, 0, 0, .9);
        border-radius: 2px;
        padding: 3px 8px;
        color: rgba(255, 255, 255, .8);
        font-size: 12px;
        font-family: $monospace-font-family;
	}
}
.redactor-toolbar li a {
	border-right: 1px solid rgba(0, 0, 0, .05);
}
.redactor-toolbar li:last-child a {
    border-right: none;
}


// =Tooltip
// ------------------------------------------------------------------
.redactor-link-tooltip {
	border-radius: 3px;
	font-family: $ui-font-family;
	position: absolute;
	padding: 16px;
	line-height: 1;
	display: inline-block;
	background-color: rgba(#000, .95);
	color: #555 !important;
	font-size: 14px;
}
.redactor-link-tooltip a {
	font-size: 14px;
	color: #ccc;
	margin: 0 8px;
	text-decoration: none;

	&:hover {
		color: #fff;
	}
}


// =Structure
// ------------------------------------------------------------------
.redactor-structure {

	h1, h2, h3, h4, h5, h6, div {
		position: relative;
		&:before {
			width: 24px;
			position: absolute;
			font-size: 10px;
			font-weight: normal;
			opacity: .3;
			left: -28px;
			text-align: right;
		}
	}
	h1:before  { content: "h1";  }
	h2:before  { content: "h2";  }
	h3:before  { content: "h3";  }
	h4:before  { content: "h4";  }
	h5:before  { content: "h5";  }
	h6:before  { content: "h6";  }
	div:before { content: "div"; }

}

// =Image
// ------------------------------------------------------------------
#redactor-image-box {
	position: relative;
	max-width: 100%;
	display: inline-block;
	line-height: 0;
	outline: 3px solid rgba(31,120,216,1);
	box-shadow: 0 0 12px rgba(31,120,216,1);
}
#redactor-image-editter {
	position: absolute;
	z-index: 5;
	top: 50%;
	left: 50%;
	margin-top: -11px;
	margin-left: -18px;
	line-height: 1;
	background-color: rgba(#000, .9);
	border-radius: 3px;
	color: #fff;
	font-size: 12px;
	padding: 7px 10px;
	cursor: pointer;
}
#redactor-image-resizer {
    box-sizing: border-box;
	position: absolute;
	z-index: 2;
	line-height: 1;
	cursor: nw-resize;
	bottom: -5px;
	right: -6px;
	border: 2px solid #000;
	background-color: rgba(#fff, .9);
	width: 10px;
	height: 10px;
}

// =Upload
// ------------------------------------------------------------------
#redactor-droparea {
	position: relative;
	overflow: hidden;
	padding: 64px 24px;
	border: 3px dashed rgba(0, 0, 0, .1);
}
#redactor-droparea.drag-hover {
	background: rgba(200, 222, 250, 0.75);
}
#redactor-droparea.drag-drop {
	background: rgba(250, 248, 200, 0.5);
}
#redactor-droparea-placeholder {
	text-align: center;
	font-size: 12px;
	margin-left: 64px;
	color: rgba(0, 0, 0, .7);
}
.redactor-image-dragover {
	outline: 2px solid #3d79f2;
}


// =Progress
// ------------------------------------------------------------------
#redactor-progress {
	position: fixed;
	top: 0;
	left: 0;
	width: 100%;
	z-index: 1000000;
	height: 10px;
}
#redactor-progress span {

	@include striped-redactor;
	@include animation-redactor(progress-bar-stripes 2s linear infinite);

	display: block;
	width: 100%;
	height: 100%;
	background-color: #3d58a8;
	background-size: 40px 40px;
}

@-webkit-keyframes progress-bar-stripes {
	from { background-position: 40px 0; }
	to { background-position: 0 0; }
}
@-o-keyframes progress-bar-stripes {
	from { background-position: 40px 0; }
	to { background-position: 0 0; }
}
@keyframes progress-bar-stripes {
	from { background-position: 40px 0; }
	to { background-position: 0 0; }
}


// =Animation
// ------------------------------------------------------------------
.redactor-animated {
	-webkit-animation-duration: 1s;
	animation-duration: 1s;
	-webkit-animation-fill-mode: both;
	animation-fill-mode: both;
}

// slideUp
@include keyframe(redactorSlideUp) {
	to {
		padding-top: 0;
		padding-bottom: 0;
		height: 0;
	}
}
.redactor-slideUp {
	overflow: hidden;
	-webkit-animation-name: redactorSlideUp;
	animation-name: redactorSlideUp;
}

// slideDown
@include keyframe(redactorSlideDown) {
	from {
		height: 0;
		padding-top: 0;
		padding-bottom: 0;
	}
}

.redactor-slideDown {
	overflow: hidden;
	-webkit-animation-name: redactorSlideDown;
	animation-name: redactorSlideDown;
}

// fadeIn
@include keyframe(redactorFadeIn) {
	from {
		opacity: 0;
	}
	to {
		opacity: 1;
	}
}

.redactor-fadeIn {
	-webkit-animation-name: redactorFadeIn;
	animation-name: redactorFadeIn;
}


// fadeOut
@include keyframe(redactorFadeOut) {
	from {
		opacity: 1;
	}
	to {
		opacity: 0;
	}
}

.redactor-fadeOut {
	-webkit-animation-name: redactorFadeOut;
	animation-name: redactorFadeOut;
}