/**
 * Power Coupons — Points & Rewards frontend styles.
 *
 * @package Power_Coupons
 */

/* Earn message */
.power-coupons-points-earn-message {
	background: #f0f9ff;
	border: 1px solid #bae6fd;
	border-radius: 6px;
	padding: 10px 16px;
	margin: 12px 0;
}

.power-coupons-points-earn-message p {
	margin: 0;
	color: #0369a1;
	font-size: 14px;
}

/* Redeem widget */
.power-coupons-points-redeem-widget {
	background: #fffbeb;
	border: 1px solid #fde68a;
	border-radius: 6px;
	padding: 16px;
	margin: 12px 0;
}

.power-coupons-points-balance {
	font-size: 14px;
	color: #92400e;
	margin-bottom: 12px;
}

/* Credit input form */
.power-coupons-points-credit-input-row {
	display: flex;
	align-items: stretch;
	gap: 0;
}

.power-coupons-points-credit-input {
	flex: 1;
	min-width: 0;
	padding: 8px 12px;
	font-size: 14px;
	border: 1px solid #d1d5db;
	border-radius: 4px 0 0 4px;
	border-right: none;
	-moz-appearance: textfield;
	background: #fff;
	color: #374151;
	outline: none;
}

.power-coupons-points-credit-input:focus {
	border-color: #f97316;
	box-shadow: 0 0 0 1px #f97316;
	z-index: 1;
}

.power-coupons-points-credit-input::-webkit-outer-spin-button,
.power-coupons-points-credit-input::-webkit-inner-spin-button {
	-webkit-appearance: none;
	margin: 0;
}

.power-coupons-apply-credit-btn,
.power-coupons-remove-credit-btn {
	font-size: 13px !important;
	font-weight: 600 !important;
	padding: 8px 20px !important;
	line-height: 1.5 !important;
	text-transform: uppercase !important;
	letter-spacing: 0.5px !important;
	white-space: nowrap !important;
	border-radius: 0 4px 4px 0 !important;
}

.power-coupons-points-credit-preview {
	font-size: 12px;
	color: #78350f;
	margin: 6px 0 0;
	min-height: 18px;
}

/* Full mode toggle row */
.power-coupons-points-credit-toggle-row {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
}

.power-coupons-points-credit-toggle-info {
	font-size: 14px;
	color: #451a03;
}

/* Applied credit state */
.power-coupons-points-credit-applied {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
}

.power-coupons-points-credit-info {
	font-size: 14px;
	color: #451a03;
	font-weight: 500;
}

/* Button loading state — uses pc-redeeming to avoid WC .loading conflicts */
.power-coupons-apply-credit-btn.pc-redeeming,
.power-coupons-remove-credit-btn.pc-redeeming {
	display: inline-flex !important;
	align-items: center !important;
	justify-content: center !important;
	gap: 4px !important;
	opacity: 0.7;
	pointer-events: none;
}

/* Inline spinner for button loading state */
.power-coupons-apply-credit-btn .power-coupons-spinner,
.power-coupons-remove-credit-btn .power-coupons-spinner {
	display: inline-block !important;
	width: 10px !important;
	height: 10px !important;
	border: 1.5px solid currentcolor !important;
	border-right-color: transparent !important;
	border-radius: 50% !important;
	animation: power-coupons-spin 0.6s linear infinite !important;
	vertical-align: middle !important;
	margin: 0 !important;
	padding: 0 !important;
	flex-shrink: 0;
}

@keyframes power-coupons-spin {
	to {
		transform: rotate( 360deg );
	}
}

/* Notices */
.power-coupons-points-redeem-notice {
	margin: 10px 0;
	padding: 10px 16px;
	border-radius: 6px;
	font-size: 14px;
}

.power-coupons-points-notice-success {
	background: #f0fdf4;
	border: 1px solid #bbf7d0;
	color: #166534;
}

.power-coupons-points-notice-error {
	background: #fef2f2;
	border: 1px solid #fecaca;
	color: #991b1b;
}

.power-coupons-points-redeem-notice p {
	margin: 0;
}

/* My Account — Points summary */
.power-coupons-points-summary {
	display: grid;
	grid-template-columns: repeat( auto-fit, minmax( 140px, 1fr ) );
	gap: 16px;
	margin-bottom: 24px;
}

.power-coupons-points-summary-card {
	background: #f9fafb;
	border: 1px solid #e5e7eb;
	border-radius: 8px;
	padding: 16px;
	text-align: center;
}

.power-coupons-points-summary-value {
	display: block;
	font-size: 28px;
	font-weight: 700;
	color: #111827;
	line-height: 1.2;
}

.power-coupons-points-summary-label {
	display: block;
	font-size: 13px;
	color: #6b7280;
	margin-top: 4px;
}

.power-coupons-points-pending-icon {
	font-style: normal;
	cursor: help;
	opacity: 0.5;
	margin-left: 2px;
}

/* My Account — History table */
.power-coupons-points-history {
	margin-bottom: 24px;
}

.power-coupons-points-history h3 {
	font-size: 18px;
	margin: 0 0 12px;
}

.power-coupons-points-history-table {
	width: 100%;
}

.power-coupons-points-positive {
	color: #16a34a;
	font-weight: 600;
}

.power-coupons-points-negative {
	color: #dc2626;
	font-weight: 600;
}

/* Highlight animation for newly inserted history row */
@keyframes power-coupons-row-highlight {
	from {
		background-color: #fef9c3;
	}
	to {
		background-color: transparent;
	}
}

.power-coupons-points-history-table tbody tr.pc-new-entry {
	animation: power-coupons-row-highlight 2s ease-out;
}

/* Pagination */
.power-coupons-points-pagination {
	margin-top: 16px;
	text-align: center;
}

.power-coupons-points-pagination .page-numbers {
	display: inline-block;
	padding: 4px 10px;
	margin: 0 2px;
	border: 1px solid #d1d5db;
	border-radius: 4px;
	text-decoration: none;
	color: #374151;
	font-size: 13px;
}

.power-coupons-points-pagination .page-numbers.current {
	background: #f97316;
	border-color: #f97316;
	color: #fff;
}

.power-coupons-points-pagination .page-numbers:hover {
	background: #f3f4f6;
}

.power-coupons-points-pagination .page-numbers.current:hover {
	background: #ea580c;
}
