/**
 * Admin Columns Customizer Styles
 *
 * @package AdminColumnsCustomizer
 * @since 1.0.0
 */

.wpps-admin-columns-page,
.wpps-modal {
	--wpps-accent: var(--wp-admin-theme-color, #2271b1);
	--wpps-accent-hover: var(--wp-admin-theme-color-darker-10, #135e96);
	--wpps-accent-surface: color-mix(in srgb, var(--wp-admin-theme-color, #2271b1) 12%, #fff);
}

.wpps-admin-columns-page {
	margin: 20px 20px 20px 0;
	max-width: none;
	box-sizing: border-box;
}

.wpps-pro-badge {
	display: inline-block;
	vertical-align: middle;
	font-size: 10px;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.5px;
	padding: 2px 6px;
	margin-left: 8px;
	border-radius: 3px;
	background: linear-gradient(135deg, var(--wpps-accent) 0%, var(--wpps-accent-hover) 100%);
	color: #fff;
	box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.wpps-pro-badge--admin-page {
	font-size: 14px;
	padding: 6px 14px;
	margin-left: 10px;
	border-radius: 4px;
}

.wpps-columns-container {
	display: flex;
	gap: 20px;
	margin-top: 20px;
	max-width: none;
	box-sizing: border-box;
}

.wpps-columns-sidebar {
	width: 280px;
	flex-shrink: 0;
	background: #fff;
	border: 1px solid #ccd0d4;
	box-shadow: 0 1px 1px rgba(0, 0, 0, 0.04);
	border-radius: 4px;
	padding: 20px;
}

.wpps-columns-main {
	flex: 1;
	min-width: 0;
	background: #fff;
	border: 1px solid #ccd0d4;
	box-shadow: 0 1px 1px rgba(0, 0, 0, 0.04);
	border-radius: 4px;
	padding: 20px;
}

.wpps-screen-selector h2 {
	margin-top: 0;
	font-size: 14px;
	font-weight: 600;
	text-transform: uppercase;
	color: #646970;
	margin-bottom: 15px;
}

.wpps-screen-type-tabs {
	display: flex;
	gap: 5px;
	margin-bottom: 15px;
	border-bottom: 1px solid #ccd0d4;
}

.wpps-tab-button {
	flex: 1;
	padding: 8px 12px;
	background: transparent;
	border: none;
	border-bottom: 2px solid transparent;
	cursor: pointer;
	font-size: 13px;
	color: #646970;
	transition: all 0.2s;
}

.wpps-tab-button:hover {
	color: var(--wpps-accent);
}

.wpps-tab-button.active {
	color: var(--wpps-accent);
	border-bottom-color: var(--wpps-accent);
	font-weight: 600;
}

.wpps-screen-list {
	margin-top: 10px;
}

.wpps-screen-item {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 10px 12px;
	margin-bottom: 5px;
	border-radius: 4px;
	text-decoration: none;
	color: #1d2327;
	transition: background 0.2s;
}

.wpps-screen-item:hover {
	background: #f0f0f1;
}

.wpps-screen-item.active {
	background: var(--wpps-accent-surface);
	color: var(--wpps-accent);
	font-weight: 600;
}

.wpps-screen-item.active .dashicons {
	color: var(--wpps-accent);
}

.wpps-screen-item .dashicons {
	font-size: 18px;
	width: 18px;
	height: 18px;
}

.wpps-screen-key {
	font-size: 12px;
	font-weight: 400;
	color: #646970;
	opacity: 0.9;
}

.wpps-columns-header {
	display: flex;
	justify-content: space-between;
	align-items: center;
	margin-bottom: 20px;
	padding-bottom: 15px;
	border-bottom: 1px solid #ccd0d4;
}

.wpps-columns-header h2 {
	margin: 0;
	font-size: 20px;
}

.wpps-columns-list {
	margin-top: 20px;
}

.wpps-columns-loading {
	text-align: center;
	padding: 24px 20px;
	color: #646970;
}

.wpps-columns-items {
	margin-top: 15px;
}

.wpps-column-item {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 12px 15px;
	margin-bottom: 8px;
	background: #f6f7f7;
	border: 1px solid #dcdcde;
	border-radius: 4px;
	cursor: move;
	transition: all 0.2s;
}

.wpps-column-item:hover {
	background: #fff;
	border-color: var(--wpps-accent);
	box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.wpps-column-item.ui-sortable-helper {
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
	transform: rotate(2deg);
}

.wpps-column-item.ui-sortable-placeholder {
	background: var(--wpps-accent-surface);
	border: 2px dashed var(--wpps-accent);
	height: 50px;
	visibility: visible !important;
}

.wpps-column-handle {
	color: #646970;
	cursor: move;
	font-size: 18px;
}

.wpps-column-handle:hover {
	color: var(--wpps-accent);
}

.wpps-column-checkbox {
	margin: 0;
}

.wpps-column-label {
	flex: 1;
	font-weight: 500;
	color: #1d2327;
}

.wpps-column-type {
	font-size: 12px;
	color: #646970;
	padding: 2px 8px;
	background: #f0f0f1;
	border-radius: 3px;
}

.wpps-columns-welcome {
	text-align: center;
	padding: 60px 20px;
	color: #646970;
}

.wpps-columns-welcome h2 {
	margin-bottom: 10px;
	color: #1d2327;
}

.wpps-save-columns {
	margin-left: auto;
}

.wpps-notice {
	margin: 15px 0;
	padding: 12px;
	border-left: 4px solid var(--wpps-accent);
	background: var(--wpps-accent-surface);
}

.wpps-notice.error {
	border-left-color: #d63638;
	background: #fcf0f1;
}

.wpps-notice.success {
	border-left-color: #00a32a;
	background: #f0f6f3;
}

.wpps-columns-actions {
	display: flex;
	gap: 10px;
	align-items: center;
	justify-content: flex-end;
}

.wpps-add-column {
	display: inline-flex;
	align-items: center;
	gap: 5px;
	vertical-align: middle;
}

.wpps-add-column .dashicons {
	font-size: 16px;
	width: 16px;
	height: 16px;
	line-height: 1;
}

.wpps-modal {
	position: fixed;
	z-index: 100000;
	left: 0;
	top: 0;
	width: 100%;
	height: 100%;
	background-color: rgba(0, 0, 0, 0.5);
	overflow: auto;
}

.wpps-modal-content {
	background-color: #fff;
	margin: 5% auto;
	padding: 0;
	border: 1px solid #ccd0d4;
	border-radius: 4px;
	width: 90%;
	max-width: 700px;
	box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

.wpps-modal-header {
	padding: 20px;
	border-bottom: 1px solid #ccd0d4;
	display: flex;
	justify-content: space-between;
	align-items: center;
}

.wpps-modal-header h2 {
	margin: 0;
	font-size: 18px;
}

.wpps-modal-close {
	background: none;
	border: none;
	font-size: 28px;
	font-weight: bold;
	color: #646970;
	cursor: pointer;
	padding: 0;
	width: 30px;
	height: 30px;
	line-height: 1;
}

.wpps-modal-close:hover {
	color: #1d2327;
}

.wpps-modal-body select:disabled {
	opacity: 0.65;
	cursor: wait;
}

.wpps-modal-body {
	padding: 20px;
	max-height: 60vh;
	overflow-y: auto;
}

.wpps-modal-footer {
	padding: 20px;
	border-top: 1px solid #ccd0d4;
	display: flex;
	justify-content: flex-end;
	gap: 10px;
}

.wpps-column-item {
	display: flex;
	align-items: center;
	gap: 12px;
}

.wpps-column-item .wpps-column-settings {
	margin-left: auto;
}

.wpps-column-item .wpps-column-delete {
	color: #d63638;
	cursor: pointer;
	margin-left: 10px;
}

.wpps-column-item .wpps-column-delete:hover {
	color: #b32d2e;
}

.wpps-column-item .wpps-column-edit {
	color: #50575e;
	cursor: pointer;
	margin-left: 10px;
}

.wpps-column-item .wpps-column-edit:hover {
	color: var(--wpps-accent);
}

.wpps-column-settings {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	margin-left: auto;
	font-size: 12px;
	color: #646970;
}

.wpps-column-settings .dashicons {
	font-size: 16px;
	width: 16px;
	height: 16px;
}

.wpps-browse-fields {
	margin-left: 10px;
}

.wpps-modal-body input[type="radio"] {
	accent-color: var(--wpps-accent);
}

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

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

.wpps-toggle-slider {
	position: absolute;
	cursor: pointer;
	top: 0;
	left: 0;
	right: 0;
	bottom: 0;
	background-color: #ccc;
	transition: .4s;
	border-radius: 24px;
}

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

.wpps-toggle-switch input:checked + .wpps-toggle-slider {
	background-color: var(--wpps-accent);
}

.wpps-toggle-switch input:checked + .wpps-toggle-slider:before {
	transform: translateX(26px);
}

.wpps-toggle-switch input:focus + .wpps-toggle-slider {
	box-shadow: 0 0 0 1px var(--wpps-accent);
}

/* Width Controls */
.wpps-width-unit-btn.active {
	background: var(--wpps-accent);
	color: #fff;
	border-color: var(--wpps-accent);
}

.wpps-width-unit-btn.active:hover {
	background: var(--wpps-accent-hover);
	border-color: var(--wpps-accent-hover);
}

/* Quick Add Inline (above columns list) */
.wpps-quick-add-inline {
	margin-bottom: 20px;
	padding: 16px;
	background: #f6f7f7;
	border: 1px solid #dcdcde;
	border-radius: 4px;
}

.wpps-quick-add-inline-title {
	margin: 0 0 12px 0;
	font-size: 13px;
	font-weight: 600;
	color: #1d2327;
}

.wpps-quick-add-inline-buttons {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
}

/* Center dashicons inside Admin Columns "Quick Add" buttons */
.wpps-quick-add-btn.button {
	display: inline-flex !important;
	align-items: center !important;
	justify-content: center;
	gap: 6px;
	vertical-align: middle !important;
	padding: 6px 12px;
	background: #fff;
	border: 1px solid #dcdcde;
	border-radius: 4px;
	cursor: pointer;
	font-size: 13px;
	color: #1d2327;
	transition: all 0.2s;
}

.wpps-quick-add-btn:hover {
	background: #fff;
	border-color: var(--wpps-accent);
	color: var(--wpps-accent);
}

.wpps-quick-add-btn.added {
	background: var(--wpps-accent-surface);
	border-color: var(--wpps-accent);
	color: var(--wpps-accent-hover);
	cursor: default;
}

/* Dashicons often need explicit line-height */
.wpps-quick-add-btn.button .dashicons {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	line-height: 1 !important;
	width: 20px;
	height: 20px;
	position: relative;
}

.wpps-quick-add-btn .wpps-quick-add-icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	line-height: 1;
	font-size: 16px;
}

.wpps-quick-add-btn .wpps-quick-add-icon-hash {
	font-weight: 600;
	font-size: 15px;
}

.wpps-layout-settings {
	margin: 0 0 24px;
}

.wpps-acc-accordion {
	background: #fff;
	border: 1px solid #c3c4c7;
	border-radius: 4px;
	overflow: hidden;
}

.wpps-acc-accordion-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	width: 100%;
	padding: 14px 16px;
	background: none;
	border: none;
	font-size: 14px;
	font-weight: 600;
	color: #1d2327;
	text-align: left;
	cursor: pointer;
	transition: background 0.15s ease;
}

.wpps-acc-accordion-header:hover,
.wpps-acc-accordion-header:focus {
	background: #f6f7f7;
	outline: none;
}

.wpps-acc-accordion-header:focus-visible {
	box-shadow: inset 0 0 0 2px var(--wpps-accent, var(--wp-admin-theme-color, #2271b1));
}

.wpps-acc-accordion-title {
	display: flex;
	align-items: center;
	gap: 8px;
}

.wpps-acc-accordion-chevron {
	color: #646970;
	transition: transform 0.2s ease;
}

.wpps-acc-accordion.is-open .wpps-acc-accordion-chevron {
	transform: rotate(180deg);
}

.wpps-acc-accordion-body {
	display: none;
	padding: 0 16px 16px;
	border-top: 1px solid #f0f0f1;
}

.wpps-acc-accordion.is-open .wpps-acc-accordion-body {
	display: block;
}

.wpps-acc-accordion-body .form-table {
	margin-top: 0;
}

.wpps-acc-accordion-body .form-table th {
	padding-left: 0;
	width: 200px;
}

.wpps-freeze-columns-row.is-hidden {
	display: none;
}

.wpps-column-type {
	min-width: 70px;
}
