/* Modern, clean design */
.voxfor-ml-admin-wrap {
	max-width: 1400px;
}

/* Loading states */
.voxfor-ml-loading {
	text-align: center;
	padding: 40px 20px;
	color: #666;
}

.voxfor-ml-loading::after {
	content: '';
	display: inline-block;
	width: 20px;
	height: 20px;
	border: 2px solid #ddd;
	border-top: 2px solid #0073aa;
	border-radius: 50%;
	animation: spin 1s linear infinite;
	margin-left: 10px;
	vertical-align: middle;
}

@keyframes spin {
	0% { transform: rotate(0deg); }
	100% { transform: rotate(360deg); }
}


/* Stats cards */
.voxfor-ml-memory-stats {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
	gap: 20px;
	margin: 20px 0;
}

/* Enhanced stats cards with icons */
.voxfor-ml-stat-card {
	background: #fff;
	border: 1px solid #ddd;
	border-radius: 8px;
	padding: 20px;
	text-align: center;
	box-shadow: 0 2px 4px rgba(0,0,0,0.1);
	position: relative;
	overflow: hidden;
}

.voxfor-ml-stat-card::before {
	content: '';
	position: absolute;
	top: 0;
	right: 0;
	width: 60px;
	height: 60px;
	background: rgba(0, 115, 170, 0.1);
	border-radius: 0 8px 0 60px;
}

.voxfor-ml-stat-card h3 {
	font-size: 2em;
	margin: 0 0 5px 0;
	color: #0073aa;
}

.voxfor-ml-stat-card p {
	margin: 0;
	color: #666;
}

/* Filters */
.voxfor-ml-memory-filters {
	background: #fff;
	border: 1px solid #ddd;
	border-radius: 8px;
	padding: 20px;
	margin: 20px 0;
	box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

/* WordPress Admin Override Styles */
body.wp-admin .voxfor-ml-filter-grid {
	display: grid !important;
	grid-template-columns: 2fr 1fr auto !important;
	gap: 20px !important;
	align-items: end !important;
	margin-bottom: 20px !important;
	width: 100% !important;
}

body.wp-admin .voxfor-ml-filter-item {
	display: flex !important;
	flex-direction: column !important;
	min-width: 0 !important;
}

body.wp-admin .voxfor-ml-filter-item input,
body.wp-admin .voxfor-ml-filter-item select {
	width: 100% !important;
	padding: 8px 12px !important;
	border: 1px solid #ddd !important;
	border-radius: 4px !important;
	font-size: 13px !important;
	height: 36px !important;
	box-sizing: border-box !important;
	background: #fff !important;
	margin: 0 !important;
}

body.wp-admin .voxfor-ml-filter-actions {
	display: flex !important;
	gap: 10px !important;
	align-items: end !important;
}

body.wp-admin .voxfor-ml-filter-actions .button {
	height: 36px !important;
	line-height: 34px !important;
	padding: 0 16px !important;
	font-size: 13px !important;
	margin: 0 !important;
}

.voxfor-ml-filter-grid {
	display: grid !important;
	grid-template-columns: 2fr 1fr 1fr 1fr auto;
	gap: 15px;
	align-items: end;
	margin-bottom: 20px;
	width: 100%;
}

/* When specific item container is hidden, adjust grid */
.voxfor-ml-filter-grid:has(#filter-specific-item-container[style*="display: none"]) {
	grid-template-columns: 2fr 1fr 1fr auto;
}

/* Fallback for browsers that don't support :has() */
#filter-specific-item-container[style*="display: none"] {
	display: none !important;
}

.voxfor-ml-filter-item {
	display: flex !important;
	flex-direction: column;
	min-width: 0; /* Prevent grid overflow */
}

.voxfor-ml-search-input {
	display: flex;
	flex-direction: column;
}

.voxfor-ml-filter-actions {
	display: flex;
	gap: 10px;
	align-items: end;
}

.voxfor-ml-filter-actions .button {
	height: 36px;
	line-height: 34px;
	padding: 0 16px;
	font-size: 13px;
}

@media (max-width: 768px) {
	.voxfor-ml-filter-grid {
		grid-template-columns: 1fr;
		gap: 10px;
	}
	
	.voxfor-ml-filter-item,
	.voxfor-ml-search-input,
	.voxfor-ml-filter-actions {
		grid-column: 1;
	}
	
	.voxfor-ml-filter-actions {
		margin-top: 15px;
	}
}

.voxfor-ml-filter-item label {
	display: block;
	margin-bottom: 5px;
	font-weight: 600;
	color: #555;
	font-size: 13px;
}

/* Input and Select Styling */
.voxfor-ml-filter-item input,
.voxfor-ml-filter-item select {
	width: 100%;
	padding: 8px 12px;
	border: 1px solid #ddd;
	border-radius: 4px;
	font-size: 13px;
	height: 36px;
	box-sizing: border-box;
	background: #fff;
}

.voxfor-ml-filter-item input:focus,
.voxfor-ml-filter-item select:focus {
	border-color: #0073aa;
	box-shadow: 0 0 0 1px #0073aa;
	outline: none;
}

.voxfor-ml-filter-actions {
	display: flex;
	gap: 10px;
}

/* Results info */
.voxfor-ml-results-info {
	background: #f8f9fa;
	border: 1px solid #dee2e6;
	border-radius: 4px;
	padding: 10px 15px;
	margin-bottom: 1px;
}

.voxfor-ml-results-info p {
	margin: 0;
	color: #6c757d;
}

.voxfor-ml-filtered {
	font-style: italic;
	color: #007cba;
}

/* Table improvements */
.voxfor-ml-table-wrapper {
	background: #fff;
	border: 1px solid #ddd;
	border-radius: 0 0 8px 8px;
	overflow: hidden;
}

.voxfor-ml-translation-table {
	margin: 0;
	border: none;
}

.voxfor-ml-translation-table th {
	background: #f8f9fa;
	border-bottom: 2px solid #dee2e6;
	color: #495057;
	font-weight: 600;
}

.voxfor-ml-text-content {
	line-height: 1.4;
	word-break: break-word;
}

.voxfor-ml-editable {
	cursor: pointer;
	padding: 8px;
	border-radius: 4px;
	transition: all 0.2s ease;
}

.voxfor-ml-editable:hover:not([data-locked="1"]) {
	background-color: #e7f3ff;
	border: 1px solid #b3d7ff;
	position: relative;
}

.voxfor-ml-editable:hover:not([data-locked="1"])::after {
	content: '✏️ Click to edit';
	position: absolute;
	top: -25px;
	left: 50%;
	transform: translateX(-50%);
	background: #333;
	color: #fff;
	padding: 4px 8px;
	border-radius: 4px;
	font-size: 11px;
	white-space: nowrap;
	z-index: 1000;
	opacity: 0;
	animation: fadeIn 0.3s ease forwards;
}

@keyframes fadeIn {
	to { opacity: 1; }
}

.voxfor-ml-editable[data-locked="1"] {
	background-color: #fff3cd;
	cursor: not-allowed;
}

.voxfor-ml-editable-wrapper {
	position: relative;
}

.voxfor-ml-lock-indicator {
	position: absolute;
	top: 2px;
	right: 2px;
	font-size: 12px;
}

.locked-row {
	background-color: #fffbf0;
}

/* Inline editing styles */
.voxfor-ml-edit-textarea {
	width: 100%;
	min-height: 60px;
	padding: 8px;
	border: 2px solid #0073aa;
	border-radius: 4px;
	font-family: inherit;
	font-size: 13px;
	line-height: 1.4;
	resize: vertical;
	box-shadow: 0 0 0 1px rgba(0, 115, 170, 0.2);
	transition: all 0.3s ease;
}

/* Success/Error message styles */
.voxfor-ml-message {
	position: fixed;
	top: 32px;
	right: 20px;
	padding: 12px 20px;
	border-radius: 4px;
	font-weight: 500;
	z-index: 10000;
	box-shadow: 0 2px 8px rgba(0,0,0,0.15);
	animation: slideIn 0.3s ease;
}

.voxfor-ml-message.success {
	background: #d4edda;
	color: #155724;
	border: 1px solid #c3e6cb;
}

.voxfor-ml-message.error {
	background: #f8d7da;
	color: #721c24;
	border: 1px solid #f5c6cb;
}

@keyframes slideIn {
	from { transform: translateX(100%); opacity: 0; }
	to { transform: translateX(0); opacity: 1; }
}

.voxfor-ml-edit-textarea:focus {
	outline: none;
	border-color: #005a87;
	box-shadow: 0 0 0 2px rgba(0, 115, 170, 0.3);
}

.voxfor-ml-edit-actions {
	margin-top: 8px;
	display: flex;
	gap: 8px;
}

.voxfor-ml-edit-actions .button {
	font-size: 12px;
	height: auto;
	padding: 4px 12px;
	line-height: 1.4;
}

.voxfor-ml-save-edit {
	background: #00a32a !important;
	border-color: #00a32a !important;
	color: #fff !important;
}

.voxfor-ml-save-edit:hover {
	background: #008a20 !important;
	border-color: #008a20 !important;
}

.voxfor-ml-save-edit:disabled {
	background: #a7aaad !important;
	border-color: #a7aaad !important;
	cursor: not-allowed !important;
}

.voxfor-ml-cancel-edit {
	background: #f6f7f7 !important;
	border-color: #dcdcde !important;
	color: #50575e !important;
}

.voxfor-ml-cancel-edit:hover {
	background: #f0f0f1 !important;
	border-color: #8c8f94 !important;
}

/* Badges */
.voxfor-ml-lang-badge {
	display: inline-block;
	padding: 4px 8px;
	background: #0073aa;
	color: #fff;
	border-radius: 4px;
	font-size: 11px;
	font-weight: 600;
	text-transform: uppercase;
}

.voxfor-ml-context-badge {
	display: inline-block;
	padding: 4px 8px;
	background: #f1f1f1;
	border-radius: 4px;
	font-size: 11px;
	font-weight: 500;
}

.voxfor-ml-context-badge.title { background: #e1f5fe; color: #0277bd; }
.voxfor-ml-context-badge.content { background: #f3e5f5; color: #7b1fa2; }
.voxfor-ml-context-badge.image_alt { background: #fff8e1; color: #f57c00; }
.voxfor-ml-context-badge.menu_item { background: #e8f5e8; color: #2e7d32; }



/* Pagination */
.voxfor-ml-pagination {
	background: #f8f9fa;
	border: 1px solid #dee2e6;
	border-top: none;
	border-radius: 0 0 8px 8px;
	padding: 15px;
	text-align: center;
}

.voxfor-ml-pagination .page-numbers {
	display: inline-block;
	padding: 8px 12px;
	margin: 0 2px;
	border: 1px solid #dee2e6;
	border-radius: 4px;
	text-decoration: none;
	color: #495057;
	background: #fff;
}

.voxfor-ml-pagination .page-numbers:hover {
	background: #e9ecef;
}

.voxfor-ml-pagination .page-numbers.current {
	background: #007cba;
	color: #fff;
	border-color: #007cba;
}

/* Empty state */
.voxfor-ml-no-results {
	background: #fff;
	border: 1px solid #ddd;
	border-radius: 8px;
	padding: 60px 20px;
	text-align: center;
}

.voxfor-ml-empty-state h3 {
	color: #666;
	margin-bottom: 10px;
}


/* Inline editing interface */
.voxfor-ml-edit-container {
	background: #f8f9fa;
	border: 2px solid #007cba;
	border-radius: 6px;
	padding: 10px;
	margin: 5px 0;
	box-shadow: 0 4px 12px rgba(0,123,186,0.15);
}

.voxfor-ml-inline-edit {
	width: 100%;
	min-height: 60px;
	max-height: 200px;
	padding: 8px;
	border: 1px solid #ced4da;
	border-radius: 4px;
	font-size: 13px;
	font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
	line-height: 1.4;
	resize: vertical;
	background: #fff;
	margin-bottom: 8px;
}

.voxfor-ml-inline-edit:focus {
	outline: none;
	border-color: #007cba;
	box-shadow: 0 0 0 2px rgba(0,123,186,0.25);
}

.voxfor-ml-edit-buttons {
	display: flex;
	gap: 8px;
	margin-bottom: 5px;
}

.voxfor-ml-edit-help {
	color: #6c757d;
	font-style: italic;
	margin: 0;
}

.voxfor-ml-edit-help small {
	font-size: 11px;
}

/* Responsive design */
@media (max-width: 768px) {
	.voxfor-ml-filter-grid {
		grid-template-columns: 1fr;
		gap: 10px;
	}
	
	.voxfor-ml-memory-stats {
		grid-template-columns: 1fr;
	}
	
	.voxfor-ml-translation-table th,
	.voxfor-ml-translation-table td {
		padding: 8px 4px;
		font-size: 12px;
	}
	
}

/* Additional improvements for inline editing */
.voxfor-ml-translation-table td {
	height: auto;
	min-height: 40px;
	vertical-align: top;
}

.voxfor-ml-text-content {
	display: block;
	max-height: 60px;
	overflow: hidden;
	line-height: 1.4;
	word-wrap: break-word;
}

/* Ensure proper height restoration after editing */
.voxfor-ml-translation-table .source-text,
.voxfor-ml-translation-table .translated-text {
	vertical-align: top;
	height: auto;
}

/* Enhanced filter styling */
.voxfor-ml-filter-item {
	margin-bottom: 15px;
}

.voxfor-ml-filter-item label {
	display: block;
	margin-bottom: 5px;
	font-weight: 600;
	color: #23282d;
}

.voxfor-ml-filter-item select,
.voxfor-ml-filter-item input[type="text"] {
	width: 100%;
	max-width: 300px;
	padding: 8px 12px;
	border: 1px solid #ddd;
	border-radius: 4px;
	font-size: 14px;
}

#filter-specific-item-container {
	transition: all 0.3s ease;
}

#filter-specific-item-container.show {
	opacity: 1;
	max-height: 100px;
}

#filter-specific-item-container.hide {
	opacity: 0;
	max-height: 0;
	overflow: hidden;
}
