/**
 * CWPA Admin Dashboard Styles
 */

.cwpa-wrap {
	width: calc(100% - 20px);
	max-width: 100%;
	margin: 20px 20px 20px 0;
	box-sizing: border-box;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
	color: #1e293b;
}

/* Header */
.cwpa-header {
	background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
	color: #ffffff;
	padding: 28px 32px;
	border-radius: 12px;
	margin-bottom: 24px;
	box-shadow: 0 10px 15px -3px rgba(79, 70, 229, 0.1), 0 4px 6px -2px rgba(79, 70, 229, 0.05);
	display: flex;
	justify-content: space-between;
	align-items: center;
}

.cwpa-header h1 {
	color: #ffffff;
	margin: 0 0 6px 0;
	font-size: 24px;
	font-weight: 700;
	letter-spacing: -0.02em;
}

.cwpa-header p {
	margin: 0;
	opacity: 0.9;
	font-size: 14px;
}

.cwpa-header-badge {
	background: rgba(255, 255, 255, 0.2);
	backdrop-filter: blur(8px);
	padding: 6px 14px;
	border-radius: 20px;
	font-size: 13px;
	font-weight: 600;
}

.cwpa-btn-free-vs-pro {
	background: rgba(255, 255, 255, 0.15);
	color: #ffffff !important;
	border: 1px solid rgba(255, 255, 255, 0.3);
	font-weight: 600;
	padding: 7px 14px;
	border-radius: 20px;
	font-size: 13px;
	cursor: pointer;
	display: inline-flex;
	align-items: center;
	gap: 6px;
	transition: all 0.2s ease;
}

.cwpa-btn-free-vs-pro:hover {
	background: rgba(255, 255, 255, 0.3);
	transform: translateY(-1px);
	color: #ffffff !important;
}

.cwpa-btn-get-pro {
	background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
	color: #ffffff !important;
	font-weight: 700;
	padding: 7px 16px;
	border-radius: 20px;
	text-decoration: none;
	font-size: 13px;
	display: inline-flex;
	align-items: center;
	gap: 6px;
	box-shadow: 0 4px 10px rgba(245, 158, 11, 0.35);
	transition: all 0.2s ease;
}

.cwpa-btn-get-pro:hover {
	transform: translateY(-2px);
	box-shadow: 0 6px 14px rgba(245, 158, 11, 0.5);
	color: #ffffff !important;
}

/* Modal Popup Styles */
.cwpa-modal {
	position: fixed;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	z-index: 999999;
	display: flex;
	align-items: center;
	justify-content: center;
}

.cwpa-modal-overlay {
	position: fixed;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	background: rgba(15, 23, 42, 0.65);
	backdrop-filter: blur(4px);
}

.cwpa-modal-container {
	position: relative;
	background: #ffffff;
	border-radius: 16px;
	width: 90%;
	max-width: 860px;
	max-height: 85vh;
	display: flex;
	flex-direction: column;
	box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
	z-index: 1000000;
	overflow: hidden;
	animation: cwpaModalSlide 0.25s ease-out;
}

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

.cwpa-modal-header {
	padding: 20px 24px;
	background: #f8fafc;
	border-bottom: 1px solid #e2e8f0;
	display: flex;
	align-items: center;
	justify-content: space-between;
}

.cwpa-modal-title {
	margin: 0;
	font-size: 18px;
	font-weight: 700;
	color: #0f172a;
}

.cwpa-modal-subtitle {
	margin: 4px 0 0 0;
	font-size: 13px;
	color: #64748b;
}

.cwpa-modal-close {
	background: transparent;
	border: none;
	font-size: 24px;
	font-weight: 700;
	color: #64748b;
	cursor: pointer;
	line-height: 1;
	padding: 4px 8px;
	border-radius: 6px;
	transition: all 0.2s ease;
}

.cwpa-modal-close:hover {
	color: #0f172a;
	background: #e2e8f0;
}

.cwpa-modal-body {
	padding: 24px;
	overflow-y: auto;
	flex: 1;
}

.cwpa-modal-footer {
	padding: 16px 24px;
	background: #f8fafc;
	border-top: 1px solid #e2e8f0;
	display: flex;
	justify-content: center;
}

/* Tabs Navigation */
.cwpa-tabs-nav {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	background: #ffffff;
	padding: 8px;
	border-radius: 12px;
	border: 1px solid #e2e8f0;
	margin-bottom: 24px;
	box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03);
}

.cwpa-tab-btn {
	background: transparent;
	border: none;
	padding: 10px 18px;
	border-radius: 8px;
	font-size: 14px;
	font-weight: 600;
	color: #64748b;
	cursor: pointer;
	transition: all 0.2s ease;
	display: inline-flex;
	align-items: center;
	gap: 8px;
	white-space: nowrap;
}

.cwpa-tab-btn:hover {
	color: #4f46e5;
	background: #f8fafc;
}

.cwpa-tab-btn.active {
	background: #4f46e5;
	color: #ffffff;
	box-shadow: 0 2px 4px rgba(79, 70, 229, 0.2);
}

@media (max-width: 640px) {
	.cwpa-tabs-nav {
		padding: 6px;
		gap: 6px;
	}

	.cwpa-tab-btn {
		flex: 1 1 calc(50% - 6px);
		justify-content: center;
		padding: 8px 10px;
		font-size: 13px;
	}
}

/* Tab Panels */
.cwpa-tab-panel {
	display: none;
}

.cwpa-tab-panel.active {
	display: block;
}

/* Grid & Cards */
.cwpa-grid-4 {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
	gap: 16px;
	margin-bottom: 28px;
}

.cwpa-grid-2 {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
	gap: 16px;
}

.cwpa-card {
	background: #ffffff;
	border: 1px solid #e2e8f0;
	border-radius: 12px;
	padding: 24px;
	box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
	transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.cwpa-card:hover {
	transform: translateY(-2px);
	box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

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

.cwpa-card-title {
	font-size: 14px;
	font-weight: 600;
	color: #64748b;
	text-transform: uppercase;
	letter-spacing: 0.05em;
}

.cwpa-card-icon {
	width: 40px;
	height: 40px;
	border-radius: 10px;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 18px;
}

.cwpa-icon-purple {
	background: #e0e7ff;
	color: #4f46e5;
}

.cwpa-icon-green {
	background: #dcfce7;
	color: #16a34a;
}

.cwpa-icon-blue {
	background: #dbeafe;
	color: #2563eb;
}

.cwpa-icon-orange {
	background: #ffedd5;
	color: #ea580c;
}

.cwpa-card-metric {
	font-size: 32px;
	font-weight: 700;
	color: #0f172a;
	margin: 0;
	line-height: 1.1;
}

.cwpa-card-subtext {
	font-size: 13px;
	color: #94a3b8;
	margin-top: 6px;
}

/* Author Distribution Table */
.cwpa-section-card {
	background: #ffffff;
	border: 1px solid #e2e8f0;
	border-radius: 12px;
	padding: 24px;
	margin-bottom: 28px;
	box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

@media (max-width: 640px) {
	.cwpa-section-card {
		padding: 16px;
	}
}

.cwpa-section-title {
	font-size: 18px;
	font-weight: 700;
	color: #0f172a;
	margin: 0 0 16px 0;
	display: flex;
	align-items: center;
	flex-wrap: wrap;
	gap: 10px;
}

.cwpa-table-responsive {
	overflow-x: auto;
	-webkit-overflow-scrolling: touch;
	width: 100%;
	margin-top: 12px;
	border-radius: 8px;
	border: 1px solid #e2e8f0;
}

.cwpa-table {
	width: 100%;
	border-collapse: separate;
	border-spacing: 0;
	min-width: 520px;
}

.cwpa-table th {
	background: #f8fafc;
	color: #475569;
	font-size: 12px;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.05em;
	padding: 12px 16px;
	text-align: left;
	border-bottom: 1px solid #e2e8f0;
}

.cwpa-table td {
	padding: 14px 16px;
	border-bottom: 1px solid #f1f5f9;
	color: #334155;
	font-size: 14px;
}

.cwpa-table tr:last-child td {
	border-bottom: none;
}

.cwpa-progress-bar-bg {
	background: #f1f5f9;
	border-radius: 6px;
	height: 10px;
	overflow: hidden;
	width: 100%;
}

.cwpa-progress-bar-fill {
	background: linear-gradient(90deg, #4f46e5, #7c3aed);
	height: 100%;
	border-radius: 6px;
}

/* Forms & Select Inputs */
.cwpa-form-group {
	margin-bottom: 20px;
	text-align: left;
}

.cwpa-flex-1 {
	flex: 1;
	margin-bottom: 0;
}

.cwpa-form-group label {
	display: flex;
	justify-content: flex-start;
	align-items: center;
	gap: 10px;
	font-weight: 600;
	font-size: 14px;
	color: #334155;
	margin-bottom: 8px;
	text-align: left;
}

/* Ensure Settings Tab is Left Aligned */
#cwpa-tab-settings,
#cwpa-tab-settings .cwpa-form-group,
#cwpa-tab-settings label,
#cwpa-tab-settings input,
#cwpa-tab-settings select,
#cwpa-tab-settings h4,
#cwpa-tab-settings p {
	text-align: left !important;
	justify-content: flex-start !important;
}

/* 2-Column Dashboard Layout (Side-by-Side Flex) */
.cwpa-dashboard-container {
	display: flex;
	flex-direction: row;
	gap: 24px;
	align-items: flex-start;
	width: 100%;
	box-sizing: border-box;
}

.cwpa-main-content {
	flex: 1;
	min-width: 0;
	width: auto;
	box-sizing: border-box;
}

.cwpa-dashboard-sidebar {
	width: 280px;
	min-width: 280px;
	flex-shrink: 0;
	display: flex;
	flex-direction: column;
	gap: 20px;
	box-sizing: border-box;
}

@media (max-width: 1024px) {
	.cwpa-dashboard-container {
		flex-direction: column;
	}

	.cwpa-main-content {
		width: 100%;
	}

	.cwpa-dashboard-sidebar {
		width: 100%;
		min-width: 0;
	}
}

.cwpa-sidebar-card {
	background: #ffffff;
	border: 1px solid #e2e8f0;
	border-radius: 12px;
	padding: 22px;
	box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
	text-align: left;
}

.cwpa-sidebar-card-support {
	background: linear-gradient(135deg, #f5f3ff 0%, #eff6ff 100%) !important;
	border: 2px solid #6366f1 !important;
	box-shadow: 0 4px 14px rgba(99, 102, 241, 0.15) !important;
}

.cwpa-sidebar-title {
	font-size: 16px;
	font-weight: 700;
	color: #0f172a;
	margin: 0 0 10px 0;
	display: flex;
	align-items: center;
	gap: 8px;
}

.cwpa-select,
.cwpa-input {
	width: 100%;
	padding: 10px 14px;
	border: 1px solid #cbd5e1;
	border-radius: 8px;
	font-size: 14px;
	color: #0f172a;
	background-color: #ffffff;
	transition: border-color 0.2s ease, box-shadow 0.2s ease;
	box-sizing: border-box;
}

.cwpa-select:focus,
.cwpa-input:focus {
	border-color: #4f46e5;
	box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.15);
	outline: none;
}

/* Primary Highlight Box for Bulk Transfer */
.cwpa-highlight-box {
	background: linear-gradient(135deg, #f5f3ff 0%, #eff6ff 100%);
	border: 2px solid #818cf8;
	border-radius: 12px;
	padding: 24px;
	margin-bottom: 28px;
	box-shadow: 0 4px 12px rgba(79, 70, 229, 0.08);
}

.cwpa-box-header {
	margin-bottom: 18px;
}

.cwpa-badge-required {
	background: #4f46e5;
	color: #ffffff;
	font-size: 11px;
	font-weight: 700;
	text-transform: uppercase;
	padding: 4px 10px;
	border-radius: 12px;
	letter-spacing: 0.05em;
	display: inline-block;
}

.cwpa-transfer-row {
	display: flex;
	align-items: center;
	gap: 20px;
}

@media (max-width: 768px) {
	.cwpa-transfer-row {
		flex-direction: column;
		align-items: stretch;
	}

	.cwpa-transfer-arrow {
		transform: rotate(90deg);
		margin: 8px auto;
	}
}

.cwpa-transfer-arrow {
	font-size: 24px;
	color: #4f46e5;
	font-weight: 900;
	display: flex;
	align-items: center;
	justify-content: center;
	padding-top: 20px;
}

.cwpa-select-highlight {
	border: 2px solid #a5b4fc;
	background-color: #ffffff;
	font-weight: 600;
	box-shadow: 0 2px 4px rgba(0, 0, 0, 0.04);
}

.cwpa-select-highlight:focus {
	border-color: #4f46e5;
	box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.25);
}

/* Optional Filters Box */
.cwpa-optional-box {
	background: #f8fafc;
	border: 1px dashed #cbd5e1;
	border-radius: 12px;
	padding: 24px;
	margin-bottom: 28px;
}

.cwpa-optional-header {
	margin-bottom: 20px;
}

.cwpa-badge-optional {
	background: #e2e8f0;
	color: #475569;
	font-size: 11px;
	font-weight: 700;
	text-transform: uppercase;
	padding: 4px 10px;
	border-radius: 12px;
	letter-spacing: 0.05em;
	display: inline-block;
}

.cwpa-tag-opt {
	font-size: 11px;
	color: #64748b;
	background: #e2e8f0;
	padding: 2px 8px;
	border-radius: 10px;
	font-weight: 500;
}

.cwpa-select-optional {
	background-color: #ffffff;
	border-color: #cbd5e1;
	color: #475569;
}

.cwpa-btn-primary {
	background: #4f46e5;
	color: #ffffff;
	border: none;
	padding: 14px 28px;
	border-radius: 8px;
	font-size: 15px;
	font-weight: 700;
	cursor: pointer;
	transition: background-color 0.2s ease, transform 0.1s ease;
	display: inline-flex;
	align-items: center;
	gap: 10px;
	box-shadow: 0 4px 6px -1px rgba(79, 70, 229, 0.2);
}

.cwpa-btn-primary:hover {
	background: #4338ca;
	transform: translateY(-1px);
}

/* Matrix Table for Permissions */
.cwpa-perm-table {
	width: 100%;
	border-collapse: separate;
	border-spacing: 0;
	border: 1px solid #e2e8f0;
	border-radius: 10px;
	overflow: hidden;
}

.cwpa-perm-table th,
.cwpa-perm-table td {
	padding: 14px 18px;
	text-align: center;
}

.cwpa-perm-table th:first-child,
.cwpa-perm-table td:first-child {
	text-align: left;
}

.cwpa-perm-table th {
	background: #f8fafc;
	font-size: 13px;
	font-weight: 700;
	color: #475569;
}

.cwpa-perm-table td {
	border-top: 1px solid #f1f5f9;
}

/* Switch Toggle */
.cwpa-switch {
	position: relative;
	display: inline-block;
	width: 44px;
	height: 24px;
}

.cwpa-switch input {
	opacity: 0;
	width: 0;
	height: 0;
}

.cwpa-slider {
	position: absolute;
	cursor: pointer;
	top: 0;
	left: 0;
	right: 0;
	bottom: 0;
	background-color: #cbd5e1;
	transition: .3s;
	border-radius: 24px;
}

.cwpa-slider:before {
	position: absolute;
	content: "";
	height: 18px;
	width: 18px;
	left: 3px;
	bottom: 3px;
	background-color: white;
	transition: .3s;
	border-radius: 50%;
}

input:checked+.cwpa-slider {
	background-color: #4f46e5;
}

input:checked+.cwpa-slider:before {
	transform: translateX(20px);
}

/* Notice Box */
.cwpa-notice {
	padding: 14px 18px;
	border-radius: 8px;
	margin-bottom: 20px;
	font-size: 14px;
	display: flex;
	align-items: center;
	gap: 12px;
}

.cwpa-notice-success {
	background: #f0fdf4;
	border: 1px solid #bbf7d0;
	color: #166534;
}

.cwpa-notice-error {
	background: #fef2f2;
	border: 1px solid #fecaca;
	color: #991b1b;
}

/* About Developer & Custom Work Section */
.cwpa-about-grid {
	display: grid;
	grid-template-columns: 320px 1fr;
	gap: 28px;
}

@media (max-width: 900px) {
	.cwpa-about-grid {
		grid-template-columns: 1fr;
	}
}

.cwpa-author-sidebar {
	background: #ffffff;
	border: 1px solid #e2e8f0;
	border-radius: 12px;
	padding: 28px 24px;
	text-align: center;
	box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.cwpa-avatar-ring {
	width: 140px;
	height: 140px;
	border-radius: 50%;
	padding: 4px;
	background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
	margin: 0 auto 16px auto;
	box-shadow: 0 8px 16px -2px rgba(79, 70, 229, 0.25);
}

.cwpa-avatar-img {
	width: 100%;
	height: 100%;
	border-radius: 50%;
	object-fit: cover;
	display: block;
	background: #ffffff;
}

.cwpa-author-name {
	font-size: 20px;
	font-weight: 800;
	color: #0f172a;
	margin: 0 0 4px 0;
}

.cwpa-author-title {
	font-size: 13px;
	font-weight: 600;
	color: #4f46e5;
	margin-bottom: 14px;
}

.cwpa-author-bio {
	font-size: 13px;
	color: #64748b;
	line-height: 1.6;
	margin-bottom: 20px;
}

.cwpa-badge-pill {
	background: #f1f5f9;
	color: #334155;
	font-size: 12px;
	font-weight: 600;
	padding: 6px 12px;
	border-radius: 20px;
	display: inline-block;
	margin-bottom: 8px;
}

.cwpa-btn-contact {
	background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
	color: #ffffff !important;
	padding: 12px 20px;
	border-radius: 8px;
	font-size: 14px;
	font-weight: 700;
	text-decoration: none;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	width: 100%;
	box-sizing: border-box;
	transition: transform 0.2s ease, box-shadow 0.2s ease;
	box-shadow: 0 4px 10px rgba(79, 70, 229, 0.3);
}

.cwpa-btn-contact:hover {
	transform: translateY(-2px);
	box-shadow: 0 6px 15px rgba(79, 70, 229, 0.4);
}

.cwpa-btn-outline {
	background: transparent;
	color: #4f46e5 !important;
	border: 2px solid #e0e7ff;
	padding: 10px 18px;
	border-radius: 8px;
	font-size: 13px;
	font-weight: 600;
	text-decoration: none;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 6px;
	width: 100%;
	box-sizing: border-box;
	margin-top: 10px;
	transition: background-color 0.2s ease;
}

.cwpa-btn-outline:hover {
	background: #f5f3ff;
}

.cwpa-services-grid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
	gap: 16px;
	margin-top: 16px;
}

.cwpa-service-card {
	background: #f8fafc;
	border: 1px solid #e2e8f0;
	border-radius: 10px;
	padding: 18px;
	transition: border-color 0.2s ease, transform 0.2s ease;
}

.cwpa-service-card:hover {
	border-color: #a5b4fc;
	transform: translateY(-2px);
	background: #ffffff;
}

.cwpa-service-icon {
	font-size: 24px;
	margin-bottom: 8px;
}

.cwpa-service-title {
	font-size: 15px;
	font-weight: 700;
	color: #0f172a;
	margin: 0 0 6px 0;
}

.cwpa-service-desc {
	font-size: 13px;
	color: #64748b;
	margin: 0;
	line-height: 1.5;
}

.cwpa-custom-work-banner {
	background: linear-gradient(135deg, #1e1b4b 0%, #312e81 100%);
	color: #ffffff;
	border-radius: 12px;
	padding: 28px;
	margin-top: 24px;
	display: flex;
	justify-content: space-between;
	align-items: center;
	gap: 20px;
}

@media (max-width: 768px) {
	.cwpa-custom-work-banner {
		flex-direction: column;
		text-align: center;
	}
}

.cwpa-custom-work-banner h4 {
	color: #ffffff;
	font-size: 20px;
	font-weight: 800;
	margin: 0 0 8px 0;
}

.cwpa-custom-work-banner p {
	color: #c7d2fe;
	font-size: 14px;
	margin: 0;
	line-height: 1.5;
}