/**
 * WP AI Generator - Pricing Table Styles
 * Self-contained with CSS variable fallbacks
 */

/* ========================================
   CSS Variables (self-contained fallbacks)
   ======================================== */
.wpaig-pt-table {
	--wpaig-pt-bg: var(--wpaig-bg-primary, #ffffff);
	--wpaig-pt-bg-alt: var(--wpaig-bg-secondary, #f0f4ff);
	--wpaig-pt-text: var(--wpaig-color-text, #1a1a2e);
	--wpaig-pt-text-light: var(--wpaig-color-text-light, #646970);
	--wpaig-pt-text-muted: var(--wpaig-color-text-muted, #9CA3AF);
	--wpaig-pt-accent: var(--wpaig-color-primary, #386BB7);
	--wpaig-pt-accent-secondary: var(--wpaig-color-secondary, #E24C4A);
	--wpaig-pt-border: var(--wpaig-color-border, #e2e8f0);
	--wpaig-pt-radius: 12px;
	--wpaig-pt-transition: all 0.2s ease;
}

/* ========================================
   Table Grid Layout
   ======================================== */
.wpaig-pt-table {
	display: grid;
	grid-template-columns: 200px repeat(var(--wpaig-pt-cols, 3), 1fr);
	border: 1px solid var(--wpaig-pt-border);
	border-radius: var(--wpaig-pt-radius);
	overflow: hidden;
	background: var(--wpaig-pt-bg);
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, sans-serif;
	color: var(--wpaig-pt-text);
	max-width: 1200px;
	margin: 0 auto;
}

/* ========================================
   Rows
   ======================================== */
.wpaig-pt-row {
	display: contents;
}

/* ========================================
   Cells
   ======================================== */
.wpaig-pt-cell {
	padding: 16px 20px;
	display: flex;
	align-items: center;
	border-bottom: 1px solid var(--wpaig-pt-border);
	min-height: 56px;
}

.wpaig-pt-cell--label {
	font-weight: 600;
	font-size: 14px;
	color: var(--wpaig-pt-text);
	background: var(--wpaig-pt-bg);
}

.wpaig-pt-cell--value {
	font-size: 14px;
	color: var(--wpaig-pt-text);
	justify-content: center;
	text-align: center;
}

/* ========================================
   Alternating Row Colors
   ======================================== */
.wpaig-pt-row--alt .wpaig-pt-cell {
	background: var(--wpaig-pt-bg-alt);
}

.wpaig-pt-row--alt .wpaig-pt-cell--label {
	background: var(--wpaig-pt-bg-alt);
}

/* ========================================
   Header Row
   ======================================== */
.wpaig-pt-row--header .wpaig-pt-cell--label {
	font-size: 13px;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.08em;
	color: var(--wpaig-pt-text-muted);
	background: var(--wpaig-pt-bg);
}

.wpaig-pt-cell--header {
	flex-direction: column;
	justify-content: center;
	align-items: center;
	text-align: center;
	padding: 24px 16px;
	gap: 6px;
	background: var(--wpaig-pt-bg);
	border-bottom: 1px solid var(--wpaig-pt-border);
	position: relative;
}

.wpaig-pt-plan-name {
	font-size: 20px;
	font-weight: 700;
	color: var(--wpaig-pt-text);
}

.wpaig-pt-price-label {
	font-size: 16px;
	font-weight: 600;
	color: var(--wpaig-pt-accent);
}

.wpaig-pt-subtitle {
	font-size: 13px;
	color: var(--wpaig-pt-text-light);
}

/* ========================================
   Highlighted Column
   ======================================== */
.wpaig-pt-col--highlighted {
	background: linear-gradient(180deg, rgba(56, 107, 183, 0.04) 0%, rgba(226, 76, 74, 0.04) 100%);
}

.wpaig-pt-row--alt .wpaig-pt-col--highlighted {
	background: linear-gradient(180deg, rgba(56, 107, 183, 0.08) 0%, rgba(226, 76, 74, 0.08) 100%);
}

.wpaig-pt-col--highlighted .wpaig-pt-plan-name {
	color: var(--wpaig-pt-accent);
}

/* Badge for highlighted column */
.wpaig-pt-badge {
	display: inline-block;
	padding: 3px 12px;
	background: linear-gradient(90deg, #386BB7 0%, #E24C4A 100%);
	color: #ffffff;
	font-size: 11px;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.05em;
	border-radius: 20px;
}

/* ========================================
   Title Row
   ======================================== */
.wpaig-pt-row--title .wpaig-pt-cell {
	border-bottom: none;
	min-height: 0;
	padding: 0;
}

/* ========================================
   Action Row (Buttons)
   ======================================== */
.wpaig-pt-row--actions .wpaig-pt-cell {
	border-bottom: none;
	padding: 20px;
	justify-content: center;
}

.wpaig-pt-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	padding: 12px 28px;
	font-size: 15px;
	font-weight: 600;
	border-radius: 9999px;
	border: none;
	cursor: pointer;
	transition: var(--wpaig-pt-transition);
	text-decoration: none;
	position: relative;
	overflow: hidden;
	white-space: nowrap;
	width: 100%;
	max-width: 220px;
}

.wpaig-pt-btn--fixed,
.wpaig-pt-btn--custom {
	background: linear-gradient(90deg, #386BB7 0%, #E24C4A 100%);
	color: #ffffff;
}

.wpaig-pt-btn--fixed:hover:not(:disabled),
.wpaig-pt-btn--custom:hover:not(:disabled) {
	background: linear-gradient(90deg, #E24C4A 0%, #386BB7 100%);
	transform: translateY(-1px);
}

.wpaig-pt-btn--fixed:active:not(:disabled),
.wpaig-pt-btn--custom:active:not(:disabled) {
	transform: translateY(0);
}

.wpaig-pt-btn--unavailable {
	background: var(--wpaig-pt-border);
	color: var(--wpaig-pt-text-muted);
	cursor: not-allowed;
}

.wpaig-pt-btn:disabled {
	opacity: 0.7;
	cursor: not-allowed;
	transform: none !important;
}

/* Loading state */
.wpaig-pt-btn--loading {
	pointer-events: none;
}

.wpaig-pt-btn--loading .wpaig-pt-btn-text {
	visibility: hidden;
}

.wpaig-pt-btn--loading::after {
	content: '';
	position: absolute;
	width: 18px;
	height: 18px;
	border: 2px solid currentColor;
	border-right-color: transparent;
	border-radius: 50%;
	animation: wpaig-pt-spin 0.6s linear infinite;
}

@keyframes wpaig-pt-spin {
	to { transform: rotate(360deg); }
}

/* ========================================
   Custom Plan Controls
   ======================================== */
.wpaig-pt-quantity-input {
	width: 100%;
	max-width: 120px;
	padding: 8px 10px;
	border: 2px solid var(--wpaig-pt-border);
	border-radius: 8px;
	font-size: 15px;
	font-weight: 600;
	text-align: center;
	background: var(--wpaig-pt-bg);
	color: var(--wpaig-pt-text);
	transition: var(--wpaig-pt-transition);
}

.wpaig-pt-quantity-input:focus {
	outline: none;
	border-color: var(--wpaig-pt-accent);
}

.wpaig-pt-inline-price {
	font-size: 14px;
	font-weight: 600;
	color: var(--wpaig-pt-accent);
	white-space: nowrap;
}

.wpaig-pt-cell--value:has(.wpaig-pt-quantity-input) {
	display: flex;
	align-items: center;
	gap: 8px;
}

/* ========================================
   Mobile Plan Info (hidden on desktop)
   ======================================== */
.wpaig-pt-mobile-info {
	display: none;
}

/* ========================================
   Responsive
   ======================================== */
@media (max-width: 900px) {
	.wpaig-pt-table {
		grid-template-columns: 1fr;
		border: none;
		gap: 16px;
		background: transparent;
	}

	.wpaig-pt-row {
		display: flex;
		flex-direction: column;
	}

	.wpaig-pt-row--title {
		display: none;
	}

	.wpaig-pt-row--header {
		display: none;
	}

	.wpaig-pt-row--feature {
		display: none;
	}

	.wpaig-pt-row--actions {
		display: grid;
		grid-template-columns: 1fr;
		gap: 16px;
	}

	.wpaig-pt-row--actions .wpaig-pt-cell--label {
		display: none;
	}

	.wpaig-pt-row--actions .wpaig-pt-cell--action {
		background: var(--wpaig-pt-bg);
		border: 1px solid var(--wpaig-pt-border);
		border-radius: var(--wpaig-pt-radius);
		padding: 24px;
		flex-direction: column;
		gap: 12px;
	}

	/* Show mobile card layout */
	.wpaig-pt-table::before {
		display: none;
	}

	/* Mobile: show as cards */
	.wpaig-pt-table {
		display: flex;
		flex-direction: column;
	}

	.wpaig-pt-cell--action {
		display: flex;
		flex-direction: column;
		align-items: center;
	}

	.wpaig-pt-mobile-info {
		display: flex;
		flex-direction: column;
		align-items: center;
		gap: 6px;
		text-align: center;
		width: 100%;
	}

	.wpaig-pt-mobile-features {
		width: 100%;
		margin-top: 8px;
		border-top: 1px solid var(--wpaig-pt-border);
		padding-top: 12px;
		display: flex;
		flex-direction: column;
		gap: 8px;
	}

	.wpaig-pt-mobile-feature {
		display: flex;
		justify-content: space-between;
		align-items: center;
		font-size: 14px;
		padding: 0 4px;
	}

	.wpaig-pt-mobile-feature-label {
		font-weight: 600;
		color: var(--wpaig-pt-text);
	}

	.wpaig-pt-mobile-feature-value {
		color: var(--wpaig-pt-text-light);
		display: flex;
		align-items: center;
		gap: 6px;
	}

	.wpaig-pt-btn {
		max-width: 100%;
	}
}

@media (max-width: 600px) {
	.wpaig-pt-row--actions .wpaig-pt-cell--action {
		padding: 20px 16px;
	}
}

/* ========================================
   Dark Theme Support (disabled — always light)
   ========================================
[data-theme="dark"] .wpaig-pt-table {
	--wpaig-pt-bg: var(--wpaig-bg-primary, #0a0a0a);
	--wpaig-pt-bg-alt: var(--wpaig-bg-card, #1a1a1a);
	--wpaig-pt-text: var(--wpaig-color-text, #ffffff);
	--wpaig-pt-text-light: var(--wpaig-color-text-light, #abb8c3);
	--wpaig-pt-text-muted: var(--wpaig-color-text-muted, #6b7280);
	--wpaig-pt-border: var(--wpaig-color-border, #2d2d2d);
}

@media (prefers-color-scheme: dark) {
	:root:not([data-theme="light"]) .wpaig-pt-table {
		--wpaig-pt-bg: var(--wpaig-bg-primary, #0a0a0a);
		--wpaig-pt-bg-alt: var(--wpaig-bg-card, #1a1a1a);
		--wpaig-pt-text: var(--wpaig-color-text, #ffffff);
		--wpaig-pt-text-light: var(--wpaig-color-text-light, #abb8c3);
		--wpaig-pt-text-muted: var(--wpaig-color-text-muted, #6b7280);
		--wpaig-pt-border: var(--wpaig-color-border, #2d2d2d);
	}
}
*/

