/**
 * Premium Styling for WP Email Alias & Subscription Manager
 */

/* Scope wrapper to avoid polluting general WordPress admin styling */
.email-alias-wrap,
#wp-email-alias-dashboard-root {
	--ea-bg: #0b0f19;
	--ea-card-bg: rgba(17, 24, 39, 0.85);
	--ea-border: rgba(255, 255, 255, 0.08);
	--ea-text: #f3f4f6;
	--ea-text-muted: #9ca3af;
	
	--ea-primary: #6366f1;
	--ea-primary-hover: #4f46e5;
	--ea-primary-glow: rgba(99, 102, 241, 0.2);
	
	--ea-success: #10b981;
	--ea-success-hover: #059669;
	--ea-success-glow: rgba(16, 185, 129, 0.15);
	
	--ea-warning: #f59e0b;
	--ea-warning-hover: #d97706;
	--ea-warning-glow: rgba(245, 158, 11, 0.15);
	
	--ea-danger: #ef4444;
	--ea-danger-hover: #dc2626;
	
	--ea-font-sans: 'Inter', system-ui, -apple-system, sans-serif;
	
	font-family: var(--ea-font-sans);
	color: var(--ea-text);
	background: var(--ea-bg);
	padding: 25px;
	border-radius: 16px;
	margin: 20px 20px 20px 0;
	box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4);
	border: 1px solid var(--ea-border);
	box-sizing: border-box;
}

.email-alias-wrap *,
#wp-email-alias-dashboard-root * {
	box-sizing: border-box;
}

/* Header & Banner Styles */
.email-alias-header {
	display: flex;
	justify-content: space-between;
	align-items: center;
	flex-wrap: wrap;
	padding-bottom: 20px;
	border-bottom: 1px solid var(--ea-border);
	margin-bottom: 25px;
	gap: 15px;
}

.email-alias-header h1 {
	font-size: 26px;
	font-weight: 800;
	color: #ffffff;
	margin: 0;
	display: flex;
	flex-direction: column;
	background: linear-gradient(135deg, #ffffff 30%, #818cf8 100%);
	-webkit-background-clip: text;
	-webkit-text-fill-color: transparent;
}

.ea-sub-header {
	font-size: 13px;
	font-weight: 400;
	color: var(--ea-text-muted);
	margin-top: 5px;
	-webkit-text-fill-color: initial;
}

.master-email-pill {
	display: inline-flex;
	align-items: center;
	background: var(--ea-primary-glow);
	border: 1px solid rgba(99, 102, 241, 0.4);
	padding: 8px 14px;
	border-radius: 30px;
	font-size: 13px;
	color: #a5b4fc;
	gap: 6px;
}

.master-email-pill code {
	background: rgba(0, 0, 0, 0.3) !important;
	color: #fff !important;
	padding: 2px 6px !important;
	border-radius: 4px;
	border: none;
}

/* Alerts styling */
.ea-alert {
	display: flex;
	align-items: flex-start;
	background: rgba(30, 41, 59, 0.7);
	border-left: 4px solid var(--ea-primary);
	border-radius: 8px;
	padding: 15px;
	margin-bottom: 25px;
	gap: 12px;
	border-top: 1px solid var(--ea-border);
	border-right: 1px solid var(--ea-border);
	border-bottom: 1px solid var(--ea-border);
}

.ea-alert-icon {
	color: var(--ea-primary);
	font-size: 20px;
}

.ea-alert-content h3 {
	margin: 0 0 5px 0;
	font-size: 15px;
	color: #fff;
}

.ea-alert-content p {
	margin: 0;
	font-size: 13px;
	color: var(--ea-text-muted);
}

.ea-alert-warning {
	border-left-color: var(--ea-warning);
}
.ea-alert-warning .ea-alert-icon {
	color: var(--ea-warning);
}

.ea-alert-error {
	border-left-color: var(--ea-danger);
}
.ea-alert-error .ea-alert-icon {
	color: var(--ea-danger);
}

.ea-alert-info {
	border-left-color: #60a5fa;
}
.ea-alert-info .ea-alert-icon {
	color: #60a5fa;
}

/* Navigation Tabs */
.ea-tab-nav {
	display: flex;
	border-bottom: 1px solid var(--ea-border);
	margin-bottom: 30px;
	gap: 5px;
}

.ea-tab-btn {
	background: transparent;
	border: none;
	border-bottom: 3px solid transparent;
	padding: 12px 20px;
	color: var(--ea-text-muted);
	font-size: 14px;
	font-weight: 600;
	cursor: pointer;
	display: flex;
	align-items: center;
	gap: 8px;
	transition: all 0.3s ease;
}

.ea-tab-btn:hover {
	color: #fff;
	background: rgba(255, 255, 255, 0.03);
}

.ea-tab-btn.active {
	color: var(--ea-primary);
	border-bottom-color: var(--ea-primary);
}

.ea-tab-btn .dashicons {
	font-size: 18px;
	width: 18px;
	height: 18px;
}

/* Tab Panes */
.ea-tab-pane {
	display: none;
}

.ea-tab-pane.active {
	display: block;
}

/* Grid Layouts */
.ea-grid-2 {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
	gap: 25px;
}

.ea-admin-grid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
	gap: 25px;
}

.ea-col-span-2 {
	grid-column: span 2;
}

/* Stats Row */
.ea-stats-row {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
	gap: 20px;
	margin-bottom: 30px;
}

.ea-stat-card {
	background: var(--ea-card-bg);
	border: 1px solid var(--ea-border);
	border-radius: 12px;
	padding: 20px;
	display: flex;
	align-items: center;
	gap: 15px;
	backdrop-filter: blur(10px);
	box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
	transition: transform 0.3s ease, border-color 0.3s ease;
}

.ea-stat-card:hover {
	transform: translateY(-2px);
	border-color: rgba(99, 102, 241, 0.3);
}

.ea-stat-icon {
	width: 48px;
	height: 48px;
	border-radius: 10px;
	background: var(--ea-primary-glow);
	color: var(--ea-primary);
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 24px;
}

.ea-stat-icon .dashicons {
	font-size: 24px;
	width: 24px;
	height: 24px;
}

.ea-stat-data h3 {
	margin: 0 0 5px 0;
	font-size: 22px;
	font-weight: 700;
	color: #ffffff;
	word-break: break-all;
}

.ea-stat-data p {
	margin: 0;
	font-size: 12px;
	color: var(--ea-text-muted);
	text-transform: uppercase;
	letter-spacing: 0.5px;
}

/* Card Elements */
.ea-card {
	background: var(--ea-card-bg);
	border: 1px solid var(--ea-border);
	border-radius: 12px;
	backdrop-filter: blur(10px);
	box-shadow: 0 8px 30px rgba(0, 0, 0, 0.25);
	overflow: hidden;
}

.ea-card-header {
	padding: 18px 20px;
	border-bottom: 1px solid var(--ea-border);
	background: rgba(255, 255, 255, 0.02);
}

.ea-card-header h2 {
	margin: 0;
	font-size: 16px;
	font-weight: 700;
	color: #fff;
	display: flex;
	align-items: center;
	gap: 8px;
}

.ea-card-header h2 .dashicons {
	color: var(--ea-primary);
}

.ea-card-body {
	padding: 20px;
}

/* Buttons */
.ea-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	font-weight: 600;
	font-size: 13px;
	padding: 10px 18px;
	border-radius: 8px;
	cursor: pointer;
	border: 1px solid transparent;
	transition: all 0.2s ease;
	gap: 6px;
	text-decoration: none;
}

.ea-btn-full {
	display: flex;
	width: 100%;
}

.ea-btn-primary {
	background: var(--ea-primary);
	color: #fff;
}
.ea-btn-primary:hover {
	background: var(--ea-primary-hover);
	transform: translateY(-1px);
	box-shadow: 0 4px 12px rgba(99, 102, 241, 0.35);
}

.ea-btn-success {
	background: var(--ea-success);
	color: #fff;
}
.ea-btn-success:hover {
	background: var(--ea-success-hover);
	transform: translateY(-1px);
	box-shadow: 0 4px 12px rgba(16, 185, 129, 0.35);
}

.ea-btn-warning {
	background: var(--ea-warning);
	color: #fff;
}
.ea-btn-warning:hover {
	background: var(--ea-warning-hover);
	transform: translateY(-1px);
}

.ea-btn-outline {
	background: transparent;
	border-color: var(--ea-border);
	color: var(--ea-text);
}
.ea-btn-outline:hover {
	background: rgba(255, 255, 255, 0.05);
	border-color: rgba(255, 255, 255, 0.2);
}

.ea-btn-danger {
	background: transparent;
	color: var(--ea-danger);
	border-color: rgba(239, 68, 68, 0.2);
	padding: 6px 12px;
	font-size: 11px;
}
.ea-btn-danger:hover {
	background: rgba(239, 68, 68, 0.1);
	border-color: var(--ea-danger);
}

/* Forms & Inputs */
.form-group {
	margin-bottom: 18px;
}

.form-group label {
	display: block;
	font-size: 13px;
	font-weight: 600;
	color: #e5e7eb;
	margin-bottom: 6px;
}

.ea-input,
.ea-select,
.ea-textarea {
	width: 100%;
	background: rgba(0, 0, 0, 0.3) !important;
	border: 1px solid var(--ea-border) !important;
	border-radius: 8px !important;
	padding: 10px 14px !important;
	color: #fff !important;
	font-size: 13px !important;
	transition: all 0.3s ease !important;
	outline: none !important;
	box-shadow: none !important;
}

.ea-input:focus,
.ea-select:focus,
.ea-textarea:focus {
	border-color: var(--ea-primary) !important;
	box-shadow: 0 0 0 3px var(--ea-primary-glow) !important;
}

.description {
	font-size: 11px;
	color: var(--ea-text-muted);
	margin-top: 5px;
	line-height: 1.4;
}

/* Custom Domain Info Panels */
.domain-status-box {
	background: rgba(0, 0, 0, 0.2);
	border: 1px solid var(--ea-border);
	border-radius: 8px;
	padding: 15px;
	margin-bottom: 15px;
}

.dns-setup-instructions {
	background: #0d1117;
	border: 1px solid #21262d;
	border-radius: 8px;
	padding: 15px;
	margin-top: 15px;
	font-family: monospace;
	font-size: 12px;
}

.dns-setup-instructions h4 {
	margin-top: 0;
	color: #818cf8;
}

.dns-table {
	width: 100%;
	border-collapse: collapse;
	font-size: 11px;
	color: #c9d1d9;
}

.dns-table th, .dns-table td {
	text-align: left;
	padding: 6px 8px;
	border-bottom: 1px solid #21262d;
}

.dns-table code {
	background: #1f242c;
	color: #f0f6fc;
	padding: 2px 4px;
	border-radius: 3px;
}

/* Tables */
.ea-table-container {
	width: 100%;
	overflow-x: auto;
}

.scrollable-table {
	max-height: 380px;
	overflow-y: auto;
}

.ea-table {
	width: 100%;
	border-collapse: collapse;
	text-align: left;
	font-size: 13px;
}

.ea-table th {
	border-bottom: 2px solid var(--ea-border);
	padding: 12px 10px;
	font-weight: 600;
	color: #fff;
}

.ea-table td {
	border-bottom: 1px solid var(--ea-border);
	padding: 14px 10px;
	color: #e5e7eb;
	vertical-align: middle;
}

.ea-table tr:hover td {
	background: rgba(255, 255, 255, 0.02);
}

/* Badges */
.badge {
	display: inline-block;
	font-size: 11px;
	font-weight: 600;
	padding: 2px 8px;
	border-radius: 12px;
	background: rgba(255, 255, 255, 0.1);
	color: #fff;
}

.admin-badge {
	background: linear-gradient(135deg, #db2777 0%, #7c3aed 100%);
}

.plan-label {
	display: inline-block;
	background: #1e1b4b;
	color: #c7d2fe;
	padding: 3px 8px;
	border-radius: 6px;
	font-size: 11px;
	text-transform: uppercase;
	font-weight: 600;
}

.status-badge {
	display: inline-block;
	font-size: 11px;
	font-weight: 600;
	padding: 3px 8px;
	border-radius: 12px;
}

.status-active {
	background: rgba(16, 185, 129, 0.15);
	color: #34d399;
}

.status-expired,
.status-rejected {
	background: rgba(239, 68, 68, 0.15);
	color: #f87171;
}

.status-pending {
	background: rgba(245, 158, 11, 0.15);
	color: #fbbf24;
}

.direction-badge {
	display: inline-block;
	font-size: 10px;
	font-weight: 700;
	padding: 2px 6px;
	border-radius: 4px;
	text-transform: uppercase;
}

.direction-incoming {
	background: rgba(59, 130, 246, 0.2);
	color: #93c5fd;
}

.direction-forwarded {
	background: rgba(139, 92, 246, 0.2);
	color: #c084fc;
}

.direction-reply {
	background: rgba(16, 185, 129, 0.2);
	color: #34d399;
}

.status-indicator {
	font-weight: 600;
	font-size: 11px;
}
.status-indicator.status-success,
.status-indicator.status-received,
.status-indicator.status-active,
.status-indicator.status-sent {
	color: var(--ea-success);
}
.status-indicator.status-failed,
.status-indicator.status-rejected {
	color: var(--ea-danger);
}
.status-indicator.status-pending {
	color: var(--ea-warning);
}

.small-text {
	font-size: 11px;
	color: var(--ea-text-muted);
}

/* Pricing Cards */
.pricing-cards-container {
	display: flex;
	justify-content: center;
	flex-wrap: wrap;
	gap: 25px;
	margin-top: 20px;
}

.pricing-card {
	flex: 1;
	min-width: 280px;
	max-width: 340px;
	background: var(--ea-card-bg);
	border: 1px solid var(--ea-border);
	border-radius: 16px;
	padding: 30px 25px;
	text-align: center;
	position: relative;
	transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
	box-shadow: 0 4px 20px rgba(0,0,0,0.15);
	overflow: hidden;
}

.pricing-card:hover {
	transform: translateY(-5px);
	border-color: rgba(99, 102, 241, 0.4);
	box-shadow: 0 12px 30px rgba(99, 102, 241, 0.15);
}

.premium-card {
	border-color: var(--ea-primary);
	background: linear-gradient(180deg, rgba(30, 27, 75, 0.4) 0%, rgba(17, 24, 39, 0.9) 100%);
	box-shadow: 0 8px 25px rgba(99, 102, 241, 0.12);
}

.pricing-badge {
	position: absolute;
	top: 15px;
	right: 15px;
	background: rgba(255,255,255,0.06);
	font-size: 10px;
	text-transform: uppercase;
	font-weight: 700;
	padding: 3px 8px;
	border-radius: 20px;
	color: var(--ea-text-muted);
}

.badge-popular {
	background: var(--ea-primary);
	color: #fff;
}

.pricing-card h3 {
	font-size: 18px;
	margin: 15px 0;
	color: #fff;
}

.pricing-card .price {
	font-size: 36px;
	font-weight: 800;
	color: #fff;
	margin: 20px 0;
}

.pricing-card .price .currency {
	font-size: 16px;
	font-weight: 600;
	color: var(--ea-text-muted);
	vertical-align: super;
}

.pricing-card .price .period {
	font-size: 14px;
	font-weight: 400;
	color: var(--ea-text-muted);
}

.pricing-card .features {
	list-style: none;
	padding: 0;
	margin: 25px 0 35px 0;
	text-align: left;
}

.pricing-card .features li {
	font-size: 13px;
	color: var(--ea-text);
	margin-bottom: 12px;
	display: flex;
	align-items: center;
	gap: 8px;
}

.pricing-card .features li .dashicons {
	font-size: 16px;
	width: 16px;
	height: 16px;
}

/* Modals */
.ea-modal {
	position: fixed;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	background: rgba(11, 15, 25, 0.85);
	backdrop-filter: blur(8px);
	display: flex;
	align-items: center;
	justify-content: center;
	z-index: 99999;
	opacity: 1;
	transition: opacity 0.3s ease;
}

.ea-modal-content {
	background: #111827;
	border: 1px solid var(--ea-border);
	border-radius: 16px;
	padding: 30px;
	width: 100%;
	max-width: 450px;
	box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
	position: relative;
}

.ea-modal-close {
	position: absolute;
	top: 15px;
	right: 15px;
	background: transparent;
	border: none;
	color: var(--ea-text-muted);
	font-size: 24px;
	cursor: pointer;
}

.ea-modal-close:hover {
	color: #fff;
}

.pricing-summary {
	background: rgba(0,0,0,0.25);
	border: 1px solid var(--ea-border);
	border-radius: 8px;
	padding: 15px;
	margin: 20px 0;
}

.summary-line {
	display: flex;
	justify-content: space-between;
	margin-bottom: 10px;
	font-size: 13px;
}

.summary-line:last-child {
	margin-bottom: 0;
	border-top: 1px solid var(--ea-border);
	padding-top: 10px;
}

/* Guest Views / Auth styling */
.guest-dashboard {
	max-width: 1100px;
	margin: 30px auto;
}

.auth-pane {
	animation: fadeIn 0.3s ease forwards;
}

/* Utility Helpers */
.ea-hidden {
	display: none !important;
}

.text-center {
	text-align: center;
}

.text-success {
	color: var(--ea-success) !important;
}

.alias-preview-box {
	background: rgba(16, 185, 129, 0.08);
	border: 1px dashed rgba(16, 185, 129, 0.4);
	border-radius: 6px;
	padding: 10px;
	margin-bottom: 15px;
	text-align: center;
	font-size: 12px;
}

.alias-preview-box code {
	background: rgba(0,0,0,0.2) !important;
	color: #34d399 !important;
	font-weight: bold;
}

/* Fade in animations */
@keyframes fadeIn {
	from { opacity: 0; transform: translateY(8px); }
	to { opacity: 1; transform: translateY(0); }
}

.animate-fade-in {
	animation: fadeIn 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}
