/**
 * Add-Ons Admin Page Styles
 *
 * Modern, clean design following WordPress.org guidelines
 *
 * @package auto_form_builder
 * @since 1.0.0
 */

/* Page Container */
.auto-form-builder-addons-page {
	max-width: 1400px;
	margin: 20px 0;
}

/* Header Section */
.auto-form-builder-addons-header {
	background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
	padding: 40px;
	border-radius: 8px;
	margin-bottom: 40px;
	box-shadow: 0 4px 6px rgb(0 0 0 / 10%);
}

.auto-form-builder-addons-title {
	color: #fff;
	font-size: 32px;
	font-weight: 600;
	margin: 0 0 10px;
	display: flex;
	align-items: center;
	gap: 12px;
}

.auto-form-builder-addons-title .dashicons {
	font-size: 36px;
	width: 36px;
	height: 36px;
}

.auto-form-builder-addons-subtitle {
	color: rgb(255 255 255 / 90%);
	font-size: 16px;
	margin: 0;
	line-height: 1.6;
}

/* Section Container */
.auto-form-builder-addons-section {
	background: #fff;
	border: 1px solid #e0e0e0;
	border-radius: 8px;
	margin-bottom: 40px;
	overflow: hidden;
	box-shadow: 0 2px 4px rgb(0 0 0 / 5%);
}

.auto-form-builder-section-header {
	display: flex;
	align-items: center;
	gap: 20px;
	padding: 30px;
	background: #f8f9fa;
	border-bottom: 2px solid #e9ecef;
}

.auto-form-builder-section-icon {
	flex-shrink: 0;
	width: 60px;
	height: 60px;
	display: flex;
	align-items: center;
	justify-content: center;
	border-radius: 12px;
	background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.auto-form-builder-section-icon .dashicons {
	color: #fff;
	font-size: 32px;
	width: 32px;
	height: 32px;
}

.auto-form-builder-premium-section .auto-form-builder-section-icon {
	background: linear-gradient(135deg, #f59e0b 0%, #f97316 100%);
}

.auto-form-builder-extended-section .auto-form-builder-section-icon {
	background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
}

.auto-form-builder-section-info h2 {
	margin: 0 0 8px;
	font-size: 24px;
	font-weight: 600;
	color: #1e293b;
}

.auto-form-builder-section-info p {
	margin: 0;
	color: #64748b;
	font-size: 14px;
	line-height: 1.5;
}

/* Addons Grid */
.auto-form-builder-addons-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
	gap: 24px;
	padding: 30px;
}

/* Addon Card */
.auto-form-builder-addon-card {
	position: relative;
	background: #fff;
	border: 2px solid #e5e7eb;
	border-radius: 12px;
	padding: 0;
	transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
	display: flex;
	flex-direction: column;
	overflow: hidden;
}

.auto-form-builder-addon-card:hover {
	transform: translateY(-4px);
	box-shadow: 0 12px 24px rgb(0 0 0 / 12%);
	border-color: #d1d5db;
}

/* Addon Badge */
.auto-form-builder-addon-badge {
	position: absolute;
	top: 16px;
	right: 16px;
	padding: 6px 12px;
	border-radius: 20px;
	font-size: 11px;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.5px;
	display: flex;
	align-items: center;
	gap: 4px;
	z-index: 10;
}

.auto-form-builder-addon-badge .dashicons {
	font-size: 14px;
	width: 14px;
	height: 14px;
}

/* Built-in Badge Styles */
.auto-form-builder-builtin-badge {
	background: #e2e8f0;
	color: #64748b;
	box-shadow: 0 2px 4px rgb(100 116 139 / 15%);
}

.auto-form-builder-builtin-card.addon-active .auto-form-builder-builtin-badge {
	background: linear-gradient(135deg, #10b981 0%, #059669 100%);
	color: #fff;
	box-shadow: 0 2px 8px rgb(16 185 129 / 30%);
	animation: badge-pulse 2s ease-in-out infinite;
}

@keyframes badge-pulse {
	0%, 100% {
		box-shadow: 0 2px 8px rgb(16 185 129 / 30%);
	}

	50% {
		box-shadow: 0 2px 12px rgb(16 185 129 / 50%);
	}
}

.auto-form-builder-premium-badge {
	background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
	color: #fff;
	box-shadow: 0 2px 8px rgb(245 158 11 / 30%);
}

.auto-form-builder-extended-badge {
	background: linear-gradient(135deg, #60a5fa 0%, #3b82f6 100%);
	color: #fff;
	box-shadow: 0 2px 8px rgb(59 130 246 / 30%);
}

.auto-form-builder-coming-soon-badge {
	background: linear-gradient(135deg, #f59e0b 0%, #f97316 100%);
	color: #fff;
	box-shadow: 0 2px 8px rgb(245 158 11 / 30%);
}

/* Active Card Styling */
.auto-form-builder-builtin-card.addon-active {
	border-color: #10b981;
	background: linear-gradient(to bottom, #f0fdf4 0%, #fff 100%);
	box-shadow: 0 0 0 2px rgb(16 185 129 / 10%);
}

.auto-form-builder-builtin-card.addon-active:hover {
	border-color: #059669;
	box-shadow: 0 12px 24px rgb(16 185 129 / 15%), 0 0 0 2px rgb(16 185 129 / 20%);
}

.auto-form-builder-builtin-card.addon-active .auto-form-builder-addon-icon .dashicons {
	color: #10b981;
}

/* Addon Icon */
.auto-form-builder-addon-icon {
	padding: 32px 24px 0;
	text-align: center;
}

.auto-form-builder-addon-icon .dashicons {
	font-size: 48px;
	width: 48px;
	height: 48px;
	color: #64748b;
}

.auto-form-builder-premium-card .auto-form-builder-addon-icon .dashicons {
	color: #f59e0b;
}

.auto-form-builder-extended-card .auto-form-builder-addon-icon .dashicons {
	color: #3b82f6;
}

/* Addon Title */
.auto-form-builder-addon-title {
	margin: 16px 24px 0;
	font-size: 18px;
	font-weight: 600;
	color: #1e293b;
	text-align: center;
	line-height: 1.4;
}

/* Addon Description */
.auto-form-builder-addon-description {
	margin: 12px 24px 24px;
	color: #64748b;
	font-size: 14px;
	line-height: 1.6;
	text-align: center;
}

/* Addon Footer */
.auto-form-builder-addon-footer {
	margin-top: auto;
	padding: 20px 24px;
	background: #f8f9fa;
	border-top: 1px solid #e9ecef;
}

/* Built-in active: Settings + Deactivate side by side */
.auto-form-builder-builtin-card.addon-active .auto-form-builder-addon-footer {
	display: flex;
	gap: 12px;
	flex-wrap: wrap;
}

.auto-form-builder-builtin-card.addon-active .auto-form-builder-addon-footer > a,
.auto-form-builder-builtin-card.addon-active .auto-form-builder-addon-footer > form {
	flex: 1;
	min-width: 120px;
}

.auto-form-builder-builtin-card.addon-active .auto-form-builder-addon-footer .auto-form-builder-addon-button {
	width: 100%;
}

/* Addon Button */
.auto-form-builder-addon-button {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	width: 100%;
	padding: 12px 24px;
	border: none;
	border-radius: 8px;
	font-size: 14px;
	font-weight: 600;
	text-decoration: none;
	text-align: center;
	transition: all 0.2s ease;
	cursor: pointer;
}

.auto-form-builder-addon-button .dashicons {
	font-size: 18px;
	width: 18px;
	height: 18px;
}

/* Activate Button */
.auto-form-builder-activate-button {
	background: linear-gradient(135deg, #10b981 0%, #059669 100%);
	color: #fff;
	box-shadow: 0 2px 8px rgb(16 185 129 / 30%);
}

.auto-form-builder-activate-button:hover {
	background: linear-gradient(135deg, #059669 0%, #047857 100%);
	box-shadow: 0 4px 12px rgb(16 185 129 / 40%);
	color: #fff;
	transform: translateY(-1px);
}

.auto-form-builder-activate-button:active {
	transform: translateY(0);
}

/* Settings Button (for active add-ons) */
.auto-form-builder-settings-button {
	background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
	color: #fff;
	box-shadow: 0 2px 8px rgb(59 130 246 / 30%);
}

.auto-form-builder-settings-button:hover {
	background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
	box-shadow: 0 4px 12px rgb(59 130 246 / 40%);
	color: #fff;
	transform: translateY(-1px);
}

.auto-form-builder-settings-button:active {
	transform: translateY(0);
}

/* Deactivate Button */
.auto-form-builder-deactivate-button {
	background: #fff;
	color: #ef4444;
	border: 2px solid #ef4444;
	box-shadow: 0 2px 4px rgb(239 68 68 / 10%);
}

.auto-form-builder-deactivate-button:hover {
	background: #ef4444;
	color: #fff;
	box-shadow: 0 4px 12px rgb(239 68 68 / 30%);
	transform: translateY(-1px);
}

.auto-form-builder-deactivate-button:active {
	transform: translateY(0);
}

.auto-form-builder-premium-button {
	background: linear-gradient(135deg, #f59e0b 0%, #f97316 100%);
	color: #fff;
	box-shadow: 0 2px 8px rgb(245 158 11 / 30%);
}

.auto-form-builder-premium-button:hover {
	background: linear-gradient(135deg, #f97316 0%, #ea580c 100%);
	box-shadow: 0 4px 12px rgb(245 158 11 / 40%);
	color: #fff;
	transform: translateY(-1px);
}

.auto-form-builder-extended-button {
	background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
	color: #fff;
	box-shadow: 0 2px 8px rgb(59 130 246 / 30%);
}

.auto-form-builder-extended-button:hover {
	background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
	box-shadow: 0 4px 12px rgb(59 130 246 / 40%);
	color: #fff;
	transform: translateY(-1px);
}

/* Extended card: contain button within card to prevent overflow */
.auto-form-builder-extended-card {
	min-width: 0;
}

.auto-form-builder-extended-card .auto-form-builder-addon-footer {
	min-width: 0;
	overflow: hidden;
}

.auto-form-builder-extended-card .auto-form-builder-addon-button {
	box-sizing: border-box;
	max-width: 100%;
}

/* Addon Status Indicator (for Coming Soon) */
.auto-form-builder-addon-status {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	width: 100%;
	padding: 12px 24px;
	color: #64748b;
	font-size: 14px;
	font-weight: 600;
}

.auto-form-builder-addon-status .dashicons {
	font-size: 18px;
	width: 18px;
	height: 18px;
	color: #f59e0b;
}

/* Responsive Design */
@media screen and (width <= 1200px) {
	.auto-form-builder-addons-grid {
		grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
	}
}

@media screen and (width <= 782px) {
	.auto-form-builder-addons-header {
		padding: 30px 24px;
	}

	.auto-form-builder-addons-title {
		font-size: 24px;
	}

	.auto-form-builder-addons-title .dashicons {
		font-size: 28px;
		width: 28px;
		height: 28px;
	}

	.auto-form-builder-addons-subtitle {
		font-size: 14px;
	}

	.auto-form-builder-section-header {
		flex-direction: column;
		align-items: flex-start;
		padding: 24px;
	}

	.auto-form-builder-section-icon {
		width: 50px;
		height: 50px;
	}

	.auto-form-builder-section-icon .dashicons {
		font-size: 26px;
		width: 26px;
		height: 26px;
	}

	.auto-form-builder-section-info h2 {
		font-size: 20px;
	}

	.auto-form-builder-addons-grid {
		grid-template-columns: 1fr;
		gap: 20px;
		padding: 24px;
	}
}

@media screen and (width <= 600px) {
	.auto-form-builder-addons-header {
		padding: 24px 20px;
	}

	.auto-form-builder-section-header {
		padding: 20px;
	}

	.auto-form-builder-addons-grid {
		padding: 20px;
	}

	.auto-form-builder-addon-icon {
		padding: 24px 20px 0;
	}

	.auto-form-builder-addon-icon .dashicons {
		font-size: 40px;
		width: 40px;
		height: 40px;
	}

	.auto-form-builder-addon-title {
		font-size: 16px;
		margin: 12px 20px 0;
	}

	.auto-form-builder-addon-description {
		margin: 10px 20px 0;
		font-size: 13px;
	}

	.auto-form-builder-addon-features {
		margin: 16px 20px;
	}

	.auto-form-builder-addon-footer {
		padding: 16px 20px;
	}
}

/* Legacy Compatibility - Hide old classes */
.addons-admin-page:not(.auto-form-builder-addons-page) {
	display: none;
}
