/**
 * Email Dropdown Component Styles
 * v5.2.22 - Simple Blue Card Design
 */

/* Dropdown Wrapper */
.pzmo-email-dropdown-wrapper {
	position: relative;
	display: inline-block;
}

/* Dropdown Button */
.pzmo-email-dropdown-btn,
.pzmo-email-dropdown-btn-trigger {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	cursor: pointer;
	background: #2196F3;
	color: #fff;
	border: none;
	padding: 8px 16px;
	border-radius: 8px;
	font-size: 14px;
	font-weight: 500;
	transition: all 0.2s;
}

.pzmo-email-dropdown-btn:hover,
.pzmo-email-dropdown-btn-trigger:hover {
	background: #1976D2;
}

/* Compact button for table cells */
.pzmo-email-dropdown-wrapper[data-context="admin-table"] .pzmo-email-dropdown-btn {
	background: #f5f5f5;
	color: #1f2937;
	padding: 6px 12px;
	font-size: 13px;
	border-radius: 20px;
	border: 1px solid #e5e7eb;
}

.pzmo-email-dropdown-wrapper[data-context="admin-table"] .pzmo-email-dropdown-btn:hover {
	background: #e5e7eb;
}

/* ============================================
   v5.2.22 SIMPLE BLUE CARD WIDGET
   ============================================ */
.pzmo-email-dropdown-menu {
	position: absolute;
	top: 100%;
	left: 0;
	margin-top: 8px;
	z-index: 9999;
	animation: pzmo-dropdown-appear 0.2s ease-out;
}

@keyframes pzmo-dropdown-appear {
	from { opacity: 0; transform: translateY(-10px); }
	to { opacity: 1; transform: translateY(0); }
}

/* The Blue Card */
.pzmo-email-widget {
	background: #2196F3;
	border-radius: 16px;
	padding: 24px;
	min-width: 280px;
	max-width: 320px;
	position: relative;
	box-shadow: 0 10px 40px rgba(33, 150, 243, 0.3);
}

/* Close X button */
.pzmo-widget-close-x {
	position: absolute;
	top: 12px;
	right: 12px;
	background: none;
	border: none;
	color: rgba(255, 255, 255, 0.7);
	font-size: 24px;
	line-height: 1;
	cursor: pointer;
	padding: 0;
	width: 24px;
	height: 24px;
}

.pzmo-widget-close-x:hover {
	color: #fff;
}

/* Title */
.pzmo-widget-title {
	color: #fff;
	font-size: 18px;
	font-weight: 600;
	margin-bottom: 4px;
}

/* Subtitle */
.pzmo-widget-subtitle {
	color: rgba(255, 255, 255, 0.8);
	font-size: 14px;
	margin-bottom: 20px;
}

/* Template Dropdown */
.pzmo-template-select {
	width: 100%;
	padding: 12px 16px;
	border: 2px solid rgba(255, 255, 255, 0.3);
	border-radius: 8px;
	background: rgba(255, 255, 255, 0.15);
	color: #fff;
	font-size: 14px;
	cursor: pointer;
	margin-bottom: 20px;
	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='white' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
	background-repeat: no-repeat;
	background-position: right 12px center;
}

.pzmo-template-select:focus {
	outline: none;
	border-color: rgba(255, 255, 255, 0.6);
}

.pzmo-template-select option {
	background: #2196F3;
	color: #fff;
}

/* Buttons Row */
.pzmo-widget-buttons {
	display: flex;
	gap: 12px;
}

/* Cancel Button */
.pzmo-btn-cancel {
	flex: 1;
	padding: 12px 20px;
	border: none;
	border-radius: 8px;
	background: rgba(255, 255, 255, 0.25);
	color: #fff;
	font-size: 14px;
	font-weight: 500;
	cursor: pointer;
	transition: background 0.2s;
}

.pzmo-btn-cancel:hover {
	background: rgba(255, 255, 255, 0.35);
}

/* Send Button */
.pzmo-btn-send {
	flex: 1;
	padding: 12px 20px;
	border: none;
	border-radius: 8px;
	background: #fff;
	color: #2196F3;
	font-size: 14px;
	font-weight: 600;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 6px;
	transition: all 0.2s;
}

.pzmo-btn-send:hover {
	background: #f5f5f5;
}

.pzmo-btn-send:disabled {
	opacity: 0.7;
	cursor: not-allowed;
}

.pzmo-send-arrow {
	font-size: 10px;
}

/* ============================================
   EMAIL COMPOSER MODAL
   ============================================ */
.pzmo-modal {
	position: fixed;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	z-index: 100000;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 20px;
}

.pzmo-modal-overlay {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	background: rgba(0, 0, 0, 0.5);
}

.pzmo-modal-content {
	position: relative;
	background: #fff;
	border-radius: 12px;
	box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
	width: 90%;
	max-width: 560px;
	max-height: 85vh;
	display: flex;
	flex-direction: column;
	animation: pzmo-modal-slide-up 0.3s ease-out;
	overflow: hidden;
}

@keyframes pzmo-modal-slide-up {
	from { opacity: 0; transform: translateY(40px); }
	to { opacity: 1; transform: translateY(0); }
}

/* Modal Header */
.pzmo-modal-header {
	background: #2196F3;
	color: white;
	padding: 20px 24px;
}

.pzmo-modal-header-top {
	display: flex;
	align-items: center;
	justify-content: space-between;
	margin-bottom: 12px;
}

.pzmo-modal-header h2 {
	margin: 0;
	font-size: 18px;
	font-weight: 600;
	color: white;
	display: flex;
	align-items: center;
	gap: 8px;
}

.pzmo-modal-close {
	background: rgba(255, 255, 255, 0.2);
	border: none;
	color: white;
	width: 32px;
	height: 32px;
	border-radius: 6px;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
}

.pzmo-modal-close:hover {
	background: rgba(255, 255, 255, 0.3);
}

/* Recipients in header */
.pzmo-modal-recipients {
	display: flex;
	gap: 8px;
	flex-wrap: wrap;
}

.pzmo-modal-recipient {
	background: rgba(255, 255, 255, 0.2);
	padding: 4px 12px;
	border-radius: 16px;
	font-size: 13px;
}

/* Modal Body */
.pzmo-modal-body {
	padding: 0;
	overflow-y: auto;
	flex: 1;
}

/* Template Tabs */
.pzmo-template-tabs {
	display: flex;
	gap: 8px;
	padding: 16px 24px;
	overflow-x: auto;
	border-bottom: 1px solid #e0e0e0;
	background: #f8f9fa;
}

.pzmo-template-tab {
	padding: 8px 14px;
	border: 1px solid #e0e0e0;
	border-radius: 20px;
	background: white;
	cursor: pointer;
	font-size: 13px;
	white-space: nowrap;
	transition: all 0.2s;
	color: #666;
}

.pzmo-template-tab:hover {
	border-color: #2196F3;
	color: #2196F3;
}

.pzmo-template-tab.active {
	border-color: #2196F3;
	background: #e3f2fd;
	color: #2196F3;
}

/* Form Section */
.pzmo-form-section {
	padding: 24px;
}

.pzmo-form-group {
	margin-bottom: 20px;
}

.pzmo-form-group:last-child {
	margin-bottom: 0;
}

.pzmo-form-group label {
	display: block;
	font-size: 13px;
	font-weight: 500;
	color: #333;
	margin-bottom: 8px;
}

.pzmo-form-group input[type="text"],
.pzmo-form-group input[type="email"] {
	width: 100%;
	padding: 12px 14px;
	border: 1px solid #ddd;
	border-radius: 8px;
	font-size: 14px;
}

.pzmo-form-group input:focus {
	outline: none;
	border-color: #2196F3;
}

.pzmo-form-group input[readonly] {
	background: #f5f5f5;
	color: #666;
}

/* Message Box */
.pzmo-message-box {
	border: 1px solid #ddd;
	border-radius: 8px;
	overflow: hidden;
}

.pzmo-message-box:focus-within {
	border-color: #2196F3;
}

.pzmo-message-toolbar {
	background: #f8f9fa;
	padding: 8px 12px;
	border-bottom: 1px solid #e0e0e0;
	display: flex;
	gap: 4px;
}

.pzmo-message-toolbar button {
	background: none;
	border: none;
	padding: 6px 8px;
	border-radius: 4px;
	cursor: pointer;
	color: #666;
}

.pzmo-message-toolbar button:hover {
	background: #e0e0e0;
}

.pzmo-form-group textarea,
.pzmo-message-textarea {
	width: 100%;
	border: none;
	padding: 14px;
	min-height: 140px;
	resize: none;
	font-size: 14px;
	font-family: inherit;
	line-height: 1.6;
}

.pzmo-message-textarea:focus {
	outline: none;
}

/* Modal Footer */
.pzmo-modal-footer {
	display: flex;
	align-items: center;
	justify-content: flex-end;
	gap: 12px;
	padding: 16px 24px;
	background: #f8f9fa;
	border-top: 1px solid #e0e0e0;
}

#pzmo-email-cancel {
	padding: 10px 20px;
	border: 1px solid #ddd;
	border-radius: 8px;
	background: white;
	font-size: 14px;
	cursor: pointer;
	color: #666;
}

#pzmo-email-cancel:hover {
	background: #f5f5f5;
}

#pzmo-email-send {
	padding: 10px 24px;
	border: none;
	border-radius: 8px;
	background: #2196F3;
	color: white;
	font-size: 14px;
	font-weight: 500;
	cursor: pointer;
	display: flex;
	align-items: center;
	gap: 6px;
}

#pzmo-email-send:hover {
	background: #1976D2;
}

#pzmo-email-send.loading {
	opacity: 0.7;
	pointer-events: none;
}

/* ============================================
   TOAST NOTIFICATIONS
   ============================================ */
.pzmo-toast-container {
	position: fixed;
	bottom: 24px;
	right: 24px;
	z-index: 100001;
}

.pzmo-toast {
	background: white;
	border-radius: 8px;
	box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
	padding: 14px 18px;
	display: flex;
	align-items: center;
	gap: 12px;
	min-width: 280px;
	animation: pzmo-toast-in 0.3s ease-out;
}

@keyframes pzmo-toast-in {
	from { opacity: 0; transform: translateX(100px); }
	to { opacity: 1; transform: translateX(0); }
}

.pzmo-toast-icon {
	width: 36px;
	height: 36px;
	border-radius: 8px;
	display: flex;
	align-items: center;
	justify-content: center;
}

.pzmo-toast.success .pzmo-toast-icon {
	background: #e8f5e9;
	color: #4caf50;
}

.pzmo-toast.error .pzmo-toast-icon {
	background: #ffebee;
	color: #f44336;
}

.pzmo-toast-content {
	flex: 1;
}

.pzmo-toast-title {
	font-weight: 600;
	font-size: 14px;
	color: #333;
}

.pzmo-toast-close {
	background: none;
	border: none;
	color: #999;
	cursor: pointer;
	padding: 4px;
}

.pzmo-toast-undo {
	background: #2196F3;
	color: white;
	border: none;
	padding: 6px 12px;
	border-radius: 4px;
	font-size: 12px;
	cursor: pointer;
}

/* Loading overlay */
#pzmo-loading-overlay {
	position: fixed;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	background: rgba(0, 0, 0, 0.3);
	z-index: 99999;
	display: flex;
	align-items: center;
	justify-content: center;
}

#pzmo-loading-overlay .dashicons {
	font-size: 32px;
	color: #2196F3;
	animation: pzmo-spin 1s infinite linear;
}

@keyframes pzmo-spin {
	100% { transform: rotate(360deg); }
}

/* Body scroll lock */
body.pzmo-modal-open {
	overflow: hidden;
}

/* Responsive */
@media (max-width: 640px) {
	.pzmo-email-widget {
		min-width: 260px;
	}
	
	.pzmo-modal-content {
		max-width: 100%;
		margin: 10px;
	}
}
