.tq-schoolcal {
	--tq-brand: #4a6b5a;
	--tq-brand-dark: #3a5548;
	--tq-brand-light: #eef4f1;
	--tq-brand-border: rgba(74, 107, 90, 0.16);
	--tq-section-border: rgba(74, 107, 90, 0.4);
	--tq-text: #22302b;
	--tq-muted: #57685f;
	--tq-border: #d7e3de;
	--tq-radius: 16px;

	font-family: 'IBM Plex Sans Arabic', Tahoma, Arial, sans-serif;
	color: var(--tq-text);
	width: 100%;
	max-width: 100%;
	margin: 24px 0;
	box-sizing: border-box;
	border: 3px solid var(--tq-brand);
	border-radius: var(--tq-radius);
	overflow: hidden;
	background: #ffffff;
}

.tq-schoolcal *,
.tq-schoolcal *::before,
.tq-schoolcal *::after {
	box-sizing: inherit;
}

/* ----- الرأس ----- */

.tq-schoolcal-header {
	background: linear-gradient(135deg, #5c7d6c 0%, var(--tq-brand) 100%);
	color: #ffffff;
	text-align: center;
	padding: 16px 20px;
}

.tq-schoolcal-header-title-row {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 10px;
	margin-bottom: 8px;
}

.tq-schoolcal-header-icon {
	display: inline-flex;
	width: 26px;
	height: 26px;
}

.tq-schoolcal-header-icon svg {
	width: 100%;
	height: 100%;
}

.tq-schoolcal-title {
	margin: 0;
	font-size: 24px;
	font-weight: 700;
}

.tq-schoolcal-subtitle {
	margin: 0;
	font-size: 15px;
	font-weight: 400;
	opacity: 0.9;
}

/* ----- تنبيه ----- */

.tq-schoolcal-disclaimer {
	display: flex;
	align-items: center;
	gap: 10px;
	background: #fdf3e6;
	border-bottom: 1.5px solid #f0d9b5;
	color: #8a6416;
	padding: 12px 20px;
	font-size: 13.5px;
	font-weight: 600;
	line-height: 1.6;
	text-align: right;
}

/* ----- بلوك الدولة ----- */

.tq-schoolcal-country-block {
	margin: 16px 20px 0;
	padding: 16px;
	background: var(--tq-brand-light);
	border: 2px solid var(--tq-section-border);
	border-radius: 14px;
}

.tq-schoolcal-country-label {
	display: flex;
	align-items: center;
	gap: 8px;
	margin: 0 0 10px;
	font-size: 15px;
	font-weight: 700;
	color: var(--tq-brand-dark);
}

.tq-schoolcal-step-badge {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 22px;
	height: 22px;
	border-radius: 50%;
	background: var(--tq-brand);
	color: #ffffff;
	flex-shrink: 0;
}

.tq-schoolcal-select {
	width: 100%;
	padding: 12px 40px;
	border: 1.5px solid var(--tq-border);
	border-radius: 10px;
	background-color: #ffffff;
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2357685f' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
	background-repeat: no-repeat;
	background-position: left 14px center;
	background-size: 16px;
	font-family: inherit;
	font-size: clamp(13.5px, 3.8vw, 16px);
	font-weight: 700;
	color: var(--tq-text);
	text-align: center;
	text-align-last: center;
	-webkit-appearance: none;
	-moz-appearance: none;
	appearance: none;
	cursor: pointer;
}

.tq-schoolcal-select:focus {
	outline: none;
	border-color: var(--tq-brand);
	box-shadow: 0 0 0 3px var(--tq-brand-border);
}

/* ----- الجسم ----- */

.tq-schoolcal-body {
	background: #ffffff;
	padding: 20px;
}

/* ----- بطاقة الحالة + العد التنازلي ----- */

.tq-schoolcal-status-card {
	background: var(--tq-brand-light);
	border: 2px solid var(--tq-section-border);
	border-radius: 14px;
	padding: 18px 16px;
	margin-bottom: 18px;
	text-align: center;
}

.tq-schoolcal-status-top {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 8px;
	margin-bottom: 14px;
	min-height: 53px;
}

.tq-schoolcal-year-label {
	font-size: clamp(12px, 3.6vw, 14px);
	font-weight: 700;
	color: var(--tq-muted);
	white-space: nowrap;
	max-width: 100%;
}

.tq-schoolcal-status-badge {
	display: inline-block;
	padding: 6px 14px;
	border-radius: 999px;
	background: var(--tq-brand);
	color: #ffffff;
	font-size: 13.5px;
	font-weight: 700;
}

.tq-schoolcal-status-badge.is-break {
	background: #b8863f;
}

.tq-schoolcal-status-badge.is-summer {
	background: #4c7fa8;
}

.tq-schoolcal-countdown {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 2px;
	min-height: 68px;
	justify-content: center;
}

.tq-schoolcal-countdown-value {
	display: inline-flex;
	align-items: baseline;
	gap: 4px;
	line-height: 1.1;
}

.tq-schoolcal-countdown-number {
	font-size: 42px;
	font-weight: 800;
	color: var(--tq-brand-dark);
	font-variant-numeric: tabular-nums;
}

.tq-schoolcal-countdown-unit {
	font-size: 19px;
	font-weight: 700;
	color: var(--tq-brand-dark);
}

.tq-schoolcal-countdown-label {
	font-size: 14.5px;
	font-weight: 600;
	color: var(--tq-muted);
}

.tq-schoolcal-swipe-hint {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 6px;
	margin-top: 10px;
	padding: 7px 12px;
	border: 1.5px solid var(--tq-brand-border);
	border-radius: 20px;
	background: var(--tq-brand-light);
	font-size: 12.5px;
	font-weight: 600;
	color: var(--tq-brand-dark);
	opacity: 1;
	max-height: 40px;
	overflow: hidden;
	transition: opacity 0.25s ease, max-height 0.25s ease, margin-top 0.25s ease;
}

.tq-schoolcal-swipe-hint.tq-hint-dismissed {
	opacity: 0;
	max-height: 0;
	margin-top: 0;
	padding-top: 0;
	padding-bottom: 0;
	pointer-events: none;
}

.tq-schoolcal-swipe-hint-arrow {
	display: inline-block;
	color: var(--tq-brand);
	font-weight: 800;
	animation: tq-schoolcal-hint-nudge 1.4s ease-in-out infinite;
}

.tq-schoolcal-swipe-hint-arrow:last-child {
	animation-delay: 0.2s;
}

@keyframes tq-schoolcal-hint-nudge {
	0%, 100% { transform: translateX(0); }
	50% { transform: translateX(-3px); }
}

@media ( prefers-reduced-motion: reduce ) {
	.tq-schoolcal-swipe-hint-arrow {
		animation: none;
	}
}

/* ----- بطاقات الأقسام ----- */

.tq-schoolcal-section-card {
	background: var(--tq-brand-light);
	border: 2px solid var(--tq-section-border);
	border-radius: 14px;
	padding: 18px 16px;
	margin-bottom: 18px;
}

.tq-schoolcal-section-title {
	margin: 0 0 14px;
	font-size: 16px;
	font-weight: 700;
	color: var(--tq-brand-dark);
}

/* ----- المسار الزمني ----- */

.tq-schoolcal-timeline-wrap {
	position: relative;
}

.tq-schoolcal-timeline-wrap::before,
.tq-schoolcal-timeline-wrap::after {
	content: '';
	position: absolute;
	top: 0;
	bottom: 12px;
	width: 30px;
	pointer-events: none;
	z-index: 2;
	opacity: 1;
	transition: opacity 0.15s ease;
}

.tq-schoolcal-timeline-wrap.tq-no-fade-start::before {
	opacity: 0;
}

.tq-schoolcal-timeline-wrap.tq-no-fade-end::after {
	opacity: 0;
}

.tq-schoolcal-timeline-wrap::before {
	right: 0;
	background: linear-gradient( to left, var(--tq-brand-light), rgba(238, 244, 241, 0) );
}

.tq-schoolcal-timeline-wrap::after {
	left: 0;
	background: linear-gradient( to right, var(--tq-brand-light), rgba(238, 244, 241, 0) );
}

.tq-schoolcal-timeline {
	display: flex;
	overflow-x: auto;
	gap: 6px;
	padding-top: 14px;
	padding-bottom: 6px;
	min-height: 80px;
	-webkit-overflow-scrolling: touch;
	scrollbar-width: thin;
	scrollbar-color: var(--tq-brand) var(--tq-border);
}

.tq-schoolcal-timeline::-webkit-scrollbar {
	height: 6px;
}

.tq-schoolcal-timeline::-webkit-scrollbar-track {
	background: var(--tq-border);
	border-radius: 999px;
}

.tq-schoolcal-timeline::-webkit-scrollbar-thumb {
	background: var(--tq-brand);
	border-radius: 999px;
}

.tq-schoolcal-timeline-seg {
	position: relative;
	flex: 0 0 auto;
	min-width: 96px;
	padding: 12px 10px 10px;
	border-radius: 10px;
	background: #ffffff;
	border: 1.5px solid var(--tq-border);
	text-align: center;
}

.tq-schoolcal-timeline-seg.is-break {
	background: #fbf3e5;
	border-color: #eddab0;
}

.tq-schoolcal-timeline-seg.is-current {
	border-color: var(--tq-brand);
	box-shadow: 0 0 0 2px var(--tq-brand-border);
}

.tq-schoolcal-timeline-here {
	position: absolute;
	top: -10px;
	left: 50%;
	transform: translateX(-50%);
	background: var(--tq-brand);
	color: #ffffff;
	font-size: 10.5px;
	font-weight: 700;
	padding: 2px 8px;
	border-radius: 999px;
	white-space: nowrap;
}

.tq-schoolcal-timeline-label {
	display: block;
	font-size: 12.5px;
	font-weight: 700;
	color: var(--tq-brand-dark);
	margin-bottom: 4px;
}

.tq-schoolcal-timeline-seg.is-break .tq-schoolcal-timeline-label {
	color: #8a6416;
}

.tq-schoolcal-timeline-range {
	display: block;
	font-size: 11px;
	font-weight: 600;
	color: var(--tq-muted);
}

/* ----- الجدول ----- */

.tq-schoolcal-table {
	display: flex;
	flex-direction: column;
	gap: 8px;
	min-height: 160px;
}

.tq-schoolcal-row {
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	gap: 10px;
	background: #ffffff;
	border: 1.5px solid var(--tq-border);
	border-radius: 10px;
	padding: 10px 14px;
}

.tq-schoolcal-row.is-past {
	opacity: 0.55;
}

.tq-schoolcal-row.is-next {
	border-color: var(--tq-brand);
	background: #ffffff;
	box-shadow: 0 0 0 2px var(--tq-brand-border);
}

.tq-schoolcal-row-title {
	font-size: 14px;
	font-weight: 700;
	color: var(--tq-text);
	line-height: 1.5;
}

.tq-schoolcal-row-date {
	font-size: 13px;
	font-weight: 600;
	color: var(--tq-muted);
	white-space: nowrap;
	line-height: 1.5;
	flex-shrink: 0;
}

/* ----- ملاحظة الدولة ----- */

.tq-schoolcal-note {
	margin: 0;
	min-height: 42px;
	font-size: 12.5px;
	font-weight: 600;
	color: var(--tq-muted);
	line-height: 1.7;
	text-align: center;
}

@media (max-width: 480px) {
	.tq-schoolcal-header {
		padding: 14px 10px;
	}

	.tq-schoolcal-header-title-row {
		gap: 6px;
	}

	.tq-schoolcal-header-icon {
		display: none;
	}

	.tq-schoolcal-title {
		font-size: 17px;
		white-space: nowrap;
	}

	.tq-schoolcal-subtitle {
		font-size: 12px;
		white-space: nowrap;
	}

	.tq-schoolcal-countdown-number {
		font-size: 34px;
	}

	.tq-schoolcal-countdown-unit {
		font-size: 16px;
	}
}
