/**
 * Developer Tools Styles
 *
 * Styles for the developer mode features including:
 * - Test data generator interface
 * - Developer settings panel
 * - Reset and cleanup tools
 *
 * FOR DEVELOPMENT/QA ENVIRONMENTS ONLY
 * @package Lens
 * @subpackage Developer Tools
 */

/* Developer Section - ensure proper display even on first load */
.lens-developer-section {
	display: none; /* Hidden by default, shown via JS */
	padding: 20px;
	max-height: 600px;
	overflow-y: auto;
}

.lens-developer-section[data-section="developer"] {
	display: block;
}

.lens-settings-section[data-section="developer"] {
	display: none;
}

.lens-settings-section[data-section="developer"].active {
	display: block;
}

.lens-test-data-header {
	display: flex;
	justify-content: space-between;
	align-items: center;
	margin-bottom: 20px;
	padding-bottom: 15px;
	border-bottom: 1px solid #e0e0e0;
}

.lens-test-data-title-wrapper {
	display: flex;
	align-items: center;
	gap: 10px;
}

.lens-test-data-title-wrapper h4 {
	margin: 0;
	font-size: 18px;
	font-weight: 600;
	color: #1d2327;
}

/* Small DEV indicator next to title */
.lens-dev-mode-indicator {
	display: inline-flex;
	align-items: center;
	padding: 2px 5px;
	background: #2271b1;
	color: white;
	font-size: 9px;
	font-weight: 700;
	letter-spacing: 0.3px;
	border-radius: 2px;
	line-height: 1;
	height: 16px;
	vertical-align: middle;
	margin-left: 2px;
}

/* Exit Dev Mode button uses standard WordPress button class */
.lens-disable-dev-mode svg {
	margin-right: 4px;
	vertical-align: middle;
}

/* Container for badge and exit button - keeping for backward compatibility */
.lens-test-data-actions-top {
	display: none;
}

.lens-badge {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	padding: 0 10px;
	height: 30px; /* Match WordPress button height */
	border-radius: 3px;
	font-size: 11px;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.5px;
}

.lens-badge-warning {
	background: #2271b1; /* WordPress admin blue */
	color: white;
	border: 1px solid #1e5a87;
}

/* Exit Dev Mode button - ensure consistent height */
.lens-disable-dev-mode {
	display: inline-flex !important;
	align-items: center;
	gap: 6px;
	height: 30px !important; /* Match badge height */
	line-height: 28px !important; /* Account for border */
	padding: 0 12px !important;
	font-size: 13px !important;
}

.lens-disable-dev-mode svg {
	width: 14px;
	height: 14px;
	flex-shrink: 0;
}

/* Warning Box */
.lens-test-data-warning {
	display: flex;
	gap: 12px;
	padding: 12px 15px;
	background: #fcf9e8;
	border-left: 4px solid #dba617;
	margin-bottom: 20px;
}

.lens-test-data-warning svg {
	flex-shrink: 0;
	color: #dba617;
}

.lens-test-data-warning div {
	flex: 1;
	font-size: 13px;
	line-height: 1.5;
}

/* Statistics */
.lens-test-data-stats {
	background: #f0f0f1;
	padding: 15px;
	border-radius: 3px;
	margin-bottom: 20px;
	border: 1px solid #c3c4c7;
}

.lens-test-data-stats h5 {
	margin: 0 0 15px 0;
	font-size: 14px;
	font-weight: 600;
	color: #1d2327;
}

.lens-stats-grid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
	gap: 10px;
	margin-bottom: 15px;
}

/* Fix icon alignment in cleanup button - removed old styles that weren't working */

.lens-stat-item {
	display: flex;
	justify-content: space-between;
	padding: 8px 12px;
	background: white;
	border: 1px solid #dcdcde;
	border-radius: 3px;
}

.lens-stat-label {
	color: #666;
	font-size: 12px;
}

.lens-stat-value {
	font-weight: 600;
	color: #333;
}

/* Configuration */
.lens-test-data-config {
	margin-bottom: 20px;
}

.lens-test-data-config h5 {
	margin: 0 0 15px 0;
	font-size: 14px;
	font-weight: 600;
}

.lens-config-grid {
	display: grid;
	grid-template-columns: repeat(2, 1fr);
	gap: 20px;
	margin-bottom: 15px;
}

.lens-config-section {
	background: #f6f7f7;
	padding: 15px;
	border: 1px solid #dcdcde;
	border-radius: 3px;
}

.lens-config-section h6 {
	margin: 0 0 12px 0;
	font-size: 13px;
	font-weight: 600;
	color: #333;
}

.lens-config-field {
	margin-bottom: 12px;
}

.lens-config-field:last-child {
	margin-bottom: 0;
}

.lens-config-field label {
	display: block;
	margin-bottom: 4px;
	font-size: 12px;
	color: #666;
}

.lens-config-field input[type="number"],
.lens-config-field select {
	width: 100%;
	padding: 6px 8px;
	border: 1px solid #ddd;
	border-radius: 4px;
	font-size: 13px;
}

.lens-config-field input[type="checkbox"] {
	margin-right: 6px;
}

/* Locked folders settings container */
.lens-locked-folders-settings {
	margin: 8px 0 12px 0;
	padding: 10px 12px;
	background: rgba(34, 113, 177, 0.03);
	border-left: 2px solid #2271b1;
	border-radius: 0 3px 3px 0;
	transition: all 0.3s ease;
}

.lens-locked-folders-settings .lens-config-field:last-child {
	margin-bottom: 0;
}

/* Content generation settings - same style as locked folders */
.lens-content-generation-settings {
	margin: 8px 0 12px 0;
	padding: 10px 12px;
	background: rgba(34, 113, 177, 0.03);
	border-left: 2px solid #2271b1;
	border-radius: 0 3px 3px 0;
	transition: all 0.3s ease;
}

.lens-content-generation-settings .lens-config-field:last-child {
	margin-bottom: 0;
}

.lens-config-field input[type="password"] {
	width: 100%;
	padding: 6px 8px;
	border: 1px solid #ddd;
	border-radius: 4px;
	font-size: 13px;
}

.lens-config-field input[type="text"] {
	width: 100%;
	padding: 6px 8px;
	border: 1px solid #ddd;
	border-radius: 4px;
	font-size: 13px;
}

.lens-field-hint {
	display: block;
	margin-top: 4px;
	font-size: 11px;
	color: #999;
}

/* Actions */
.lens-test-data-actions {
	display: flex;
	gap: 10px;
	margin-top: 15px;
}

.lens-test-data-actions button svg {
	margin-right: 5px;
	vertical-align: middle;
	position: relative;
	top: -1px;
}

/* Ensure buttons match WordPress admin style */
.lens-test-data-actions .button-primary {
	background: #2271b1;
	border-color: #2271b1;
	color: #fff;
}

.lens-test-data-actions .button-primary:hover {
	background: #135e96;
	border-color: #135e96;
}

.lens-cleanup-test-data {
	color: #d63638;
	border-color: #d63638;
}

.lens-cleanup-test-data:hover {
	color: #fff;
	background: #d63638;
	border-color: #d63638;
}

.lens-disable-dev-mode {
	color: #50575e;
	border-color: #50575e;
}

.lens-disable-dev-mode:hover {
	color: #2271b1;
	border-color: #2271b1;
}

/* Presets Wrapper */
.lens-presets-wrapper {
	position: relative;
}

/* Presets Menu */
.lens-test-presets-menu {
	position: absolute;
	bottom: calc(100% + 5px); /* Position above the button */
	left: 0;
	background: white;
	border: 1px solid #c3c4c7;
	border-radius: 3px;
	box-shadow: 0 2px 5px rgba(0,0,0,0.15);
	padding: 4px 0;
	z-index: 100000;
	min-width: 280px;
	max-width: 350px;
}

.lens-preset-option {
	display: block;
	width: 100%;
	padding: 8px 16px;
	background: none;
	border: none;
	text-align: left;
	font-size: 13px;
	cursor: pointer;
	transition: background 0.1s;
	color: #2c3338;
}

.lens-preset-option:hover {
	background: #f0f0f1;
	color: #2271b1;
}

/* Progress Display */
.lens-test-data-progress {
	background: #f0f0f1;
	padding: 20px;
	border-radius: 3px;
	margin-bottom: 20px;
}

.lens-test-data-progress h5 {
	margin: 0 0 15px 0;
	font-size: 14px;
	font-weight: 600;
}

.lens-progress-stage {
	display: flex;
	gap: 8px;
	margin-bottom: 15px;
	font-size: 13px;
}

.lens-stage-label {
	color: #666;
}

.lens-stage-value {
	font-weight: 600;
	color: #2271b1;
}

/* Progress Bar */
.lens-progress-bar-wrapper {
	display: flex;
	align-items: center;
	gap: 10px;
	margin-bottom: 15px;
}

.lens-progress-bar {
	flex: 1;
	height: 8px;
	background: #dcdcde;
	border-radius: 4px;
	overflow: hidden;
	position: relative;
}

.lens-progress-fill {
	height: 100%;
	background: #2271b1;
	border-radius: 4px;
	transition: width 0.3s ease;
	position: relative;
}

.lens-progress-fill::after {
	content: '';
	position: absolute;
	top: 0;
	left: 0;
	right: 0;
	bottom: 0;
	background: linear-gradient(
		45deg,
		rgba(255,255,255,0.2) 25%,
		transparent 25%,
		transparent 50%,
		rgba(255,255,255,0.2) 50%,
		rgba(255,255,255,0.2) 75%,
		transparent 75%,
		transparent
	);
	background-size: 30px 30px;
	animation: lens-progress-stripes 1s linear infinite;
}

@keyframes lens-progress-stripes {
	0% {
		background-position: 0 0;
	}
	100% {
		background-position: 30px 0;
	}
}

.lens-progress-percentage {
	font-weight: 600;
	font-size: 13px;
	min-width: 40px;
}

/* Progress Details */
.lens-progress-details {
	display: flex;
	gap: 20px;
	margin-bottom: 15px;
}

.lens-progress-item {
	display: flex;
	align-items: center;
	gap: 6px;
	font-size: 12px;
}

.lens-progress-item svg {
	color: #666;
}

.lens-progress-item span:last-child {
	font-weight: 600;
	color: #333;
}

.lens-progress-actions {
	display: flex;
	gap: 10px;
}

/* Fix icon alignment in progress action buttons */
.lens-progress-actions .button {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 6px;
}

.lens-progress-actions .button svg {
	flex-shrink: 0;
	vertical-align: middle;
}

/* Success Message */
.lens-test-data-success {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 12px 15px;
	background: #edfaef;
	border-left: 4px solid #00a32a;
	margin-bottom: 20px;
}

.lens-test-data-success svg {
	color: #00a32a;
	flex-shrink: 0;
}

.lens-test-data-success h5 {
	margin: 0 0 4px 0;
	font-size: 14px;
	font-weight: 600;
	color: #1e4d2b;
}

.lens-test-data-success p {
	margin: 0;
	font-size: 13px;
	color: #1e4d2b;
}

/* Developer Badge */
.lens-developer-badge {
	animation: lens-dev-subtle 3s ease-in-out infinite;
}

@keyframes lens-dev-subtle {
	0%, 100% {
		opacity: 0.95;
		transform: translateY(0);
	}
	50% {
		opacity: 1;
		transform: translateY(-1px);
	}
}

/* Developer tools actions row */
.lens-test-data-actions-row {
	display: flex;
	gap: 10px;
	margin-top: 10px;
	align-items: center;
}

/* Assign media button wrapper for tooltip */
.lens-assign-button-wrapper {
	position: relative;
	display: inline-block;
}

/* Assign media button */
.lens-assign-media-to-folders {
	display: inline-flex !important;
	align-items: center;
	gap: 6px;
}

.lens-assign-media-to-folders svg {
	flex-shrink: 0;
}

.lens-assign-media-to-folders:disabled {
	opacity: 0.6;
	cursor: not-allowed;
}

.lens-assign-media-to-folders.is-loading .spinner {
	margin: 0;
	float: none;
	margin-right: 6px;
}

/* Tooltip for disabled assign button */
.lens-assign-button-wrapper .lens-assign-tooltip {
	position: absolute;
	background: #1e1e1e;
	color: #ffffff;
	padding: 6px 12px;
	border-radius: 6px;
	font-size: 12px;
	white-space: nowrap;
	pointer-events: none;
	z-index: 10000;
	bottom: calc(100% + 8px);
	left: 50%;
	transform: translateX(-50%);
	opacity: 0;
	visibility: hidden;
	transition: opacity 0.2s ease, visibility 0.2s ease;
}

/* Show tooltip on hover when button is disabled */
.lens-assign-button-wrapper.lens-has-tooltip:hover .lens-assign-tooltip {
	opacity: 1;
	visibility: visible;
}

/* Tooltip arrow */
.lens-assign-button-wrapper .lens-assign-tooltip::after {
	content: '';
	position: absolute;
	top: 100%;
	left: 50%;
	transform: translateX(-50%);
	border: 5px solid transparent;
	border-top-color: #1e1e1e;
}

/* Cleanup Dropdown */
.lens-cleanup-dropdown {
	position: relative;
	display: inline-block;
}

.lens-cleanup-trigger {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 6px 12px;
	font-size: 13px;
	min-height: 30px;
	background: #fff;
	border: 1px solid #c3c4c7;
	border-radius: 3px;
	color: #2c3338;
	cursor: pointer;
	transition: all 0.15s ease;
}

.lens-cleanup-trigger:hover {
	background: #f6f7f7;
	border-color: #8c8f94;
}

.lens-cleanup-trigger:focus {
	outline: none;
	border-color: #2271b1;
	box-shadow: 0 0 0 1px #2271b1;
}

.lens-cleanup-trigger svg {
	flex-shrink: 0;
}

/* Dropdown Menu */
.lens-cleanup-menu {
	position: absolute;
	bottom: calc(100% + 4px);
	left: 0;
	min-width: 200px;
	background: #fff;
	border: 1px solid #c3c4c7;
	border-radius: 3px;
	box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
	z-index: 10000;
	overflow: hidden;
}

.lens-cleanup-option {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	width: 100%;
	padding: 10px 14px;
	background: none;
	border: none;
	border-bottom: 1px solid #f0f0f1;
	text-align: left;
	cursor: pointer;
	transition: background 0.15s ease;
}

.lens-cleanup-option:last-child {
	border-bottom: none;
}

.lens-cleanup-option:hover {
	background: #f6f7f7;
}

.lens-cleanup-option:focus {
	background: #f0f6fc;
	outline: none;
}

.lens-cleanup-option-label {
	font-size: 13px;
	font-weight: 600;
	color: #1d2327;
	margin-bottom: 2px;
}

.lens-cleanup-option-desc {
	font-size: 12px;
	color: #646970;
	line-height: 1.4;
}

/* Danger styling for "all" option */
.lens-cleanup-option[data-cleanup-type="all"] .lens-cleanup-option-label {
	color: #d63638;
}

.lens-cleanup-option[data-cleanup-type="all"]:hover {
	background: #fcf0f1;
}

/* Loading state */
.lens-cleanup-trigger.is-loading {
	opacity: 0.7;
	pointer-events: none;
}

.lens-cleanup-trigger.is-loading svg:first-child {
	animation: spin 1s linear infinite;
}

@keyframes spin {
	from { transform: rotate(0deg); }
	to { transform: rotate(360deg); }
}

/* Responsive adjustments */
@media (max-width: 768px) {
	.lens-config-grid {
		grid-template-columns: 1fr;
	}
	
	.lens-stats-grid {
		grid-template-columns: 1fr;
	}
	
	.lens-progress-details {
		flex-direction: column;
		gap: 8px;
	}
	
	.lens-test-data-actions-row {
		flex-direction: column;
		align-items: stretch;
		gap: 8px;
	}
	
	.lens-assign-button-wrapper {
		width: 100%;
	}
	
	.lens-assign-media-to-folders {
		width: 100%;
		justify-content: center;
	}
	
	.lens-cleanup-dropdown {
		display: block;
		width: 100%;
	}
	
	.lens-cleanup-trigger {
		width: 100%;
		justify-content: center;
	}
	
	.lens-cleanup-menu {
		left: 0;
		right: 0;
		width: auto;
	}
}

/* Cleanup Options - New three-button layout */
.lens-cleanup-options {
	margin-top: 15px;
}

.lens-cleanup-buttons {
	display: flex;
	gap: 8px;
	flex-wrap: wrap;
}

.lens-cleanup-buttons .button {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 6px;
	padding: 6px 12px;
	font-size: 13px;
	min-height: 32px;
	transition: all 0.2s ease;
	line-height: 1;
}

.lens-cleanup-buttons .button svg {
	width: 16px;
	height: 16px;
	flex-shrink: 0;
	vertical-align: middle;
}

/* Different colors for different cleanup types */
.lens-cleanup-buttons .button[data-cleanup-type="all"] {
	border-color: #d63638;
	color: #d63638;
}

.lens-cleanup-buttons .button[data-cleanup-type="all"]:hover:not(:disabled) {
	background: #d63638;
	color: white;
	border-color: #d63638;
}

.lens-cleanup-buttons .button[data-cleanup-type="folders"] {
	border-color: #f0b849;
	color: #996800;
}

.lens-cleanup-buttons .button[data-cleanup-type="folders"]:hover:not(:disabled) {
	background: #f0b849;
	color: white;
	border-color: #f0b849;
}

.lens-cleanup-buttons .button[data-cleanup-type="media"] {
	border-color: #00a0d2;
	color: #00a0d2;
}

.lens-cleanup-buttons .button[data-cleanup-type="media"]:hover:not(:disabled) {
	background: #00a0d2;
	color: white;
	border-color: #00a0d2;
}

.lens-cleanup-buttons .button:disabled {
	opacity: 0.5;
	cursor: not-allowed;
}

.lens-cleanup-hint {
	margin: 8px 0 0;
	font-size: 12px;
	color: #666;
	font-style: italic;
}

/* Cancel button icon alignment fix */
.lens-cancel-generation {
	display: inline-flex !important;
	align-items: center;
	justify-content: center;
	gap: 6px;
}

.lens-cancel-generation svg {
	flex-shrink: 0;
	vertical-align: middle;
}

/* Generic button icon fix for developer tools section */
.lens-test-data-config .button,
.lens-test-data-progress .button,
.lens-test-data-stats .button {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 6px;
	line-height: 1;
}

.lens-test-data-config .button svg,
.lens-test-data-progress .button svg,
.lens-test-data-stats .button svg {
	flex-shrink: 0;
	vertical-align: middle;
}

/* Responsive for cleanup buttons */
@media (max-width: 768px) {
	.lens-cleanup-buttons {
		flex-direction: column;
		width: 100%;
	}
	
	.lens-cleanup-buttons .button {
		width: 100%;
		justify-content: center;
	}
}
