/**
 * EZ Sales Notification - Styles
 * Admin Dashboard & Frontend Notifications
 */

/* ===========================
   Admin Dashboard Styles
   =========================== */

.ez-sales-notification-wrapper {
	max-width: 900px;
	margin: 20px auto;
	background: #fff;
	border-radius: 8px;
	box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
	overflow: hidden;
}

.ez-sales-notification-header {
	background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
	color: #fff;
	padding: 40px;
	text-align: center;
}

.ez-sales-notification-header h1 {
	margin: 0 0 10px 0;
	font-size: 32px;
	font-weight: 600;
}

.ez-sales-notification-header .subtitle {
	margin: 0;
	opacity: 0.9;
	font-size: 15px;
}

.ez-sales-notification-form {
	padding: 40px;
}

.ez-sales-notification-section {
	margin-bottom: 40px;
	padding: 30px;
	background: #f8f9fa;
	border-radius: 6px;
	border-left: 4px solid #667eea;
}

.ez-sales-notification-section h2 {
	margin: 0 0 25px 0;
	font-size: 18px;
	font-weight: 600;
	color: #333;
}

.ez-sales-notification-setting {
	display: flex;
	justify-content: space-between;
	align-items: flex-start;
	padding: 20px;
	background: #fff;
	border-radius: 4px;
	margin-bottom: 15px;
	border: 1px solid #e0e0e0;
}

.ez-sales-notification-setting:last-child {
	margin-bottom: 0;
}

.setting-label {
	flex: 1;
	max-width: 60%;
	padding-right: 20px;
}

.setting-label label {
	display: block;
	font-weight: 600;
	font-size: 14px;
	color: #333;
	margin-bottom: 8px;
	cursor: pointer;
}

.setting-label .description {
	font-size: 13px;
	color: #666;
	margin: 0;
	line-height: 1.4;
}

.setting-control {
	flex: 0 0 auto;
	display: flex;
	align-items: center;
}

/* ===========================
   Toggle Switch
   =========================== */

.toggle-switch {
	display: inline-flex;
	align-items: center;
	cursor: pointer;
	position: relative;
	user-select: none;
}

.toggle-switch input[type="checkbox"] {
	display: none;
}

.toggle-slider {
	display: inline-block;
	width: 50px;
	height: 28px;
	background-color: #ccc;
	border-radius: 14px;
	position: relative;
	transition: background-color 0.3s ease;
	box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.1);
}

.toggle-slider::after {
	content: '';
	position: absolute;
	width: 24px;
	height: 24px;
	background-color: white;
	border-radius: 50%;
	top: 2px;
	left: 2px;
	transition: left 0.3s ease;
	box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.toggle-switch input[type="checkbox"]:checked + .toggle-slider {
	background-color: #667eea;
}

.toggle-switch input[type="checkbox"]:checked + .toggle-slider::after {
	left: 24px;
}

/* ===========================
   Form Controls
   =========================== */

.setting-control input[type="number"],
.setting-control input[type="color"],
.setting-control input[type="url"],
.setting-control textarea,
.setting-control select {
	padding: 8px 12px;
	border: 1px solid #ddd;
	border-radius: 4px;
	font-size: 14px;
	font-family: inherit;
	transition: border-color 0.3s ease;
	min-width: 200px;
}

.setting-control textarea {
	resize: vertical;
	min-height: 100px;
}

.setting-control input[type="number"]:focus,
.setting-control input[type="color"]:focus,
.setting-control input[type="url"]:focus,
.setting-control textarea:focus,
.setting-control select:focus {
	outline: none;
	border-color: #667eea;
	box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.setting-control select {
	cursor: pointer;
	appearance: none;
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23333' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
	background-repeat: no-repeat;
	background-position: right 10px center;
	padding-right: 30px;
}

/* ===========================
   Submit Button
   =========================== */

.ez-sales-notification-submit {
	margin-top: 30px;
	padding-top: 30px;
	border-top: 1px solid #e0e0e0;
	text-align: right;
}

.ez-sales-notification-submit .button {
	background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
	color: white;
	border: none;
	padding: 12px 40px;
	border-radius: 4px;
	font-size: 14px;
	font-weight: 600;
	cursor: pointer;
	transition: all 0.3s ease;
	box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
}

.ez-sales-notification-submit .button:hover {
	transform: translateY(-2px);
	box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.ez-sales-notification-submit .button:active {
	transform: translateY(0);
}

/* ===========================
   Notices
   =========================== */

.ez-sales-notification-notice {
	margin: 0 0 20px 0 !important;
	padding: 12px 16px !important;
	border-left-color: #46b450 !important;
}

.ez-sales-notification-notice p {
	margin: 0 !important;
}

/* ===========================
   Frontend Notification
   =========================== */

.ez-sales-notification {
	position: fixed;
	bottom: 20px;
	left: auto !important;
	right: 20px !important;
	background: #ffffff;
	border-radius: 8px;
	border: 1px solid rgba(0, 0, 0, 0.08);
	box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12), 0 2px 8px rgba(0, 0, 0, 0.08);
	max-width: 360px;
	padding: 16px;
	display: flex;
	gap: 12px;
	z-index: 9999;
	font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
	animation: slideInRight 0.5s cubic-bezier(0.23, 1, 0.32, 1);
	pointer-events: all;
	transition: all 0.3s ease;
	backdrop-filter: blur(10px);
}

.ez-sales-notification:hover {
	box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15), 0 2px 8px rgba(0, 0, 0, 0.1);
	transform: translateY(-2px);
}

.ez-sales-notification.bottom-left {
	left: 20px !important;
	right: auto !important;
	animation: slideInLeft 0.5s cubic-bezier(0.23, 1, 0.32, 1);
}

.ez-sales-notification.bottom-right {
	left: auto !important;
	right: 20px !important;
	animation: slideInRight 0.5s cubic-bezier(0.23, 1, 0.32, 1);
}

/* ===========================
   Notification Image
   =========================== */

.ez-sales-notification-image {
	flex-shrink: 0;
	width: 60px;
	height: 60px;
	border-radius: 6px;
	overflow: hidden;
	background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
	display: flex;
	align-items: center;
	justify-content: center;
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.ez-sales-notification-image img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
	transition: transform 0.3s ease;
}

.ez-sales-notification:hover .ez-sales-notification-image img {
	transform: scale(1.05);
}

/* ===========================
   Notification Content
   =========================== */

.ez-sales-notification-content {
	flex: 1;
	display: flex;
	flex-direction: column;
	justify-content: center;
	min-width: 0;
}

.ez-sales-notification-text {
	font-size: 14px;
	line-height: 1.5;
	margin: 0;
	word-wrap: break-word;
	overflow-wrap: break-word;
	font-weight: 500;
	letter-spacing: 0.2px;
}

/* ===========================
   Close Button
   =========================== */

.ez-sales-notification-close {
	flex-shrink: 0;
	background: rgba(102, 126, 234, 0.1);
	border: none;
	color: #667eea;
	cursor: pointer;
	font-size: 20px;
	padding: 0;
	width: 28px;
	height: 28px;
	border-radius: 50%;
	display: flex;
	align-items: center;
	justify-content: center;
	transition: all 0.3s ease;
}

.ez-sales-notification-close:hover {
	color: #fff;
	background: #667eea;
	transform: rotate(90deg);
}

/* ===========================
   Animations
   =========================== */

@keyframes slideInRight {
	from {
		transform: translateX(450px) scale(0.9);
		opacity: 0;
	}
	to {
		transform: translateX(0) scale(1);
		opacity: 1;
	}
}

@keyframes slideInLeft {
	from {
		transform: translateX(-450px) scale(0.9);
		opacity: 0;
	}
	to {
		transform: translateX(0) scale(1);
		opacity: 1;
	}
}

@keyframes fadeOut {
	from {
		transform: scale(1);
		opacity: 1;
	}
	to {
		transform: scale(0.95);
		opacity: 0;
	}
}

@keyframes bounce {
	0%, 100% {
		transform: translateY(0) scale(1);
		opacity: 1;
	}
	50% {
		transform: translateY(-10px) scale(1.02);
	}
}

.ez-sales-notification.fade-out {
	animation: fadeOut 0.4s ease-out forwards;
}

/* Animation style modifiers */
.ez-sales-notification[data-animation="bounce"] {
	animation: bounce 0.6s ease-in-out;
}

/* ===========================
   Responsive Design
   =========================== */

/* Timing Timeline Indicator */
.ez-sales-notification-timing-timeline {
	display: flex;
	align-items: center;
	gap: 10px;
	margin-top: 15px;
	padding: 15px;
	background: #f0f4ff;
	border-radius: 6px;
	border-left: 3px solid #667eea;
}

.timing-bar {
	flex: 1;
	height: 6px;
	background: #e0e7ff;
	border-radius: 3px;
	overflow: hidden;
	position: relative;
}

.timing-bar-delayed {
	flex: 0 0 auto;
	width: 50px;
	height: 6px;
	background: linear-gradient(90deg, #667eea, #764ba2);
	border-radius: 3px;
}

.timing-label {
	font-size: 12px;
	color: #667eea;
	font-weight: 600;
	min-width: 40px;
	text-align: right;
}

@media (max-width: 768px) {
	.ez-sales-notification-wrapper {
		margin: 10px;
	}

	.ez-sales-notification-header {
		padding: 25px;
	}

	.ez-sales-notification-header h1 {
		font-size: 24px;
	}

	.ez-sales-notification-form {
		padding: 20px;
	}

	.ez-sales-notification-section {
		padding: 20px;
	}

	.ez-sales-notification-setting {
		flex-direction: column;
		align-items: flex-start;
	}

	.setting-label {
		max-width: 100%;
		padding-right: 0;
		margin-bottom: 12px;
	}

	.setting-control {
		width: 100%;
	}

	.setting-control input,
	.setting-control textarea,
	.setting-control select {
		width: 100%;
		min-width: unset;
		box-sizing: border-box;
	}

	.ez-sales-notification-submit {
		text-align: left;
	}

	/* Frontend notification on mobile */
	.ez-sales-notification {
		max-width: calc(100vw - 20px);
		bottom: 10px;
		right: 10px;
		left: auto;
		padding: 12px;
	}

	.ez-sales-notification.bottom-left {
		left: 10px;
		right: auto;
	}

	.ez-sales-notification-image {
		width: 50px;
		height: 50px;
	}

	.ez-sales-notification-text {
		font-size: 12px;
	}
}

@media (max-width: 480px) {
	.ez-sales-notification-header {
		padding: 20px;
	}

	.ez-sales-notification-header h1 {
		font-size: 20px;
	}

	.ez-sales-notification-form {
		padding: 15px;
	}

	.ez-sales-notification-section {
		padding: 15px;
		margin-bottom: 20px;
	}

	.ez-sales-notification-setting {
		padding: 15px;
		margin-bottom: 10px;
	}

	/* Stack image above text on very small screens */
	.ez-sales-notification {
		flex-direction: column;
		max-width: calc(100vw - 20px);
		width: auto;
	}

	.ez-sales-notification-image {
		margin: 0;
		width: 100%;
		height: auto;
		aspect-ratio: 16 / 9;
	}
}

/* ===========================
   Accessibility
   =========================== */

@media (prefers-reduced-motion: reduce) {
	.ez-sales-notification,
	.ez-sales-notification.fade-out,
	.toggle-slider,
	.toggle-slider::after {
		animation: none !important;
		transition: none !important;
	}
}

/* ===========================
   Print Styles
   =========================== */

@media print {
	.ez-sales-notification-wrapper,
	.ez-sales-notification {
		display: none !important;
	}
}
