@import "@wordpress/base-styles/breakpoints";
@import "@wordpress/base-styles/mixins";
@import "@automattic/color-studio/dist/color-variables";
@import "@automattic/typography/styles/variables";

body.is-section-earn.theme-default.color-scheme {
	--color-surface-backdrop: var(--studio-white);
}

.memberships__module-header {
	background: var(--color-surface);
	height: 40px;
	line-height: 40px;
	padding-left: 24px;
	position: relative;
}

.memberships__module-header-title {
	@extend %mobile-interface-element;
	@extend %placeholder;

	color: var(--color-neutral-70);
	font-weight: 600;
	height: 40px; // 1
	overflow: hidden; // 1
	width: auto;
}

.memberships__module-content {
	max-height: 520px;
	overflow-y: auto;
	margin-top: -24px;
	border-bottom: 1px solid var(--color-neutral-5);
}

.memberships__onboarding-wrapper {
	display: flex;
	flex-direction: row;
	@include break-medium {
		padding: 8px;
	}
}

.memberships__onboarding-column-info {
	@include break-medium {
		width: 66%;
	}
}
.memberships__onboarding-column-image {
	display: none;
	@include break-medium {
		flex: 2;
		display: block;
		text-align: center;
		padding-top: 8px;
	}
}

.memberships__onboarding-header {
	@extend .wp-brand-font;
	font-size: $font-title-medium;
	/* identical to box height */
	margin-bottom: 8px;

	@include break-medium {
		font-size: $font-title-large;
	}
}
.memberships__onboarding-paragraph {
	font-size: $font-body;
	color: var(--color-text);

	.button {
		margin-top: 16px;
	}
}
.memberships__onboarding-paragraph-disclaimer {
	font-size: $font-body-small;
}
.memberships__onboarding-benefits {
	color: var(--color-text-subtle);
	display: flex;
	flex-wrap: wrap;
	justify-content: space-between;
	border-top: 1px solid var(--color-neutral-5);
	padding-top: 8px;

	@include break-medium {
		padding-top: 16px;
		margin: 0 8px;
	}
}
.memberships__onboarding-benefits > div {
	margin: 16px 0;
	flex-basis: 100%;
	color: var(--color-text-subtle);

	@include break-small {
		flex-basis: 48%;
	}

	@include break-medium {
		margin: 16px 0;
	}
}
.memberships__onboarding-benefits > div > h3 {
	font-size: $font-title-small;
	line-height: 27px;
	color: var(--color-text);
}

.memberships__earnings-breakdown-list {
	margin: 0;
}

.memberships__earnings-breakdown-label {
	color: var(--color-neutral-60);
	font-size: $font-body-small;
	letter-spacing: 0.1em;
	line-height: 1.8;
	text-transform: uppercase;

	@include breakpoint-deprecated( ">480px" ) {
		font-size: $font-body-extra-small;
		line-height: 1.6;
	}
}

.memberships__earnings-breakdown-item {
	width: 33%;
	float: left;
	padding: 5px 0 10px;
	list-style-type: none;
	text-align: center;

	@include breakpoint-deprecated( "<480px" ) {
		width: auto;
		float: none;
		padding: 10px 24px;
		text-align: left;
	}
}

.memberships__earnings-breakdown-value {
	width: 100%;
	display: block;
	font-size: $font-title-medium;

	@include breakpoint-deprecated( "<480px" ) {
		width: auto;
		float: right;
		font-size: $font-body;
	}
}

.memberships__delete-plan-modal,
.memberships__stripe-disconnect-modal {
	width: 580px;
	max-width: 98%;
	h1 {
		margin-bottom: 1em;
	}
}

.memberships__commission-notice {
	font-size: $font-body-small;
	color: var(--studio-gray-70);
}

.paid-subscriptions-list {
	margin: 20px 0 0;

	.row {
		border-block-end: 1px solid $studio-gray-5;
		display: flex;
		align-items: center;
		flex-direction: row;
		padding-top: 20px;
		padding-bottom: 20px;

		> * {
			flex: 1;
		}

		.paid-subscriptions-list__checkbox-column,
		.paid-subscriptions-list__profile-column,
		.paid-subscriptions-list__offer-type-column,
		.paid-subscriptions-list__total-column,
		.paid-subscriptions-list__since-column,
		.paid-subscriptions-list__menu-column {
			font-weight: 400;
			font-size: $font-body-small;
			line-height: 20px;
			letter-spacing: -0.15px;
			color: $studio-gray-60;
		}

		.paid-subscriptions-list__profile-column {
			display: flex;
			align-items: center;
			flex: 2;
			min-width: 0;
		}

		.paid-subscriptions-list__offer-type-column {
			flex: 2;
			.paid-subscriptions-list__offer-type-title {
				font-weight: 600;
				/* stylelint-disable-next-line unit-allowed-list */
				max-width: 28ch;
				overflow: hidden;
				white-space: nowrap;
				text-overflow: ellipsis;
			}
			.paid-subscriptions-list__offer-type-price {
				font-size: $font-body-extra-small;
				color: $studio-gray-40;
			}
		}

		.paid-subscriptions-list__menu-column {
			flex-basis: 48px;
			flex-grow: initial;

			.gridicon {
				fill: $studio-gray-50;
			}
		}

		.hidden {
			display: none;
		}

		&:last-child {
			border-bottom: none;
		}

		&.header {
			padding-bottom: $font-code;
			padding-top: 8px;

			span {
				font-weight: 500;
			}

			@media (max-width: $break-small) {
				display: none;
			}
		}
	}

	.paid-subscriptions-list__user-profile {
		display: flex;
		align-items: center;
		min-width: 0;

		.paid-subscriptions-list__user-image {
			height: 40px;
			width: 40px;
			border-radius: 50%;
			margin-right: 12px;
			flex: 0;
		}

		.paid-subscriptions-list__user-details {
			display: flex;
			flex-direction: column;
			justify-content: center;
			max-width: 100%;
			overflow: hidden;
			min-width: 0;

			.paid-subscriptions-list__user-name {
				overflow: hidden;
				text-overflow: ellipsis;
				white-space: nowrap;
				font-weight: 600;
				font-size: $font-code;
				min-width: 0;
			}

			.paid-subscriptions-list__user-email {
				overflow: hidden;
				text-overflow: ellipsis;
				white-space: nowrap;
				font-weight: 400;
				font-size: $font-body-extra-small;
				color: $studio-gray-40;
				min-width: 0;
			}
		}
	}
}

@media (max-width: $break-large) {
	.paid-subscriptions-list {
		padding-left: 16px;
		padding-right: 16px;

		.paid-subscriptions-list__since-column {
			display: none;
		}
	}
}

@media (max-width: $break-medium) {
	.paid-subscriptions-list {
		padding-left: 16px;
		padding-right: 16px;

		.paid-subscriptions-list__offer-type-column {
			display: none;
		}
	}
}

.memberships__module-footer {
	display: none;
	margin-top: 20px;
}

@media (max-width: $break-small) {
	.memberships__module-footer {
		display: block;
	}
}

.memberships__module-plans-title,
.memberships__products-card-title {
	color: var(--color-neutral-100);
	font-size: $font-body-small;
}

.memberships__module-settings-title {
	color: var(--color-neutral-100);
	display: flex;
	align-items: center;
}

.memberships__loading {
	text-align: center;
	padding: 3em 0;
}

.memberships__module-settings-description {
	color: var(--color-neutral-100);
	font-size: $font-body-small;
}

.memberships__module-plans-description {
	color: var(--color-neutral-100);
	font-size: $font-body-small;
}

.memberships__module-plans-content {
	display: flex;
	flex-direction: row;
}

.memberships__module-plans-icon {
	padding-right: 24px;
	display: flex;
	align-items: center;
	justify-content: center;
	color: var(--color-neutral-60);
}

.memberships__module-products-list-icon {
	margin-right: 6px;
}

.memberships__products-list {
	margin-bottom: 30px;
}

.memberships__products-product-card {
	display: flex;
}
.memberships__products-product-details {
	flex-grow: 1;
}
.memberships__products-product-price {
	color: var(--color-text-subtle);
	font-size: $font-body-small;
	line-height: 1.5;
}
.memberships__products-product-title {
	color: var(--color-text);
	font-size: $font-body;
	font-weight: bold;
}
.memberships__products-product-badge {
	margin-top: 10px;
	margin-left: -5px;
}
.memberships__coupons-coupon-badge {
	float: left;
	margin-top: 10px;
	margin-left: 5px;
}
.memberships__earnings-breakdown-notes {
	display: block;
	clear: both;
	color: var(--color-neutral-30);
	padding-bottom: 12px;
	padding-top: 24px;
	font-size: $font-body-extra-small;
	line-height: 1.6;
	font-style: italic;
	text-align: center;
	em {
		font-weight: 600;
	}
}
.memberships__subscriber-actions {
	float: right;
}

/**
 * Delete Site Options
 */

.memberships__settings-section-title {
	margin-bottom: 4px;
	font-size: $font-body-small;
	line-height: 18px;
	color: var(--color-neutral-70);

	&.is-warning {
		color: var(--color-error);
	}
}

.memberships__settings-section-desc {
	margin-bottom: 0;
	font-size: $font-body-small;
	color: var(--color-text-subtle);
	font-style: italic;
}

.memberships__settings-content {
	flex: 0 1 auto;
}

.memberships__settings-link,
.memberships__settings-link:hover,
.memberships__settings-link:active,
.memberships__settings-link:visited {
	color: inherit;
}

.earn__payments-loading {
	margin-top: 25px;

	.wpcom__loading-ellipsis {
		display: block;
		margin: auto;
	}
}

.memberships__settings-sandbox-warning {
	float: left;
	padding: 5px 11px;

	&.stripe-disconnected {
		padding: 5px 11px;
		margin-right: 8px;
	}
}
