/* Polymetric Pagination Styles */
.polymetric-loading {
	text-align: center;
	padding: 30px;
	color: #666;
}

.polymetric-loading i {
	font-size: 24px;
	margin-right: 10px;
}

.polymetric-od-container {
	display: flex;
	flex-direction: column;
	margin-bottom: 30px;
	overflow-y: auto;
	contain: layout style paint;
	will-change: transform;
	transform: translateZ(0);
	scroll-behavior: smooth;
	-webkit-overflow-scrolling: touch;
}

.polymetric-zone-row {
	display: flex;
	align-items: center;
	padding: 8px;
	border-bottom: 1px solid #eee;
	will-change: transform;
	transform: translateZ(0);
	contain: layout style;
	backface-visibility: hidden;
}

.polymetric-zone-row.highlighted {
	background-color: #f0f8ff;
}

.polymetric-zone-info {
	flex: 1;
	min-width: 200px;
}

.polymetric-zone-names {
	text-transform: uppercase;
	font-weight: bold;
	margin-bottom: 0;
	font-size: 13px;
}

.polymetric-zone-select {
	flex: 1;
	min-width: 150px;
}

.polymetric-select-fullscreen {
	width: 100%;
	padding: 6px;
	border: 1px solid #ddd;
	border-radius: 3px;
	background-color: #fff;
	font-size: 13px;
}

.polymetric-pagination-controls {
	display: flex;
	justify-content: space-between;
	align-items: center;
	margin-bottom: 15px;
	padding: 10px;
	background: #f5f5f5;
	border-radius: 4px;
    position: sticky;
    top: 22px;
    z-index: 20;
}

.polymetric-pagination-left {
	display: flex;
	align-items: center;
	gap: 15px;
}

.polymetric-pagination-right {
	display: flex;
	align-items: center;
	gap: 10px;
}

.polymetric-items-per-page {
	margin: 0;
	min-width: 150px;
}

.polymetric-pagination-info {
	color: #666;
	font-size: 14px;
}

.polymetric-pagination-nav {
	display: flex;
	align-items: center;
	gap: 10px;
}

.polymetric-page-info {
	min-width: 80px;
	text-align: center;
}

.polymetric-pagination-bottom {
	display: flex;
	justify-content: center;
	align-items: center;
	gap: 10px;
	margin-top: 15px;
	padding: 10px;
    position: sticky;
    bottom: -16px;
    background: #fff;
    z-index: 20;
}

.polymetric-page-info-bottom {
	padding: 0 15px;
}

/* Virtual Scrolling Matrix Styles */
.polymetric-matrix-container {
	height: 100%;
	overflow: auto;
	position: relative;
	/* border: 1px solid #ddd; */
	background: #fff;
	contain: layout style paint;
	will-change: scroll-position;
}

.polymetric-matrix-header {
	position: sticky;
	top: 0;
	z-index: 20;
	background: #fff;
	/* border-bottom: 2px solid #eee; */
}

.polymetric-matrix-header-row {
	display: flex;
}

.polymetric-matrix-corner {
	width: 150px;
	height: 50px;
	border-right: 1px solid #eee;
	border-bottom: 1px solid #eee;
	display: flex;
	align-items: center;
	justify-content: center;
	font-weight: bold;
	background: #f8f9fa;
	text-transform: uppercase;
	font-size: 12px;
}

.polymetric-matrix-header-cells {
	display: flex;
}

.polymetric-matrix-header-cell {
	width: 90px;
	height: 50px;
	border-right: 1px solid #eee;
	text-align: center;
	line-height: 1.2;
	font-weight: bold;
	text-transform: uppercase;
	font-size: 10px;
	background: #f8f9fa;
	display: flex;
	align-items: center;
	justify-content: center;
	word-wrap: break-word;
	overflow-wrap: break-word;
	hyphens: auto;
	padding: 2px;
	box-sizing: border-box;
}

.polymetric-matrix-body {
	position: relative;
}

.polymetric-matrix-row {
	display: flex;
	height: 50px;
	/* border-bottom: 1px solid #eee; */
}

.polymetric-matrix-row-label {
	width: 150px;
	height: 50px;
	border-right: 1px solid #eee;
	border-bottom: 1px solid #eee;
	background: #f8f9fa;
	display: flex;
	align-items: center;
	padding: 0 10px;
	font-weight: bold;
	text-transform: uppercase;
	font-size: 10px;
	position: sticky;
	left: 0;
	z-index: 10;
	word-wrap: break-word;
	overflow-wrap: break-word;
	hyphens: auto;
	box-sizing: border-box;
	overflow: hidden;
}

.polymetric-matrix-cells {
	display: flex;
}

.polymetric-matrix-cell {
	width: 90px;
	height: 50px;
	border-bottom: 1px solid #eee;
	border-right: 1px solid #eee;
}

.polymetric-matrix-row:nth-child(2n+1) .polymetric-matrix-cells {
	background-color: #ca064d36;
}

.polymetric-matrix-input {
	margin: 0;
	padding: 2px;
	width: 100%;
	overflow: hidden;
}

.polymetric-matrix-input select {
	width: 100%;
	height: 36px;
	border: none;
	background: transparent;
	font-size: 12px;
	text-align: center;
}

.polymetric-matrix-input md-select {
	min-width: 90px;
	height: 36px;
	width: 100%;
	overflow: hidden;
}

.fare-class-row:hover {
    background: #ca064d36;
}

/* Performance optimizations for OD polymetric */
.fare-class-row {
    transition: background-color 0.2s ease;
}

.fare-class-row.highlighted {
    background-color: #f0f8ff;
    border-left: 3px solid #2196F3;
}

/* Optimize scrolling performance */
#polymetric-od-container {
    will-change: transform;
    transform: translateZ(0);
}

/* Matrix optimization for big data */
.polymetric-matrix-optimized {
    contain: layout style paint;
    will-change: transform;
    transform: translateZ(0);
    overflow: hidden;
}

.polymetric-matrix-row-optimized {
    contain: layout style;
    will-change: transform;
    transform: translateZ(0);
    backface-visibility: hidden;
}

.polymetric-matrix-cell-optimized {
    contain: layout style;
    will-change: transform;
    transform: translateZ(0);
}

/* Chunked rendering for large matrices */
.polymetric-matrix-chunk {
    display: none;
}

.polymetric-matrix-chunk.visible {
    display: block;
}

/* Performance optimizations for large datasets */
.polymetric-matrix-container-large {
    height: 60vh;
    overflow: auto;
    contain: layout style paint;
    will-change: scroll-position;
}

.polymetric-matrix-header-sticky {
    position: sticky;
    top: 0;
    z-index: 100;
    background: #fff;
    border-bottom: 2px solid #eee;
}

.polymetric-matrix-left-sticky {
    position: sticky;
    left: 0;
    z-index: 50;
    background: #fff;
    border-right: 2px solid #eee;
}

/* Triangular matrix styles */
.triangular-disabled {
	background-color: #f5f5f5 !important;
	opacity: 0.85;
}

.triangular-disabled-cell {
	width: 80px;
	height: 40px;
	border-right: 1px solid #eee;
	display: flex;
	align-items: center;
	justify-content: center;
	background-color: #f8f9fa;
	position: relative;
}

.triangular-symbol {
	color: #999;
	font-size: 16px;
	font-weight: bold;
}

.triangular-disabled-cell::before {
	content: '';
	position: absolute;
	top: 0;
	left: 0;
	right: 0;
	bottom: 0;
	background: linear-gradient(45deg, transparent 0%, transparent 45%, #ddd 45%, #ddd 55%, transparent 55%, transparent 100%);
	pointer-events: none;
}

.strike-through {
	text-decoration: line-through;
	color: #999;
}

/* Polymetric loader overlay */
.polymetric-loader-overlay {
	position: absolute;
	top: 0;
	left: 0;
	right: 0;
	bottom: 0;
	background: rgba(0, 0, 0, 0.4);
	z-index: 22;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	padding: 24px;
	box-sizing: border-box;
	overflow-y: auto;
}

.polymetric-loader-overlay .polymetric-loader-list {
	background: #fff;
	padding: 16px 20px;
	border-radius: 8px;
	box-shadow: 0 2px 8px rgba(0,0,0,0.1);
	min-width: 320px;
	max-width: 100%;
}

.maincontainer { position: relative; }

/* Loader overlay inline styles → CSS */
.polymetric-loader-list .polymetric-loader-row { margin-bottom: 0; }
.polymetric-loader-list .polymetric-saving-col { align-items: center; justify-content: center; display: flex; }
.polymetric-saving-title { color: #ca064d; }
#polymetric-loader { margin-bottom: 8px; }
.polymetric-loader-item-row { margin-bottom: 0; }
.polymetric-loader-date-row { margin-bottom: 0; margin-top: 10px; }
.polymetric-loader-progress-wrap { margin-top: 4px; }
.polymetric-loader-step-text { font-size: 12px; margin: 0 0 10px 0; color: #666; text-align: right; }
.polymetric-loader-list .polymetric-loader-linear { height: 8px; }
.polymetric-loader-list .polymetric-loader-date-col { align-items: center; display: flex; justify-content: flex-end; }
.polymetric-loader-list .polymetric-loader-text-col { align-items: center; display: flex; }
.fare-class-item { display: flex; flex-direction: column; padding: 8px 0; border-bottom: 1px solid #eee; }

/* Toolbar */
.polymetric-tour-include { float: right; }

/* Right panel / fare classes */
.polymetric-right-panel-body { padding: 20px 0; }
.polymetric-right-panel-input-col { padding-right: 15px; }
.polymetric-pasted-values-box { margin-top: 10px; padding: 10px; border: 1px solid #ddd; border-radius: 4px; background-color: #f9f9f9; }
.polymetric-pasted-values-title { margin: 0 0 10px 0; font-size: 14px; color: #666; }
.polymetric-pasted-value-row { display: flex; align-items: center; justify-content: space-between; padding: 5px 0; border-bottom: 1px solid #eee; }
.polymetric-pasted-value-label { flex: 1; }
.polymetric-fare-class-exists { color: #bb0000; font-size: 12px; text-transform: uppercase; margin-right: 10px; }
.polymetric-fare-class-exists-icon { color: #bb0000; line-height: 36px; margin-right: 8px; }
.polymetric-add-pasted-btn { margin: 0; min-width: 40px; }
.polymetric-pasted-actions { margin-top: 10px; }
.polymetric-add-all-btn { margin-right: 10px; }
.polymetric-sort-toggle { padding: 5px 0; display: flex; align-items: center; gap: 10px; cursor: pointer; color: #999; flex-direction: row; justify-content: flex-start; }
.polymetric-sort-label { font-size: 12px; color: #666; }
.fare-class-meta { display: flex; justify-content: space-between; align-items: center; font-size: 12px; color: #999; margin-bottom: 2px; padding-left: 5px; }
.fare-class-main-row { display: flex; align-items: center; justify-content: space-between; }
.fare-class-value { word-break: break-word; overflow-wrap: anywhere; display: block; padding-left: 5px; }
.fare-class-actions-wrap { white-space: nowrap; }
.fare-class-action-icon { cursor: pointer; padding: 5px; vertical-align: middle; }

/* Main content cards */
.polymetric-card-mb0 { margin-bottom: 0; }

/* Filters */
.polymetric-filter-toggle-wrap { position: relative; }
.polymetric-filters-row { flex-wrap: wrap; }
.polymetric-routes-placeholder { height: 30px; line-height: 30px; }
.polymetric-zones-count { margin-top: 5px; color: #666; font-size: 12px; }
.polymetric-filter-buttons-wrap { padding: 15px 5px; }

/* Polymetric card title */
.polymetric-card-title-full { height: 100%; }

/* Matrix type buttons row */
.polymetric-type-buttons-row { padding-bottom: 10px; position: sticky; top: -24px; z-index: 20; background: #fff; }
.polymetric-type-btn { margin: 0 5px 0 0 !important; }

/* Matrix controls */
.polymetric-matrix-controls-bar { display: flex; align-items: center; margin-bottom: 15px; padding: 10px; background: #f5f5f5; border-radius: 4px; }
.polymetric-matrix-controls-inner { display: flex; align-items: center; gap: 15px; }
.polymetric-matrix-view-info { color: #666; font-size: 14px; }

/* Matrix cell selects (fullscreen) */
.polymetric-matrix-select-fullscreen { width: 100%; height: 36px; border: none; background: transparent; font-size: 12px; text-align: center; }
.polymetric-matrix-select-inline { min-width: 80px; height: 36px; }

/* OD pagination select */
.polymetric-items-per-page-select { width: 100%; }

/* OD zone pair md-input-container */
.polymetric-od-input-container { position: relative; margin-bottom: 0; }
.polymetric-od-md-select { min-width: 120px; }

/* Responsive design for pagination controls */
@media (max-width: 768px) {
    .pagination-controls {
        flex-direction: column;
        gap: 10px;
    }

    .pagination-info {
        text-align: center;
    }
}
