/* ==========================================================================
   LearnKit Video Player — learnkit-player.css
   ========================================================================== */

/* --------------------------------------------------------------------------
   Container & Layout
   -------------------------------------------------------------------------- */

.lk-player-wrap {
	position: relative;
	width: 100%;
	background: #000;
	border-radius: 6px;
	overflow: hidden;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
	font-size: 14px;
	color: #fff;
	user-select: none;
	-webkit-user-select: none;
	line-height: 1;
}

/* Theater mode — expands to viewport width */
.lk-player-wrap.lk-theater {
	position: fixed;
	top: 0;
	left: 0;
	width: 100vw;
	height: 100vh;
	z-index: 99990;
	border-radius: 0;
}

.lk-player-wrap.lk-theater .lk-player-video-area {
	height: calc(100vh - 54px);
}

/* Fullscreen */
.lk-player-wrap:-webkit-full-screen { width: 100%; height: 100%; }
.lk-player-wrap:-moz-full-screen    { width: 100%; height: 100%; }
.lk-player-wrap:fullscreen          { width: 100%; height: 100%; }

/* --------------------------------------------------------------------------
   Video Area
   -------------------------------------------------------------------------- */

.lk-player-video-area {
	position: relative;
	width: 100%;
	padding-bottom: 56.25%; /* 16:9 */
	background: #000;
	overflow: hidden;
}

.lk-player-wrap.lk-theater .lk-player-video-area,
.lk-player-wrap:-webkit-full-screen .lk-player-video-area,
.lk-player-wrap:fullscreen .lk-player-video-area {
	padding-bottom: 0;
	height: 100%;
}

.lk-player-video-area video,
.lk-player-video-area iframe,
.lk-player-video-area #lk-yt-player,
.lk-player-video-area #lk-vm-player {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	border: none;
}

/* --------------------------------------------------------------------------
   Watermark
   -------------------------------------------------------------------------- */

.lk-player-watermark {
	position: absolute;
	pointer-events: none;
	z-index: 10;
	padding: 4px 8px;
	background: rgba(0, 0, 0, 0.35);
	border-radius: 3px;
	font-size: 12px;
	color: rgba(255, 255, 255, 0.65);
	letter-spacing: 0.03em;
	transition: opacity 0.6s ease;
	white-space: nowrap;
	/* default position — overridden inline by JS */
	top: 8%;
	left: 8%;
}

.lk-player-watermark.lk-wm-hidden {
	opacity: 0;
}

/* --------------------------------------------------------------------------
   Resume Banner
   -------------------------------------------------------------------------- */

.lk-resume-banner {
	position: absolute;
	bottom: 58px;
	left: 50%;
	transform: translateX(-50%);
	z-index: 20;
	display: flex;
	align-items: center;
	gap: 10px;
	background: rgba(20, 20, 20, 0.9);
	border: 1px solid rgba(255, 255, 255, 0.15);
	border-radius: 6px;
	padding: 8px 14px;
	font-size: 13px;
	white-space: nowrap;
	backdrop-filter: blur(4px);
}

.lk-resume-banner button {
	background: #e53935;
	color: #fff;
	border: none;
	border-radius: 4px;
	padding: 4px 10px;
	font-size: 12px;
	cursor: pointer;
	font-weight: 600;
}

.lk-resume-banner button:hover {
	background: #c62828;
}

.lk-resume-banner .lk-resume-dismiss {
	background: transparent;
	color: rgba(255, 255, 255, 0.5);
	padding: 0;
	font-size: 16px;
	line-height: 1;
}

.lk-resume-banner .lk-resume-dismiss:hover {
	color: #fff;
	background: transparent;
}

/* --------------------------------------------------------------------------
   Completion Toast
   -------------------------------------------------------------------------- */

.lk-completion-toast {
	position: absolute;
	top: 16px;
	right: 16px;
	z-index: 30;
	display: flex;
	align-items: center;
	gap: 8px;
	background: rgba(27, 94, 32, 0.93);
	border: 1px solid #2e7d32;
	border-radius: 6px;
	padding: 10px 16px;
	font-size: 13px;
	font-weight: 600;
	backdrop-filter: blur(4px);
	opacity: 0;
	transform: translateY(-8px);
	transition: opacity 0.3s ease, transform 0.3s ease;
	pointer-events: none;
}

.lk-completion-toast.lk-toast-visible {
	opacity: 1;
	transform: translateY(0);
	pointer-events: auto;
}

.lk-completion-toast .dashicons {
	font-size: 18px;
	width: 18px;
	height: 18px;
	color: #a5d6a7;
}

/* --------------------------------------------------------------------------
   Controls Bar
   -------------------------------------------------------------------------- */

.lk-player-controls {
	display: flex;
	align-items: center;
	gap: 6px;
	padding: 0 10px;
	height: 48px;
	background: linear-gradient(to top, rgba(0, 0, 0, 0.9) 0%, rgba(0, 0, 0, 0.7) 100%);
	position: relative;
	z-index: 5;
	flex-wrap: nowrap;
	overflow: visible;
}

/* Auto-hide controls in theater / fullscreen */
.lk-player-wrap.lk-controls-hidden .lk-player-controls {
	opacity: 0;
	pointer-events: none;
}

.lk-player-wrap.lk-theater .lk-player-controls,
.lk-player-wrap:fullscreen .lk-player-controls {
	position: absolute;
	bottom: 0;
	left: 0;
	right: 0;
	transition: opacity 0.25s ease;
}

/* --------------------------------------------------------------------------
   Progress / Seek Bar
   -------------------------------------------------------------------------- */

.lk-progress-wrap {
	flex: 1 1 auto;
	position: relative;
	height: 4px;
	background: rgba(255, 255, 255, 0.25);
	border-radius: 2px;
	cursor: pointer;
	transition: height 0.15s ease;
}

.lk-progress-wrap:hover {
	height: 6px;
}

/* Buffered fill */
.lk-progress-buffered {
	position: absolute;
	top: 0;
	left: 0;
	height: 100%;
	background: rgba(255, 255, 255, 0.35);
	border-radius: 2px;
	pointer-events: none;
	width: 0%;
}

/* Played fill */
.lk-progress-played {
	position: absolute;
	top: 0;
	left: 0;
	height: 100%;
	background: #e53935;
	border-radius: 2px;
	pointer-events: none;
	width: 0%;
}

/* Scrub handle */
.lk-ctrl-seek {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	opacity: 0;
	cursor: pointer;
	margin: 0;
	padding: 0;
}

/* Chapter markers on progress bar */
.lk-chapter-marker {
	position: absolute;
	top: 50%;
	transform: translate(-50%, -50%);
	width: 3px;
	height: 110%;
	background: rgba(255, 255, 255, 0.6);
	border-radius: 1px;
	pointer-events: none;
	z-index: 2;
}

/* --------------------------------------------------------------------------
   Control Buttons (common)
   -------------------------------------------------------------------------- */

.lk-ctrl-btn {
	background: none;
	border: none;
	color: #fff;
	cursor: pointer;
	padding: 6px;
	border-radius: 4px;
	display: flex;
	align-items: center;
	justify-content: center;
	flex-shrink: 0;
	transition: background 0.15s ease, color 0.15s ease;
	line-height: 1;
}

.lk-ctrl-btn:hover {
	background: rgba(255, 255, 255, 0.12);
}

.lk-ctrl-btn .dashicons {
	font-size: 20px;
	width: 20px;
	height: 20px;
}

/* Play / Pause button — slightly larger */
.lk-ctrl-play .dashicons {
	font-size: 24px;
	width: 24px;
	height: 24px;
}

/* --------------------------------------------------------------------------
   Volume
   -------------------------------------------------------------------------- */

.lk-volume-wrap {
	display: flex;
	align-items: center;
	gap: 4px;
	flex-shrink: 0;
}

.lk-ctrl-volume-range {
	-webkit-appearance: none;
	appearance: none;
	width: 70px;
	height: 4px;
	background: rgba(255, 255, 255, 0.35);
	border-radius: 2px;
	outline: none;
	cursor: pointer;
}

.lk-ctrl-volume-range::-webkit-slider-thumb {
	-webkit-appearance: none;
	appearance: none;
	width: 12px;
	height: 12px;
	border-radius: 50%;
	background: #fff;
	cursor: pointer;
}

.lk-ctrl-volume-range::-moz-range-thumb {
	width: 12px;
	height: 12px;
	border-radius: 50%;
	background: #fff;
	cursor: pointer;
	border: none;
}

/* --------------------------------------------------------------------------
   Time Display
   -------------------------------------------------------------------------- */

.lk-time-display {
	font-size: 12px;
	color: rgba(255, 255, 255, 0.8);
	white-space: nowrap;
	flex-shrink: 0;
	letter-spacing: 0.02em;
}

/* --------------------------------------------------------------------------
   Speed Menu
   -------------------------------------------------------------------------- */

.lk-speed-wrap {
	position: relative;
	flex-shrink: 0;
}

.lk-ctrl-speed {
	font-size: 12px;
	font-weight: 600;
	padding: 5px 8px;
	border-radius: 4px;
	cursor: pointer;
	background: none;
	border: 1px solid rgba(255, 255, 255, 0.25);
	color: #fff;
	white-space: nowrap;
	transition: background 0.15s ease;
}

.lk-ctrl-speed:hover {
	background: rgba(255, 255, 255, 0.12);
}

.lk-speed-menu {
	position: absolute;
	bottom: calc(100% + 6px);
	right: 0;
	background: rgba(18, 18, 18, 0.97);
	border: 1px solid rgba(255, 255, 255, 0.12);
	border-radius: 6px;
	padding: 4px 0;
	min-width: 80px;
	display: none;
	z-index: 50;
	backdrop-filter: blur(6px);
}

.lk-speed-wrap.lk-open .lk-speed-menu {
	display: block;
}

.lk-speed-menu button {
	display: block;
	width: 100%;
	padding: 7px 14px;
	background: none;
	border: none;
	color: rgba(255, 255, 255, 0.75);
	text-align: left;
	cursor: pointer;
	font-size: 13px;
	transition: background 0.1s ease, color 0.1s ease;
}

.lk-speed-menu button:hover,
.lk-speed-menu button.lk-active {
	background: rgba(255, 255, 255, 0.1);
	color: #fff;
}

.lk-speed-menu button.lk-active {
	font-weight: 600;
	color: #ef9a9a;
}

/* --------------------------------------------------------------------------
   Subtitle Menu
   -------------------------------------------------------------------------- */

.lk-subtitle-wrap {
	position: relative;
	flex-shrink: 0;
}

.lk-subtitle-menu {
	position: absolute;
	bottom: calc(100% + 6px);
	right: 0;
	background: rgba(18, 18, 18, 0.97);
	border: 1px solid rgba(255, 255, 255, 0.12);
	border-radius: 6px;
	padding: 4px 0;
	min-width: 120px;
	display: none;
	z-index: 50;
	backdrop-filter: blur(6px);
}

.lk-subtitle-wrap.lk-open .lk-subtitle-menu {
	display: block;
}

.lk-subtitle-menu button {
	display: block;
	width: 100%;
	padding: 7px 14px;
	background: none;
	border: none;
	color: rgba(255, 255, 255, 0.75);
	text-align: left;
	cursor: pointer;
	font-size: 13px;
	transition: background 0.1s ease, color 0.1s ease;
}

.lk-subtitle-menu button:hover,
.lk-subtitle-menu button.lk-active {
	background: rgba(255, 255, 255, 0.1);
	color: #fff;
}

.lk-subtitle-menu button.lk-active {
	font-weight: 600;
	color: #80cbc4;
}

/* --------------------------------------------------------------------------
   Chapter Menu
   -------------------------------------------------------------------------- */

.lk-chapters-wrap {
	position: relative;
	flex-shrink: 0;
}

.lk-chapter-menu {
	position: absolute;
	bottom: calc(100% + 6px);
	right: 0;
	background: rgba(18, 18, 18, 0.97);
	border: 1px solid rgba(255, 255, 255, 0.12);
	border-radius: 6px;
	padding: 4px 0;
	min-width: 220px;
	max-height: 260px;
	overflow-y: auto;
	display: none;
	z-index: 50;
	backdrop-filter: blur(6px);
}

.lk-chapters-wrap.lk-open .lk-chapter-menu {
	display: block;
}

.lk-chapter-menu button {
	display: flex;
	align-items: center;
	gap: 10px;
	width: 100%;
	padding: 8px 14px;
	background: none;
	border: none;
	color: rgba(255, 255, 255, 0.75);
	text-align: left;
	cursor: pointer;
	font-size: 13px;
	transition: background 0.1s ease, color 0.1s ease;
}

.lk-chapter-menu button:hover,
.lk-chapter-menu button.lk-active {
	background: rgba(255, 255, 255, 0.1);
	color: #fff;
}

.lk-chapter-menu button.lk-active {
	font-weight: 600;
}

.lk-chapter-time {
	font-size: 11px;
	color: rgba(255, 255, 255, 0.4);
	white-space: nowrap;
	font-variant-numeric: tabular-nums;
}

.lk-chapter-label {
	flex: 1;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

/* --------------------------------------------------------------------------
   Spacer
   -------------------------------------------------------------------------- */

.lk-ctrl-spacer {
	flex: 1 1 auto;
}

/* --------------------------------------------------------------------------
   Right-click disabled overlay (transparent, just blocks the menu)
   -------------------------------------------------------------------------- */

.lk-player-video-area::after {
	content: "";
	position: absolute;
	inset: 0;
	z-index: 1;
	pointer-events: none; /* JS adds contextmenu listener on the video itself */
}

/* --------------------------------------------------------------------------
   Responsive
   -------------------------------------------------------------------------- */

@media (max-width: 480px) {
	.lk-ctrl-volume-range {
		width: 48px;
	}

	.lk-time-display {
		font-size: 11px;
	}

	.lk-player-controls {
		gap: 3px;
		padding: 0 6px;
	}
}
