/**
 * WC Product Lists - frontend styles
 * Palette matches the site's Order History plugin for visual consistency.
 */

:root {
	--wcpl-primary-color: #8b5cf6;
	--wcpl-primary-hover: #7c3aed;
	--wcpl-secondary-color: #64748b;
	--wcpl-success-color: #10b981;
	--wcpl-error-color: #ef4444;
	--wcpl-border-color: #e2e8f0;
	--wcpl-background-light: #f8f9fa;
	--wcpl-text-primary: #1a202c;
	--wcpl-text-secondary: #64748b;
	--wcpl-shadow-light: 0 2px 8px rgba(0, 0, 0, 0.05);
	--wcpl-shadow-medium: 0 4px 12px rgba(0, 0, 0, 0.1);
	--wcpl-border-radius: 12px;
	--wcpl-border-radius-small: 8px;
	--wcpl-transition: all 0.2s ease;
}

/* -------------------------------------------------------------------
 * Buttons
 * ---------------------------------------------------------------- */

.wcpl-button {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 6px;
	padding: 9px 18px;
	font-size: 14px;
	font-weight: 600;
	border-radius: var(--wcpl-border-radius-small);
	border: 1px solid transparent;
	cursor: pointer;
	transition: var(--wcpl-transition);
	line-height: 1.2;
}

.wcpl-button-primary {
	border-color: var(--wcpl-primary-color);
	color: var(--wcpl-primary-color);
	background: #fff;
}

.wcpl-button-primary:hover {
	color: #331468;
	background: #7c3aed80;
}

.wcpl-button-secondary {
	background: #fff;
	border-color: var(--wcpl-border-color);
	color: var(--wcpl-text-primary);
}

.wcpl-button-secondary:hover {
	background: var(--wcpl-background-light);
	border-color: var(--wcpl-primary-color);
}

.wcpl-button-danger {
	background: var(--wcpl-error-color);
	color: #fff;
}

.wcpl-button-danger:hover {
	background: #dc2626;
}

.wcpl-button:focus {
	outline: 2px solid var(--wcpl-primary-color);
	outline-offset: 2px;
}

/* -------------------------------------------------------------------
 * Modals (Add to List, and the generic alert/confirm/prompt modal)
 * ---------------------------------------------------------------- */

.wcpl-modal-overlay {
	position: fixed;
	top: 0; left: 0; right: 0; bottom: 0;
	background: rgba(15, 23, 42, 0.45);
	z-index: 100000;
	display: flex;
	align-items: center;
	justify-content: center;
}

/* The generic modal (alert/confirm/prompt) can be triggered from within
   the Add to List modal (e.g. Create New List) - it needs to sit above it. */
#wcpl-generic-modal {
	z-index: 100010;
}

.wcpl-modal {
	background: #fff;
	width: 90%;
	max-width: 420px;
	border-radius: var(--wcpl-border-radius);
	overflow: hidden;
	box-shadow: var(--wcpl-shadow-medium);
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

.wcpl-modal-small {
	max-width: 380px;
}

.wcpl-modal-header {
	background: var(--wcpl-background-light);
	padding: 18px 24px;
	display: flex;
	align-items: center;
	justify-content: space-between;
	border-bottom: 1px solid var(--wcpl-border-color);
}

.wcpl-modal-header h2 {
	margin: 0;
	font-size: 18px;
	font-weight: 600;
	color: var(--wcpl-text-primary);
}

.wcpl-modal-close {
	background: none;
	border: none;
	font-size: 22px;
	line-height: 1;
	cursor: pointer;
	color: var(--wcpl-text-secondary);
}

.wcpl-modal-close:hover {
	color: var(--wcpl-text-primary);
}

.wcpl-modal-body {
	padding: 20px 24px;
	max-height: 300px;
	overflow-y: auto;
}

.wcpl-modal-body p {
	margin: 0 0 12px;
	color: var(--wcpl-text-primary);
	font-size: 14px;
}

.wcpl-modal-body p:empty {
	display: none;
}

.wcpl-list-row {
	display: block;
	padding: 8px 0;
	font-size: 15px;
	color: var(--wcpl-text-primary);
}

.wcpl-text-input {
	width: 100%;
	padding: 9px 12px;
	border: 1px solid var(--wcpl-border-color);
	border-radius: var(--wcpl-border-radius-small);
	font-size: 14px;
	box-sizing: border-box;
}

.wcpl-text-input:focus {
	outline: none;
	border-color: var(--wcpl-primary-color);
}

.wcpl-modal-footer {
	display: flex;
	gap: 10px;
	padding: 16px 24px;
	border-top: 1px solid var(--wcpl-border-color);
}

.wcpl-modal-footer .wcpl-button {
	flex: 1;
}

/* -------------------------------------------------------------------
 * Toast notifications
 * ---------------------------------------------------------------- */

.wcpl-notification {
	position: fixed;
	top: 20px;
	right: 20px;
	padding: 14px 22px;
	border-radius: var(--wcpl-border-radius-small);
	color: #fff;
	font-weight: 500;
	font-size: 14px;
	z-index: 100001;
	box-shadow: var(--wcpl-shadow-medium);
	max-width: 360px;
	animation: wcpl-slide-in 0.25s ease;
	transition: opacity 0.3s ease, transform 0.3s ease;
}

.wcpl-notification-success {
	background: var(--wcpl-success-color);
}

.wcpl-notification-error {
	background: var(--wcpl-error-color);
}

.wcpl-notification-hide {
	opacity: 0;
	transform: translateX(20px);
}

@keyframes wcpl-slide-in {
	from { transform: translateX(100%); opacity: 0; }
	to { transform: translateX(0); opacity: 1; }
}

/* -------------------------------------------------------------------
 * My Lists - card layout
 * ---------------------------------------------------------------- */

.wcpl-my-lists {
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
	max-width: 1200px;
}

.wcpl-container {
	background: #fff;
	height: 100%;
    border-radius: var(--wc-unpaid-orders-border-radius);
    box-shadow: var(--wc-unpaid-orders-shadow-light);
    border: 1px solid rgba(0, 0, 0, 0.15);
}

.wcpl-container > p {
    text-align: center;
}

.wcpl-my-lists-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 24px 32px;
    border-radius: 12px 12px 0px 0px;
    background: var(--wc-unpaid-orders-background-light);
    border-bottom: 1px solid var(--wc-unpaid-orders-border-color);
}

.wcpl-my-lists-header h2 {
	font-size: 22px;
	font-weight: 600;
	margin: 0;
	color: var(--wcpl-text-primary);
}

.wcpl-my-lists-header h2 span {
	font-size: 13px;
	font-weight: 400;
	color: var(--wcpl-text-secondary);
	margin-left: 8px;
}

.wcpl-list-card {
	display: flex;
	align-items: center;
	justify-content: space-between;
	background: #fff;
	border: 1px solid var(--wcpl-border-color);
	border-radius: var(--wcpl-border-radius);
	padding: 20px 24px;
	margin-bottom: 12px;
	margin-top: 12px;
	cursor: pointer;
	transition: var(--wcpl-transition);
	margin-left: 1rem;
    margin-right: 1rem;
}

.wcpl-list-card:hover {
	border-color: var(--wcpl-primary-color);
	box-shadow: var(--wcpl-shadow-medium);
}

.wcpl-list-card-main h3 {
	margin: 0 0 8px;
	font-size: 19px;
	font-weight: 600;
	color: var(--wcpl-text-primary);
}

.wcpl-list-count {
	font-size: 13px;
	font-weight: 400;
	color: var(--wcpl-text-secondary);
	margin-left: 8px;
}

.wcpl-list-meta {
	font-size: 13px;
	color: var(--wcpl-text-secondary);
}

.wcpl-list-meta-sep {
	margin: 0 8px;
	color: var(--wcpl-border-color);
}

.wcpl-list-actions {
	flex-shrink: 0;
	font-size: 14px;
	white-space: nowrap;
}

.wcpl-list-actions a {
	color: var(--wcpl-primary-color);
	font-weight: 600;
	text-decoration: none;
	padding: 4px 8px;
	border-radius: 4px;
	transition: var(--wcpl-transition);
}

.wcpl-list-actions a:hover {
	background: rgba(139, 92, 246, 0.1);
	color: var(--wcpl-primary-hover);
}

.wcpl-list-actions-sep {
	margin: 0 4px;
	color: var(--wcpl-border-color);
}

/* -------------------------------------------------------------------
 * Responsive
 * ---------------------------------------------------------------- */

@media (max-width: 600px) {
	.wcpl-list-card {
		flex-direction: column;
		align-items: flex-start;
		gap: 12px;
	}

	.wcpl-list-actions {
		align-self: flex-end;
	}
}