@import '_inc/client/scss/functions/rem';
@import '_inc/client/scss/variables/colors';

.updated { // utlizes some core styles, overrides some others
	&.jp-banner {
		position: relative;
		padding: 0;
	}

	.jp-banner__header {
		font-size: rem( 18px ) ;
		font-weight: 400;
		margin-top: 0;
	}

	.jp-banner__button-container {
		padding: rem( 12px ) 0 0;
	}

	.jp-banner__tos-blurb {
		display: block;
		padding: rem( 6px ) 0;
		line-height: 1.5;
		font-size: rem( 11px );
		color: $gray-dark;
	}
}

.jp-banner .notice-dismiss {
	text-decoration: none;
}

.jp-banner__description {
	font-size: rem( 14px );
}

.jp-banner__description-container {
	padding: rem( 16px );
}

// Full Page Connection Banner
// only show when Jetpack is disconnected
.jetpack-disconnected {
	.jp-connect-full__container {
		box-sizing: border-box;
		position: absolute;
			top: 0;
			right: 0;
			bottom: rem( 20px );
			left: 0;
		z-index: 999; // to sit over other elements
		background: rgb( 241, 241, 241 );
		text-align: center;

		.jp-connect-full__container-card {
			padding: rem( 48px ) rem( 64px ) rem( 96px );
			background: white;
			margin: 1em;

				img.jetpack-logo {
					width: 160px;
				}

				img.support-characters {
					margin-top: rem( 24px );
					width: 50%;
				}
		}

		h4 {
			line-height: 1.25;
			font-size: rem( 22px );
			font-weight: normal;
			margin: 1em 0;
		}

		@include minbreakpoint(tablet) {
			left: -20px; // fill gap of wp-admin sidebar right margin on large screens
		};

	}

	// Full page connection banner in the Jetpack dashboard.
	&.toplevel_page_jetpack .jp-connect-full__container {
		position: relative;
		bottom: 0;
		box-shadow: 0 0 0 1px transparentize( lighten( $gray, 20% ), .5 ),
			0 1px 2px lighten( $gray, 30% );

		.jp-connect-full__container-card {
			margin: 0;
		}

		@include minbreakpoint(tablet) {
			left: 0;
		};

		@include breakpoint(tablet) {
			top: 46px;
		};

		// hide the notice by default. Only display it when it is injected in the middle of the page.
		display: none;
	}

	// Only display the banner when it is injected in the middle of the page.
	&.toplevel_page_jetpack .jp-jetpack-connect__container {
		.jp-connect-full__container {
			display: block;
		}
	}
}

// dismiss
.jp-connect-full__svg-dismiss {
	position: absolute;
		right: 0;
		top: 0;
	fill: $gray;
	padding: rem( 16px );
	height: rem( 24px );
	width: rem( 24px );

	@include breakpoint(phablet) {
		top: rem( 50px );
	};
}

.jp-connect-full__step-header {
	max-width: 700px;
	margin: 0 auto;
	line-height: 1.5;

	h2 {
		margin: rem( 24px ) 0 0;
		font-size: rem( 22px );
		font-weight: bold;
		color: black;
	}

	h3 {
		color: $gray-text-min;
		font-size: rem( 16px );
		font-weight: normal;
		margin: rem( 10px ) 0 rem( 24px );
	}

	&.bottom {
		margin-top: rem( 80px );
	}
}
.jp-connect-full__tos-blurb {
	font-size: rem( 11px );
	margin: 0 auto rem( 24px );
	color: $gray-text-min;
	a{
		text-decoration: none;
		color: $green-primary;
	}
}

.jp-connect-full__button-container {
	margin: 0;
	.dops-button.is-primary {
		background: $green-primary;
		border-color: $green-secondary;

		&:hover, &:focus {
			background: $green-secondary;
			border-color: $green-dark;
		}
	}
}

.jp-connect-full__dismiss {
	cursor: pointer;
}

.jp-connect-full__dismiss-paragraph {
	font-size: .6875rem;

	a {
		cursor: pointer;
		color: $gray-text-min;
		text-decoration: none;
	}

	a:hover {
		text-decoration: underline;
	}
}

.jp-connect-full__slide {
	max-width: 750px;
	margin: 4em auto;
	display: flex;
	flex-direction: row;
	justify-content: stretch;

	@include breakpoint(tablet) {
		flex-wrap: wrap;
	};

	.jp-connect-full__slide-card {
		flex: 1;
		text-align: left;
		order: 2;

		@include minbreakpoint(tablet) {
			order: unset;
		};
	}

	.illustration {
		order: 1;

		@include minbreakpoint(tablet) {
			order: unset;
		};

		img {
			margin: 2.5em 1em;
			display: block;
			min-width: 200px;

			@include minbreakpoint(phablet) {
				margin: 2.5em auto;
				width: 75%;
			};
		}
	}
}

.jp-connect-full__step-support {
	max-width: 700px;
	margin: 0 auto;
	line-height: 1.25;

	h2 {
		margin: rem( 16px ) 0 0;
		font-size: rem( 22px );
		font-weight: normal;
		color: black;
	}

	h3 {
		color: $gray-text-min;
		font-size: rem( 16px );
		font-weight: normal;
		margin: rem( 10px ) 0 rem( 24px );
	}
}


// Plugin List + wp-admin dashboard Connection Banners (displayed after plugin activation)
// Written in the style of React to stay consistent with the Jetpack interior

// wp-admin overrides
.updated.jp-wpcom-connect__container {
	border-left: none;
	padding: 0;
	box-shadow: 0 0 0 1px rgba(200, 215, 225, 0.5), 0 1px 2px #e9eff3;

	@media screen and (max-width: 782px) {
		padding: 0 !important; // override core cascades
	}
}

.updated.jp-wpcom-connect__container .dops-button {
	padding: 7px 14px 9px; // override wp-admin .updated a padding
}

.updated .notice-dismiss {
	z-index: 1;
	text-decoration: none;
	&:before {
		color: $white;
	}
}
// end overrides

.jp-wpcom-connect__container-top-text {
	padding: 15px 15px 25px 15px;
	background-color: $green-primary;
	color: $white;
	font-weight: 600;

	svg {
		width: 24px;
		height: 24px;
		margin-right: 10px;
		position: relative;
		top: 7px;

		path {
			fill: #fff;
		}
	}

	span {
		display: inline-block;
	}
}

.jp-wpcom-connect__container {
	display: block;
	position: relative;
	box-sizing: border-box;
	background-color: $green-primary;
}

.jp-wpcom-connect__inner-container > a:first-child {
	z-index: 1;
}

.jp-wpcom-connect__inner-container {
	display: flex;
	flex-direction: row;
	flex-wrap: nowrap;
	justify-content: left;
	// border: 4px $green-primary solid;
	background: #fff;
}

.jp-wpcom-connect__content-container {
	width: 1250px;
	position: relative;
	padding: rem( 32px );
	z-index: 0;

	@include minbreakpoint(tablet) {
		padding: rem( 32px ) rem( 32px ) rem( 96px ) rem( 32px );
	};
}

.jp-wpcom-connect__content-container p {
	color: darken( $gray, 20% );
	font-size: rem( 14px );
}

.jp-wpcom-connect__content-container h2 {
	margin-top: 0;
	color: #4F748E;
	line-height: 1.6;
}



.jp-wpcom-connect__content-icon {
	float: right;
	margin: 0 rem( 24px ) 0 rem( 36px );

	&.jp-connect-illo {

		@include breakpoint(tablet) {
			float: none;
			width: 100%;
			text-align: center;
			margin: rem( 36px ) 0 rem( 24px );
		}
	}
}

.jp-wpcom-connect__slide {
	display: none;

	&.jp__slide-is-active {
		display: block;
	}
}

.jp-wpcom-connect__slide ul {
	list-style: disc;
	padding: 0 0 0 rem( 15px );
}

.jp-wpcom-connect__slide ul li {
	color: darken( $gray, 20% );
	font-size: rem( 12px );
}

.jp-wpcom-connect__content-container .jp-banner__button-container {
	@include minbreakpoint(tablet) {
		position: absolute;
		bottom: rem( 8px );
	};
}

.jp-banner__button-container .dops-button {
	margin: rem( 5px ) 0;

	&.is-primary {
		background: $green-primary;
		border-color: $green-secondary;

		&:hover, &:focus {
			background: $green-secondary;
			border-color: $green-dark;
		}
	}
}

// Connection Banner Vertical Menu
.jp-wpcom-connect__vertical-nav {
	background-color: #F3F6F8;

	@include minbreakpoint(phablet) {
		flex-direction: column;
		justify-content: flex-start;
	};

	@include breakpoint(phablet) {
		display: none; // hide nav on sm screens. becomes a linear tutorial
	};
}

.jp-wpcom-connect__vertical-nav-container {
	width: rem( 240px );
}

.vertical-menu__feature-item-label {
	display: none;
}

@include minbreakpoint(phablet) {

	.vertical-menu__feature-item {
		display: flex;
		flex-direction: row;
		align-items: center;
		border: none;
		padding: rem( 12px ) rem( 8px );
		border-bottom: 1px solid #c8d7e1;
		border-right: 1px solid #c8d7e1;
		border-left: 3px solid #F3F6F8;
		background-color: #F3F6F8;
		color: #87a6bc;
		cursor: pointer;

		// trick to hide the bottom border of the last menu item when the menu is the tallest element,
		// but display the border when the overall container is taller than the menu
		&:last-of-type {
			position: relative;
			top: 1px;
		}
	}

	.vertical-menu__feature-item-is-selected {
		border-left: 3px solid #F3F6F8;
		border-right: 1px solid #fff;
		background-color: #fff;
		color: #2e4453;

		&.jp-feature-intro {
			border-left: 3px solid #F3F6F8;
		}
	}

	.vertical-menu__feature-item-icon {
		width: rem( 20px );
		height: rem( 20px );
		padding: rem( 4px );
		text-align: center;
	}

	// svg fill swaps
	.vertical-menu__feature-item {
		svg {
			fill: #86A6BD;
		}
	}

	.vertical-menu__feature-item-is-selected {

		svg {
			fill: #3D596D;
		}

		&.jp-feature-intro {
			svg {
				fill: $green-primary;
			}
		}

		&.wp-app-logo {
			svg path {
				fill: #3D596D;
			}
		}
	}
	// end svg fill swaps

	.vertical-menu__feature-item-label {
		display: block;
		padding: rem( 8px );
	}
};
