/**
 * Tutor LMS — Aula del estudiante (Design 4 / Consolidados)
 * Decora .tutor-course-single-content-wrapper sin alterar el markup de Tutor.
 */

body.hexfly-tutor-lesson-d4 {
	--hexfly-d4-bg: #f5f7fa;
	--hexfly-d4-surface: #ffffff;
	--hexfly-d4-ink: #1f2937;
	--hexfly-d4-muted: #6b7280;
	--hexfly-d4-line: #e5e7eb;
	--hexfly-d4-primary: #0057d9;
	--hexfly-d4-primary-hover: #003e9c;
	--hexfly-d4-primary-rgb: 0, 87, 217;
	--hexfly-d4-sidebar-w: 300px;
	--hexfly-d4-topbar-h: 3.5rem;
	--hexfly-d4-sans: 'DM Sans', system-ui, sans-serif;

	background: var(--hexfly-d4-bg) !important;
	font-family: var(--hexfly-d4-sans);
}

body.hexfly-tutor-lesson-d4 .site-content,
body.hexfly-tutor-lesson-d4 #content,
body.hexfly-tutor-lesson-d4 .ast-container,
body.hexfly-tutor-lesson-d4 .entry-content {
	max-width: none;
	padding-left: 0;
	padding-right: 0;
}

body.hexfly-tutor-lesson-d4 .tutor-wrap {
	padding: 0;
	max-width: none;
}

/* ── Layout principal ── */

body.hexfly-tutor-lesson-d4 .tutor-course-single-content-wrapper {
	display: flex;
	align-items: stretch;
	min-height: calc(100dvh - var(--hexfly-d4-topbar-h, 3.5rem));
	background: var(--hexfly-d4-bg);
	color: var(--hexfly-d4-ink);
	font-family: var(--hexfly-d4-sans);
	line-height: 1.5;
}

/* ── Sidebar ── */

body.hexfly-tutor-lesson-d4 .tutor-course-single-sidebar-wrapper,
body.hexfly-tutor-lesson-d4 .tutor-lesson-sidebar {
	flex-shrink: 0;
	width: var(--hexfly-d4-sidebar-w);
	background: var(--hexfly-d4-surface);
	border-right: 1px solid var(--hexfly-d4-line);
	overflow-y: auto;
}

body.hexfly-tutor-lesson-d4 .tutor-course-single-sidebar-title {
	padding: 0.85rem 1rem;
	border-bottom: 1px solid var(--hexfly-d4-line);
	background: var(--hexfly-d4-surface);
}

body.hexfly-tutor-lesson-d4 .tutor-course-single-sidebar-title > span:first-child {
	font-size: 0.7rem;
	font-weight: 600;
	letter-spacing: 0.04em;
	text-transform: uppercase;
	color: var(--hexfly-d4-muted);
}

@media (min-width: 1200px) {
	body.hexfly-tutor-lesson-d4 .tutor-course-single-sidebar-title {
		display: none;
	}
}

/* Tarjeta de progreso (inyectada por PHP) */

body.hexfly-tutor-lesson-d4 .hexfly-d4-profile {
	padding: 1.1rem 1rem;
	border-bottom: 1px solid var(--hexfly-d4-line);
	background: linear-gradient(
		180deg,
		rgba(var(--hexfly-d4-primary-rgb), 0.06) 0%,
		transparent 100%
	);
}

body.hexfly-tutor-lesson-d4 .hexfly-d4-profile__head {
	display: flex;
	align-items: center;
	gap: 0.65rem;
	margin-bottom: 0.65rem;
}

body.hexfly-tutor-lesson-d4 .hexfly-d4-profile__icon {
	display: grid;
	place-items: center;
	width: 2.5rem;
	height: 2.5rem;
	border-radius: 10px;
	background: rgba(var(--hexfly-d4-primary-rgb), 0.12);
	color: var(--hexfly-d4-primary);
}

body.hexfly-tutor-lesson-d4 .hexfly-d4-profile__label {
	margin: 0;
	font-size: 0.72rem;
	color: var(--hexfly-d4-muted);
	text-transform: uppercase;
	letter-spacing: 0.06em;
}

body.hexfly-tutor-lesson-d4 .hexfly-d4-profile__percent {
	margin: 0;
	font-size: 1.35rem;
	font-weight: 700;
	color: var(--hexfly-d4-primary);
	line-height: 1.1;
}

body.hexfly-tutor-lesson-d4 .hexfly-d4-profile__bar {
	height: 6px;
	margin-bottom: 0.5rem;
	border-radius: 999px;
	background: var(--hexfly-d4-line);
	overflow: hidden;
}

body.hexfly-tutor-lesson-d4 .hexfly-d4-profile__bar span {
	display: block;
	height: 100%;
	border-radius: inherit;
	background: var(--hexfly-d4-primary);
	transition: width 0.3s ease;
}

body.hexfly-tutor-lesson-d4 .hexfly-d4-profile__meta {
	margin: 0;
	font-size: 0.78rem;
	color: var(--hexfly-d4-muted);
}

/* Módulos / temas */

body.hexfly-tutor-lesson-d4 .tutor-course-topic {
	border: none;
	margin: 0;
	background: transparent;
}

body.hexfly-tutor-lesson-d4 .tutor-accordion-item-header {
	padding: 0.85rem 1rem 0.35rem;
	border: none;
	background: transparent;
	cursor: pointer;
}

body.hexfly-tutor-lesson-d4 .tutor-course-topic-title {
	font-size: 0.7rem;
	font-weight: 600;
	letter-spacing: 0.04em;
	text-transform: uppercase;
	color: var(--hexfly-d4-muted);
}

body.hexfly-tutor-lesson-d4 .tutor-course-topic-summary {
	font-size: 0.72rem;
	color: var(--hexfly-d4-muted);
}

body.hexfly-tutor-lesson-d4 .tutor-accordion-item-body {
	padding: 0;
	border: none;
	background: transparent;
}

/* Ítems de lección */

body.hexfly-tutor-lesson-d4 .tutor-course-topic-item {
	border: none;
	margin: 0;
}

body.hexfly-tutor-lesson-d4 .tutor-course-topic-item a {
	display: flex;
	align-items: flex-start;
	gap: 0.5rem;
	padding: 0.65rem 1rem;
	border-left: 3px solid transparent;
	color: var(--hexfly-d4-ink);
	text-decoration: none;
	transition: background 0.15s ease, border-color 0.15s ease;
}

body.hexfly-tutor-lesson-d4 .tutor-course-topic-item a:hover {
	background: rgba(var(--hexfly-d4-primary-rgb), 0.05);
	color: var(--hexfly-d4-ink);
}

body.hexfly-tutor-lesson-d4 .tutor-course-topic-item.is-active a,
body.hexfly-tutor-lesson-d4 .tutor-course-topic-item-lesson.is-active a {
	border-left-color: var(--hexfly-d4-primary);
	background: rgba(var(--hexfly-d4-primary-rgb), 0.08);
}

body.hexfly-tutor-lesson-d4 .tutor-course-topic-item-icon {
	color: var(--hexfly-d4-primary);
	flex-shrink: 0;
	margin-top: 0.1rem;
}

body.hexfly-tutor-lesson-d4 .tutor-course-topic-item-title {
	font-size: 0.85rem;
	font-weight: 500;
	line-height: 1.35;
	color: inherit;
}

body.hexfly-tutor-lesson-d4 .tutor-course-topic-item.is-active .tutor-course-topic-item-title {
	font-weight: 600;
	color: var(--hexfly-d4-primary);
}

body.hexfly-tutor-lesson-d4 .tutor-course-topic-item-duration {
	font-size: 0.72rem;
	color: var(--hexfly-d4-muted);
}

body.hexfly-tutor-lesson-d4 .tutor-form-check-input.tutor-form-check-circle {
	width: 1.1rem;
	height: 1.1rem;
	border-color: var(--hexfly-d4-line);
	accent-color: var(--hexfly-d4-primary);
}

body.hexfly-tutor-lesson-d4 .tutor-form-check-input:checked {
	background-color: var(--hexfly-d4-primary);
	border-color: var(--hexfly-d4-primary);
}

/* ── Columna principal ── */

body.hexfly-tutor-lesson-d4 #tutor-single-entry-content,
body.hexfly-tutor-lesson-d4 .tutor-quiz-single-entry-wrap {
	flex: 1;
	min-width: 0;
	display: flex;
	flex-direction: column;
	background: var(--hexfly-d4-bg);
}

/* Top bar */

body.hexfly-tutor-lesson-d4 .tutor-course-topic-single-header,
body.hexfly-tutor-lesson-d4 .tutor-single-page-top-bar {
	display: flex;
	align-items: center;
	gap: 0.75rem;
	min-height: var(--hexfly-d4-topbar-h);
	padding: 0 1rem;
	background: var(--hexfly-d4-primary-hover);
	color: #fff;
	border-bottom: 1px solid rgba(255, 255, 255, 0.1);
	flex-shrink: 0;
}

body.hexfly-tutor-lesson-d4 .tutor-course-topic-single-header-title {
	font-size: 0.85rem;
	font-weight: 600;
	color: rgba(255, 255, 255, 0.92);
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

body.hexfly-tutor-lesson-d4 .tutor-course-topic-single-header .tutor-progress-content {
	color: rgba(255, 255, 255, 0.75);
	font-size: 0.8rem;
}

body.hexfly-tutor-lesson-d4 .tutor-course-topic-single-header .tutor-fs-7 {
	color: rgba(255, 255, 255, 0.92);
}

body.hexfly-tutor-lesson-d4 .tutor-course-topics-sidebar-toggler,
body.hexfly-tutor-lesson-d4 .tutor-course-topic-single-header .tutor-iconic-btn {
	color: rgba(255, 255, 255, 0.85);
	background: rgba(255, 255, 255, 0.1);
	border: 1px solid rgba(255, 255, 255, 0.15);
	border-radius: 8px;
}

body.hexfly-tutor-lesson-d4 .tutor-course-topics-sidebar-toggler:hover,
body.hexfly-tutor-lesson-d4 .tutor-course-topic-single-header .tutor-iconic-btn:hover {
	background: rgba(255, 255, 255, 0.18);
	color: #fff;
}

body.hexfly-tutor-lesson-d4 .tutor-topbar-mark-btn,
body.hexfly-tutor-lesson-d4 .tutor-topbar-complete-btn .tutor-btn-primary {
	background: var(--hexfly-d4-primary) !important;
	border-color: var(--hexfly-d4-primary) !important;
	color: #fff !important;
	border-radius: 8px;
	font-weight: 600;
	font-size: 0.85rem;
	padding: 0.55rem 0.9rem;
}

body.hexfly-tutor-lesson-d4 .tutor-topbar-mark-btn:hover,
body.hexfly-tutor-lesson-d4 .tutor-topbar-complete-btn .tutor-btn-primary:hover {
	background: var(--hexfly-d4-primary-hover) !important;
	border-color: var(--hexfly-d4-primary-hover) !important;
}

/* Cuerpo de la lección */

body.hexfly-tutor-lesson-d4 .tutor-course-topic-single-body {
	flex: 1;
	padding: 1rem 1rem 2rem;
	overflow-y: auto;
}

@media (min-width: 900px) {
	body.hexfly-tutor-lesson-d4 .tutor-course-topic-single-body {
		padding: 1.25rem 1.5rem 2.5rem;
	}
}

/* Reproductor de video */

body.hexfly-tutor-lesson-d4 .tutor-video-player-wrapper {
	max-width: 960px;
	margin: 0 auto 1.25rem;
	border-radius: 12px;
	overflow: hidden;
	background: #0b1220;
	box-shadow: 0 20px 50px rgba(31, 41, 55, 0.12);
}

body.hexfly-tutor-lesson-d4 .tutor-video-player {
	background: #111827;
}

body.hexfly-tutor-lesson-d4 .tutor-ratio-16x9 {
	background: #111827;
}

body.hexfly-tutor-lesson-d4 .tutor-video-player iframe {
	border: none;
}

/* Contenido / overview */

body.hexfly-tutor-lesson-d4 .tutor-course-spotlight-wrapper {
	max-width: 960px;
	margin: 0 auto;
	padding: 0 0.25rem;
}

body.hexfly-tutor-lesson-d4 .tutor-course-spotlight-tab .tutor-tab-nav {
	border-bottom: 1px solid var(--hexfly-d4-line);
	margin-bottom: 1rem;
}

body.hexfly-tutor-lesson-d4 .tutor-course-spotlight-tab .tutor-nav-link {
	font-size: 0.85rem;
	font-weight: 600;
	color: var(--hexfly-d4-muted);
	border-radius: 8px 8px 0 0;
}

body.hexfly-tutor-lesson-d4 .tutor-course-spotlight-tab .tutor-nav-link.is-active,
body.hexfly-tutor-lesson-d4 .tutor-course-spotlight-tab .tutor-nav-link:hover {
	color: var(--hexfly-d4-primary);
}

body.hexfly-tutor-lesson-d4 .tutor-lesson-wrapper,
body.hexfly-tutor-lesson-d4 .tutor-tab-item .tutor-container {
	font-size: 0.92rem;
	color: var(--hexfly-d4-muted);
	line-height: 1.65;
}

body.hexfly-tutor-lesson-d4 .tutor-lesson-wrapper h1,
body.hexfly-tutor-lesson-d4 .tutor-lesson-wrapper h2,
body.hexfly-tutor-lesson-d4 .tutor-lesson-wrapper h3,
body.hexfly-tutor-lesson-d4 .tutor-tab-item h1,
body.hexfly-tutor-lesson-d4 .tutor-tab-item h2 {
	color: var(--hexfly-d4-ink);
	font-weight: 700;
	letter-spacing: -0.02em;
}

/* Adjuntos / recursos */

body.hexfly-tutor-lesson-d4 .tutor-lesson-attachment,
body.hexfly-tutor-lesson-d4 .tutor-course-attachments,
body.hexfly-tutor-lesson-d4 .tutor-attachment-list {
	display: flex;
	flex-direction: column;
	gap: 0.5rem;
	margin: 1rem 0 0;
	padding: 0;
	list-style: none;
}

body.hexfly-tutor-lesson-d4 .tutor-lesson-attachment a,
body.hexfly-tutor-lesson-d4 .tutor-course-attachments a,
body.hexfly-tutor-lesson-d4 .tutor-attachment-list a,
body.hexfly-tutor-lesson-d4 .tutor-lesson-attachment .tutor-attachment-file,
body.hexfly-tutor-lesson-d4 .tutor-course-attachments .tutor-attachment-file {
	display: flex;
	align-items: center;
	gap: 0.5rem;
	padding: 0.65rem 0.85rem;
	font-size: 0.85rem;
	font-weight: 500;
	color: var(--hexfly-d4-primary) !important;
	background: var(--hexfly-d4-surface);
	border: 1px solid var(--hexfly-d4-line);
	border-radius: 8px;
	text-decoration: none;
	transition: border-color 0.15s ease, background 0.15s ease;
}

body.hexfly-tutor-lesson-d4 .tutor-lesson-attachment a:hover,
body.hexfly-tutor-lesson-d4 .tutor-course-attachments a:hover,
body.hexfly-tutor-lesson-d4 .tutor-attachment-list a:hover {
	border-color: rgba(var(--hexfly-d4-primary-rgb), 0.4);
	background: rgba(var(--hexfly-d4-primary-rgb), 0.04);
}

/* Toggle del sidebar (estilo design4) */

body.hexfly-tutor-lesson-d4 .tutor-course-topics-sidebar-toggler {
	width: 1.25rem;
	height: 3rem;
	padding: 0;
	border-radius: 0 6px 6px 0;
	border-left: none;
}

/* ── Responsive ── */

@media (max-width: 1199px) {
	body.hexfly-tutor-lesson-d4 .tutor-course-single-sidebar-wrapper:not(.tutor-lesson-sidebar-show),
	body.hexfly-tutor-lesson-d4 .tutor-lesson-sidebar:not(.tutor-lesson-sidebar-show) {
		position: fixed;
		top: 0;
		left: 0;
		bottom: 0;
		z-index: 100001;
		box-shadow: 8px 0 24px rgba(31, 41, 55, 0.12);
	}
}

@media (max-width: 768px) {
	body.hexfly-tutor-lesson-d4 .tutor-course-single-sidebar-wrapper,
	body.hexfly-tutor-lesson-d4 .tutor-lesson-sidebar {
		width: min(var(--hexfly-d4-sidebar-w), 88vw);
	}

	body.hexfly-tutor-lesson-d4 .tutor-course-topic-single-header .tutor-d-none.tutor-d-xl-flex {
		display: none !important;
	}
}

@media (prefers-reduced-motion: reduce) {
	body.hexfly-tutor-lesson-d4 .hexfly-d4-profile__bar span {
		transition: none;
	}
}
