/**
 * Leat Debug Toolbar Styles
 *
 * @package Leat\Admin
 */

.leat-debug-toolbar {
	position: fixed;
	bottom: 20px;
	right: 20px;
	z-index: 999999;
	font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
	font-size: 13px;
}

/* When toolbar is positioned inline (on order page) */
.leat-debug-toolbar.leat-debug-inline {
	position: relative;
	display: inline-block;
	vertical-align: middle;
	margin-left: 12px;
	bottom: auto;
	right: auto;
}

/* Hide toolbar while JavaScript is repositioning it to prevent flash */
.leat-debug-toolbar.leat-debug-positioning {
	visibility: hidden;
}

/* Adjust heading container to allow inline elements */
.woocommerce-order-data__heading {
	display: inline-block;
}

.leat-debug-launcher {
	width: 60px;
	height: 60px;
	border-radius: 50%;
	background: #000000;
	border: none;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	box-shadow:
		0 1px 6px rgba(0, 0, 0, 0.06),
		0 2px 32px rgba(0, 0, 0, 0.16);
	transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
	padding: 14px;
	position: relative;
}

/* Smaller launcher for inline positioning */
.leat-debug-toolbar.leat-debug-inline .leat-debug-launcher {
	width: 24px;
	height: 24px;
	padding: 5px;
	position: relative;
	top: -3px;
	box-shadow:
		0 1px 3px rgba(0, 0, 0, 0.1),
		0 1px 2px rgba(0, 0, 0, 0.06);
}

.leat-debug-launcher:hover {
	transform: scale(1.1);
	box-shadow:
		0 2px 8px rgba(0, 0, 0, 0.1),
		0 4px 40px rgba(0, 0, 0, 0.2);
}

.leat-debug-toolbar.leat-debug-inline .leat-debug-launcher:hover {
	transform: scale(1.15);
	box-shadow:
		0 2px 6px rgba(0, 0, 0, 0.15),
		0 2px 20px rgba(0, 0, 0, 0.1);
}

.leat-debug-launcher:active {
	transform: scale(1.05);
}

.leat-debug-launcher-icon {
	width: 100%;
	height: 100%;
	object-fit: contain;
}

.leat-debug-toolbar.leat-debug-collapsed .leat-debug-panel {
	display: none;
}

.leat-debug-toolbar:not(.leat-debug-collapsed) .leat-debug-launcher {
	display: none;
}

.leat-debug-panel {
	position: absolute;
	bottom: 0;
	right: 0;
	width: 420px;
	max-height: 704px;
	background: #0a0a0a;
	color: #e0e0e0;
	border-radius: 16px;
	border: 1px solid #1a1a1a;
	box-shadow:
		0 0 0 1px rgba(255, 255, 255, 0.05),
		0 20px 60px rgba(0, 0, 0, 0.5);
	overflow: hidden;
	display: flex;
	flex-direction: column;
}

/* Panel positioning when toolbar is inline */
.leat-debug-toolbar.leat-debug-inline .leat-debug-panel {
	position: fixed;
	bottom: 20px;
	right: 20px;
	top: auto;
	left: auto;
}

.leat-debug-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 16px 20px;
	background: #000000;
	border-bottom: 1px solid #1a1a1a;
	user-select: none;
	flex-shrink: 0;
}

.leat-debug-title {
	display: flex;
	align-items: center;
	gap: 10px;
	font-weight: 600;
	font-size: 14px;
	color: #ffffff;
	letter-spacing: 0.3px;
	line-height: 1;
}

.leat-debug-close {
	background: transparent;
	border: none;
	color: #9ca3af;
	width: 32px;
	height: 32px;
	border-radius: 6px;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	transition: all 0.2s;
	flex-shrink: 0;
	padding: 0;
}

.leat-debug-close:hover {
	background: rgba(255, 255, 255, 0.1);
	color: #ffffff;
}

.leat-debug-body {
	flex: 1;
	overflow-y: auto;
	overflow-x: hidden;
}

.leat-debug-body::-webkit-scrollbar {
	width: 6px;
}

.leat-debug-body::-webkit-scrollbar-track {
	background: #000000;
}

.leat-debug-body::-webkit-scrollbar-thumb {
	background: linear-gradient(180deg, #667eea 0%, #764ba2 100%);
	border-radius: 3px;
}

.leat-debug-body::-webkit-scrollbar-thumb:hover {
	background: linear-gradient(180deg, #8b9aff 0%, #9171d4 100%);
}

.leat-debug-section {
	padding: 18px;
	border-bottom: 1px solid #1a1a1a;
	background: linear-gradient(180deg, rgba(10, 10, 10, 0) 0%, rgba(0, 0, 0, 0.3) 100%);
}

.leat-debug-section:last-child {
	border-bottom: none;
}

.leat-debug-section:hover {
	background: linear-gradient(180deg, rgba(102, 126, 234, 0.02) 0%, rgba(0, 0, 0, 0.3) 100%);
}

.leat-debug-section-title {
	margin: 0 0 14px 0;
	font-size: 11px;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 1px;
	color: #667eea;
	text-shadow: 0 0 10px rgba(102, 126, 234, 0.3);
}

#order_data .leat-debug-section-title {
	color: #667eea;
}

.leat-debug-subsection-title {
	margin: 12px 0 8px 0;
	font-size: 11px;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.5px;
	color: #6b7280;
}

.leat-debug-table {
	width: 100%;
	border-collapse: collapse;
	table-layout: fixed;
}

.leat-debug-table th {
	text-align: left;
	padding: 6px 8px 6px 0;
	font-weight: 500;
	color: #9ca3af;
	font-size: 12px;
	white-space: nowrap;
	vertical-align: top;
	width: 35%;
}

.leat-debug-table td {
	padding: 6px 0;
	color: #e0e0e0;
	word-break: break-word;
	overflow-wrap: break-word;
	max-width: 0;
}

.leat-debug-table-small th,
.leat-debug-table-small td {
	padding: 4px 0;
	font-size: 11px;
}

.leat-debug-table thead th {
	border-bottom: 1px solid #2a2a2a;
	padding-bottom: 8px;
}

.leat-debug-table tbody tr:not(:last-child) td {
	border-bottom: 1px solid #2a2a2a;
}

.leat-debug-badge {
	display: inline-block;
	padding: 2px 8px;
	border-radius: 12px;
	font-size: 11px;
	font-weight: 500;
	text-transform: uppercase;
	letter-spacing: 0.3px;
}

.leat-debug-badge-success {
	background: rgba(16, 185, 129, 0.2);
	color: #10b981;
}

.leat-debug-badge-error {
	background: rgba(239, 68, 68, 0.2);
	color: #ef4444;
}

.leat-debug-badge-warning {
	background: rgba(245, 158, 11, 0.2);
	color: #f59e0b;
}

.leat-debug-badge-pending {
	background: rgba(156, 163, 175, 0.2);
	color: #9ca3af;
}

.leat-debug-badge-local {
	background: rgba(139, 92, 246, 0.2);
	color: #8b5cf6;
}

.leat-debug-badge-pending,
.leat-debug-badge-processing,
.leat-debug-badge-on-hold {
	background: rgba(245, 158, 11, 0.2);
	color: #f59e0b;
}

.leat-debug-badge-completed {
	background: rgba(16, 185, 129, 0.2);
	color: #10b981;
}

.leat-debug-badge-cancelled,
.leat-debug-badge-refunded,
.leat-debug-badge-failed {
	background: rgba(239, 68, 68, 0.2);
	color: #ef4444;
}

.leat-debug-uuid {
	font-family: 'Monaco', 'Menlo', monospace;
	font-size: 11px;
	background: rgba(102, 126, 234, 0.15);
	border: 1px solid rgba(102, 126, 234, 0.3);
	padding: 3px 8px;
	border-radius: 4px;
	color: #8b9aff;
}

.leat-debug-empty {
	color: #6b7280;
	font-style: italic;
}

.leat-debug-points {
	color: #10b981;
	font-size: 14px;
}

.leat-debug-link {
	display: inline-block;
	margin-left: 8px;
	color: #60a5fa;
	text-decoration: none;
	font-size: 14px;
	transition: color 0.2s;
}

.leat-debug-link:hover {
	color: #93c5fd;
}

.leat-debug-no-data {
	color: #9ca3af;
	margin: 0 0 8px 0;
}

.leat-debug-hint {
	color: #6b7280;
	font-size: 12px;
	margin: 0;
}

.leat-debug-pre {
	background: #000000;
	padding: 10px;
	border-radius: 6px;
	border: 1px solid rgba(102, 126, 234, 0.15);
	font-size: 11px;
	font-family: 'Monaco', 'Menlo', monospace;
	overflow-x: auto;
	overflow-y: auto;
	max-height: 200px;
	margin: 0;
	color: #d1d5db;
	white-space: pre-wrap;
	word-wrap: break-word;
	max-width: 100%;
}

.leat-debug-pre::-webkit-scrollbar {
	width: 4px;
	height: 4px;
}

.leat-debug-pre::-webkit-scrollbar-track {
	background: transparent;
	border-radius: 2px;
}

.leat-debug-pre::-webkit-scrollbar-thumb {
	background: rgba(102, 126, 234, 0.4);
	border-radius: 2px;
}

.leat-debug-pre::-webkit-scrollbar-thumb:hover {
	background: rgba(102, 126, 234, 0.6);
}

.leat-debug-meta-item {
	margin-bottom: 14px;
	padding-bottom: 14px;
	border-bottom: 1px solid rgba(102, 126, 234, 0.1);
}

.leat-debug-meta-item:last-child {
	margin-bottom: 0;
	padding-bottom: 0;
	border-bottom: none;
}

.leat-debug-meta-item:hover {
	padding-left: 4px;
	border-left: 2px solid rgba(102, 126, 234, 0.3);
	transition: all 0.2s;
}

.leat-debug-meta-key {
	font-size: 11px;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.5px;
	color: #9ca3af;
	margin-bottom: 6px;
	display: flex;
	align-items: center;
	gap: 8px;
}

.leat-debug-copy {
	background: rgba(255, 255, 255, 0.1);
	border: none;
	color: #9ca3af;
	padding: 4px;
	border-radius: 3px;
	cursor: pointer;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	transition: all 0.2s;
	opacity: 0.6;
}

.leat-debug-copy:hover {
	background: rgba(255, 255, 255, 0.2);
	color: #e0e0e0;
	opacity: 1;
}

.leat-debug-copy:active {
	transform: scale(0.95);
}

.leat-debug-copy.copied {
	background: rgba(16, 185, 129, 0.2);
	color: #10b981;
}

.leat-debug-meta-value {
	max-width: 100%;
	overflow: hidden;
}

.leat-debug-transaction {
	margin: 4px 0;
}

.leat-debug-section-footer {
	background: #000000;
	border-top: 1px solid rgba(102, 126, 234, 0.2);
}

.leat-debug-collapsible .leat-debug-section-title {
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: space-between;
	transition: color 0.2s;
}

.leat-debug-collapsible .leat-debug-section-title:hover {
	color: #d1d5db;
}

.leat-debug-toggle-section .leat-debug-toggle-icon {
	font-size: 10px;
	transition: transform 0.3s;
}

.leat-debug-section-content.leat-debug-expanded + .leat-debug-toggle-icon {
	transform: rotate(180deg);
}

.leat-debug-actions {
	display: flex;
	flex-direction: column;
	gap: 10px;
	margin-bottom: 10px;
}

.leat-debug-action-button {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	padding: 10px 14px;
	background: rgba(239, 68, 68, 0.15);
	border: 1px solid rgba(239, 68, 68, 0.3);
	color: #ef4444;
	border-radius: 6px;
	cursor: pointer;
	font-size: 12px;
	font-weight: 600;
	transition: all 0.2s;
	text-align: center;
	width: 100%;
}

.leat-debug-action-button:hover {
	background: rgba(239, 68, 68, 0.25);
	border-color: rgba(239, 68, 68, 0.5);
	color: #fca5a5;
	box-shadow: 0 0 12px rgba(239, 68, 68, 0.3);
}

.leat-debug-action-button:active {
	transform: scale(0.98);
}

.leat-debug-action-button svg {
	flex-shrink: 0;
}

.leat-debug-action-button.leat-debug-action-loading {
	opacity: 0.6;
	cursor: not-allowed;
	pointer-events: none;
}
