/* Transfer Matrix Styles */

.transfer-matrix-wrapper {
	margin: 20px 0;
}

/* Selection Dropdowns */
.transfer-matrix-selection {
	display: flex;
	gap: 20px;
	margin-bottom: 20px;
	flex-wrap: wrap;
}

.transfer-matrix-field {
	flex: 1;
	min-width: 200px;
}

.transfer-matrix-field label {
	display: block;
	margin-bottom: 5px;
	font-weight: 600;
}

.transfer-matrix-select {
	width: 100%;
	padding: 8px 12px;
	border: 1px solid #ddd;
	border-radius: 4px;
	font-size: 14px;
	background-color: #fff;
}

.transfer-matrix-select:focus {
	outline: none;
	border-color: #0073aa;
	box-shadow: 0 0 0 1px #0073aa;
}

/* Results Container */
.transfer-matrix-results {
	margin-top: 20px;
}

.transfer-matrix-header {
	margin-bottom: 15px;
}

.transfer-matrix-count {
	font-size: 16px;
	font-weight: 600;
	color: #333;
}

.transfer-matrix-table-container {
	overflow-x: auto;
}

.transfer-matrix-table-footer {
	margin-top: 12px;
	margin-bottom: 0;
	font-size: 13px;
	color: #555;
	line-height: 1.5;
}

/* DataTables Customization */
.transfer-matrix-table {
	width: 100% !important;
}

.transfer-matrix-table tbody tr {
	cursor: pointer;
	transition: background-color 0.2s;
}

.transfer-matrix-table tbody tr:hover {
	background-color: #f5f5f5;
}

/* Loading State */
.transfer-matrix-loading {
	text-align: center;
	padding: 40px;
	color: #666;
}

/* Error State */
.transfer-matrix-error {
	background-color: #f8d7da;
	color: #721c24;
	padding: 12px;
	border-radius: 4px;
	margin: 20px 0;
}

/* Modal Styles - Works with both jQuery UI Dialog and custom fallback */
#transfer-matrix-modal {
	display: none; /* Hidden by default */
}

/* Custom Modal Fallback Styles (used when jQuery UI is not available) */
#transfer-matrix-modal:not(.ui-dialog-content) {
	position: fixed;
	z-index: 999999;
	left: 0;
	top: 0;
	width: 100%;
	height: 100%;
	overflow: auto;
}

.transfer-matrix-modal-overlay {
	position: absolute;
	left: 0;
	top: 0;
	width: 100%;
	height: 100%;
	background-color: rgba(0, 0, 0, 0.5);
}

/* Hide overlay when jQuery UI Dialog is active */
#transfer-matrix-modal.ui-dialog-content .transfer-matrix-modal-overlay {
	display: none;
}

.transfer-matrix-modal-content {
	position: relative;
	z-index: 1000000;
	background-color: #fefefe;
	margin: 5% auto;
	padding: 0;
	border: 1px solid #888;
	width: 90%;
	max-width: 800px;
	max-height: 80vh;
	overflow-y: auto;
	border-radius: 4px;
	box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

/* When jQuery UI Dialog is active, reset some styles */
#transfer-matrix-modal.ui-dialog-content .transfer-matrix-modal-content {
	position: static;
	z-index: auto;
	margin: 0;
	width: 100%;
	max-width: none;
	max-height: none;
	border: none;
	border-radius: 0;
	box-shadow: none;
}

.transfer-matrix-modal-header {
	padding: 20px;
	border-bottom: 1px solid #ddd;
	display: flex;
	justify-content: space-between;
	align-items: center;
	background-color: #f9f9f9;
}

/* Hide custom header when jQuery UI Dialog is active (jQuery UI provides its own) */
#transfer-matrix-modal.ui-dialog-content .transfer-matrix-modal-header {
	display: none;
}

.transfer-matrix-modal-header h3 {
	margin: 0;
	font-size: 20px;
}

.transfer-matrix-modal-close {
	color: #aaa;
	font-size: 28px;
	font-weight: bold;
	cursor: pointer;
	background: none;
	border: none;
	padding: 0;
	width: 30px;
	height: 30px;
	line-height: 30px;
	text-align: center;
}

.transfer-matrix-modal-close:hover,
.transfer-matrix-modal-close:focus {
	color: #000;
}

/* Hide custom close button when jQuery UI Dialog is active (jQuery UI provides its own) */
#transfer-matrix-modal.ui-dialog-content .transfer-matrix-modal-close {
	display: none;
}

.transfer-matrix-modal-body {
	padding: 20px;
}

#transfer-matrix-modal-loading {
	text-align: center;
	padding: 40px;
	color: #666;
}

/* Ensure dialog content is scrollable when using jQuery UI */
.ui-dialog-content {
	overflow-y: auto;
	max-height: 70vh;
}

/* Detail View Styles (matching CourseAtlas format) */
.detailViewer {
	padding: 10px;
}

.sectionHeader {
	font-weight: bold;
	font-size: 16px;
	margin: 20px 0 10px 0;
	color: #333;
	border-bottom: 2px solid #0073aa;
	padding-bottom: 5px;
}

.sectionHeader:first-child {
	margin-top: 0;
}

.courseListContainer {
	background-color: #f9f9f9;
	border: 1px solid #ddd;
	border-radius: 4px;
	padding: 15px;
	margin-bottom: 15px;
}

.courseDetailContainer {
	padding: 0;
}

.courseId {
	font-weight: 600;
	font-size: 16px;
	color: #0073aa;
	margin-bottom: 8px;
}

.courseDesc {
	color: #666;
	margin: 8px 0;
	line-height: 1.5;
}

.courseCreditsLine,
.courseMinGradeLine {
	margin: 8px 0;
	color: #333;
}

.courseCreditsLine .label,
.courseMinGradeLine .label {
	font-weight: 600;
	margin-right: 8px;
}

.transfer-matrix-basic-detail {
	padding: 20px;
}

.transfer-matrix-basic-detail h4 {
	margin-top: 0;
	color: #0073aa;
}

.transfer-matrix-basic-detail p {
	margin: 10px 0;
	line-height: 1.6;
}

.transfer-matrix-basic-detail strong {
	color: #333;
}

.transfer-matrix-basic-detail em {
	color: #666;
	font-style: italic;
}

.error {
	color: #d32f2f;
	padding: 10px;
	background-color: #ffebee;
	border-radius: 4px;
	margin: 10px 0;
}

/* Course Lookup Specific Styles */
.transfer-matrix-course-lookup-wrapper {
	margin: 20px 0;
}

.transfer-matrix-course-lookup-selection {
	display: flex;
	gap: 20px;
	margin-bottom: 20px;
	flex-wrap: wrap;
}

.transfer-matrix-course-lookup-results {
	margin-top: 20px;
}

/* Responsive Design */
@media (max-width: 768px) {
	.transfer-matrix-selection,
	.transfer-matrix-course-lookup-selection {
		flex-direction: column;
		gap: 15px;
	}

	.transfer-matrix-field {
		min-width: 100%;
	}

	/* Dialog width handled by jQuery UI */

	.transfer-matrix-table {
		font-size: 14px;
	}

	/* DataTables responsive will handle table on mobile */
}

@media (max-width: 480px) {
	/* Dialog responsive behavior handled by jQuery UI */
	.ui-dialog {
		width: 95% !important;
		margin: 2.5% auto !important;
	}
}
