:root {
	--teachers-calendar-gradient: linear-gradient(135deg, #00040b 0%, #2963bd 70%, #00040b 100%);
;
}

/* Teachers Calendar Page */
/* Page Header - Match Home Hero Section Gradient */
section.page-header {
	background: var(--teachers-calendar-gradient) !important;
	background-size: cover;
	background-position: center;
	position: relative;
	overflow: visible;
}

section.page-header::before {
	content: '';
	position: absolute;
	top: 0;
	left: 0;
	right: 0;
	bottom: 0;
	background: url('data:image/svg+xml,<svg width="100" height="100" xmlns="http://www.w3.org/2000/svg"><rect fill="rgba(255,255,255,0.05)" width="50" height="50"/></svg>');
	background-size: 100px 100px;
	opacity: 0.3;
	z-index: 0;
}

section.page-header .container {
	position: relative;
	z-index: 1;
	overflow: visible;
}

/* Header Search Container - Glass Style */
.header-search-container {
	max-width: 600px;
	width: 600px;
	margin: 25px auto 1rem;
	position: relative;
	overflow: visible;
	z-index: 100;
}

@media (max-width: 768px) {
	.header-search-container {
		width: 90%;
		max-width: 90%;
	}
}

@media (max-width: 480px) {
	.header-search-container {
		width: 95%;
		max-width: 95%;
	}
}

.header-search-form {
	width: 100%;
	position: relative !important;
	overflow: visible !important;
	z-index: 100;
}

/* Header Search Input Wrapper - Glass Style */
.header-search-input-wrapper {
	background: rgba(255, 255, 255, 0.25);
	backdrop-filter: blur(10px);
	-webkit-backdrop-filter: blur(10px);
	border: 2px solid rgba(255, 255, 255, 0.4);
	border-radius: 50px;
	padding: 8px 20px;
	display: flex;
	align-items: center;
	gap: 10px;
	position: relative;
	transition: all 0.3s ease;
	width: 600px;
	height: 65px;
	box-sizing: border-box;
}

@media (max-width: 768px) {
	.header-search-input-wrapper {
		width: 100%;
		height: auto;
		min-height: 50px;
		padding: 6px 15px;
	}
}

@media (max-width: 480px) {
	.header-search-input-wrapper {
		width: 100%;
		height: auto;
		min-height: 45px;
		padding: 5px 12px;
		border-radius: 25px;
	}
}

.header-search-input-wrapper:focus-within {
	background: rgba(255, 255, 255, 0.35);
	border-color: rgba(255, 255, 255, 0.6);
	box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.2);
}

.header-search-input {
	flex: 1;
	border: none;
	background: transparent;
	color: white;
	font-size: 1rem;
	padding: 10px 0;
	outline: none;
	font-family: 'Vazirmatn', sans-serif;
}

.header-search-input::placeholder {
	color: rgba(255, 255, 255, 0.7);
}

.header-search-icon {
	font-size: 1.2rem;
	color: rgba(255, 255, 255, 0.9);
	pointer-events: none;
	display: flex;
	align-items: center;
	justify-content: center;
}

.header-search-icon .search-icon-svg {
	width: 1.2rem;
	height: 1.2rem;
	filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.2));
	opacity: 0.9;
}

.header-clear-btn {
	color: rgba(255, 255, 255, 0.9);
	text-decoration: none;
	font-size: 1.2rem;
	padding: 5px 10px;
	border-radius: 50%;
	transition: all 0.2s ease;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 28px;
	height: 28px;
}

.header-clear-btn:hover {
	background: rgba(255, 255, 255, 0.2);
	color: white;
}

/* Update teacher-suggestions positioning and style for header search */
.header-search-form {
	position: relative !important;
	overflow: visible !important;
	z-index: 100;
}

.header-search-form .teacher-suggestions {
	position: absolute;
	top: calc(100% + 0.5rem);
	right: 0;
	left: 0;
	margin-top: 0;
	z-index: 10000;
	background: #ffffff;
	border: 1px solid #e5e7eb;
	border-radius: 10px;
	box-shadow: 0 10px 30px rgba(2,6,23,0.1);
	max-height: 320px;
	overflow-y: auto;
	overflow-x: visible;
	display: none;
}

/* Ensure suggestions show when .show class is added */
.header-search-form .teacher-suggestions.show {
	display: block !important;
}

.teachers-calendar .how-it-works {
	margin: 1rem 0 2rem;
	background: #fff;
	border-radius: 12px;
	padding: 1rem 1.25rem;
	box-shadow: 0 4px 14px rgba(0,0,0,0.06);
}
.teachers-calendar .how-it-works h2 {
	margin: 0 0 .5rem;
	font-size: 1.1rem;
}
.teachers-calendar .how-it-works ol {
	padding-right: 1.25rem;
	margin: 0;
	line-height: 1.9;
}
/* Old search form styles - kept for backward compatibility */
.teacher-search-form {
	display: flex;
	gap: .5rem;
	margin: 1rem 0 1.25rem;
	position: relative; /* for suggestions absolute positioning */
}

/* When search form is in header, override old styles */
.header-search-form.teacher-search-form {
	margin: 0;
}

.teacher-search-input {
	flex: 1;
	border: 1px solid #e2e8f0;
	border-radius: 10px;
	padding: .65rem .9rem;
	background: #fff;
}

.teacher-search-btn {
	border: none;
	background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
	color: #fff;
	border-radius: 10px;
	padding: .65rem 1rem;
	cursor: pointer;
}
/* Autocomplete suggestions */
.teacher-suggestions {
	display: none;
	position: absolute;
	top: 100%;
	right: 0;
	left: 0;
	background: #ffffff;
	border: 1px solid #e5e7eb;
	border-radius: 10px;
	box-shadow: 0 10px 30px rgba(2,6,23,0.1);
	max-height: 320px;
	overflow-y: auto;
	margin-top: .4rem;
	z-index: 1000;
}

/* Show suggestions when .show class is added - consolidated rule */
.teacher-suggestions.show,
.header-search-form .teacher-suggestions.show { 
	display: block !important; 
}

/* Suggestion item styling - consolidated */
.teacher-suggestions .suggestion-item,
.header-search-form .teacher-suggestions .suggestion-item {
	padding: 12px 20px;
	cursor: pointer;
	transition: all 0.2s ease;
	display: flex;
	align-items: flex-start;
	gap: 12px;
	border-bottom: 1px solid #f0f0f0;
	background: #ffffff;
}

.teacher-suggestions .suggestion-item:first-child,
.header-search-form .teacher-suggestions .suggestion-item:first-child {
	border-top-left-radius: 10px;
	border-top-right-radius: 10px;
}

.teacher-suggestions .suggestion-item:last-child,
.header-search-form .teacher-suggestions .suggestion-item:last-child {
	border-bottom: none;
	border-bottom-left-radius: 10px;
	border-bottom-right-radius: 10px;
}

.teacher-suggestions .suggestion-item:hover,
.header-search-form .teacher-suggestions .suggestion-item:hover {
	background: #f8f9fa;
	border-color: #dee2e6;
}

.teacher-suggestions .suggestion-content,
.header-search-form .teacher-suggestions .suggestion-content {
	flex: 1;
	display: flex;
	flex-direction: column;
	gap: 6px;
	min-width: 0;
}

.teacher-suggestions .suggestion-text,
.header-search-form .teacher-suggestions .suggestion-text {
	color: #212529;
	font-weight: 600;
	font-size: 1rem;
	line-height: 1.5;
	display: block;
	word-wrap: break-word;
}

.teacher-suggestions .suggestion-meta,
.header-search-form .teacher-suggestions .suggestion-meta {
	font-size: 0.875rem;
	color: #6c757d;
	margin-top: 0;
	font-weight: 400;
	display: block;
	line-height: 1.4;
}
/* Letter Grouping & Headers */
.letter-section { 
	margin: 1rem 0;
}

.letter-header {
	
	width: 100%;
	display: flex;
	align-items: center;
	justify-content: flex-start;
	gap: 12px;
	background: linear-gradient(135deg, #fafcff 0%, #f3f6fb 100%);
	border: 1px solid #e5e7eb;
	color: #0f172a;
	border-radius: 14px;
	padding: 14px 18px;
	font-weight: 900;
	font-size: 1rem;
	font-family: inherit;
	z-index: 10;
	box-shadow: 0 3px 12px rgba(15, 23, 42, 0.05);
	cursor: pointer;
	transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
	text-align: right;
}


.letter-header > * {
	pointer-events: none;
}


.letter-header:hover {
	background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
	color: #ffffff;
	border-color: transparent;
	box-shadow: 0 6px 20px rgba(102, 126, 234, 0.25);
	transform: translateY(-1px);
}

.letter-header:active {
	transform: translateY(0);
	box-shadow: 0 3px 12px rgba(102, 126, 234, 0.2);
}

.letter-header:focus {
	outline: 2px solid rgba(102, 126, 234, 0.5);
	outline-offset: 2px;
}

.letter-header:focus:not(:focus-visible) {
	outline: none;
}

/* Letter Text (the actual letter like ا، ب، etc.) */
.letter-header .letter-text {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 42px;
	height: 42px;
	background: linear-gradient(135deg, #50a5ff 0%, #2963bd 100%);
	color: #ffffff;
	border-radius: 12px;
	font-size: 1.4rem;
	font-weight: 900;
	flex-shrink: 0;
	box-shadow: 0 3px 10px rgba(102, 126, 234, 0.3);
	transition: all 0.25s ease;
}

.letter-header:hover .letter-text {
	background: rgba(255, 255, 255, 0.2);
	box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1);
}

/* Teacher Count Badge */
.letter-header .letter-count {
	flex: 1;
	font-size: 0.9rem;
	font-weight: 600;
	color: #6b7280;
	transition: color 0.25s ease;
}

.letter-header:hover .letter-count {
	color: rgba(255, 255, 255, 0.9);
}

/* Chevron Arrow */
.letter-header .letter-chevron {
	font-size: 0.8rem;
	color: #9ca3af;
	transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), color 0.25s ease;
	margin-right: auto;
}

.letter-header:hover .letter-chevron {
	color: rgba(255, 255, 255, 0.8);
}

/* Collapsed State */
.letter-section.collapsed .letter-header .letter-chevron {
	transform: rotate(-90deg);
}

.letter-section.collapsed .letter-header {
	border-radius: 14px;
}

/* Letter Items - Collapsible Container */
.letter-items {
	margin-top: 0;
	overflow-y: auto;
	overflow-x: hidden;
	max-height: 600px; /* Reasonable max height with scrolling */
	opacity: 1;
	transition: 
		max-height 0.4s cubic-bezier(0.4, 0, 0.2, 1),
		opacity 0.3s ease,
		margin-top 0.3s ease,
		padding 0.3s ease;
	padding-top: 10px;
	-webkit-overflow-scrolling: touch; /* Smooth scrolling on iOS */
	scrollbar-width: thin; /* Firefox */
	scrollbar-color: rgba(102, 126, 234, 0.5) transparent; /* Firefox */
}

/* Custom scrollbar for WebKit browsers */
.letter-items::-webkit-scrollbar {
	width: 8px;
}

.letter-items::-webkit-scrollbar-track {
	background: transparent;
	border-radius: 4px;
}

.letter-items::-webkit-scrollbar-thumb {
	background: rgba(102, 126, 234, 0.5);
	border-radius: 4px;
}

.letter-items::-webkit-scrollbar-thumb:hover {
	background: rgba(102, 126, 234, 0.7);
}

.letter-section.collapsed .letter-items {
	max-height: 0;
	opacity: 0;
	padding-top: 0;
	margin-top: 0;
}

.letter-items { margin-top: .6rem; }
.teachers-list .teacher-item {
	background: #fff;
	border: 1px solid #eef2f7;
	border-radius: 12px;
	padding: .8rem 1rem;
	margin-bottom: .6rem;
	box-shadow: 0 3px 10px rgba(0,0,0,0.04);
}
.teacher-name {
	display: flex;
	align-items: center;
	gap: 0;
	font-size: 1rem;
	font-family: var(--font-display);
	background: transparent;
	border: none;
	cursor: pointer;
	color: #111827;
	width: 100%;
	text-align: right;
}
.teacher-meta {
	margin-top: .35rem;
	font-size: .85rem;
	color: #6b7280;
	display: flex;
	gap: .8rem;
	flex-wrap: wrap;
}
.teacher-meta .meta {
	background: #f8fafc;
	padding: .2rem .5rem;
	border-radius: 8px;
}

/* Lazy loading placeholder */
.teachers-lazy-placeholder {
	text-align: center;
	color: #6b7280;
	margin: 2rem 0;
	padding: 2rem;
}
.teachers-lazy-placeholder .lazy-placeholder-text {
	font-size: 1.1rem;
	margin: 0;
}

.no-results {
	text-align: center;
	color: #6b7280;
	margin: 1.5rem 0;
}

.no-results-icon {
	display: flex;
	justify-content: center;
	align-items: center;
	margin-bottom: 20px;
}

.no-results-icon img {
	max-width: 300px;
	width: 100%;
	height: auto;
	opacity: 0.8;
}

.no-results h2 {
	font-size: 1.5rem;
	color: #495057;
	margin-bottom: 10px;
}

/* Perfect Alphabet Index Navigation - Professional Implementation */
.teachers-calendar {
	position: relative;
}

.teachers-calendar > .container { 
	position: relative; 
	padding-left: 0; /* No padding needed - index is absolutely positioned */
}

/* Side Index Container - Left Side Positioning from Teachers List Start */
.side-index {
	position: fixed;
	left: 0;
	top: 0; /* Will be set by JavaScript to start from teachers list */
	z-index: 1000;
	pointer-events: none;
	display: flex;
	align-items: flex-start;
	justify-content: center;
	width: auto;
	height: auto; /* Will be set by JavaScript */
	transition: top 0.2s ease-out, height 0.2s ease-out; /* Smooth position updates */
}

/* Index List - Perfect Styling - Left Side */
.side-index ul {
	list-style: none;
	margin: 0;
	padding: 10px 6px;
	background: rgba(255, 255, 255, 0.98);
	backdrop-filter: blur(20px);
	-webkit-backdrop-filter: blur(20px);
	border: 1px solid rgba(229, 231, 235, 0.8);
	border-left: none;
	border-radius: 0 20px 20px 0;
	box-shadow: 
		4px 0 20px rgba(0, 0, 0, 0.08),
		0 0 0 1px rgba(0, 0, 0, 0.02) inset;
	display: flex;
	flex-direction: column;
	gap: 2px;
	pointer-events: auto;
	height: 100%; /* Fill available height */
	overflow-y: auto;
	overflow-x: hidden;
	scrollbar-width: none; /* Firefox */
	-ms-overflow-style: none; /* IE/Edge */
	scroll-behavior: smooth;
}

.side-index ul::-webkit-scrollbar {
	display: none; /* Chrome/Safari */
}

/* Index Letter Button - Perfect Design */
.side-index .index-letter {
	border: none;
	background: transparent;
	color: #4b5563;
	font-size: 12px;
	line-height: 1;
	width: 32px;
	height: 32px;
	min-width: 32px;
	min-height: 32px;
	display: flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	border-radius: 12px;
	font-family: var(--font-display, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif);
	font-weight: 700;
	letter-spacing: 0;
	transition: all 0.15s cubic-bezier(0.4, 0, 0.2, 1);
	position: relative;
	-webkit-tap-highlight-color: transparent;
	touch-action: manipulation;
	user-select: none;
	-webkit-user-select: none;
}

/* Hover State */
.side-index .index-letter:hover {
	color: #111827;
	background: rgba(102, 126, 234, 0.12);
	transform: scale(1.08);
}

/* Active State - Clear Visual Feedback */
.side-index .index-letter.active {
	color: #ffffff;
	background: linear-gradient(135deg, #50a5ff 0%, #2963bd 100%);
	box-shadow: 
		0 2px 8px rgba(102, 126, 234, 0.3),
		0 0 0 2px rgba(255, 255, 255, 0.2) inset;
	transform: scale(1.1);
	font-weight: 800;
}

/* Active State Animation */
.side-index .index-letter.active::after {
	content: '';
	position: absolute;
	inset: -2px;
	border-radius: 14px;
	background: linear-gradient(135deg, #50a5ff 0%, #2963bd 100%);
	opacity: 0.2;
	z-index: -1;
	animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
	0%, 100% {
		opacity: 0.2;
		transform: scale(1);
	}
	50% {
		opacity: 0.3;
		transform: scale(1.05);
	}
}

/* Focus State for Accessibility */
.side-index .index-letter:focus {
	outline: 2px solid rgba(102, 126, 234, 0.5);
	outline-offset: 2px;
}

.side-index .index-letter:focus:not(:focus-visible) {
	outline: none;
}

/* Tablet Responsive */
@media (max-width: 1024px) {
	.side-index ul {
		padding: 8px 5px;
		border-radius: 0 18px 18px 0;
	}
	
	.side-index .index-letter {
		width: 30px;
		height: 30px;
		min-width: 30px;
		min-height: 30px;
		font-size: 11.5px;
		border-radius: 11px;
	}
	
	/* Responsive max-height for letter items on tablet with scrolling */
	.letter-items {
		max-height: 550px;
		overflow-y: auto;
		overflow-x: hidden;
		-webkit-overflow-scrolling: touch;
	}
}

/* Mobile Responsive */
@media (max-width: 768px) {
	.side-index {
		left: -2px;
	}
	
	.side-index ul {
		padding: 8px 4px;
		border-radius: 0 16px 16px 0;
		gap: 1.5px;
		box-shadow: 
			3px 0 15px rgba(0, 0, 0, 0.1),
			0 0 0 1px rgba(0, 0, 0, 0.02) inset;
}
	
	.side-index .index-letter {
		width: 28px;
		height: 28px;
		min-width: 28px;
		min-height: 28px;
		font-size: 11px;
		border-radius: 10px;
	}
	
	.side-index .index-letter:hover {
		transform: scale(1.05);
	}
	
.side-index .index-letter.active {
		transform: scale(1.08);
	}
	
	.side-index .index-letter.active::after {
		border-radius: 12px;
	}
	
	/* Responsive max-height for letter items on mobile with scrolling */
	.letter-items {
		max-height: 500px;
		overflow-y: auto;
		overflow-x: hidden;
		-webkit-overflow-scrolling: touch;
	}
	
	/* Mobile-friendly scrollbar - slightly wider for touch */
	.letter-items::-webkit-scrollbar {
		width: 10px;
	}
}

/* Small Mobile */
@media (max-width: 480px) {
	.side-index {
		left: -3px;
	}
	
	.side-index ul {
		padding: 6px 3px;
		border-radius: 0 14px 14px 0;
		gap: 1px;
	}
	
	.side-index .index-letter {
		width: 26px;
		height: 26px;
		min-width: 26px;
		min-height: 26px;
		font-size: 10px;
		border-radius: 9px;
	}
	
	.side-index .index-letter.active::after {
		border-radius: 11px;
	}
	
	/* Responsive max-height for letter items on small mobile with scrolling */
	.letter-items {
		max-height: 400px;
		overflow-y: auto;
		overflow-x: hidden;
		-webkit-overflow-scrolling: touch;
	}
	
	/* Small mobile-friendly scrollbar - wider for easier touch */
	.letter-items::-webkit-scrollbar {
		width: 12px;
	}
}

/* High DPI Displays */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
	.side-index ul {
		border-width: 0.5px;
	}
}

/* Dark Mode Support (if needed in future) */
@media (prefers-color-scheme: dark) {
	.side-index ul {
		background: rgba(30, 30, 30, 0.98);
		border-color: rgba(255, 255, 255, 0.1);
		box-shadow: 
			4px 0 20px rgba(0, 0, 0, 0.3),
			0 0 0 1px rgba(255, 255, 255, 0.05) inset;
	}
	
	.side-index .index-letter {
		color: #9ca3af;
	}
	
	.side-index .index-letter:hover {
		color: #ffffff;
		background: rgba(102, 126, 234, 0.2);
	}
}

/* Ensure consistent font on this page */
.teachers-calendar, .teachers-calendar * {
	font-family: var(--font-display);
}

/* Presence Modal */
.presence-modal {
	position: fixed;
	inset: 0;
	background: rgba(0,0,0,0.45);
	display: none;
	align-items: center;
	justify-content: center;
	padding: 1rem;
	z-index: 1000;
}
.presence-modal.is-visible {
	display: flex;
}
.presence-modal-content {
	background: #fff;
	border-radius: 14px;
	box-shadow: 0 20px 50px rgba(0,0,0,0.2);
	max-width: 720px;
	width: 100%;
	padding: 1rem;
}
.presence-close {
	position: absolute;
	right: 1.25rem;
	top: 1rem;
	border: none;
	background: transparent;
	font-size: 1.5rem;
	cursor: pointer;
}
.presence-header {
	padding: .7rem .5rem 1.1rem;
	border-bottom: 1px solid #eef2f7;
}
.presence-title {
	margin: 0 0 .3rem;
	font-size: 1.15rem;
}
.presence-teacher {
	margin: 0;
	color: #6b7280;
}
.presence-meta {
	margin: .2rem 0 0;
	color: #4b5563;
	font-size: .9rem;
}
.presence-days {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: .7rem;
	padding: 1rem .2rem;
}
@media (min-width: 700px) {
	.presence-days {
		grid-template-columns: repeat(3, minmax(0, 1fr));
	}
}
.presence-day {
	border: 1px solid #eef2f7;
	border-radius: 12px;
	padding: .8rem .9rem;
	background: #fff;
	display: flex;
	flex-direction: column;
	gap: .35rem;
}
.presence-day .day-name {
	font-weight: 700;
}
.presence-day .time-range {
	color: #111827;
}
.presence-classes {
	display: flex;
	flex-direction: column;
	gap: .35rem;
}
.presence-class {
	background: #f8fafc;
	border: 1px dashed #e5e7eb;
	border-radius: 10px;
	padding: .6rem .7rem;
}
.presence-class.empty {
	text-align: center;
	color: #9ca3af;
	font-size: .9rem;
}
.presence-class-title {
	font-weight: 700;
	margin-bottom: .25rem;
}
.presence-class-meta {
	display: flex;
	flex-wrap: wrap;
	gap: .4rem .8rem;
	color: #4b5563;
	font-size: .9rem;
}
.presence-day.absent .time-range {
	color: #9ca3af;
}
.presence-day .day-action {
	margin-top: .25rem;
	border: none;
	border-radius: 10px;
	padding: .5rem .6rem;
	cursor: pointer;
	font-family: var(--font-display);
	font-weight: 800;
	letter-spacing: .01em;
}
.presence-day.present .day-action {
	background: #eef2ff;
	color: #4338ca;
}
.presence-day.absent .day-action {
	background: #f3f4f6;
	color: #6b7280;
	cursor: not-allowed;
}
.presence-footer {
	padding: .6rem .2rem 0;
	display: flex;
	justify-content: flex-end;
}
.presence-close-btn {
	border: none;
	background: #f3f4f6;
	color: #111827;
	border-radius: 10px;
	padding: .55rem .9rem;
	cursor: pointer;
}


