/**
 * Tutor LMS — global frontend styles (منصة 99)
 */

/* ── Base ─────────────────────────────────────────────── */

body.p99-tutor-page,
body.p99-tutor-page .tutor-wrap,
body.p99-tutor-page .tutor-container {
	font-family: var(--p99-font);
	direction: rtl;
}

body.p99-tutor-page .tutor-btn,
body.p99-tutor-page .tutor-button,
body.p99-tutor-page button.tutor-btn,
body.p99-tutor-page a.tutor-btn {
	font-family: inherit;
}

/* ── Buttons ──────────────────────────────────────────── */

body.p99-tutor-page .tutor-btn-primary,
body.p99-tutor-page .tutor-button-primary,
body.p99-tutor-page a.tutor-btn-primary,
body.p99-tutor-page button.tutor-btn-primary,
body.p99-tutor-page .p99-tutor-btn {
	background: var(--p99-blue) !important;
	border-color: var(--p99-blue) !important;
	color: #fff !important;
	border-radius: 999px !important;
	font-weight: 700 !important;
}

body.p99-tutor-page .tutor-btn-primary:hover,
body.p99-tutor-page .tutor-button-primary:hover,
body.p99-tutor-page .p99-tutor-btn:hover {
	background: var(--p99-blue-dark) !important;
	border-color: var(--p99-blue-dark) !important;
	color: #fff !important;
}

body.p99-tutor-page .tutor-btn-outline-primary,
body.p99-tutor-page .tutor-btn-ghost {
	border-radius: 999px !important;
}

/* ── Alerts / notices ─────────────────────────────────── */

body.p99-tutor-page .tutor-alert,
body.p99-tutor-page .tutor-notice-wrap {
	border-radius: var(--p99-radius-sm);
	font-family: inherit;
}

body.p99-tutor-page .tutor-alert-warning {
	background: #fff8e6;
	border: 1px solid #f0d88a;
	color: #7a5b00;
}

body.p99-tutor-page .tutor-alert-success {
	background: #edf7e6;
	border: 1px solid #b8d99a;
	color: #3d5c1a;
}

body.p99-tutor-page .tutor-alert-danger,
body.p99-tutor-page .tutor-alert-error {
	background: #fdeeee;
	border: 1px solid #f0b4b4;
	color: #8b2020;
}

body.p99-tutor-page .tutor-alert-info {
	background: #eef4fc;
	border: 1px solid #b8cce8;
	color: var(--p99-blue-dark);
}

/* ── Course archive ───────────────────────────────────── */

body.p99-tutor-archive-page .p99-filters {
	display: flex;
	flex-wrap: wrap;
	gap: 0.75rem;
	align-items: center;
	margin-bottom: 1.75rem;
	padding: 1rem 1.25rem;
	background: #fff;
	border: 1px solid var(--p99-border);
	border-radius: var(--p99-radius);
}

body.p99-tutor-archive-page .p99-filters input[type="search"],
body.p99-tutor-archive-page .p99-filters select {
	flex: 1 1 180px;
	min-height: 44px;
	padding: 0.5rem 0.85rem;
	border: 1px solid var(--p99-border);
	border-radius: var(--p99-radius-sm);
	font-family: inherit;
	font-size: 0.95rem;
	background: #fff;
}

body.p99-tutor-archive-page .p99-courses-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
	gap: 1.25rem;
	margin-bottom: 2rem;
}

body.p99-tutor-archive-page .page-numbers {
	display: flex;
	flex-wrap: wrap;
	gap: 0.35rem;
	justify-content: center;
	list-style: none;
	padding: 0;
	margin: 2rem 0 0;
}

body.p99-tutor-archive-page .page-numbers a,
body.p99-tutor-archive-page .page-numbers span {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 40px;
	min-height: 40px;
	padding: 0 0.65rem;
	border: 1px solid var(--p99-border);
	border-radius: var(--p99-radius-sm);
	color: var(--p99-text);
	font-weight: 600;
}

body.p99-tutor-archive-page .page-numbers .current {
	background: var(--p99-blue);
	border-color: var(--p99-blue);
	color: #fff;
}

body.p99-tutor-archive-page .p99-empty {
	text-align: center;
	padding: 3rem 1.5rem;
	background: #fff;
	border: 1px dashed var(--p99-border);
	border-radius: var(--p99-radius);
	color: var(--p99-text-muted);
}

/* ── Learning breadcrumbs ─────────────────────────────── */

.p99-breadcrumbs--learning {
	margin-bottom: 0;
}

body.p99-tutor-learning-page {
	background: var(--p99-bg-soft);
}

.p99-tutor-learning .tutor-wrap-parent,
.p99-tutor-learning .tutor-page-wrap {
	background: transparent;
}

/* ── Lesson / quiz pagination ─────────────────────────── */

.p99-tutor-pagination {
	display: flex;
	flex-wrap: wrap;
	justify-content: space-between;
	gap: 1rem;
	margin-top: 2rem;
	padding-top: 1.5rem;
	border-top: 1px solid var(--p99-border);
}

.p99-tutor-pagination__link {
	display: inline-flex;
	align-items: center;
	gap: 0.5rem;
	padding: 0.65rem 1.25rem;
	background: #fff;
	border: 1px solid var(--p99-border);
	border-radius: 999px;
	font-weight: 600;
	color: var(--p99-blue);
	transition: background 0.2s, border-color 0.2s;
}

.p99-tutor-pagination__link:hover {
	background: rgba(43, 91, 174, 0.06);
	border-color: var(--p99-blue);
	color: var(--p99-blue-dark);
}

.p99-tutor-pagination__link--next {
	margin-inline-start: auto;
}

/* ── Lesson player ────────────────────────────────────── */

body.p99-tutor-lesson-page .tutor-course-topic-single,
body.p99-tutor-lesson-page .tutor-lesson-wrapper {
	direction: rtl;
}

body.p99-tutor-lesson-page .tutor-lesson-sidebar,
body.p99-tutor-lesson-page .tutor-lesson-sidebar-wrapper {
	font-family: inherit;
}

body.p99-tutor-lesson-page .tutor-lesson-sidebar-title,
body.p99-tutor-lesson-page .tutor-course-topic-title {
	font-weight: 700;
	color: var(--p99-text);
}

body.p99-tutor-lesson-page .tutor-topbar,
body.p99-tutor-lesson-page .tutor-course-topic-single-header {
	background: #fff;
	border-bottom: 1px solid var(--p99-border);
}

body.p99-tutor-lesson-page .tutor-video-player-wrapper,
body.p99-tutor-lesson-page .tutor-lesson-content-area {
	border-radius: var(--p99-radius);
	overflow: hidden;
}

body.p99-tutor-lesson-page .tutor-lesson-content-wrap {
	background: #fff;
	border: 1px solid var(--p99-border);
	border-radius: var(--p99-radius);
	padding: 1.5rem;
	line-height: 1.85;
}

/* ── Quiz ─────────────────────────────────────────────── */

body.p99-tutor-quiz-page .tutor-quiz-wrap,
body.p99-tutor-quiz-page .tutor-quiz-single-wrap {
	direction: rtl;
	font-family: inherit;
}

body.p99-tutor-quiz-page .tutor-quiz-header,
body.p99-tutor-quiz-page .tutor-start-quiz-wrapper {
	background: #fff;
	border: 1px solid var(--p99-border);
	border-radius: var(--p99-radius);
	padding: 1.5rem;
	margin-bottom: 1.5rem;
}

body.p99-tutor-quiz-page .tutor-quiz-question-wrap,
body.p99-tutor-quiz-page .tutor-quiz-ans-no {
	background: #fff;
	border: 1px solid var(--p99-border);
	border-radius: var(--p99-radius-sm);
	padding: 1.25rem;
	margin-bottom: 1rem;
}

body.p99-tutor-quiz-page .tutor-quiz-ans-no input[type="radio"],
body.p99-tutor-quiz-page .tutor-quiz-ans-no input[type="checkbox"] {
	margin-inline-end: 0.5rem;
}

body.p99-tutor-quiz-page .tutor-quiz-btn-group,
body.p99-tutor-quiz-page .tutor-quiz-submit-btn-wrap {
	display: flex;
	flex-wrap: wrap;
	gap: 0.75rem;
	margin-top: 1.5rem;
}

body.p99-tutor-quiz-page .tutor-quiz-time-counter {
	color: var(--p99-blue);
	font-weight: 700;
}

/* ── Tables (dashboard + quiz attempts) ───────────────── */

body.p99-tutor-page .tutor-table,
body.p99-tutor-page table.tutor-table,
body.p99-tutor-page .tutor-dashboard-table {
	width: 100%;
	border-collapse: collapse;
	font-size: 0.95rem;
}

body.p99-tutor-page .tutor-table th,
body.p99-tutor-page .tutor-table td,
body.p99-tutor-page .tutor-dashboard-table th,
body.p99-tutor-page .tutor-dashboard-table td {
	padding: 0.85rem 1rem;
	border-bottom: 1px solid var(--p99-border);
	text-align: start;
	vertical-align: middle;
}

body.p99-tutor-page .tutor-table th,
body.p99-tutor-page .tutor-dashboard-table th {
	background: var(--p99-bg-soft);
	color: var(--p99-blue-dark);
	font-weight: 700;
}

body.p99-tutor-page .tutor-table tr:hover td {
	background: rgba(43, 91, 174, 0.03);
}

/* ── Cards & empty states ─────────────────────────────── */

body.p99-tutor-page .tutor-card,
body.p99-tutor-page .tutor-dashboard-content-inner {
	border-radius: var(--p99-radius);
}

body.p99-tutor-page .tutor-empty-state,
body.p99-tutor-page .tutor-no-data-found {
	text-align: center;
	padding: 2.5rem 1.5rem;
	color: var(--p99-text-muted);
}

/* ── Forms ────────────────────────────────────────────── */

body.p99-tutor-page input[type="text"],
body.p99-tutor-page input[type="email"],
body.p99-tutor-page input[type="password"],
body.p99-tutor-page input[type="search"],
body.p99-tutor-page input[type="number"],
body.p99-tutor-page select,
body.p99-tutor-page textarea {
	font-family: inherit;
	border-radius: var(--p99-radius-sm);
	border: 1px solid var(--p99-border);
}

body.p99-tutor-page input:focus,
body.p99-tutor-page select:focus,
body.p99-tutor-page textarea:focus {
	outline: none;
	border-color: var(--p99-blue);
	box-shadow: 0 0 0 3px rgba(43, 91, 174, 0.12);
}

/* ── Dashboard wrapper from page.php ──────────────────── */

body.p99-tutor-dashboard-page .p99-tutor-dashboard-wrap {
	width: 100%;
	max-width: none;
	padding-inline: 0;
}

body.p99-tutor-dashboard-page .p99-tutor-dashboard-wrap .p99-page-header {
	display: none;
}

body.p99-tutor-dashboard-page .p99-tutor-dashboard-wrap .p99-main {
	padding-block: 0;
}

/* ── Responsive ───────────────────────────────────────── */

@media (max-width: 768px) {
	body.p99-tutor-archive-page .p99-filters {
		flex-direction: column;
		align-items: stretch;
	}

	body.p99-tutor-archive-page .p99-filters input[type="search"],
	body.p99-tutor-archive-page .p99-filters select {
		width: 100%;
	}

	.p99-tutor-pagination {
		flex-direction: column;
	}

	.p99-tutor-pagination__link--next {
		margin-inline-start: 0;
	}

	body.p99-tutor-page .tutor-table {
		display: block;
		overflow-x: auto;
		-webkit-overflow-scrolling: touch;
	}
}
