/* Gift Code Redemption Page */

.dwp-gift-redeem-wrap {
	max-width: 540px;
	margin: 2rem auto;
	padding: 0 1rem;
}

.dwp-gift-redeem-box {
	background: #fff;
	border: 1px solid #e0e0e0;
	border-radius: 6px;
	padding: 2rem;
}

.dwp-gift-redeem-box h2 {
	margin-top: 0;
	margin-bottom: 0.5rem;
	font-size: 1.5rem;
}

.dwp-gift-redeem-box h3 {
	margin-top: 1.5rem;
	margin-bottom: 1rem;
	font-size: 1.1rem;
}

/* Error messages */
.dwp-gift-redeem-errors {
	background: #fef2f2;
	border: 1px solid #fca5a5;
	border-radius: 4px;
	padding: 0.75rem 1rem;
	margin: 1rem 0;
}

.dwp-gift-redeem-errors p {
	margin: 0.25rem 0;
	color: #991b1b;
	font-size: 0.9rem;
}

/* Gift details */
.dwp-gift-redeem-details {
	background: #f8f8f8;
	border-radius: 4px;
	padding: 1rem 1.25rem;
	margin: 1.25rem 0;
}

.dwp-gift-redeem-details p {
	margin: 0.25rem 0;
}

.dwp-gift-plan-name {
	font-weight: 700;
	font-size: 1.1rem;
}

.dwp-gift-from {
	color: #555;
	font-size: 0.95rem;
}

.dwp-gift-message {
	margin-top: 0.75rem;
	padding-top: 0.75rem;
	border-top: 1px solid #e0e0e0;
	font-style: italic;
	color: #444;
}

/* Form fields */
.dwp-gift-redeem-form {
	margin-top: 1.25rem;
}

.dwp-gift-field-group {
	margin-bottom: 1rem;
}

.dwp-gift-field-group label {
	display: block;
	font-weight: 600;
	margin-bottom: 0.3rem;
	font-size: 0.9rem;
}

.dwp-gift-field-group input[type="text"],
.dwp-gift-field-group input[type="email"],
.dwp-gift-field-group input[type="password"] {
	width: 100%;
	padding: 0.6rem 0.75rem;
	border: 1px solid #ccc;
	border-radius: 4px;
	font-size: 1rem;
	box-sizing: border-box;
}

.dwp-gift-field-group input:focus {
	border-color: #2563eb;
	outline: none;
	box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.15);
}

#dwp_gift_code {
	font-family: monospace;
	font-size: 1.15rem;
	letter-spacing: 0.05em;
	text-transform: uppercase;
}

/* Two-column field row */
.dwp-gift-field-row {
	display: flex;
	gap: 1rem;
}

.dwp-gift-field-half {
	flex: 1;
}

/* Buttons */
.dwp-gift-btn {
	display: inline-block;
	padding: 0.7rem 1.5rem;
	border: none;
	border-radius: 4px;
	font-size: 1rem;
	font-weight: 600;
	cursor: pointer;
	text-decoration: none;
	text-align: center;
	transition: background-color 0.2s;
}

.dwp-gift-btn-primary {
	background-color: #2563eb;
	color: #fff;
}

.dwp-gift-btn-primary:hover {
	background-color: #1d4ed8;
	color: #fff;
}

.dwp-gift-btn-secondary {
	background-color: #f3f4f6;
	color: #374151;
	border: 1px solid #d1d5db;
	margin-left: 0.5rem;
}

.dwp-gift-btn-secondary:hover {
	background-color: #e5e7eb;
	color: #374151;
}

/* Logged-in prompt */
.dwp-gift-logged-in-prompt {
	margin-top: 1rem;
}

/* Two-column activate layout (password-set step) */
.dwp-gift-redeem-wrap:has(.dwp-gift-activate-columns) {
	max-width: 800px;
}

.dwp-gift-activate-columns {
	display: flex;
	gap: 2rem;
	align-items: flex-start;
	margin-top: 1.25rem;
}

.dwp-gift-activate-left,
.dwp-gift-activate-right {
	flex: 1;
	min-width: 0;
}

.dwp-gift-activate-left {
	overflow-wrap: break-word;
	word-break: break-word;
}

.dwp-gift-activate-left .dwp-gift-redeem-details {
	margin-top: 0;
}

.dwp-gift-activate-right .dwp-gift-redeem-form {
	margin-top: 0;
}

.dwp-gift-activate-footer {
	margin-top: 1.5rem;
	text-align: center;
}

.dwp-gift-activate-footer .dwp-gift-field-group {
	max-width: 400px;
	margin: 0 auto 1rem;
	text-align: left;
}

.dwp-gift-activate-footer .dwp-gift-btn {
	display: inline-block;
}

/* Alt action link */
.dwp-gift-alt-action {
	margin-top: 1.25rem;
	font-size: 0.9rem;
	color: #666;
}

.dwp-gift-alt-action a {
	color: #2563eb;
}

/* Success page */
.dwp-gift-success h2 {
	color: #166534;
}

.dwp-gift-next-steps {
	margin-top: 1.5rem;
}

.dwp-gift-next-steps p {
	margin-bottom: 1rem;
}

/* Error page */
.dwp-gift-error-box h2 {
	color: #991b1b;
}

/* Responsive */
@media (max-width: 768px) {
	.dwp-gift-activate-columns {
		flex-direction: column;
		gap: 1rem;
	}
}

@media (max-width: 480px) {
	.dwp-gift-redeem-box {
		padding: 1.25rem;
	}

	.dwp-gift-field-row {
		flex-direction: column;
		gap: 0;
	}
}

/* =====================================================
   Profile Page — Purchaser Gift Codes Table
   ===================================================== */

#dwp-purchaser-gift-codes {
	margin-top: 2rem;
}

#dwp-purchaser-gift-codes h3 {
	margin-bottom: 1rem;
	font-size: 1.2rem;
}

.dwp-gift-codes-table {
	width: 100%;
	border-collapse: collapse;
	font-size: 0.9rem;
}

.dwp-gift-codes-table thead th {
	text-align: left;
	padding: 0.5rem 0.75rem;
	border-bottom: 2px solid #ddd;
	font-weight: 600;
	font-size: 0.85rem;
	color: #555;
}

.dwp-gift-codes-table tbody td {
	padding: 0.6rem 0.75rem;
	border-bottom: 1px solid #eee;
	vertical-align: middle;
}

.dwp-gift-codes-table tbody tr:last-child td {
	border-bottom: none;
}

.dwp-gift-code-cell-code code {
	font-size: 0.9rem;
	letter-spacing: 0.03em;
	background: #f5f5f5;
	padding: 0.15rem 0.4rem;
	border-radius: 3px;
}

.dwp-gift-code-cell-recipient {
	max-width: 180px;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

/* Status badges */
.dwp-gift-code-badge {
	display: inline-block;
	padding: 0.15rem 0.5rem;
	border-radius: 3px;
	font-size: 0.8rem;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.02em;
}

.dwp-gift-code-badge-pending {
	background: #fef3c7;
	color: #92400e;
}

.dwp-gift-code-badge-redeemed {
	background: #d1fae5;
	color: #065f46;
}

.dwp-gift-code-badge-expired {
	background: #f3f4f6;
	color: #6b7280;
}

.dwp-gift-code-badge-refunded {
	background: #fee2e2;
	color: #991b1b;
}

/* Row dimming for non-pending */
.dwp-gift-code-status-redeemed td,
.dwp-gift-code-status-expired td,
.dwp-gift-code-status-refunded td {
	opacity: 0.7;
}

/* Action buttons */
.dwp-gift-code-cell-actions {
	white-space: nowrap;
}

.dwp-gift-code-copy-link,
.dwp-gift-code-resend {
	display: inline-block;
	padding: 0.25rem 0.6rem;
	font-size: 0.8rem;
	font-weight: 500;
	border: 1px solid #d1d5db;
	border-radius: 3px;
	background: #fff;
	color: #374151;
	cursor: pointer;
	margin-right: 0.35rem;
	transition: background-color 0.15s;
}

.dwp-gift-code-copy-link:hover,
.dwp-gift-code-resend:hover {
	background: #f3f4f6;
}

.dwp-gift-code-copy-link:disabled,
.dwp-gift-code-resend:disabled {
	opacity: 0.6;
	cursor: not-allowed;
}

.dwp-gift-code-redeemed-date {
	font-size: 0.8rem;
	color: #6b7280;
}

/* Action status message */
.dwp-gift-code-action-status {
	margin-top: 0.75rem;
	padding: 0.5rem 0.75rem;
	border-radius: 4px;
	font-size: 0.9rem;
}

.dwp-gift-code-action-status.success {
	background: #d1fae5;
	color: #065f46;
}

.dwp-gift-code-action-status.error {
	background: #fee2e2;
	color: #991b1b;
}

.dwp-gift-code-action-status p {
	margin: 0;
}

/* Responsive table */
@media (max-width: 640px) {
	.dwp-gift-codes-table,
	.dwp-gift-codes-table thead,
	.dwp-gift-codes-table tbody,
	.dwp-gift-codes-table tr,
	.dwp-gift-codes-table td,
	.dwp-gift-codes-table th {
		display: block;
	}

	.dwp-gift-codes-table thead {
		display: none;
	}

	.dwp-gift-codes-table tbody tr {
		margin-bottom: 1rem;
		border: 1px solid #e5e7eb;
		border-radius: 6px;
		padding: 0.75rem;
	}

	.dwp-gift-codes-table tbody td {
		padding: 0.3rem 0;
		border-bottom: none;
	}

	.dwp-gift-codes-table tbody td:before {
		content: attr(data-label);
		font-weight: 600;
		font-size: 0.8rem;
		color: #555;
		display: block;
		margin-bottom: 0.15rem;
	}

	.dwp-gift-code-cell-recipient {
		max-width: none;
		white-space: normal;
	}
}
