// ------------------------------------------------------------------
//
// 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: 2;
}
.redactor-link-tooltip {
    z-index: 1050;
}
.redactor-toolbar-box {
	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;
	display: block;
	color: rgba(0, 0, 0, .3);
	content: attr(placeholder);
	font-weight: normal !important;
}


// =Editor
// ------------------------------------------------------------------
.redactor-layer {
    position: relative;
    overflow: auto;
    margin: 0;
    padding: 24px 32px 12px 32px;
    outline: none;
    border: 2px solid color($gray, light);
    border-top: 0;
    border-radius: 0 0 border-radius(s) border-radius(s);
    box-shadow: 0 3px rgba($black, .075);
    white-space: normal;
}
.redactor-relative {
	position: relative;
}
.redactor-in {
	cursor: text;
}
.redactor-layer:focus,
.redactor-in:focus {
    outline: none;
}


// =Utility
// ------------------------------------------------------------------
.redactor-scrollbar-measure {
	position: absolute;
	top: -9999px;
	overflow: scroll;
	width: 50px;
	height: 50px;
}
.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-box {
    position: sticky;
	top: 0;

	& .re-button-tooltip {
    	position: absolute;
    	z-index: 101;
    	display: none !important;
        padding: 3px 8px;
        border-radius: 2px;
        background: rgba(0, 0, 0, .9);
        color: rgba(255, 255, 255, .8);
    	white-space: nowrap;
        font-size: 12px;
        font-family: $monospace-font-family;
	}
}

.redactor-toolbar {

	@include clearfix;

	padding: 0 !important;
    border: 2px solid color($gray, light);
    border-bottom: 0;
    border-radius: border-radius(s) border-radius(s) 0 0;
 	background: #fff;
    box-shadow: 0 3px rgba($black, .075);
}
.redactor-toolbar.redactor-toolbar-overflow {
    overflow-y: auto;
    height: 48px;
    white-space: nowrap;
}
.redactor-toolbar li a {
	color: color($gray, dark);

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


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

	position: absolute;
	padding: 0;
	min-width: 200px;
	max-width: 576px;
	border: none;
	border-radius: 4px;
	background: rgba(0, 0, 0, .9);
}
.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 {
		outline: none;
		background-color: transparent !important;
		color: rgba(255, 255, 255, .3);
		cursor: default;
	}
}
.redactor-air li a.redactor-button-focus {
	background: #eee;
	color: #333;
}


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

	&.re-button-icon {
    	padding: 16px;
    	font-size: 16px;
	}
}
.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 {
	position: absolute;
	display: inline-block;
	padding: 16px;
	border-radius: 3px;
	background-color: rgba(#000, .95);
	color: #555 !important;
	font-size: 14px;
	font-family: $ui-font-family;
	line-height: 1;
}
.redactor-link-tooltip a {
	margin: 0 8px;
	color: #ccc;
	text-decoration: none;
	font-size: 14px;

	&:hover {
		color: #fff;
	}
}


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

	h1, h2, h3, h4, h5, h6, div {
		position: relative;
		&:before {
			position: absolute;
			left: -28px;
			width: 24px;
			text-align: right;
			font-weight: normal;
			font-size: 10px;
			opacity: .3;
		}
	}
	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;
	display: inline-block;
	max-width: 100%;
	outline: 3px solid color($blue, light);
	box-shadow: 0 0 12px color($blue, light);
	line-height: 0;
}
#redactor-image-editter {
	position: absolute;
	top: 50%;
	left: 50%;
	z-index: 5;
	margin-top: -11px;
	margin-left: -18px;
	padding: 7px 10px;
	border-radius: 3px;
	background-color: rgba(#000, .9);
	color: #fff;
	font-size: 12px;
	line-height: 1;
	cursor: pointer;
}
#redactor-image-resizer {
	position: absolute;
	right: -6px;
	bottom: -5px;
	z-index: 2;
    box-sizing: border-box;
	width: 10px;
	height: 10px;
	border: 2px solid #000;
	background-color: rgba(#fff, .9);
	line-height: 1;
	cursor: nw-resize;
}

// =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 {
	margin-left: 64px;
	color: rgba(0, 0, 0, .7);
	text-align: center;
	font-size: 12px;
}
.redactor-image-dragover {
	outline: 2px solid color($blue, light);
}


// =Progress
// ------------------------------------------------------------------
#redactor-progress {
	position: fixed;
	top: 0;
	left: 0;
	z-index: 1000000;
	width: 100%;
	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: color($blue, dark);
	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 {
		padding-top: 0;
		padding-bottom: 0;
		height: 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;
}
