/**
 * Public stylesheet for the Codeza Offer WordPress plugin
 */

/* Container and card setup */
.codeza-offer-card {
	--transition-speed: 0.3s;
	--card-bg: #ffffff;
	--card-shadow: 0 10px 30px rgba(0, 0, 0, 0.05), 0 1px 3px rgba(0, 0, 0, 0.02);
	--card-shadow-hover: 0 20px 40px rgba(0, 0, 0, 0.1), 0 1px 8px rgba(0, 0, 0, 0.05);

	background: var(--card-bg);
	border: 1px solid rgba(0, 0, 0, 0.06);
	border-radius: 16px;
	padding: 30px;
	margin: 20px 0;
	box-shadow: var(--card-shadow);
	position: relative;
	overflow: hidden;
	transition: transform var(--transition-speed) cubic-bezier(0.25, 0.8, 0.25, 1),
				box-shadow var(--transition-speed) cubic-bezier(0.25, 0.8, 0.25, 1),
				border-color var(--transition-speed) ease;
	max-width: 600px;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
	color: var(--codeza-text);
}

.codeza-offer-card:hover {
	transform: translateY(-5px);
	box-shadow: var(--card-shadow-hover);
	border-color: rgba(var(--codeza-primary), 0.2);
}

/* Card state modifications */
.codeza-offer-card.codeza-offer-expired {
	opacity: 0.75;
	filter: grayscale(20%);
	pointer-events: none;
}

.codeza-offer-card.codeza-offer-expired::after {
	content: '';
	position: absolute;
	top: 0;
	left: 0;
	right: 0;
	bottom: 0;
	background: rgba(255, 255, 255, 0.1);
	pointer-events: none;
}

/* Expiry Badge */
.codeza-expiry-badge {
	position: absolute;
	top: 15px;
	right: 15px;
	padding: 6px 12px;
	border-radius: 50px;
	font-size: 11px;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.8px;
	display: inline-flex;
	align-items: center;
	z-index: 2;
}

.codeza-expiry-badge.active {
	background-color: rgba(16, 185, 129, 0.1);
	color: #047857;
	border: 1px solid rgba(16, 185, 129, 0.2);
}

.codeza-expiry-badge.expired {
	background-color: rgba(239, 68, 68, 0.1);
	color: #b91c1c;
	border: 1px solid rgba(239, 68, 68, 0.2);
}

/* Header section */
.codeza-offer-header {
	display: flex;
	align-items: center;
	gap: 20px;
	margin-bottom: 20px;
}

.codeza-offer-image {
	flex-shrink: 0;
	width: 80px;
	height: 80px;
	border-radius: 12px;
	overflow: hidden;
	box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
	border: 1px solid rgba(0, 0, 0, 0.08);
}

.codeza-offer-image img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

.codeza-offer-title-group {
	flex-grow: 1;
}

.codeza-offer-discount-badge {
	display: inline-block;
	background: linear-gradient(135deg, var(--codeza-primary), var(--codeza-secondary));
	color: #ffffff;
	font-weight: 800;
	font-size: 14px;
	padding: 4px 12px;
	border-radius: 6px;
	margin-bottom: 8px;
	text-transform: uppercase;
	letter-spacing: 0.5px;
	box-shadow: 0 4px 10px rgba(0, 0, 0, 0.08);
}

.codeza-offer-title {
	font-size: 22px;
	font-weight: 800;
	margin: 0;
	color: var(--codeza-text);
	line-height: 1.3;
}

/* Content/Body section */
.codeza-offer-content {
	font-size: 15px;
	line-height: 1.6;
	color: var(--codeza-text);
	opacity: 0.85;
	margin-bottom: 25px;
}

.codeza-offer-content p:last-child {
	margin-bottom: 0;
}

/* Footer Section */
.codeza-offer-footer {
	display: flex;
	flex-wrap: wrap;
	gap: 15px;
	align-items: center;
	justify-content: space-between;
	border-top: 1px dashed rgba(0, 0, 0, 0.1);
	padding-top: 20px;
}

/* Coupon box styling */
.codeza-coupon-wrapper {
	flex-grow: 1;
	min-width: 200px;
}

.codeza-coupon-code-box {
	display: flex;
	align-items: center;
	justify-content: space-between;
	background: #f8fafc;
	border: 2px dashed rgba(0, 0, 0, 0.15);
	border-radius: 8px;
	padding: 8px 12px 8px 16px;
	font-weight: 700;
	font-size: 16px;
	letter-spacing: 1px;
	position: relative;
	transition: background-color 0.2s ease, border-color 0.2s ease;
}

.codeza-coupon-code-box:hover {
	background: #f1f5f9;
	border-color: var(--codeza-primary);
}

.codeza-code-text {
	color: var(--codeza-primary);
	text-transform: uppercase;
}

.codeza-copy-btn {
	background: none;
	border: none;
	color: #64748b;
	cursor: pointer;
	padding: 6px;
	border-radius: 6px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	transition: background-color 0.2s ease, color 0.2s ease;
	position: relative;
	outline: none;
}

.codeza-copy-btn:hover {
	background-color: rgba(0, 0, 0, 0.05);
	color: var(--codeza-primary);
}

.codeza-copy-btn .dashicons {
	font-size: 18px;
	width: 18px;
	height: 18px;
}

/* Copy Tooltip */
.codeza-btn-tooltip {
	position: absolute;
	bottom: calc(100% + 8px);
	left: 50%;
	transform: translateX(-50%) translateY(4px);
	background: #0f172a;
	color: #ffffff;
	padding: 4px 10px;
	border-radius: 4px;
	font-size: 11px;
	font-weight: 500;
	white-space: nowrap;
	opacity: 0;
	visibility: hidden;
	pointer-events: none;
	transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s ease;
}

.codeza-btn-tooltip::after {
	content: '';
	position: absolute;
	top: 100%;
	left: 50%;
	transform: translateX(-50%);
	border: 5px solid transparent;
	border-top-color: #0f172a;
}

.codeza-copy-btn:hover .codeza-btn-tooltip {
	opacity: 1;
	visibility: visible;
	transform: translateX(-50%) translateY(0);
}

.codeza-copy-btn.copied .codeza-btn-tooltip {
	background-color: #10b981;
}

.codeza-copy-btn.copied .codeza-btn-tooltip::after {
	border-top-color: #10b981;
}

/* Action button styling */
.codeza-action-wrapper {
	flex-shrink: 0;
}

.codeza-offer-btn {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	background: var(--codeza-btn);
	color: #ffffff !important;
	text-decoration: none !important;
	padding: 12px 24px;
	font-weight: 700;
	font-size: 15px;
	border-radius: 8px;
	box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
	transition: background-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.codeza-offer-btn:hover {
	transform: translateY(-2px);
	box-shadow: 0 6px 16px rgba(0, 0, 0, 0.15);
	filter: brightness(1.05);
}

.codeza-offer-btn:active {
	transform: translateY(0);
}

.codeza-offer-btn .dashicons {
	font-size: 16px;
	width: 16px;
	height: 16px;
	transition: transform 0.2s ease;
}

.codeza-offer-btn:hover .dashicons {
	transform: translateX(4px);
}

/* Mobile Responsiveness */
@media (max-width: 480px) {
	.codeza-offer-card {
		padding: 20px;
	}

	.codeza-offer-header {
		flex-direction: column;
		align-items: flex-start;
		gap: 15px;
	}

	.codeza-offer-image {
		width: 60px;
		height: 60px;
	}

	.codeza-offer-footer {
		flex-direction: column;
		align-items: stretch;
	}

	.codeza-offer-btn {
		width: 100%;
		justify-content: center;
	}
}

/* ==========================================
   POPUP MODAL COMPONENT (High-Fidelity)
   ========================================== */

/* Overlay with backdrop blur */
.codeza-popup-overlay {
	position: fixed;
	top: 0;
	left: 0;
	width: 100vw;
	height: 100vh;
	background: rgba(15, 23, 42, 0.55);
	backdrop-filter: blur(8px);
	-webkit-backdrop-filter: blur(8px);
	z-index: 999999;
	display: flex;
	align-items: center;
	justify-content: center;
	animation: codezaFadeIn 0.3s ease-out forwards;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
}

/* Centered modal box */
.codeza-popup-content-wrapper {
	width: 90%;
	max-width: 480px;
	perspective: 1000px;
}

.codeza-popup-content {
	background: #ffffff;
	border-radius: 24px;
	padding: 40px 30px;
	box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25), 0 0 40px rgba(0, 0, 0, 0.03);
	position: relative;
	overflow: hidden;
	text-align: center;
	transform: scale(0.9) translateY(20px);
	opacity: 0;
	animation: codezaScaleIn 0.4s cubic-bezier(0.34, 1.56, 0.64, 1) 0.1s forwards;
	border: 1px solid rgba(255, 255, 255, 0.8);
}

/* Elegant close button */
.codeza-popup-close {
	position: absolute;
	top: 20px;
	right: 20px;
	background: #f1f5f9;
	border: none;
	width: 32px;
	height: 32px;
	border-radius: 50%;
	font-size: 20px;
	font-weight: 400;
	color: #64748b;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	transition: background-color 0.2s ease, color 0.2s ease, transform 0.2s ease;
	line-height: 1;
	z-index: 10;
}

.codeza-popup-close:hover {
	background-color: #e2e8f0;
	color: #1e293b;
	transform: rotate(90deg);
}

/* Celebrating Header */
.codeza-popup-header {
	margin-bottom: 25px;
}

.codeza-popup-gift-icon {
	width: 64px;
	height: 64px;
	background: linear-gradient(135deg, var(--codeza-primary), var(--codeza-secondary));
	color: #ffffff;
	border-radius: 50%;
	display: flex;
	align-items: center;
	justify-content: center;
	margin: 0 auto 15px auto;
	box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
	animation: codezaGiftWobble 2s infinite ease-in-out;
}

.codeza-popup-gift-icon .dashicons {
	font-size: 32px;
	width: 32px;
	height: 32px;
}

.codeza-popup-title {
	font-size: 28px;
	font-weight: 800;
	background: linear-gradient(135deg, var(--codeza-primary), var(--codeza-secondary));
	-webkit-background-clip: text;
	-webkit-text-fill-color: transparent;
	margin: 0 0 6px 0;
	letter-spacing: -0.5px;
}

.codeza-popup-subtitle {
	font-size: 14px;
	color: #64748b;
	margin: 0;
	font-weight: 500;
}

/* Body / Core content */
.codeza-popup-body {
	margin-bottom: 30px;
}

.codeza-popup-discount-display {
	display: inline-flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	background: #f8fafc;
	border: 2px dashed var(--codeza-primary);
	border-radius: 20px;
	padding: 15px 30px;
	margin-bottom: 20px;
	box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.02);
}

.codeza-popup-discount-val {
	font-size: 48px;
	font-weight: 900;
	color: var(--codeza-primary);
	line-height: 1;
	letter-spacing: -1px;
}

.codeza-popup-discount-lbl {
	font-size: 13px;
	font-weight: 800;
	color: var(--codeza-secondary);
	letter-spacing: 2px;
	margin-top: 4px;
}

.codeza-popup-offer-title {
	font-size: 18px;
	font-weight: 700;
	margin: 0 0 10px 0;
	color: var(--codeza-text);
}

.codeza-popup-desc {
	font-size: 14px;
	line-height: 1.5;
	color: #475569;
	margin: 0;
}

/* Footer & Collect Button */
.codeza-popup-footer {
	display: flex;
	justify-content: center;
}

.codeza-collect-btn {
	background: var(--codeza-btn);
	color: #ffffff;
	border: none;
	padding: 14px 40px;
	font-size: 16px;
	font-weight: 700;
	border-radius: 12px;
	cursor: pointer;
	box-shadow: 0 10px 20px -5px rgba(16, 185, 129, 0.3);
	display: inline-flex;
	align-items: center;
	gap: 10px;
	transition: background-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
	position: relative;
	overflow: hidden;
}

.codeza-collect-btn:hover {
	transform: translateY(-2px);
	box-shadow: 0 15px 25px -5px rgba(16, 185, 129, 0.4);
	filter: brightness(1.05);
}

.codeza-collect-btn:active {
	transform: translateY(0);
}

.codeza-collect-btn .dashicons {
	font-size: 20px;
	width: 20px;
	height: 20px;
	transition: transform 0.2s ease;
}

.codeza-collect-btn:hover .dashicons {
	transform: scale(1.2);
}

/* Animations */
@keyframes codezaFadeIn {
	from { opacity: 0; }
	to { opacity: 1; }
}

@keyframes codezaScaleIn {
	from {
		opacity: 0;
		transform: scale(0.9) translateY(20px);
	}
	to {
		opacity: 1;
		transform: scale(1) translateY(0);
	}
}

@keyframes codezaGiftWobble {
	0%, 100% { transform: translateY(0) rotate(0deg); }
	15% { transform: translateY(-4px) rotate(-6deg); }
	30% { transform: translateY(2px) rotate(4deg); }
	45% { transform: translateY(-2px) rotate(-3deg); }
	60% { transform: translateY(1px) rotate(2deg); }
	75% { transform: translateY(0) rotate(-1deg); }
}

/* Mobile responsiveness for popup */
@media (max-width: 480px) {
	.codeza-popup-content {
		padding: 30px 20px;
	}
	
	.codeza-popup-title {
		font-size: 24px;
	}
	
	.codeza-popup-discount-val {
		font-size: 38px;
	}
	
	.codeza-collect-btn {
		width: 100%;
		justify-content: center;
	}
}

/* ==========================================
   TOAST NOTIFICATION (Premium UX)
   ========================================== */
.codeza-toast {
	position: fixed;
	top: 24px;
	right: 24px;
	z-index: 9999999;
	display: flex;
	align-items: flex-start;
	gap: 14px;
	background: rgba(255, 255, 255, 0.95);
	backdrop-filter: blur(12px);
	-webkit-backdrop-filter: blur(12px);
	border-left: 4px solid var(--codeza-btn, #10b981);
	border-radius: 12px;
	padding: 16px 20px;
	box-shadow: 0 10px 25px -5px rgba(15, 23, 42, 0.1), 0 8px 10px -6px rgba(15, 23, 42, 0.05);
	max-width: 350px;
	animation: codezaToastSlideIn 0.35s cubic-bezier(0.16, 1, 0.3, 1) forwards;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
	border: 1px solid rgba(0, 0, 0, 0.05);
}

.codeza-toast-icon {
	color: var(--codeza-btn, #10b981);
	flex-shrink: 0;
}

.codeza-toast-icon .dashicons {
	font-size: 22px;
	width: 22px;
	height: 22px;
}

.codeza-toast-content {
	flex-grow: 1;
}

.codeza-toast-content h4 {
	margin: 0 0 4px 0;
	font-weight: 700;
	font-size: 15px;
	color: #0f172a;
	line-height: 1.2;
}

.codeza-toast-content p {
	margin: 0;
	font-size: 13px;
	line-height: 1.4;
	color: #475569;
}

.codeza-toast-close {
	background: none;
	border: none;
	cursor: pointer;
	color: #94a3b8;
	font-size: 18px;
	padding: 0;
	line-height: 1;
	margin-left: 8px;
	transition: color 0.2s ease;
}

.codeza-toast-close:hover {
	color: #1e293b;
}

@keyframes codezaToastSlideIn {
	from {
		opacity: 0;
		transform: translateY(-20px) scale(0.95);
	}
	to {
		opacity: 1;
		transform: translateY(0) scale(1);
	}
}

@keyframes codezaToastSlideOut {
	from {
		opacity: 1;
		transform: translateY(0) scale(1);
	}
	to {
		opacity: 0;
		transform: translateY(-20px) scale(0.95);
	}
}

@media (max-width: 480px) {
	.codeza-toast {
		left: 20px;
		right: 20px;
		max-width: none;
		top: 20px;
	}
}

/* ==========================================
   DUAL REWARD SELECTOR LAYOUT
   ========================================== */
.codeza-popup-content-wrapper.codeza-dual-wrap {
	max-width: 720px;
}

.codeza-popup-content-wrapper.codeza-dual-wrap .codeza-popup-content {
	padding: 40px;
}

.codeza-choices-container {
	display: flex;
	gap: 20px;
	margin: 25px 0;
	justify-content: center;
	flex-wrap: wrap;
}

.codeza-choice-card {
	flex: 1;
	min-width: 260px;
	background: #ffffff;
	border: 2px solid #e2e8f0;
	border-radius: 20px;
	padding: 30px 20px;
	cursor: pointer;
	position: relative;
	transition: border-color 0.25s ease, background-color 0.25s ease, transform 0.25s ease, box-shadow 0.25s ease;
	text-align: center;
	display: flex;
	flex-direction: column;
	align-items: center;
}

.codeza-choice-card:hover {
	transform: translateY(-4px);
	border-color: rgba(var(--codeza-primary), 0.4);
	box-shadow: 0 10px 20px rgba(0, 0, 0, 0.03);
}

.codeza-choice-card.active {
	border-color: var(--codeza-primary);
	background-color: #f8fafc;
	box-shadow: 0 15px 30px -10px rgba(15, 23, 42, 0.08);
}

/* Selector radio visual indicator */
.codeza-choice-radio {
	position: absolute;
	top: 15px;
	right: 15px;
	width: 24px;
	height: 24px;
	border-radius: 50%;
	border: 2px solid #cbd5e1;
	display: flex;
	align-items: center;
	justify-content: center;
	transition: border-color 0.2s ease, background-color 0.2s ease;
	color: transparent;
	background: #ffffff;
}

.codeza-choice-card.active .codeza-choice-radio {
	border-color: var(--codeza-primary);
	background-color: var(--codeza-primary);
	color: #ffffff;
}

.codeza-choice-radio .dashicons {
	font-size: 16px;
	width: 16px;
	height: 16px;
}

/* Choice value accent */
.codeza-choice-value {
	font-size: 24px;
	font-weight: 900;
	color: var(--codeza-primary);
	line-height: 1.2;
	letter-spacing: -0.5px;
	margin-top: 10px;
}

.codeza-choice-title {
	font-size: 16px;
	font-weight: 800;
	color: var(--codeza-text);
	margin: 15px 0 8px 0;
	line-height: 1.3;
}

.codeza-choice-desc {
	font-size: 13px;
	line-height: 1.45;
	color: #64748b;
	margin: 0;
}

/* Mobile responsiveness adjustments */
@media (max-width: 640px) {
	.codeza-choices-container {
		flex-direction: column;
		gap: 15px;
	}
	
	.codeza-choice-card {
		min-width: 100%;
		padding: 24px 20px;
	}
	
	.codeza-popup-content-wrapper.codeza-dual-wrap .codeza-popup-content {
		padding: 30px 20px;
	}
}

/* Near Add to Cart Widget Styles */
.codeza-near-add-to-cart-widget {
	display: inline-flex;
	flex-direction: column;
	align-items: flex-start;
	gap: 6px;
	margin-top: 20px;
	margin-bottom: 10px;
	padding: 12px 18px;
	background: linear-gradient(135deg, rgba(var(--codeza-primary-rgb, 59, 130, 246), 0.07) 0%, rgba(var(--codeza-primary-rgb, 59, 130, 246), 0.02) 100%);
	border: 1px solid rgba(var(--codeza-primary-rgb, 59, 130, 246), 0.2);
	border-radius: 14px;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
	box-shadow: 0 4px 20px rgba(var(--codeza-primary-rgb, 59, 130, 246), 0.04), inset 0 1px 0 rgba(255, 255, 255, 0.6);
	transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
	position: relative;
	overflow: hidden;
	width: auto;
	max-width: 100%;
}

/* Shine sweep animation */
.codeza-near-add-to-cart-widget::before {
	content: '';
	position: absolute;
	top: 0;
	left: -150%;
	width: 80%;
	height: 100%;
	background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
	transform: skewX(-20deg);
	transition: 0.75s;
}

.codeza-near-add-to-cart-widget:hover::before {
	left: 150%;
	transition: 0.8s ease-in-out;
}

.codeza-near-add-to-cart-widget:hover {
	transform: translateY(-2px);
	box-shadow: 0 8px 24px rgba(var(--codeza-primary-rgb, 59, 130, 246), 0.1), inset 0 1px 0 rgba(255, 255, 255, 0.8);
	border-color: rgba(var(--codeza-primary-rgb, 59, 130, 246), 0.35);
}

/* Badge (OFFER ACTIVE tag) */
.codeza-widget-badge {
	display: inline-flex;
	align-items: center;
	gap: 5px;
	padding: 3px 8px;
	background: rgba(var(--codeza-primary-rgb, 59, 130, 246), 0.12);
	border-radius: 6px;
}

.codeza-badge-dot {
	width: 6px;
	height: 6px;
	background-color: var(--codeza-primary);
	border-radius: 50%;
	animation: codeza-pulse-dot 1.5s infinite ease-in-out;
}

@keyframes codeza-pulse-dot {
	0%, 100% {
		transform: scale(0.9);
		opacity: 0.6;
	}
	50% {
		transform: scale(1.2);
		opacity: 1;
		box-shadow: 0 0 8px var(--codeza-primary);
	}
}

.codeza-badge-text {
	font-size: 10px;
	font-weight: 800;
	letter-spacing: 0.8px;
	color: var(--codeza-primary);
	text-transform: uppercase;
}

/* Content block with SVG icon and text */
.codeza-widget-content {
	display: flex;
	align-items: center;
	gap: 8px;
}

.codeza-widget-gift-svg {
	width: 18px;
	height: 18px;
	color: var(--codeza-primary);
	flex-shrink: 0;
	animation: codeza-widget-gift-shake 2.5s infinite ease-in-out;
	transform-origin: bottom center;
}

@keyframes codeza-widget-gift-shake {
	0%, 100% {
		transform: rotate(0) scale(1);
	}
	20%, 60% {
		transform: rotate(-6deg) scale(1.05);
	}
	40%, 80% {
		transform: rotate(6deg) scale(1.05);
	}
}

.codeza-widget-text {
	font-size: 14px;
	font-weight: 700;
	color: #1e293b;
	letter-spacing: -0.1px;
}



