/**
 * Program Display Styles
 */
section#accordion.accordion
	> .inner
	.accordion-item
	input[type="checkbox"]:checked
	+ .accordion-summary
	+ .accordion-content {
	max-height: 100%;
}

.acalog-program {
	margin-bottom: 40px;
	position: relative;
}

.acalog-error {
	color: #c00;
	padding: 10px;
	border: 1px solid #c00;
	background-color: #fff0f0;
	margin: 10px 0;
}

.acalog-course-header {
	text-transform: capitalize;
}

.acalog-program-description {
	margin-bottom: 20px;
	background-color: #f9f9f9;
	padding: 15px;
	border-left: 4px solid #007cba;
	margin-bottom: 25px;
	border-radius: 0 4px 4px 0;
}

/* Table styles */
.acalog-cores-table {
	width: 100%;
	border-collapse: collapse;
	margin-bottom: 30px;
	background-color: white;
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
	border-radius: 6px;
	overflow: visible;
	line-height: 1.5;
}

.acalog-cores-table > thead {
	background-color: #d9edf7;
}

.acalog-cores-table th,
.acalog-cores-table td {
	text-align: left;
	vertical-align: middle;
	border-bottom: 1px solid #e6e6e6;
	overflow: visible;
	font-weight: 300;
}

.acalog-cores-table thead th {
	font-weight: 600;
	color: #495057;
	font-size: 17.5px;
	letter-spacing: 0.5px;
	border-bottom: 2px solid #dee2e6;
	padding: 1em;
}

.acalog-course-header {
	width: 75%;
}

.acalog-hours-header {
	width: 25%;
	text-align: center;
}

/* Core/Term headers */
.acalog-core-header {
	font-weight: 600 !important;
	color: #495057;
	font-size: 18.75px;
	text-transform: none;
	padding: 1em;
}

.depth-1 .acalog-core-header {
	padding-left: 24px;
	font-size: 17.5px;
}

.depth-2 .acalog-core-header {
	background-color: #f8f9fa !important;
	padding-left: 32px;
	font-size: 16.25px;
}

.acalog-core-description {
	font-style: italic;
	padding: 12px 16px;
	color: #6c757d;
	font-size: 17.5px;
}

/* Shared core styling */
.shared-core .acalog-core-header {
	font-style: italic;
	color: #6f42c1; /* Purple color to distinguish shared cores */
}

.shared-core .acalog-core-header::after {
	content: " (Shared)";
	font-weight: normal;
	font-size: 14px;
	color: #6c757d;
	margin-left: 8px;
}

/* Sub-term side-by-side layout */
.acalog-subterm-group-row {
	background-color: #f0f4f7;
	border-top: 2px solid #0073aa;
}

.acalog-subterm-group-header {
	font-weight: 600;
	color: #23282d;
	font-size: 18px;
	padding: 14px 16px;
}

.acalog-subterm-columns-row {
	background-color: #fff;
}

.acalog-subterm-term-row {
	background-color: #f7f9fc;
}

.acalog-subterm-term-label {
	font-weight: 600;
	padding: 8px 12px;
	text-transform: uppercase;
	letter-spacing: 0.05em;
	border-top: 1px solid #d4dbe5;
}
.acalog-subterm-columns-cell {
	padding: 0;
}

.acalog-cores-table td.acalog-total-hours-value {
	padding: 1em 0;
}
.acalog-cores-table td.acalog-total-hours-value > strong {
	font-weight: 600;
}
th.acalog-subterm-term-label {
	text-transform: capitalize;
	font-weight: 600;
	padding-left: 1.55em;
}

.acalog-subterm-columns {
	display: grid;
	grid-template-columns: repeat(var(--subterm-count, 2), minmax(0, 1fr));
	gap: 12px;
}

.acalog-subterm-column {
	border: 1px solid #ccd4dd;
	border-radius: 6px;
	background-color: #f7f9fc;
	display: flex;
	flex-direction: column;
	overflow: hidden;
}

.acalog-subterm-column-header {
	background-color: #d9edf7;
	border-bottom: 1px solid #c7d2de;
	padding: 12px 16px;
	font-weight: 600;
	font-size: 15px;
	color: #1f2933;
}

.acalog-subterm-table {
	width: 100%;
	border-collapse: collapse;
	background-color: #ffffff;
}

.acalog-subterm-course-row:nth-child(even) td {
	background-color: #f4f7fb;
}

.acalog-subterm-course-content {
	padding: 12px 14px;
	font-size: 15px;
	line-height: 1.45;
	color: #1f2933;
	border-bottom: 1px solid #dfe3ea;
	overflow: visible;
}

.acalog-subterm-course-hours {
	width: 60px;
	padding: 12px 12px 12px 16px;
	font-size: 15px;
	font-weight: 600;
	color: #1f2933;
	text-align: right;
	border-left: 1px solid #dfe3ea;
	border-bottom: 1px solid #dfe3ea;
	white-space: nowrap;
}

.acalog-subterm-column .acalog-subterm-course-row:last-child td {
	border-bottom: none;
}

.acalog-subterm-course-title {
	font-weight: 600;
	color: #1f2933;
}

.acalog-subterm-course-details summary {
	cursor: pointer;
}

.acalog-subterm-course-notes {
	margin-top: 8px;
	font-size: 14px;
	color: #374151;
	border-left: 3px solid #93c5fd;
	padding-left: 10px;
}

.acalog-subterm-course-notes.after {
	border-color: #34d399;
}

.acalog-subterm-note + .acalog-subterm-note {
	margin-top: 6px;
}

.acalog-subterm-note-title {
	display: block;
	margin-bottom: 4px;
}

.acalog-subterm-column-total {
	margin-top: auto;
	padding: 12px 16px;
	background-color: #eef2f7;
	border-top: 1px solid #d3dae3;
	text-align: right;
	color: #1f2933;
	font-weight: 600;
}

.acalog-subterm-column-total strong {
	font-weight: 300;
}
.acalog-subterm-total-row {
	display: none !important;
}
.acalog-subterm-totals-row {
	background-color: #f0f0f1;
	border-top: 2px solid #0073aa;
	font-weight: 600;
}

.acalog-subterm-total {
	padding: 12px 16px;
	text-align: right;
	color: #1d2327;
}

/* Responsive behavior for sub-terms */
@media screen and (max-width: 1024px) {
	.acalog-subterm-columns {
		grid-template-columns: 1fr;
	}
}

/* Print styles for sub-terms */
@media print {
	.acalog-subterm-course-content,
	.acalog-subterm-course-hours {
		page-break-inside: avoid;
	}

	.acalog-subterm-columns-row {
		page-break-after: avoid;
	}
}

/* Course rows */
.acalog-course-row {
	background-color: white;
}

.acalog-course-title {
	color: #212529;
	overflow: visible;
	position: relative;
	width: 100%;
	line-height: 1em;
	padding: 1em;
}

.acalog-course-title strong {
	font-size: 17.5px;
	margin-bottom: 4px;
	font-weight: 300;
}

/* Ensure parent containers don't clip content */
.acalog-course-row .acalog-course-title {
	overflow: visible !important;
	height: auto !important;
	min-height: 20px !important;
	cursor: pointer;
}

/* Ensure details content is properly contained within table layout */
.acalog-course-row {
	overflow: visible !important;
}

.acalog-course-row details {
	overflow: visible !important;
	height: auto !important;
}

.acalog-subterm-course-details summary,
.acalog-course-row summary {
	display: list-item !important;
	border-bottom: none !important;
	padding: 0 !important;
	font-weight: 100 !important;
}

.acalog-subterm-course-details {
	overflow: visible;
	height: auto !important;
}

.acalog-subterm-course-details summary::-webkit-details-marker {
	display: inline;
}

.acalog-subterm-course-details .acalog-course-description {
	margin-top: 8px;
	padding: 8px 12px;
	background-color: #f8f9fa;
	border-radius: 4px;
	border-left: 3px solid #93c5fd;
	font-size: 1em;
	line-height: 1.4;
	max-height: none !important;
}

.acalog-subterm-course-details:not([open]) .acalog-course-description {
	display: none;
}

.acalog-subterm-course-details[open] .acalog-course-description {
	display: block;
	max-height: none;
}

.acalog-course-row summary::marker {
	display: inline;
}

.acalog-course-row td {
	overflow: visible !important;
	position: relative;
}

th.acalog-hours-header {
	text-align: center !important;
}

.acalog-core-row.depth-1:last-child th {
	text-align: right;
	color: #000;
	padding-right: 2.25em !important;
}

.acalog-core-row.depth-2 .acalog-core-header {
	text-align: right !important;
	padding-right: 35px
	;
	font-style: italic;
}

.acalog-course-hours {
	text-align: center !important;
	color: #495057;
	font-size: 17.5px;
	vertical-align: middle;
}

/* Total hours rows styling */
.acalog-total-row {
	border-top: 2px solid #0d6efd !important;
}

.acalog-total-row strong {
	color: #0d6efd;
	font-weight: 300;
}

.acalog-total-row .acalog-course-hours {
	color: #0d6efd;
	font-weight: 300;
	font-size: 18.75px;
	text-align: center;
}

/* Remove borders on last row */
.acalog-cores-table tbody tr:last-child td {
	border-bottom: none;
}

/* Improved spacing between sections */
.acalog-core-row + .acalog-course-row {
	border-top: 1px solid #dee2e6;
}

/* Variant tabs */
.acalog-variants {
	margin-bottom: 30px;
}

.acalog-variant-tabs {
	display: flex;
	flex-wrap: wrap;
	border-bottom: 2px solid #ddd;
	margin-bottom: 20px;
	background-color: #f9f9f9;
	padding: 5px 5px 0 5px;
	border-radius: 8px 8px 0 0;
}

.acalog-variant-tab {
	padding: 12px 20px;
	background-color: #e9e9e9;
	border: 1px solid #ccc;
	border-bottom: none;
	margin-right: 3px;
	margin-bottom: -2px;
	cursor: pointer;
	border-radius: 6px 6px 0 0;
	font-size: 17.5px;
	font-weight: 300;
	color: #555;
	transition: all 0.3s ease;
	position: relative;
	min-width: 120px;
	text-align: center;
}

.acalog-variant-tab:hover {
	background-color: #f0f0f0;
	color: #333;
	transform: translateY(-1px);
}

.acalog-variant-tab.active {
	background-color: #fff;
	border-color: #ddd;
	border-bottom: 2px solid #fff;
	color: #333;
	font-weight: 600;
	box-shadow: 0 -2px 4px rgba(0, 0, 0, 0.1);
}

.acalog-variant-content {
	display: none;
	animation: fadeIn 0.3s ease-in;
}

.acalog-variant-content.active {
	display: block;
}

@keyframes fadeIn {
	from {
		opacity: 0;
	}
	to {
		opacity: 1;
	}
}

/* Responsive tabs */
@media (max-width: 768px) {
	.acalog-variant-tabs {
		flex-direction: column;
		align-items: stretch;
	}

	.acalog-variant-tab {
		margin-right: 0;
		margin-bottom: 2px;
		border-radius: 4px;
		text-align: left;
	}

	.acalog-variant-tab.active {
		border-bottom: 1px solid #ccc;
	}

	.acalog-cores-table {
		font-size: 17.5px;
	}

	.acalog-cores-table th,
	.acalog-cores-table td {
		padding: 8px 12px;
	}

	.acalog-course-header {
		width: 70%;
	}

	.acalog-hours-header {
		width: 30%;
		text-align: center;
	}
}

.acalog-variant-content .acalog-cores-table {
	box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
	border-radius: 4px;
	overflow: visible;
}

.acalog-program h2 {
	color: #333;
	border-bottom: 2px solid #007cba;
	padding-bottom: 10px;
	margin-bottom: 20px;
}

/* Adhoc notes styling */
.acalog-adhoc-row {
	background-color: #f8f9fa;
	border-left: 0;
}

.acalog-adhoc-row > td:first-child,
.acalog-adhoc-row > th:first-child {
	padding-left: 12px;
}

.acalog-adhoc-row > td:first-child::before,
.acalog-adhoc-row > th:first-child::before {
	content: "•";
	display: inline-block;
	margin-right: 10px;
	font-size: 2em;
}

.acalog-adhoc-content {
	font-style: italic;
	color: #495057;
	padding: 8px 12px;
}

.acalog-adhoc-content strong {
	color: #343a40;
	font-style: normal;
}

.acalog-or-row .acalog-course-title {
	font-style: normal;
}

.acalog-or {
	font-weight: 600;
	padding: 0 8px;
}

/* Improved course description styling */
.acalog-course-description {
	margin-top: 8px;
	padding: 8px 12px;
	background-color: #f8f9fa;
	border-radius: 4px;
	border-left: 3px solid #dee2e6;
	font-size: 1em;
	line-height: 1.4;
}

.acalog-total-hours-value {
	text-align: right !important;
	padding-right: 2.25em !important;
	font-weight: 600 !important;
	white-space: nowrap !important;
}

.acalog-total-hours-row {
	border-top: 1px solid #ddd;
}

/* Program-level total (shown at the very end) */
.acalog-program-total-row {
	border-top: 2px solid #333;
	background-color: #f5f5f5;
}

.acalog-program-total-row .acalog-total-hours-label,
.acalog-program-total-row .acalog-total-hours-value {
	padding-top: 12px;
	padding-bottom: 12px;
	font-size: 1.1em;
}

/* OR group course details styling */
.acalog-or-course-details {
	margin-bottom: 12px;
}

.acalog-or-course-details summary {
	cursor: pointer;
	user-select: none;
}

.acalog-or-separator {
	margin: 8px 0;
	font-weight: 600;
	font-size: 0.8em;
	text-transform: lowercase;
}

.acalog-or-course-description {
	margin-top: 8px;
	padding: 12px;
	background-color: #f8f9fa;
	border-radius: 4px;
	border-left: 3px solid #0d6efd;
	font-size: 0.95em;
	line-height: 1.5;
	position: relative;
	/* NOT absolute - stays in normal flow */
}

.acalog-or-row .acalog-course-title {
	font-style: normal;
}

.acalog-or {
	font-weight: 600;
	padding: 0 8px;
}
