/**
 * CleanUp WP - Admin Styles
 */

.cleanup-wp-wrap {
	max-width: 1200px;
}

.cleanup-wp-wrap > h1 {
	display: flex;
	align-items: center;
	gap: 8px;
}

.cleanup-wp-wrap > h1 .dashicons {
	font-size: 28px;
	width: 28px;
	height: 28px;
	color: #2271b1;
}

/* Tabs */
.cleanup-wp-tabs {
	display: flex;
	gap: 4px;
	margin: 20px 0 0;
	border-bottom: 1px solid #c3c4c7;
}

.cleanup-wp-tab {
	display: flex;
	align-items: center;
	gap: 6px;
	padding: 12px 20px;
	background: #f0f0f1;
	border: 1px solid #c3c4c7;
	border-bottom: none;
	border-radius: 4px 4px 0 0;
	cursor: pointer;
	font-size: 14px;
	font-weight: 500;
	color: #50575e;
	margin-bottom: -1px;
	transition: all 0.15s ease;
}

.cleanup-wp-tab:hover {
	background: #fff;
	color: #2271b1;
}

.cleanup-wp-tab.active {
	background: #fff;
	border-bottom-color: #fff;
	color: #1d2327;
}

.cleanup-wp-tab .dashicons {
	font-size: 18px;
	width: 18px;
	height: 18px;
}

/* Container */
.cleanup-wp-container {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 24px;
	align-items: start;
}

@media (max-width: 1024px) {
	.cleanup-wp-container {
		grid-template-columns: 1fr;
	}
}

.cleanup-wp-panel {
	background: #fff;
	border: 1px solid #c3c4c7;
	border-top: none;
	border-radius: 0 4px 4px 4px;
	padding: 20px;
}

.cleanup-wp-preview {
	background: #fff;
	border: 1px solid #c3c4c7;
	border-radius: 4px;
	padding: 20px;
	margin-top: 20px;
	position: sticky;
	top: 32px;
}

.cleanup-wp-preview h2 {
	margin-top: 0;
	padding-bottom: 12px;
	border-bottom: 1px solid #c3c4c7;
}

/* Tab Content */
.cleanup-wp-tab-content {
	display: none;
}

.cleanup-wp-tab-content.active {
	display: block;
}

.cleanup-wp-intro {
	margin: 0 0 16px;
	padding: 12px;
	background: #f0f6fc;
	border-left: 4px solid #2271b1;
	border-radius: 2px;
}

/* Select All */
.cleanup-wp-select-all {
	padding: 12px 0;
	border-bottom: 1px solid #f0f0f1;
	margin-bottom: 8px;
}

/* Tasks (Cleanup Tab) */
.cleanup-wp-task {
	padding: 12px 0;
	border-bottom: 1px solid #f0f0f1;
}

.cleanup-wp-task:last-of-type {
	border-bottom: none;
}

.cleanup-wp-task.done {
	opacity: 0.6;
}

.cleanup-wp-task label {
	display: flex;
	align-items: center;
	gap: 8px;
	cursor: pointer;
	flex-wrap: wrap;
}

.cleanup-wp-task.done label {
	cursor: default;
}

.cleanup-wp-task input[type="checkbox"] {
	margin: 0;
}

.cleanup-wp-task input[type="checkbox"]:disabled {
	cursor: not-allowed;
}

.cleanup-wp-task .description {
	margin: 4px 0 0 26px;
	color: #646970;
	font-size: 13px;
}

/* Badge */
.cleanup-wp-badge {
	display: inline-block;
	padding: 2px 8px;
	border-radius: 3px;
	font-size: 11px;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.3px;
}

.cleanup-wp-badge.done {
	background: #edfaef;
	color: #00a32a;
	border: 1px solid #00a32a;
}

/* Task Options */
.cleanup-wp-task-option {
	margin: 12px 0 0 26px;
	padding: 12px;
	background: #f6f7f7;
	border-radius: 4px;
}

.cleanup-wp-task-option label {
	display: block;
	margin-bottom: 6px;
	font-weight: 500;
}

.cleanup-wp-task-option select,
.cleanup-wp-task-option input[type="text"] {
	width: 100%;
	max-width: 300px;
}

/* Actions */
.cleanup-wp-actions {
	display: flex;
	gap: 12px;
	margin-top: 20px;
	padding-top: 20px;
	border-top: 1px solid #c3c4c7;
}

.cleanup-wp-actions .button {
	display: inline-flex;
	align-items: center;
	gap: 6px;
}

.cleanup-wp-actions .button .dashicons {
	font-size: 16px;
	width: 16px;
	height: 16px;
}

/* Optimize Options (Toggle switches) */
.cleanup-wp-option {
	padding: 16px 0;
	border-bottom: 1px solid #f0f0f1;
}

.cleanup-wp-option:last-of-type {
	border-bottom: none;
}

.cleanup-wp-option-header {
	display: flex;
	justify-content: space-between;
	align-items: center;
	gap: 16px;
}

.cleanup-wp-option-info {
	flex: 1;
}

.cleanup-wp-option-info strong {
	display: block;
	margin-bottom: 4px;
}

.cleanup-wp-option-info .description {
	margin: 0;
	color: #646970;
	font-size: 13px;
}

/* Toggle Switch */
.cleanup-wp-toggle {
	position: relative;
	display: inline-block;
	width: 48px;
	height: 26px;
	flex-shrink: 0;
}

.cleanup-wp-toggle input {
	opacity: 0;
	width: 0;
	height: 0;
}

.cleanup-wp-toggle-slider {
	position: absolute;
	cursor: pointer;
	top: 0;
	left: 0;
	right: 0;
	bottom: 0;
	background-color: #c3c4c7;
	transition: 0.2s;
	border-radius: 26px;
}

.cleanup-wp-toggle-slider:before {
	position: absolute;
	content: "";
	height: 20px;
	width: 20px;
	left: 3px;
	bottom: 3px;
	background-color: white;
	transition: 0.2s;
	border-radius: 50%;
	box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

.cleanup-wp-toggle input:checked + .cleanup-wp-toggle-slider {
	background-color: #00a32a;
}

.cleanup-wp-toggle input:checked + .cleanup-wp-toggle-slider:before {
	transform: translateX(22px);
}

.cleanup-wp-toggle input:focus + .cleanup-wp-toggle-slider {
	box-shadow: 0 0 0 2px #fff, 0 0 0 4px #2271b1;
}

.cleanup-wp-toggle.is-loading .cleanup-wp-toggle-slider {
	opacity: 0.5;
}

/* Preview Panel */
#cleanup-wp-preview-content {
	min-height: 200px;
}

.cleanup-wp-placeholder {
	color: #646970;
	font-style: italic;
}

/* Result Items */
.cleanup-wp-result-item {
	display: block;
	width: 100%;
	box-sizing: border-box;
	padding: 14px 16px;
	margin-bottom: 12px;
	border-radius: 4px;
	border-left: 4px solid #c3c4c7;
	background: #f6f7f7;
}

.cleanup-wp-result-item:last-child {
	margin-bottom: 0;
}

.cleanup-wp-result-item h4 {
	margin: 0 0 6px;
	font-size: 13px;
	font-weight: 600;
	color: #1d2327;
}

.cleanup-wp-result-item p {
	margin: 0;
	font-size: 13px;
	color: #50575e;
	line-height: 1.5;
}

.cleanup-wp-result-item .dashicons {
	font-size: 16px;
	width: 16px;
	height: 16px;
	vertical-align: text-bottom;
	margin-right: 4px;
}

/* Preview State */
.cleanup-wp-result-item.preview {
	border-left-color: #2271b1;
	background: #f0f6fc;
}

.cleanup-wp-result-item.preview h4 {
	color: #2271b1;
}

/* Success State */
.cleanup-wp-result-item.success {
	border-left-color: #00a32a;
	background: #edfaef;
}

.cleanup-wp-result-item.success h4 {
	color: #1e4620;
}

.cleanup-wp-result-item.success .dashicons {
	color: #00a32a;
}

/* Error State */
.cleanup-wp-result-item.error {
	border-left-color: #d63638;
	background: #fcf0f1;
}

.cleanup-wp-result-item.error h4 {
	color: #8a2424;
}

/* Already done */
.cleanup-wp-result-item .dashicons-yes-alt {
	color: #00a32a;
}

/* Loading */
.cleanup-wp-loading {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 20px;
	color: #646970;
}

.cleanup-wp-loading .spinner {
	float: none;
	margin: 0;
}

/* Messages */
.cleanup-wp-message {
	display: block;
	width: 100%;
	box-sizing: border-box;
	padding: 14px 16px;
	border-radius: 4px;
	margin-bottom: 16px;
}

.cleanup-wp-message p {
	margin: 0;
	font-weight: 500;
}

.cleanup-wp-message .dashicons {
	vertical-align: text-bottom;
	margin-right: 6px;
}

.cleanup-wp-message.success {
	background: #edfaef;
	border: 1px solid #00a32a;
	color: #1e4620;
}

.cleanup-wp-message.success .dashicons {
	color: #00a32a;
}

/* Toast notification */
.cleanup-wp-toast {
	position: fixed;
	bottom: 20px;
	right: 20px;
	padding: 12px 20px;
	background: #1d2327;
	color: #fff;
	border-radius: 4px;
	font-size: 14px;
	z-index: 99999;
	box-shadow: 0 4px 12px rgba(0,0,0,0.15);
	animation: slideIn 0.3s ease;
}

.cleanup-wp-toast.success {
	background: #00a32a;
}

.cleanup-wp-toast.error {
	background: #d63638;
}

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

/* Button States */
.button.is-loading {
	opacity: 0.7;
	pointer-events: none;
}
