/*
 * Tech with Glory: dark styling for Tutor LMS.
 *
 * Tutor 4's learning area (lessons, assignments, quizzes) already has its own dark theme and marks
 * <html data-tutor-theme="dark">. The classic Tutor pages (course details, course list, dashboard,
 * registration and login) still use Tutor's light palette, so everything below is scoped to pages
 * without that marker.
 */

/* ---------- Palette: remap Tutor's classic colour variables ---------- */
html:not([data-tutor-theme]) body.twg-site {
	--tutor-body-color: #f4f7ff;
	--tutor-body-color-rgb: 244, 247, 255;
	--tutor-color-black: #f4f7ff;
	--tutor-color-secondary: #c4cad6;
	--tutor-color-subdued: #a9b0be;
	--tutor-color-muted: #8b93a5;
	--tutor-color-hints: #8b93a5;
	--tutor-border-color: #232c3d;
	--tutor-border-color-rgb: 35, 44, 61;
	--tutor-color-gray: #1b2333;
	--tutor-color-gray-rgb: 27, 35, 51;
	--tutor-color-gray-10: #111827;
	--tutor-color-primary: #3e68e8;
	--tutor-color-primary-rgb: 62, 104, 232;
	--tutor-color-primary-hover: #5079f0;
	--tutor-color-primary-hover-rgb: 80, 121, 240;
	--tutor-color-success: #3fbf6e;
	--tutor-color-success-rgb: 63, 191, 110;
	--tutor-color-warning: #f2b544;
	--tutor-color-danger: #ff7a70;
	--twg-tutor-surface: #0c1320;
	--twg-tutor-surface-2: #111a2a;
	--twg-tutor-line: #232c3d;
	color: #f4f7ff;
}

/* Text helpers Tutor uses directly */
html:not([data-tutor-theme]) body.twg-site :is(.tutor-color-black, .tutor-course-details-title, .tutor-course-content-list-item-title, .tutor-course-content-list-item-title a, .tutor-accordion-item-header, .tutor-card-title, .tutor-form-label, .tutor-dashboard-content-inner h3, .tutor-dashboard-title) {
	color: #f4f7ff;
}
html:not([data-tutor-theme]) body.twg-site :is(.tutor-color-secondary, .tutor-course-details-content, .tutor-course-details-content p, .tutor-course-details-widget li span) {
	color: #c4cad6;
}
html:not([data-tutor-theme]) body.twg-site :is(.tutor-color-muted, .tutor-color-subdued, .tutor-color-hints, .tutor-meta, .tutor-meta-key, .tutor-course-content-list-item-duration) {
	color: #8b93a5;
}
html:not([data-tutor-theme]) body.twg-site .tutor-color-success { color: #3fbf6e; }
html:not([data-tutor-theme]) body.twg-site :is(a.tutor-btn-link, .tutor-course-content-list-item-title a:hover, a.tutor-color-primary) { color: #7599ff; }

/* ---------- Surfaces: Tutor hard-codes white cards ---------- */
html:not([data-tutor-theme]) body.twg-site :is(
	.tutor-card,
	.tutor-sidebar-card,
	.tutor-accordion-item,
	.tutor-course-content-list-item,
	.tutor-course-details-instructors,
	.tutor-modal-content,
	.tutor-modal-content-white,
	.tutor-dropdown,
	.tutor-nav-more-list,
	.tutor-dashboard-content,
	.tutor-frontend-dashboard-header,
	.tutor-table,
	.tutor-table td,
	.tutor-table th,
	.tutor-login-wrap,
	.tutor-login-form-wrapper,
	.tutor-registration-wrap,
	.tutor-course-card,
	.tutor-card-footer,
	.tutor-pagination,
	.tutor-empty-state
) {
	background-color: var(--twg-tutor-surface);
	border-color: var(--twg-tutor-line);
	color: #f4f7ff;
}
html:not([data-tutor-theme]) body.twg-site :is(.tutor-card, .tutor-sidebar-card, .tutor-accordion-item, .tutor-course-details-instructors, .tutor-course-card, .tutor-login-wrap, .tutor-registration-wrap) {
	border-radius: 14px;
	box-shadow: none;
}
html:not([data-tutor-theme]) body.twg-site :is(.tutor-card-body, .tutor-accordion-item-header, .tutor-table thead th, .tutor-course-progress-wrapper) {
	background-color: var(--twg-tutor-surface-2);
	border-color: var(--twg-tutor-line);
}
html:not([data-tutor-theme]) body.twg-site .tutor-accordion-item-header.is-active { color: #f4f7ff; }
html:not([data-tutor-theme]) body.twg-site .tutor-course-content-list-item + .tutor-course-content-list-item { border-top: 1px solid var(--twg-tutor-line); }
html:not([data-tutor-theme]) body.twg-site :is(.tutor-course-content-list-item-icon, .tutor-course-content-list-item-status, .tutor-accordion-item-header::after) { color: #8b93a5; }

/* Course details tabs (Course Info / Announcements) */
html:not([data-tutor-theme]) body.twg-site .tutor-course-details-tab .tutor-nav,
html:not([data-tutor-theme]) body.twg-site .tutor-nav:not(.tutor-nav-pills) {
	background: transparent;
	border-color: var(--twg-tutor-line);
}
html:not([data-tutor-theme]) body.twg-site .tutor-nav-link { color: #a9b0be; background: transparent; }
html:not([data-tutor-theme]) body.twg-site .tutor-nav-link:hover { color: #f4f7ff; }
html:not([data-tutor-theme]) body.twg-site .tutor-nav-link.is-active { color: #f4f7ff; border-bottom-color: #3e68e8; background: transparent; }

/* Progress bars */
html:not([data-tutor-theme]) body.twg-site .tutor-progress-bar { background-color: #1b2333; }
html:not([data-tutor-theme]) body.twg-site .tutor-progress-value { background-color: #3e68e8; }

/* ---------- Buttons ---------- */
html:not([data-tutor-theme]) body.twg-site .tutor-btn-primary,
html:not([data-tutor-theme]) body.twg-site .tutor-btn-primary:is(:hover, :focus) {
	color: #fff;
}
html:not([data-tutor-theme]) body.twg-site :is(.tutor-btn-ghost, .tutor-btn-outline-primary, .tutor-btn-tertiary) { color: #c4cad6; }
html:not([data-tutor-theme]) body.twg-site :is(.tutor-btn-ghost, .tutor-btn-tertiary):hover { color: #f4f7ff; }
html:not([data-tutor-theme]) body.twg-site .tutor-btn-outline-primary { border-color: #3e68e8; color: #9db5ff; }
html:not([data-tutor-theme]) body.twg-site .tutor-btn-outline-primary:hover { background: #3e68e8; color: #fff; }
html:not([data-tutor-theme]) body.twg-site .tutor-btn-secondary { background: #1b2333; border-color: #2a3448; color: #f4f7ff; }

/* ---------- Forms (registration, login, dashboard settings) ---------- */
html:not([data-tutor-theme]) body.twg-site :is(.tutor-form-control, .tutor-form-select, input[type="text"], input[type="email"], input[type="password"], input[type="number"], input[type="url"], input[type="tel"], select, textarea):not(.twg-py__input):not(.ff-el-form-control) {
	background-color: #0b111c;
	border: 1px solid #2a3448;
	color: #f4f7ff;
}
html:not([data-tutor-theme]) body.twg-site :is(.tutor-form-control, input, textarea)::placeholder { color: #6f7789; opacity: 1; }
html:not([data-tutor-theme]) body.twg-site :is(.tutor-form-control, input, select, textarea):not(.twg-py__input):focus {
	border-color: #3e68e8;
	box-shadow: 0 0 0 3px rgba(62, 104, 232, .25);
	outline: none;
}
html:not([data-tutor-theme]) body.twg-site :is(.tutor-form-label, label) { color: #c4cad6; }
html:not([data-tutor-theme]) body.twg-site :is(.tutor-form-check-input, input[type="checkbox"], input[type="radio"]) { accent-color: #3e68e8; }

/* ---------- Learning area (already dark): the assignment answer editor ---------- */
[data-tutor-theme="dark"] :is(.wp-editor-container, .mce-container, .mce-edit-area) { border-color: #2a3448; }
[data-tutor-theme="dark"] .wp-editor-area { background: #0b111c; color: #f4f7ff; }

/* Sidebar widgets (Audience, Requirements, Tags) and the sticky tab bar */
html:not([data-tutor-theme]) body.twg-site .tutor-single-course-sidebar .tutor-course-details-widget {
	background-color: var(--twg-tutor-surface);
	border: 1px solid var(--twg-tutor-line);
	border-radius: 14px;
	color: #f4f7ff;
}
html:not([data-tutor-theme]) body.twg-site .tutor-course-details-widget li span { color: #c4cad6; }
html:not([data-tutor-theme]) body.twg-site .tutor-is-sticky {
	background-color: rgba(5, 10, 19, .92);
	-webkit-backdrop-filter: blur(10px);
	backdrop-filter: blur(10px);
}
html:not([data-tutor-theme]) body.twg-site .tutor-avatar-text { color: #fff; }

/* Tutor's dark palette: small links that fall short of 4.5:1 on its card surface */
[data-tutor-theme="dark"] .tutor-btn-link-gray { color: #a9b0be; }
[data-tutor-theme="dark"] .tutor-btn-link-gray:hover { color: #f4f7ff; }
[data-tutor-theme="dark"] .tutor-btn-link { color: #8eaaff; }
[data-tutor-theme="dark"] .tutor-btn-link:hover { color: #b3c6ff; }

/* Tutor's dark palette: lift subdued text (item types, section labels) to 4.5:1 */
html[data-tutor-theme="dark"] { --tutor-text-subdued: #a3a8b3; }

/* Registration terms notice */
.twg-reg-terms { margin: 4px 0 16px; font-size: .85rem; line-height: 1.55; color: #a9b0be; }
.twg-reg-terms a { color: #8eaaff; text-decoration: underline; text-underline-offset: 3px; }
