/**
 * Frontend Styles for Masteriyo Bundle Flexible Payments
 *
 * @package MasteriyoBundleFlexiblePayments
 * @since 1.0.0
 * @version 1.2.7 - Updated for labels next to radio buttons
 */

/* Payment Selector Container */
.mbfp-payment-selector {
	margin: 30px 0;
	padding: 0;
}

.mbfp-selector-title {
	margin: 0 0 24px 0;
	font-size: 24px;
	font-weight: 600;
	color: #1a1a1a;
}

/* Plans Container */
.mbfp-plans {
	display: flex;
	flex-direction: column; /* Stacked layout */
	gap: 20px;
	margin-bottom: 30px; /* Space before Buy Now button */
}

/* Individual Plan Option */
.mbfp-plan-option {
	width: 100%; /* Full width cards */
	border: 1px solid #000;
	border-radius: 8px;
	padding: 20px;
	background: none;
	transition: all 0.2s ease;
}

.mbfp-plan-option:hover {
	border-color: #000;
	box-shadow: none;
}

.mbfp-plan-option.mbfp-plan-selected {
	border-color: #000;
	background: none;
}

/* Radio Button with Label */
.mbfp-plan-radio-label {
	display: flex;
	align-items: center;
	gap: 12px;
	cursor: pointer;
	margin-bottom: 16px;
}

.mbfp-plan-radio {
	width: 20px;
	height: 20px;
	margin: 0;
	cursor: pointer;
	accent-color: #2563eb;
	flex-shrink: 0;
}

.mbfp-plan-title-inline {
	font-size: 20px;
	font-weight: 600;
	color: #1a1a1a;
	line-height: 1.2;
}

/* Plan Details */
.mbfp-plan-details {
	padding-left: 32px; /* Align with label text */
}

/* Badge Container */
.mbfp-plan-badge-container {
	margin-bottom: 12px;
}

.mbfp-plan-badge {
	display: inline-block;
	padding: 4px 12px;
	font-size: 12px;
	font-weight: 600;
	text-transform: uppercase;
	border-radius: 12px;
}

.mbfp-badge-sale {
	background: #dc2626;
	color: #fff;
}

.mbfp-badge-flexible {
	background: #2563eb;
	color: #fff;
}

/* Plan Price */
.mbfp-plan-price {
	margin-bottom: 16px;
}

.mbfp-regular-price {
	display: block;
	font-size: 16px;
	color: #9ca3af;
	margin-bottom: 4px;
	text-decoration: line-through;
}

.mbfp-sale-price {
	display: block;
	font-size: 32px;
	font-weight: 700;
	color: #1a1a1a;
	line-height: 1;
}

.mbfp-recurring-price {
	display: block;
	font-size: 32px;
	font-weight: 700;
	color: #1a1a1a;
	line-height: 1;
}

.mbfp-interval {
	font-size: 16px;
	font-weight: 400;
	color: #6b7280;
}

.mbfp-period-info {
	display: block;
	margin-top: 4px;
	font-size: 14px;
	color: #6b7280;
}

/* Plan Features */
.mbfp-plan-features {
	list-style: none;
	margin: 0;
	padding: 0;
}

.mbfp-plan-features li {
	display: flex;
	align-items: flex-start;
	padding: 6px 0;
	font-size: 14px;
	color: #4b5563;
	line-height: 1.5;
}

.mbfp-check {
	display: inline-block;
	width: 20px;
	height: 20px;
	margin-right: 8px;
	flex-shrink: 0;
	color: #10b981;
	font-weight: 700;
	font-size: 16px;
	line-height: 20px;
}

/* Add to Cart Button */
.mbfp-add-to-cart {
	width: 100%;
	padding: 15px 30px;
	font-size: 16px;
	font-weight: 600;
	text-align: center;
	border: none;
	border-radius: 4px;
	cursor: pointer;
	transition: all 0.3s ease;
	margin-top: 20px;
}

.mbfp-add-to-cart:disabled {
	opacity: 0.6;
	cursor: not-allowed;
}

.mbfp-add-to-cart.mbfp-loading {
	position: relative;
}

.mbfp-add-to-cart.mbfp-loading::after {
	content: "";
	position: absolute;
	right: 15px;
	top: 50%;
	transform: translateY(-50%);
	width: 16px;
	height: 16px;
	border: 2px solid rgba(255, 255, 255, 0.3);
	border-top-color: #fff;
	border-radius: 50%;
	animation: mbfp-spin 0.6s linear infinite;
}

@keyframes mbfp-spin {
	to {
		transform: translateY(-50%) rotate(360deg);
	}
}

/* Cart Plan Label */
.mbfp-plan-label {
	display: inline-block;
	margin-left: 10px;
	padding: 2px 8px;
	font-size: 12px;
	font-weight: 600;
	background: #eff6ff;
	color: #2563eb;
	border-radius: 3px;
}

/* Cart Plan Details */
.mbfp-cart-plan-details {
	margin-top: 8px;
	padding: 12px;
	background: #f9fafb;
	border-radius: 4px;
}

.mbfp-recurring-info,
.mbfp-onetime-info {
	display: block;
	font-size: 13px;
	color: #6b7280;
	line-height: 1.5;
}

.mbfp-recurring-info strong {
	color: #2563eb;
	font-size: 14px;
}

/* Notices */
.mbfp-notice {
	padding: 12px 16px;
	margin-bottom: 20px;
	border-left: 4px solid;
	border-radius: 4px;
	animation: mbfp-slide-in 0.3s ease;
}

@keyframes mbfp-slide-in {
	from {
		opacity: 0;
		transform: translateY(-10px);
	}
	to {
		opacity: 1;
		transform: translateY(0);
	}
}

.mbfp-notice-success {
	background: #ecfdf5;
	border-color: #10b981;
	color: #065f46;
}

.mbfp-notice-error {
	background: #fef2f2;
	border-color: #ef4444;
	color: #991b1b;
}

/* Responsive Design */
@media (max-width: 768px) {
	.mbfp-selector-title {
		font-size: 20px;
	}

	.mbfp-plan-option {
		padding: 16px;
	}

	.mbfp-plan-title-inline {
		font-size: 18px;
	}

	.mbfp-plan-details {
		padding-left: 32px;
	}

	.mbfp-sale-price,
	.mbfp-recurring-price {
		font-size: 28px;
	}

	.mbfp-add-to-cart {
		padding: 12px 24px;
		font-size: 15px;
	}
}

@media (max-width: 480px) {
	.mbfp-payment-selector {
		margin: 20px 0;
	}

	.mbfp-selector-title {
		font-size: 18px;
		margin-bottom: 16px;
	}

	.mbfp-plan-option {
		padding: 12px;
	}

	.mbfp-plan-title-inline {
		font-size: 16px;
	}

	.mbfp-plan-details {
		padding-left: 28px;
	}

	.mbfp-sale-price,
	.mbfp-recurring-price {
		font-size: 24px;
	}

	.mbfp-plan-features li {
		font-size: 13px;
	}

	.mbfp-add-to-cart {
		padding: 10px 20px;
		font-size: 14px;
	}
}

/* Hide default Masteriyo price when flexible payments are active */
.mbfp-flexible-payments-active .masteriyo-course-bundle--content__price,
.mbfp-flexible-payments-active .masteriyo-course-bundle-price,
.mbfp-flexible-payments-active .masteriyo-bundle-price,
.mbfp-flexible-payments-active .course-bundle-price {
	display: none !important;
}

/* Fix for Masteriyo time button visibility */
.masteriyo-bundle__sidebar .masteriyo-time-btn {
	display: block !important;
	width: 100% !important;
}

/* Full-width Buy Now button below pricing cards */
.mbfp-payment-selector .mbfp-add-to-cart-link,
.mbfp-payment-selector .masteriyo-time-btn {
	width: 100% !important;
	display: block !important;
	text-align: center !important;
	margin: 0 auto !important;
	padding: 16px 48px !important;
	font-size: 18px !important;
	font-weight: 600 !important;
	border-radius: 8px !important;
	background: #1a1a1a !important;
	color: #ffffff !important;
	text-decoration: none !important;
	transition: all 0.3s ease !important;
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1) !important;
}

.mbfp-payment-selector .mbfp-add-to-cart-link:hover,
.mbfp-payment-selector .masteriyo-time-btn:hover {
	background: #333333 !important;
	box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15) !important;
	transform: translateY(-2px) !important;
}
