/* Popup Select Modal Styles */

/* Modal Overlay */
.popup-select-overlay {
	position: fixed;
	top: 0;
	left: 0;
	right: 0;
	bottom: 0;
	background: rgba(15, 23, 42, 0.85);
	backdrop-filter: blur(8px);
	-webkit-backdrop-filter: blur(8px);
	z-index: 9999;
	display: flex;
	align-items: center;
	justify-content: center;
	opacity: 0;
	visibility: hidden;
	transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

.popup-select-overlay.active {
	opacity: 1;
	visibility: visible;
}

/* Modal Container */
.popup-select-modal {
	background: linear-gradient(145deg, #1e293b 0%, #0f172a 100%);
	border-radius: 20px;
	width: 90%;
	max-width: 520px;
	max-height: 85vh;
	display: flex;
	flex-direction: column;
	transform: scale(0.85) translateY(30px);
	transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
	overflow: hidden;
	box-shadow: 
		0 25px 50px -12px rgba(0, 0, 0, 0.6),
		0 0 0 1px rgba(255, 255, 255, 0.05),
		inset 0 1px 0 rgba(255, 255, 255, 0.1);
	border: 1px solid rgba(255, 255, 255, 0.08);
}

.popup-select-overlay.active .popup-select-modal {
	transform: scale(1) translateY(0);
}

/* Modal Header */
.popup-select-header {
	padding: 20px 24px;
	background: linear-gradient(135deg, rgba(59, 130, 246, 0.15) 0%, rgba(139, 92, 246, 0.1) 100%);
	border-bottom: 1px solid rgba(255, 255, 255, 0.08);
	display: flex;
	align-items: center;
	justify-content: space-between;
	position: relative;
}

.popup-select-header::before {
	content: '';
	position: absolute;
	left: 24px;
	top: 50%;
	transform: translateY(-50%);
	width: 4px;
	height: 24px;
	background: linear-gradient(180deg, #3b82f6 0%, #8b5cf6 100%);
	border-radius: 2px;
}

.popup-select-title {
	color: #f8fafc;
	font-size: 1.25rem;
	font-weight: 700;
	margin: 0;
	padding-left: 16px;
	letter-spacing: -0.02em;
}

.popup-select-close {
	background: rgba(255, 255, 255, 0.05);
	border: 1px solid rgba(255, 255, 255, 0.1);
	color: #94a3b8;
	font-size: 1.25rem;
	cursor: pointer;
	padding: 8px;
	line-height: 1;
	transition: all 0.25s ease;
	border-radius: 10px;
	width: 36px;
	height: 36px;
	display: flex;
	align-items: center;
	justify-content: center;
}

.popup-select-close:hover {
	color: #f1f5f9;
	background: rgba(239, 68, 68, 0.2);
	border-color: rgba(239, 68, 68, 0.3);
	transform: rotate(90deg);
}

/* Search Box */
.popup-select-search {
	padding: 16px 24px;
	background: rgba(0, 0, 0, 0.2);
	border-bottom: 1px solid rgba(255, 255, 255, 0.05);
	position: relative;
}

.popup-select-search-wrapper {
	position: relative;
}

.popup-select-search-icon {
	position: absolute;
	left: 14px;
	top: 50%;
	transform: translateY(-50%);
	color: #64748b;
	font-size: 0.9rem;
	transition: color 0.25s ease;
	pointer-events: none;
}

.popup-select-search-input {
	width: 100%;
	padding: 14px 14px 14px 44px;
	background: rgba(15, 23, 42, 0.8);
	border: 2px solid rgba(255, 255, 255, 0.08);
	border-radius: 12px;
	color: #f1f5f9;
	font-size: 0.9375rem;
	outline: none;
	transition: all 0.3s ease;
	font-family: inherit;
}

.popup-select-search-input::placeholder {
	color: #64748b;
}

.popup-select-search-input:focus {
	border-color: #3b82f6;
	background: rgba(15, 23, 42, 1);
	box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.15);
}

.popup-select-search-input:focus + .popup-select-search-icon,
.popup-select-search-wrapper:focus-within .popup-select-search-icon {
	color: #3b82f6;
}

/* Table Container */
.popup-select-body {
	flex: 1;
	overflow-y: auto;
	padding: 8px 16px;
	min-height: 200px;
}

/* Table Styles */
.popup-select-table {
	width: 100%;
	border-collapse: separate;
	border-spacing: 0 6px;
}

.popup-select-table thead {
	position: sticky;
	top: 0;
	z-index: 1;
}

.popup-select-table th {
	background: transparent;
	color: #64748b;
	font-weight: 600;
	font-size: 0.75rem;
	text-transform: uppercase;
	letter-spacing: 0.1em;
	padding: 12px 16px 8px;
	text-align: left;
}

.popup-select-table th:first-child {
	width: 50px;
	text-align: center;
	padding-left: 8px;
}

.popup-select-table th:last-child {
	width: 100px;
	text-align: center;
	padding-right: 8px;
}

.popup-select-table td {
	padding: 14px 16px;
	color: #e2e8f0;
	font-size: 0.9375rem;
	background: rgba(255, 255, 255, 0.03);
	border: none;
}

.popup-select-table td:first-child {
	text-align: center;
	color: #64748b;
	font-weight: 600;
	font-size: 0.8125rem;
	border-radius: 12px 0 0 12px;
	padding-left: 8px;
}

.popup-select-table td:last-child {
	text-align: center;
	border-radius: 0 12px 12px 0;
	padding-right: 8px;
}

.popup-select-table tbody tr {
	transition: all 0.25s ease;
	cursor: pointer;
}

.popup-select-table tbody tr:hover td {
	background: rgba(59, 130, 246, 0.12);
}

.popup-select-table tbody tr:hover td:first-child {
	box-shadow: inset 3px 0 0 #3b82f6;
}

.popup-select-table tbody tr.selected td {
	background: rgba(16, 185, 129, 0.15);
}

.popup-select-table tbody tr.selected td:first-child {
	box-shadow: inset 3px 0 0 #10b981;
}

/* Select Button */
.popup-select-btn {
	background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
	color: white;
	border: none;
	padding: 8px 20px;
	border-radius: 8px;
	font-size: 0.8125rem;
	font-weight: 600;
	cursor: pointer;
	transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
	box-shadow: 0 2px 8px rgba(59, 130, 246, 0.3);
	position: relative;
	overflow: hidden;
}

.popup-select-btn::before {
	content: '';
	position: absolute;
	top: 0;
	left: -100%;
	width: 100%;
	height: 100%;
	background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
	transition: left 0.5s ease;
}

.popup-select-btn:hover {
	background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
	transform: translateY(-2px);
	box-shadow: 0 4px 12px rgba(59, 130, 246, 0.4);
}

.popup-select-btn:hover::before {
	left: 100%;
}

.popup-select-btn:active {
	transform: translateY(0);
	box-shadow: 0 2px 6px rgba(59, 130, 246, 0.3);
}

/* Pagination */
.popup-select-footer {
	padding: 16px 24px;
	border-top: 1px solid rgba(255, 255, 255, 0.05);
	display: flex;
	align-items: center;
	justify-content: space-between;
	background: rgba(0, 0, 0, 0.3);
}

.popup-select-info {
	color: #64748b;
	font-size: 0.8125rem;
	font-weight: 500;
}

.popup-select-info strong {
	color: #94a3b8;
}

.popup-select-pagination {
	display: flex;
	align-items: center;
	gap: 6px;
}

.popup-select-page-btn {
	background: rgba(255, 255, 255, 0.05);
	color: #94a3b8;
	border: 1px solid rgba(255, 255, 255, 0.1);
	width: 36px;
	height: 36px;
	border-radius: 10px;
	font-size: 0.875rem;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	transition: all 0.25s ease;
}

.popup-select-page-btn:hover:not(:disabled) {
	background: rgba(59, 130, 246, 0.2);
	border-color: rgba(59, 130, 246, 0.3);
	color: #3b82f6;
}

.popup-select-page-btn:disabled {
	opacity: 0.3;
	cursor: not-allowed;
}

.popup-select-page-input {
	width: 48px;
	height: 36px;
	background: rgba(15, 23, 42, 0.8);
	border: 1px solid rgba(255, 255, 255, 0.1);
	border-radius: 10px;
	color: #e2e8f0;
	text-align: center;
	font-size: 0.875rem;
	font-weight: 600;
	transition: all 0.25s ease;
}

.popup-select-page-input:focus {
	border-color: #3b82f6;
	outline: none;
	box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

/* Trigger Input Styles */
.popup-select-trigger {
	position: relative;
	cursor: pointer;
}

.popup-select-trigger .modern-form-control {
	cursor: pointer;
	background-color: #fff;
	padding-right: 44px;
	transition: all 0.25s ease;
	border: 2px solid #e2e8f0;
}

.popup-select-trigger .modern-form-control:read-only {
	background-color: #fff;
}

.popup-select-trigger:hover .modern-form-control {
	border-color: #3b82f6;
	box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.08);
}

.popup-select-trigger .modern-form-control.has-value {
	border-color: #10b981;
	background-color: rgba(16, 185, 129, 0.02);
}

.popup-select-trigger-icon {
	position: absolute;
	right: 14px;
	top: 50%;
	transform: translateY(-50%);
	color: #94a3b8;
	pointer-events: none;
	font-size: 0.8rem;
	transition: all 0.3s ease;
	width: 24px;
	height: 24px;
	display: flex;
	align-items: center;
	justify-content: center;
	background: rgba(148, 163, 184, 0.1);
	border-radius: 6px;
}

.popup-select-trigger:hover .popup-select-trigger-icon {
	color: #3b82f6;
	background: rgba(59, 130, 246, 0.1);
	transform: translateY(-50%) rotate(180deg);
}

/* Empty State */
.popup-select-empty {
	padding: 48px 24px;
	text-align: center;
	color: #64748b;
	background: transparent;
}

.popup-select-empty i {
	font-size: 3rem;
	margin-bottom: 16px;
	display: block;
	color: #475569;
	opacity: 0.5;
}

.popup-select-empty p {
	margin: 0;
	font-size: 0.9375rem;
	font-weight: 500;
}

/* Scrollbar Styles */
.popup-select-body::-webkit-scrollbar {
	width: 6px;
}

.popup-select-body::-webkit-scrollbar-track {
	background: transparent;
}

.popup-select-body::-webkit-scrollbar-thumb {
	background: rgba(148, 163, 184, 0.3);
	border-radius: 10px;
}

.popup-select-body::-webkit-scrollbar-thumb:hover {
	background: rgba(148, 163, 184, 0.5);
}

/* Row animation */
@keyframes fadeInRow {
	from {
		opacity: 0;
		transform: translateX(-10px);
	}
	to {
		opacity: 1;
		transform: translateX(0);
	}
}

.popup-select-table tbody tr {
	animation: fadeInRow 0.3s ease forwards;
}

.popup-select-table tbody tr:nth-child(1) { animation-delay: 0.02s; }
.popup-select-table tbody tr:nth-child(2) { animation-delay: 0.04s; }
.popup-select-table tbody tr:nth-child(3) { animation-delay: 0.06s; }
.popup-select-table tbody tr:nth-child(4) { animation-delay: 0.08s; }
.popup-select-table tbody tr:nth-child(5) { animation-delay: 0.1s; }
.popup-select-table tbody tr:nth-child(6) { animation-delay: 0.12s; }
.popup-select-table tbody tr:nth-child(7) { animation-delay: 0.14s; }
.popup-select-table tbody tr:nth-child(8) { animation-delay: 0.16s; }
.popup-select-table tbody tr:nth-child(9) { animation-delay: 0.18s; }
.popup-select-table tbody tr:nth-child(10) { animation-delay: 0.2s; }

/* Selected state indicator */
.popup-select-selected-badge {
	display: inline-flex;
	align-items: center;
	gap: 4px;
	background: linear-gradient(135deg, #10b981 0%, #059669 100%);
	color: white;
	padding: 4px 10px;
	border-radius: 20px;
	font-size: 0.75rem;
	font-weight: 600;
}

.popup-select-selected-badge i {
	font-size: 0.625rem;
}

/* Mobile Responsive */
@media (max-width: 576px) {
	.popup-select-modal {
		width: 95%;
		max-height: 90vh;
		margin: 10px;
		border-radius: 16px;
	}

	.popup-select-header {
		padding: 16px 20px;
	}

	.popup-select-title {
		font-size: 1.125rem;
	}

	.popup-select-search {
		padding: 12px 16px;
	}

	.popup-select-body {
		padding: 8px 12px;
	}

	.popup-select-table th,
	.popup-select-table td {
		padding: 10px 12px;
		font-size: 0.8125rem;
	}

	.popup-select-btn {
		padding: 6px 14px;
		font-size: 0.75rem;
	}

	.popup-select-footer {
		padding: 12px 16px;
		flex-direction: column;
		gap: 12px;
	}
}
