/* =================================================================== */
/* CSS for Assignment Schedule Editor (schedule-edit.php)              */
/* All rules are scoped to #interactiveScheduleArea to prevent leaks.  */
/* =================================================================== */

/* --- Main Layout & Top Bar --- */
#interactiveScheduleArea .top-controls-bar {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0.5rem;
	padding-bottom: 1rem;
	margin-bottom: 1.5rem;
}
#interactiveScheduleArea .top-controls-bar .btn {
	white-space: nowrap;
}
#interactiveScheduleArea .schedule-top-notes {
	flex-grow: 1;
	min-width: 150px;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
	font-size: 5em;
	padding-left: 0.75rem;
	line-height: 1.5;
}
#interactiveScheduleArea {
	display: flex;
	flex-direction: row;
	align-items: flex-start;
}

/* --- Left Column: Time Gutter --- */
#interactiveScheduleArea #timeGutterColumn {
	min-width: 90px;
	flex-shrink: 0;
	flex-grow: 0;
	flex-basis: auto;
	background-color: #f8f9fa;
	border-right: 1px solid #dee2e6;
	display: flex;
	flex-direction: column;
	position: relative;
}
#interactiveScheduleArea .time-gutter-header {
	padding: 8px 5px;
	text-align: center;
	font-weight: bold;
	font-size: 0.8em;
	border-bottom: 1px solid #dee2e6;
	height: 41px;
	box-sizing: border-box;
	display: flex;
	align-items: center;
	justify-content: center;
	flex-shrink: 0;
	z-index: 35;
	position: sticky;
	top: 0;
}
#interactiveScheduleArea .time-gutter-scrollable-content {
	flex-grow: 1;
	position: relative;
}
#interactiveScheduleArea .time-gutter-week-header-placeholder {
	height: 29px;
	box-sizing: border-box;
	background-color: var(--bs-secondary, #6c757d);
	color: var(--bs-light, white);
	font-weight: bold;
	font-size: 0.8em;
	border-bottom: 1px solid #5a6268;
	top: 41px;
	z-index: 26;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 0 5px;
}
#interactiveScheduleArea .time-gutter-hour-block {
	height: calc(12px * 4);
	border-top: 1px solid #ced4da;
	box-sizing: border-box;
	display: flex;
	flex-direction: column;
	justify-content: flex-start;
}
#interactiveScheduleArea .time-gutter-major-label {
	font-size: 0.75em;
	font-weight: bold;
	color: #495057;
	height: 12px;
	line-height: 12px;
	text-align: right;
	padding-right: 5px;
	padding-top: 2px;
}
#interactiveScheduleArea .time-gutter-minor-labels {
	display: flex;
	flex-direction: column;
	justify-content: space-around;
	flex-grow: 1;
}
#interactiveScheduleArea .time-gutter-minute-label {
	font-size: 0.65em;
	color: #6c757d;
	height: 12px;
	line-height: 12px;
	display: flex;
	align-items: center;
	padding-left: 5px;
}

/* --- Middle Column: Schedule Canvas --- */
#interactiveScheduleArea #scheduleCanvasScrollable {
	flex-grow: 1;
	margin-right: 1rem;
	overflow-y: visible;
	position: relative;
}
#interactiveScheduleArea .schedule-canvas {
	display: flex;
	flex-direction: column;
	position: relative;
}
#interactiveScheduleArea .calendar-header-row {
	display: flex;
	flex-direction: row;
	z-index: 30;
	height: 41px;
	box-sizing: border-box;
	background-color: rgb(248, 249, 250);
	border-bottom: 1px solid #dee2e6;
	position: sticky;
	top: 0;
}
#interactiveScheduleArea .week-specific-date-header-row {
	display: flex;
	flex-direction: row;
	background-color: var(--bs-secondary, #6c757d);
	color: var(--bs-light, white);
	font-weight: bold;
	border-bottom: 1px solid #5a6268;
	top: 41px;
	z-index: 25;
	height: 29px;
	box-sizing: border-box;
	margin-bottom: 0;
	position: sticky;
}
#interactiveScheduleArea .week-date-cell {
	flex-grow: 1;
	flex-basis: 0;
	min-width: 80px;
	padding: 0px 5px;
	text-align: center;
	font-size: 0.8em;
	border-left: 1px solid #868e96;
	box-sizing: border-box;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
	display: flex;
	align-items: center;
	justify-content: center;
	height: 100%;
}
#interactiveScheduleArea .week-date-cell:first-child {
	border-left: none;
}
#interactiveScheduleArea .week-date-cell.out-of-range-date-header {
	opacity: 0.6;
}
#interactiveScheduleArea .week-date-cell.today-date-header {
	background-color: var(--bs-primary-bg-subtle, #cfe2ff);
	color: var(--bs-primary-text-emphasis, #004085);
	font-weight: bold;
}
#interactiveScheduleArea .canvas-week-segment {
	display: flex;
	flex-direction: column;
}
#interactiveScheduleArea .calendar-week-data-row {
	display: flex;
	flex-direction: row;
	margin-top: 0;
}
#interactiveScheduleArea .calendar-header-cell {
	flex-grow: 1;
	flex-basis: 0;
	min-width: 80px;
	border-left: 1px solid #e9ecef;
	box-sizing: border-box;
	padding: 8px 5px;
	text-align: center;
	font-weight: bold;
	font-size: 0.9em;
	height: 100%;
	display: flex;
	align-items: center;
	justify-content: center;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}
#interactiveScheduleArea .calendar-header-cell:first-child {
	border-left: none;
}
#interactiveScheduleArea .calendar-day-cell {
	position: relative;
	display: flex;
	flex-direction: column;
	flex-grow: 1;
	flex-basis: 0;
	min-width: 80px;
	border-left: 1px solid #e9ecef;
	box-sizing: border-box;
}
#interactiveScheduleArea .calendar-day-cell:first-child {
	border-left: none;
}
#interactiveScheduleArea .calendar-day-cell.day-out-of-schedule-range {
	background-color: #f1f3f5;
	position: relative;
}
#interactiveScheduleArea .calendar-day-cell.day-out-of-schedule-range::before {
	content: '';
	position: absolute;
	top: 0; left: 0; right: 0; bottom: 0;
	background-image: repeating-linear-gradient( 45deg, transparent, transparent 7px, rgba(0, 0, 0, 0.08) 7px, rgba(0, 0, 0, 0.08) 8px );
	opacity: 0.7;
	pointer-events: none;
	z-index: 1;
}
#interactiveScheduleArea .calendar-day-cell.today {
	background-color: #e9f5ff;
}
#interactiveScheduleArea .time-slots-container {
	position: relative;
	flex-grow: 1;
	overflow: hidden;
}
#interactiveScheduleArea .time-slot {
	height: 12px;
	box-sizing: border-box;
	position: relative;
	overflow: hidden;
}
#interactiveScheduleArea .time-slot.hour-mark {
	border-top: 1px solid #ced4da;
}
#interactiveScheduleArea .time-slot.drop-target-hover {
	background-color: #d0eaff;
	outline: 1px dashed #007bff;
}

/* --- Right Column: Color Palette --- */
#interactiveScheduleArea #colorPaletteColumn {
	flex: 0 0 220px;
	background-color: #f8f9fa;
	border: 1px solid #dee2e6;
	border-radius: 0.375rem;
	box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
	display: flex;
	flex-direction: column;
	position: sticky;
	top: 0;
	align-self: flex-start;
	height: calc(100vh - 60px);
	z-index: 20;
}
#interactiveScheduleArea .palette-header {
	padding: 8px 10px;
	text-align: center;
	font-weight: bold;
	border-bottom: 1px solid #dee2e6;
	font-size: 0.9em;
	height: 41px;
	box-sizing: border-box;
	display: flex;
	align-items: center;
	justify-content: center;
}
#interactiveScheduleArea .palette-content {
	padding: 10px;
	flex-grow: 1;
	overflow-y: auto;
}
#interactiveScheduleArea .palette-item {
	padding: 16px 12px;
	margin-bottom: 12px;
	border-radius: 0.5rem;
	font-size: 1em;
	font-weight: bold;
	cursor: grab;
	border: 1px solid rgba(0,0,0,0.1);
	text-align: center;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
	display: flex;
	align-items: center;
	justify-content: center;
}
#interactiveScheduleArea .palette-item:hover {
	opacity: 0.85;
	box-shadow: 0 0 5px rgba(0,0,0,0.2);
}

/* --- Assignment Block Styles --- */
#interactiveScheduleArea .assignment-block {
	position: absolute;
	left: 3px; right: 3px;
	font-size: 0.75em;
	padding: 1px 2px;
	border-radius: 3px;
	overflow: hidden;
	z-index: 5;
	border: 1px solid rgba(0,0,0,0.1);
	cursor: grab;
	display: flex;
	align-items: center;
	justify-content: center;
}
#interactiveScheduleArea .assignment-text-content {
	width: 100%;
	text-align: center;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
	padding: 1px 0;
}
#interactiveScheduleArea .assignment-block.opening {
	background-color: rgba(255, 193, 7, 0.6);
	border: 1px dashed #ffc107;
	color: #333;
}
#interactiveScheduleArea .assignment-block.dragging,
#interactiveScheduleArea .assignment-block.resizing {
	opacity: 0.7;
	cursor: grabbing;
	z-index: 1000 !important;
	box-shadow: 0 4px 8px rgba(0,0,0,0.3);
}
#interactiveScheduleArea .resize-handle {
	position: absolute;
	left: 0;
	right: 0;
	height: 6px;
	background-color: rgba(0, 0, 0, 0.1);
	z-index: 6;
}
#interactiveScheduleArea .resize-handle:hover {
	background-color: rgba(0, 0, 0, 0.3);
}
#interactiveScheduleArea .resize-handle-top {
	top: 0;
	cursor: ns-resize;
}
#interactiveScheduleArea .resize-handle-bottom {
	bottom: 0;
	cursor: ns-resize;
}
#interactiveScheduleArea .delete-assignment-icon {
	position: absolute;
	top: 1px; right: 1px;
	font-size: 0.9em;
	color: rgba(255, 255, 255, 0.7);
	cursor: pointer;
	z-index: 7;
	padding: 1px;
	line-height: 1;
}
#interactiveScheduleArea .delete-assignment-icon:hover {
	color: rgba(255, 0, 0, 0.9);
	transform: scale(1.1);
}
#interactiveScheduleArea .assignment-block.clipped-end::after {
	content: '';
	position: absolute;
	bottom: 0; left: 0; right: 0;
	height: 10px;
	background-color: #e9ecef;
	background-image: repeating-linear-gradient( -45deg, transparent, transparent 2px, rgba(220, 53, 69, 0.65) 2px, rgba(220, 53, 69, 0.65) 4px );
	pointer-events: none;
	z-index: 1;
}

#interactiveScheduleArea .assignment-block.conflict-warning {
	/* Use a subtle yellow from Bootstrap's color system as the base */
	background-color: var(--bs-warning-bg-subtle);
	border-color: var(--bs-warning-border-subtle);
	color: var(--bs-warning-text-emphasis);
}

/* Add the yellow hatch pattern as an overlay */
#interactiveScheduleArea .assignment-block.conflict-warning::after {
	content: '';
	position: absolute;
	top: 0;
	left: 0;
	right: 0;
	bottom: 0;
	background-image: repeating-linear-gradient(
		45deg,
		transparent,
		transparent 4px,
		rgba(255, 193, 7, 0.25) 4px, /* --bs-warning color with transparency */
		rgba(255, 193, 7, 0.25) 6px
	);
	pointer-events: none;
	z-index: 1;
}

/* Ensure the delete icon is still visible on a conflicted block */
#interactiveScheduleArea .assignment-block.conflict-warning .delete-assignment-icon {
	color: rgba(0, 0, 0, 0.4);
}
#interactiveScheduleArea .assignment-block.conflict-warning .delete-assignment-icon:hover {
	color: #000;
}

#interactiveScheduleArea .time-slot.unavailable-slot {
	/* A subtle yellow from Bootstrap's color system */
	background-color: var(--bs-warning-bg-subtle);
	
	/* The same yellow hatch pattern we use for conflicted blocks */
	background-image: repeating-linear-gradient(
		45deg,
		transparent,
		transparent 4px,
		rgba(255, 193, 7, 0.25) 4px, /* --bs-warning color with transparency */
		rgba(255, 193, 7, 0.25) 6px
	);
	z-index: 2; /* Ensure it's visible but behind assignment blocks */
}

#interactiveScheduleArea .assignment-block.ghosting {
	pointer-events: none;
}

#interactiveScheduleArea .assignment-block.dimmed {
	opacity: 0.25;
	transition: opacity 0.2s ease-in-out;
}