/**
 * AWS wrap
 */
.aws-main.wrap {
	position: relative;

	& > h1 {
		float: left;
	}

	.as3cf-notice, .as3cf-updated, .as3cf-error {
		-webkit-box-sizing: border-box;
		-moz-box-sizing: border-box;
		box-sizing: border-box;
	}

	.as3cf-error.fatal {
		clear: both;
	}

	h2.nav-tab-wrapper {
		float: none;
		margin-bottom: 15px;
		width: 650px;
		margin-top: 10px;
		padding: 9px 0 0 5px;

		a.nav-tab-active {
			color: #464646;
			cursor: default;
		}

		a:focus {
			-webkit-box-shadow: none;
			box-shadow: none;
		}
	}

	.more-info {
		white-space: nowrap;
	}

	.error {
		pre {
			background: #eaeaea;
			background: rgba(0, 0, 0, 0.07);
			display: block;
			padding: 10px 15px;

			code {
				padding: 0;
				background: none;
			}
		}
	}

	&[data-tab="support"] {
		.as3cf-notice, .error, .updated, .updated.show {
			display: none;
		}
		.fatal .error, .as3cf-notice.important, .dbrains-api-down {
			display: block;
		}
	}
	.as3cf-notice, .error, .updated {
		max-width: 650px;
		margin-top: 15px;
		-webkit-box-sizing: border-box;
		-moz-box-sizing: border-box;
		box-sizing: border-box;
	}

	.as3cf-updated {
		display: none;
		&.as3cf-notice, &.show {
			display: block;
		}
	}
}

/**
 * Bucket select
 */
.as3cf-tab {
	.as3cf-main-settings {
		display: none;
	}

	.as3cf-bucket-container {
		display: block;
	}

	&.as3cf-has-bucket {
		.as3cf-main-settings {
			display: block;
		}

		.as3cf-bucket-container {
			display: none;
		}
	}
}

/**
 * Settings
 */
.as3cf-tab {
	display: none;
	position: relative;
	width: 650px;

	.as3cf-main-settings {
		p {
			font-size: 13px;
			a {
				color: #444;
			}
		}
	}

	.object-prefix-desc {
		em {
			white-space: nowrap;
		}
	}

	.as3cf-url-preview-wrap {
		background: #fff;
		text-align: center;
		padding: 20px 0 0;
		max-width: 650px;
		width: 100%;
		-webkit-box-sizing: border-box;
		-moz-box-sizing: border-box;
		box-sizing: border-box;

		.as3cf-url-preview {
			margin-top: 10px;
			padding: 0 20px 10px;
			overflow-x: scroll;
		}
		span {
			color: #aaa;
			text-transform: uppercase;
			font-weight: bold;
		}
	}

	.as3cf-radio-group {
		label {
			display: block;
			margin-bottom: 10px;
			&.disabled, &.disabled p {
				color: #bbb;
				cursor: default;
			}
		}

		p {
			padding-left: 25px;
			color: #6b6b6b;
			margin: 0;
			font-size: 12px;
			&.as3cf-setting {
				margin-top: 5px;
			}
		}
	}

	.as3cf-switch {
		position: relative;
		display: inline-block;
		padding: 2px;
		overflow: hidden;
		border-radius: 2px;
		-webkit-border-radius: 2px;
		background-color: #d4d3d3;
		cursor: pointer;

		&.on {
			background-color: #ade7b5;
		}

		span {
			visibility: hidden;
			-webkit-box-sizing: border-box;
			-moz-box-sizing: border-box;
			box-sizing: border-box;
			float: left;
			display: inline-block;
			height: 100%;
			font-size: 12px;
			line-height: 20px;
			border-radius: 2px;
			-webkit-border-radius: 2px;
			font-weight: bold;
			padding: 4px 8px;
			background: #fff;
			color: #8d8d8d;
			z-index: 1;

			&.on {
				color: #82d78b;
			}

			&.checked {
				visibility: visible;
			}
		}

		&.disabled {
			cursor: default;
			background: #e6e6e6;

			span {
				background: #f1f1f1;
				color: #d6d6d6;
			}
		}

		input[type="checkbox"] {
			position: absolute !important;
			top: 0;
			left: 0;
			opacity: 0;
			filter: alpha(opacity=0);
			z-index: -1;
		}
	}

	.as3cf-setting {
		&.hide {
			display: none;
		}
	}

	div.as3cf-setting {
		margin-top: 4px;
	}

	h3 {
		font-weight: normal;
		text-transform: uppercase;
		margin: 15px 0;
	}

	.form-table {
		margin: 0;

		tr {
			&.as3cf-border-bottom td {
				border-bottom: 1px solid #ddd;
				padding: 20px 0px;
			}
			&.as3cf-setting-title td {
				padding-bottom: 0;
			}
			&.as3cf-setting-title:first-child td {
				padding-top: 20px;
			}
			td {
				padding: 15px 0;
				&:first-child {
					vertical-align: top;
					min-width: 120px;
				}

				.as3cf-notice:last-child {
					margin-bottom: 0;
				}

				& > p:first-child {
					margin-top: 0;
				}
			}

			&:first-of-type {
				td {
					padding-top: 5px;
				}
			}
		}

		tr.as3cf-bucket-setting .as3cf-defined-in-config {
			float: none;
		}

		h3 {
			padding: 0;
			margin: 0;
		}
		h4 {
			margin: 0;
		}
	}

	.as3cf-active-bucket {
		font-weight: bold;
		margin-right: 10px;
	}
	.as3cf-view-bucket {
		color: #444;
		text-decoration: none;
		margin-right: 10px;
		&:hover, &:active {
			color: #00a0d2;
		}
		&:focus {
			box-shadow: none;
		}
		.dashicons-external {
			margin-top: -2px;
		}
	}

	.tooltip {
		position: relative;
		z-index: 2;
		cursor: pointer;
	}

	/* Hide the tooltip content by default */
	.tooltip:before,
	.tooltip:after {
		visibility: hidden;
		-ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=0)";
		filter: progid:DXImageTransform.Microsoft.Alpha(Opacity=0);
		opacity: 0;
		pointer-events: none;
	}

	/* Position tooltip above the element */
	.tooltip:before {
		position: absolute;
		bottom: 150%;
		left: 50%;
		margin-bottom: 5px;
		margin-left: -250px;
		padding: 10px;
		width: 500px;
		-webkit-border-radius: 3px;
		-moz-border-radius: 3px;
		border-radius: 3px;
		background-color: #000;
		background-color: hsla(0, 0%, 20%, 0.9);
		color: #fff;
		content: attr(data-tooltip);
		text-align: center;
		font-size: 14px;
		line-height: 1.3;
	}

	/* Triangle hack to make tooltip look like a speech bubble */
	.tooltip:after {
		position: absolute;
		bottom: 150%;
		left: 50%;
		margin-left: -5px;
		width: 0;
		border-top: 5px solid #000;
		border-top: 5px solid hsla(0, 0%, 20%, 0.9);
		border-right: 5px solid transparent;
		border-left: 5px solid transparent;
		content: " ";
		font-size: 0;
		line-height: 0;
	}

	/* Show tooltip content on hover */
	.tooltip:hover:before,
	.tooltip:hover:after {
		visibility: visible;
		-ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=100)";
		filter: progid:DXImageTransform.Microsoft.Alpha(Opacity=100);
		opacity: 1;
	}

	.as3cf-defined-in-config {
		background: #ccc;
		color: #fff;
		padding: 2px 5px;
		margin: 0 0 5px 5px;
		float: right;
	}

	.as3cf-defined-setting {
		color: #bbb;

		label {
			cursor: default;
		}

		p .more-info a {
			color: #bbb;
		}

		.as3cf-radio-group p {
			color: #bbb;
		}

		.as3cf-notice {
			display: none !important;
		}
	}
}

/**
 * Media tab
 */
#tab-media {
	display: block;

	.as3cf-main-settings {
		display: none;
	}

	.as3cf-bucket-container {
		display: block;
	}

	&.as3cf-has-bucket {
		.as3cf-main-settings {
			display: block;
		}

		.as3cf-bucket-container {
			display: none;
		}
	}
}

/**
 * Bucket select
 */
.as3cf-bucket-container {
	h3 {
		line-height: 1.3;
		text-transform: none;
	}

	a:focus {
		-webkit-box-shadow: none;
		box-shadow: none;
		outline: none;
	}

	input[type=text] {
		box-sizing: border-box;
		width: 100%;
	}

	select {
		box-sizing: border-box;
		width: 50%;
	}

	.form-table {
		td {
			padding: 5px 0;

			&:first-child {
				width: 100px;
				line-height: 30px;
				vertical-align: top;
			}
		}
	}

	.bucket-actions {
		margin: 15px 0;
		border-top: 1px solid #ccc;
		padding-top: 15px;
		overflow: hidden;

		button,
		.right {
			float: right;
			margin-right: 0;
		}

		span {
			display: inline-block;
			margin-right: 20px;
			line-height: 28px;
		}

		.bucket-action-cancel {
			color: #a00;
			text-decoration: none;

			&:hover {
				color: red;
			}
		}
	}

	.as3cf-bucket-list {
		padding: 15px;
		max-height: 200px;
		overflow-x: hidden;
		overflow-y: auto;
		background-color: #fff;
		font-size: 14px;

		li:last-of-type {
			margin-bottom: 0;
		}

		a {
			color: #444;
			text-decoration: none;

			&:hover {
				color: #0074a2;
			}

			&.selected {
				font-weight: bold;
				color: #0074a2;
			}

			.dashicons {
				margin-right: 5px;
			}
		}
	}

	.as3cf-bucket-select,
	.as3cf-bucket-create {
		display: none;
	}

	.bucket-actions.select {
		display: none;
	}
}

.as3cf-tab {
	display: none;
}

#tab-media {
	display: block;
}

#tab-support {
	min-height: 900px;
	.as3cf-sidebar {
		top: 11px;
	}

	.support-section {
		border-bottom: 1px solid #ccc;
		padding-bottom: 20px;
		margin-bottom: 20px;
	}

	.debug {
		textarea {
			width: 100%;
			min-height: 200px;
			font-family: Consolas, Monaco, monospace;
			margin-bottom: 5px;
		}
	}
}

/**
 * Sidebar
 */
.as3cf-sidebar {
	position: absolute;
	top: 9px;
	left: 670px;
	width: 292px;

	.block {
		padding: 20px;
		border: 1px solid #ccc;
	}

	.subscribe {
		border-top: none;

		h2 {
			padding: 0;
			margin: 0;
			margin-bottom: 0.5em;
			color: #666;
			font-size: 20px;
			line-height: 1.2em;
			float: none;
		}

		h3 {
			font-size: 16px;
			margin: 0;
		}

		p {
			margin: 0;
		}

		.intro {
			margin-bottom: 1em;
			line-height: 1.4;
		}

		li {
			line-height: 1.4;
		}

		.links {
			margin-bottom: 2em;

			a {
				text-decoration: none;
			}
		}

		.promise {
			color: #999;
			font-size: 12px;
			line-height: 1.4em;
		}

		.field {
			margin-bottom: 0.5em;

			p {
				margin-bottom: 0.3em;
			}

			input[type=text], input[type=email] {
				width: 100%;
			}

			&.submit-button {
				margin-bottom: 1em;
			}
		}
	}

	.credits {
		border-top: 0;

		h4 {
			font-size: 16px;
			margin-top: 0;
			margin-bottom: 10px;
		}

		ul {
			margin: 0;
		}

		li {
			overflow: hidden;
		}

		li:last-child {
			margin-bottom: 0;
		}

		img {
			float: left;
			margin-right: 10px;
		}

		span {
			float: left;
			display: block;
			line-height: 32px;
		}

		a {
			display: block;
			text-decoration: none;
			color: #444;
			font-size: 16px;
			text-align: center;

			&:hover {
				color: #888;
			}
		}
	}

	@media (min--moz-device-pixel-ratio: 1.3),
	(-o-min-device-pixel-ratio: 2.6/2),
	(-webkit-min-device-pixel-ratio: 1.3),
	(min-device-pixel-ratio: 1.3),
	(min-resolution: 1.3dppx) {

		.as3cf-banner {
			background-image: url(../img/snail-banner@2x.jpg);
			background-size: 292px 156px;
		}
	}

	@media screen and (max-width: 1052px) {
		position: relative;
		top: auto;
		right: auto;
	}
}

/**
 * Misc
 */
.as3cf-banner {
	margin-top: 35px;
	width: 292px;
	height: 156px;
	display: block;
	background-image: url(../img/snail-banner.jpg);
	position: relative;

	h1 {
		font-size: 28px;
		color: #fff;
		font-weight: 200;
		margin: 0;
		position: absolute;
		bottom: 25px;
		left: 20px;
		text-decoration: none;
	}
}

.as3cf-upgrade-details {
	background-color: #73833b;
	padding: 20px;
	color: #fff;
	font-size: 13px;
	margin: 0;
	display: block;
	text-decoration: none;

	p {
		margin: 0;
	}

	a {
		color: #fff;
		font-weight: bold;
		text-decoration: none;
		font-size: 16px;

		&:hover {
			color: #fff;
			opacity: 0.9;
		}
	}

	ul {
		margin-top: 0;
		margin-left: 16px;
		list-style-type: disc;
	}
}

.aws-compatibility-notice.error {
	clear: both;
	margin: 5px 20px 5px 0;
}

.as3cf-bucket-error {
	span.title {
		font-weight: bold;
	}
}

.as3cf-invalid-bucket-name,
.as3cf-validation-error {
	display: block;
	margin-top: 2px;
	font-size: 12px;
	color: #a00;
}

.as3cf-notice-toggle-content {
	max-height: 100px;
	overflow-y: scroll;

	.as3cf-notice-toggle-list {
		margin-top: 0;
		margin-left: 0;
		padding-left: 40px;
		color: #dc3232;
	}
}
