/* TicketSuite Component Styles */

.rd-tckt-system-wrapper {
	position: fixed;
	top: 0;
	left: 0;
	right: 0;
	bottom: 0;
	width: 100%;
	height: 100vh;
	display: flex;
	flex-direction: column;
	background: var(--tckt-suite-bg, #fafafa);
	z-index: 1000;
}

/* Dark mode support */
.rd-tckt-system-wrapper[dark-mode] {
	--tckt-suite-bg: #1a1a1a;
}

.rd-tckt-system-header {
	flex-shrink: 0;
	padding: 16px 24px;
	background: var(--tckt-suite-header-bg, #ffffff);
	border-bottom: 1px solid var(--tckt-suite-header-border, #e0e0e0);
	box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
	position: relative;
	z-index: 100;
}

.rd-tckt-system-wrapper[dark-mode] .rd-tckt-system-header {
	--tckt-suite-header-bg: #1e1e1e;
	--tckt-suite-header-border: #333333;
}

.rd-tckt-system-header h1 {
	margin: 0;
	font-size: 20px;
	font-weight: 600;
	color: var(--tckt-suite-header-text, #333333);
}

.rd-tckt-system-wrapper[dark-mode] .rd-tckt-system-header h1 {
	--tckt-suite-header-text: #e0e0e0;
}

.rd-tckt-system-grid {
	position: relative;
	width: 100%;
	height: 100%;
	flex: 1;
	overflow: auto;
	padding: 16px 0;
	min-height: 0; /* Allow flex shrinking */
}

.rd-tckt-system-cell {
	display: flex;
	flex-direction: column;
	background: var(--tckt-suite-cell-bg, #ffffff);
	border: 1px solid var(--tckt-suite-cell-border, #e0e0e0);
	border-radius: 8px;
	overflow: hidden;
	min-height: 0; /* Allow flex shrinking */
}

/* Dark mode support */
.rd-tckt-system-wrapper[dark-mode] .rd-tckt-system-cell {
	--tckt-suite-cell-bg: #1e1e1e;
	--tckt-suite-cell-border: #333333;
}

.rd-tckt-system-cell-header {
	padding: 12px 16px;
	border-bottom: 1px solid var(--tckt-suite-cell-border, #e0e0e0);
	background: var(--tckt-suite-header-bg, #f5f5f5);
	flex-shrink: 0;
}

.rd-tckt-system-wrapper[dark-mode] .rd-tckt-system-cell-header {
	--tckt-suite-header-bg: #252525;
}

.rd-tckt-system-cell-header h3 {
	margin: 0;
	font-size: 14px;
	font-weight: 600;
	color: var(--tckt-suite-header-text, #333333);
}

.rd-tckt-system-wrapper[dark-mode] .rd-tckt-system-cell-header h3 {
	--tckt-suite-header-text: #e0e0e0;
}

.rd-tckt-system-cell-content {
	flex: 1;
	overflow: hidden;
	position: relative;
	min-height: 0; /* Allow flex shrinking */
}

/* Nested ticket system should fill its cell */
.rd-tckt-system-cell-content > pc-ticket-lane {
	display: block;
	width: 100%;
	height: 100%;
	position: absolute;
	top: 0;
	left: 0;
	overflow: auto;
}

/* Column Resize Handles (dedicated element between cells, matching row resize style) */
.rd-tckt-col-resize-handle {
	position: relative;
	width: 12px;
	height: 100%;
	margin: 0 -4px; /* Center on the gap, overlap into adjacent cells */
	cursor: col-resize;
	z-index: 10000;
	display: flex;
	align-items: center;
	justify-content: center;
	transition: opacity 0.2s;
	pointer-events: auto;
	background: transparent;
	flex-shrink: 0;
}

.rd-tckt-col-resize-handle::before {
	content: "";
	width: 3px;
	height: 100%;
	background: transparent;
	border-radius: 2px;
	transition: all 0.2s;
	opacity: 0.5;
}

.rd-tckt-col-resize-handle:hover::before {
	background: var(--tckt-button-bg, #4285f4);
	width: 4px;
	opacity: 1;
	box-shadow: 0 0 8px rgba(66, 133, 244, 0.5);
}

.rd-tckt-col-resize-handle:active::before {
	background: var(--tckt-button-bg, #4285f4);
	opacity: 1;
}

/* Make the cell container position relative for absolute positioning */
.rd-tckt-system-cell {
	position: relative;
}

/* Global cursor when resizing columns */
body.rd-tckt-resizing-columns,
body.rd-tckt-resizing-columns * {
	cursor: col-resize !important;
	user-select: none !important;
}

/* Row Resize Handles */
.rd-tckt-row-resize-handle {
	position: relative;
	width: 100%;
	height: 12px;
	margin: -4px 0; /* Center on the gap */
	cursor: row-resize;
	z-index: 10000;
	display: flex;
	align-items: center;
	justify-content: center;
	transition: opacity 0.2s;
	pointer-events: auto;
	background: transparent;
}

.rd-tckt-row-resize-handle::before {
	content: "";
	width: 100%;
	height: 3px;
	background: var(--tckt-border-color, #ccc);
	border-radius: 2px;
	transition: all 0.2s;
	opacity: 0.5;
}

.rd-tckt-row-resize-handle:hover::before {
	background: var(--tckt-button-bg, #4285f4);
	height: 4px;
	opacity: 1;
	box-shadow: 0 0 8px rgba(66, 133, 244, 0.5);
}

.rd-tckt-row-resize-handle:active::before {
	background: var(--tckt-button-bg, #4285f4);
	opacity: 1;
}

/* Global cursor when resizing rows */
body.rd-tckt-resizing-rows,
body.rd-tckt-resizing-rows * {
	cursor: row-resize !important;
	user-select: none !important;
}

/* Responsive: Stack vertically on small screens */
@media (max-width: 768px) {
	.rd-tckt-system-grid {
		grid-template-columns: 1fr !important;
		grid-template-rows: auto !important;
	}
	
	.rd-tckt-system-cell {
		min-height: 400px;
	}
	
	/* Hide resize handles on mobile */
	.rd-tckt-col-resize-handle,
	.rd-tckt-row-resize-handle {
		display: none;
	}
}
