/**
 * SME Hub Core - Main Frontend Styles
 *
 * @package SMEHubCore
 * @since   1.0.0
 */

/* ============================================
   Connection Limit Modal
   ============================================ */

.sme-hub-connection-limit-modal-overlay {
	display: none !important;
	position: fixed;
	top: 0;
	left: 0;
	right: 0;
	bottom: 0;
	background: rgba(0, 0, 0, 0.5);
	z-index: 999999;
	animation: sme-hub-fade-in 0.2s ease;
}

.sme-hub-connection-limit-modal-overlay.sme-hub-modal-show {
	display: flex !important;
	align-items: center;
	justify-content: center;
	padding: 20px;
}

.sme-hub-connection-limit-modal {
	background: #fff;
	border-radius: 12px;
	box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3),
				0 8px 24px rgba(0, 0, 0, 0.2),
				0 0 0 1px rgba(0, 0, 0, 0.1);
	max-width: 420px;
	width: 100%;
	position: relative;
	animation: sme-hub-modal-slide-up 0.25s ease-out;
	overflow: hidden;
}

.sme-hub-modal-header {
	background: var(--bb-primary-color);
	padding: 16px 20px;
	display: flex;
	align-items: center;
	gap: 12px;
	position: relative;
	border-radius: 12px 12px 0 0;
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.sme-hub-modal-icon {
	font-size: 20px;
	line-height: 1;
	flex-shrink: 0;
}

.sme-hub-modal-header h3 {
	margin: 0;
	color: #fff;
	font-size: 17px;
	font-weight: 600;
	line-height: 1.3;
	flex: 1;
}

.sme-hub-modal-close {
	position: absolute;
	top: 12px;
	right: 12px;
	background: rgba(255, 255, 255, 0.15);
	border: none;
	border-radius: 4px;
	width: 28px;
	height: 28px;
	display: flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	transition: background 0.15s;
	color: #fff;
	font-size: 18px;
	line-height: 1;
	padding: 0;
}

.sme-hub-modal-close:hover {
	background: rgba(255, 255, 255, 0.25);
}

.sme-hub-modal-body {
	padding: 20px;
	background: #fff;
}

.sme-hub-modal-message {
	color: #3c434a;
	font-size: 14px;
	line-height: 1.5;
	margin: 0 0 16px 0;
	text-align: center;
}

.sme-hub-modal-stats {
	background: #f6f7f7;
	border-radius: 6px;
	padding: 14px 16px;
	margin-bottom: 16px;
	border: 1px solid #e8e9ea;
}

.sme-hub-stats-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	margin-bottom: 10px;
}

.sme-hub-stats-label {
	font-size: 12px;
	color: #646970;
	font-weight: 600;
}

.sme-hub-stats-count {
	font-size: 15px;
	font-weight: 700;
	color: #1d2327;
}

.sme-hub-stats-count .current {
	color: #ed3238;
}

.sme-hub-stats-count .separator {
	color: #8c8f94;
	margin: 0 4px;
}

.sme-hub-stats-count .limit {
	color: #50575e;
}

.sme-hub-progress-bar {
	width: 100%;
	height: 8px;
	background: #e0e0e0;
	border-radius: 4px;
	overflow: hidden;
	position: relative;
}

.sme-hub-progress-fill {
	height: 100%;
	background: linear-gradient(90deg, #ed3238 0%, #0463f1 100%);
	border-radius: 4px;
	transition: width 0.3s ease;
	position: relative;
}

.sme-hub-progress-fill.at-limit {
	background: linear-gradient(90deg, #ed3238 0%, #c42328 100%);
}

.sme-hub-progress-fill.near-limit {
	background: linear-gradient(90deg, #f0b849 0%, #ed3238 100%);
}

.sme-hub-modal-actions {
	display: flex;
	gap: 10px;
}

.sme-hub-modal-button {
	flex: 1;
	padding: 11px 20px;
	border-radius: 5px;
	font-size: 14px;
	font-weight: 600;
	text-align: center;
	text-decoration: none;
	cursor: pointer;
	border: none;
	transition: all 0.15s;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 6px;
	line-height: 1.2;
}

.sme-hub-modal-button-primary {
	background: var(--bb-primary-color);
	color: #fff;
	box-shadow: 0 1px 3px rgba(237, 50, 56, 0.2);
}

.sme-hub-modal-button-primary:hover {
	transform: translateY(-1px);
	box-shadow: 0 2px 6px rgba(237, 50, 56, 0.3);
	color: #fff;
	text-decoration: none;
}

.sme-hub-modal-button-secondary {
	background: #f0f0f1;
	color: #2c3338;
	border: 1px solid #dcdcde;
}

.sme-hub-modal-button-secondary:hover {
	background: #e5e5e6;
	border-color: #c3c4c7;
	color: #1d2327;
}

/* ============================================
   Business Creation Limit Overlay
   ============================================ */

#create-business-form {
	position: relative;
}

#business-create-body {
	position: relative;
}

.sme-hub-business-limit-overlay {
	display: flex;
	position: absolute;
	top: 0;
	left: 0;
	right: 0;
	bottom: 0;
	background: rgba(0, 0, 0, 0.5);
	z-index: 600;
	align-items: center;
	justify-content: center;
	padding: 20px;
	animation: sme-hub-fade-in 0.2s ease;
	overflow-y: auto;
	min-height: 400px;
	pointer-events: auto;
}

#business-create-body:has(.sme-hub-business-limit-overlay) input,
#business-create-body:has(.sme-hub-business-limit-overlay) select,
#business-create-body:has(.sme-hub-business-limit-overlay) textarea,
#business-create-body:has(.sme-hub-business-limit-overlay) button {
	pointer-events: none;
	opacity: 0.5;
}

.sme-hub-overlay-content,
.sme-hub-overlay-content * {
	pointer-events: auto !important;
	opacity: 1 !important;
}

.sme-hub-overlay-content {
	background: #fff;
	border-radius: 12px;
	box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3),
				0 8px 24px rgba(0, 0, 0, 0.2),
				0 0 0 1px rgba(0, 0, 0, 0.1);
	max-width: 420px;
	width: 100%;
	position: relative;
	animation: sme-hub-modal-slide-up 0.25s ease-out;
	overflow: hidden;
}

.sme-hub-overlay-icon {
	background: var(--bb-primary-color);
	padding: 16px 20px;
	display: flex;
	align-items: center;
	gap: 12px;
	border-radius: 12px 12px 0 0;
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.sme-hub-overlay-icon .dashicons {
	font-size: 20px;
	line-height: 1;
	color: #fff;
	width: auto;
	height: auto;
	background: none;
	border-radius: 0;
	flex-shrink: 0;
}

.sme-hub-overlay-icon h3 {
	font-size: 17px;
	font-weight: 600;
	color: #fff;
	margin: 0;
	line-height: 1.3;
	flex: 1;
}

.sme-hub-overlay-message {
	padding: 20px;
	background: #fff;
}

.sme-hub-overlay-message p {
	font-size: 14px;
	color: #3c434a;
	line-height: 1.5;
	margin: 0 0 16px 0;
}

.sme-hub-overlay-actions {
	padding: 0 20px 20px 20px;
}

.sme-hub-upgrade-button {
	width: 100%;
	padding: 11px 20px;
	background: var(--bb-primary-color);
	color: #fff !important;
	text-decoration: none !important;
	border-radius: 5px;
	font-weight: 600;
	font-size: 14px;
	transition: all 0.15s;
	box-shadow: 0 1px 3px rgba(237, 50, 56, 0.2);
	border: none;
	cursor: pointer;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 6px;
	line-height: 1.2;
	text-align: center;
}

.sme-hub-upgrade-button:hover {
	transform: translateY(-1px);
	box-shadow: 0 2px 6px rgba(237, 50, 56, 0.3);
	color: #fff !important;
	text-decoration: none !important;
}

.sme-hub-upgrade-button:active {
	transform: translateY(0);
}

.sme-hub-upgrade-button:focus {
	outline: 2px solid #0463f1;
	outline-offset: 2px;
}

/* ============================================
   Shared Animations
   ============================================ */

@keyframes sme-hub-fade-in {
	from {
		opacity: 0;
	}
	to {
		opacity: 1;
	}
}

@keyframes sme-hub-modal-slide-up {
	from {
		opacity: 0;
		transform: translateY(20px) scale(0.97);
	}
	to {
		opacity: 1;
		transform: translateY(0) scale(1);
	}
}

/* ============================================
   Responsive Design
   ============================================ */

@media screen and (max-width: 600px) {
	.sme-hub-connection-limit-modal {
		max-width: 100%;
		margin: 0;
		border-radius: 12px 12px 0 0;
		position: absolute;
		bottom: 0;
		left: 0;
		right: 0;
	}

	.sme-hub-connection-limit-modal-overlay.sme-hub-modal-show {
		align-items: flex-end;
		padding: 0;
	}

	.sme-hub-modal-header {
		padding: 14px 18px;
		border-radius: 12px 12px 0 0;
	}

	.sme-hub-modal-header h3 {
		font-size: 16px;
	}

	.sme-hub-modal-icon {
		font-size: 18px;
	}

	.sme-hub-modal-body {
		padding: 18px;
	}

	.sme-hub-modal-actions {
		flex-direction: column;
		gap: 8px;
	}

	.sme-hub-modal-stats {
		gap: 16px;
	}

	.sme-hub-overlay-content {
		max-width: 100%;
		border-radius: 12px 12px 0 0;
	}

	.sme-hub-overlay-icon {
		padding: 14px 18px;
		border-radius: 12px 12px 0 0;
	}

	.sme-hub-overlay-icon .dashicons {
		font-size: 18px;
	}

	.sme-hub-overlay-message {
		padding: 18px;
	}

	.sme-hub-overlay-message h3 {
		font-size: 16px;
	}

	.sme-hub-overlay-actions {
		padding: 0 18px 18px 18px;
	}
}

/* ============================================
   Accessibility
   ============================================ */

.sme-hub-modal-button:focus,
.sme-hub-modal-close:focus {
	outline: 2px solid #0463f1;
	outline-offset: 2px;
}

body.sme-hub-modal-open {
	overflow: hidden;
}
