/* looptrainer app styles
 * Ported from the Loop Video WordPress plugin (assets/css/shortcode.css, v1.1.4)
 * and reworked for the dependency-free range slider in looptrainer.js.
 */

.lv-app {
	max-width: 642px;
	background-color: #F9F9F9;
}

.lv-tabs {
	display: flex;
	flex-wrap: wrap;
	position: relative;
	margin-bottom: -1px;
}

.lv-tab {
	border: none;
	font-weight: bold;
	text-align: center;
	padding: 20px 40px;
	background-color: #EEE;
	border: 1px solid transparent;
	border-bottom: none;
	box-sizing: border-box;
	width: 50%;
	color: #333;
	font: bold 16px/1 -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
}

.lv-tab.lv-active {
	border-color: #EEE;
	background-color: #F9F9F9;
}

.lv-tab:not(.lv-active):hover {
	cursor: pointer;
}

.lv-tab:focus-visible {
	outline: 2px solid #333;
	outline-offset: -2px;
}

.lv-tab-content {
	padding: 20px;
	display: none;
	border: 1px solid #EEE;
}

.lv-tab-content.lv-active {
	display: block;
}

/* Player area. The ::after overlay keeps clicks off the YouTube iframe so the
 * loop controls stay the only way to seek. */
.lv-player-wrap {
	position: relative;
}

.lv-player-wrap::after {
	z-index: 10;
	left: 0;
	right: 0;
	top: 0;
	bottom: 0;
	content: " ";
	position: absolute;
	background-color: rgba(255, 255, 255, 0.2);
}

.lv-video {
	display: flex;
	margin-top: 20px;
	position: relative;
}

.lv-audio > audio {
	width: 100%;
}

.lv-audio {
	opacity: 0;
	visibility: hidden;
	left: -9999px;
	position: absolute;
}

div.lv-video {
	color: #333;
	font-weight: bold;
	min-height: 100px;
	align-items: center;
	text-align: center;
	justify-content: center;
	background-color: #EEE;
}

iframe.lv-video {
	width: 100%;
}

.lv-controls {
	display: none;
}

.lv-controls.lv-visible {
	display: block;
}

.lv-loop-controls {
	display: flex;
	flex-wrap: nowrap;
	margin: 10px -5px;
	align-items: flex-start;
	justify-content: space-between;
}

.lv-loop-controls > div {
	padding: 5px;
	box-sizing: border-box;
}

.lv-loop-controls label {
	width: 100%;
	display: block;
	font-size: 12px;
	text-align: center;
	margin-bottom: 3px;
	white-space: nowrap;
}

.lv-loop-controls input,
.lv-length-text {
	width: 100%;
	max-width: 80px;
	padding: 5px;
	font-size: 16px;
	line-height: 1.2;
	text-align: center;
	box-sizing: border-box;
	border: 1px solid #AAA;
	font-family: 'Courier New', Courier, monospace;
	background: #FFF;
	color: #333;
}

.lv-length-text {
	border-color: transparent;
	background: transparent;
}

.lv-repeat-input {
	-webkit-appearance: none;
	-moz-appearance: textfield;
	appearance: textfield;
}

.lv-loop-controls input:disabled {
	opacity: 0.7;
}

.lv-loop-controls input:disabled:hover {
	cursor: not-allowed;
}

.lv-url-wrap,
.lv-file-wrap {
	position: relative;
}

.lv-url-input,
.lv-file-input {
	width: 100%;
	height: 60px;
	font-size: 18px;
	line-height: 1.2;
	padding: 16px 90px 16px 25px;
	box-sizing: border-box;
	background-color: #FFF;
	border: 1px solid #EEE;
	color: #333;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
}

.lv-file-input {
	font-size: 14px;
	padding-top: 18px;
}

.lv-url-btn,
.lv-file-btn {
	top: 12px;
	right: 12px;
	padding: 7px;
	cursor: pointer;
	position: absolute;
	border-radius: 3px;
	background-color: #eee;
	border: 1px solid #CCC;
	color: #333;
	font: 13.3333px -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
}

.lv-visually-hidden {
	position: absolute !important;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

.lv-url-input:disabled:hover,
.lv-url-btn:disabled:hover,
.lv-file-input:disabled:hover,
.lv-file-btn:disabled:hover {
	cursor: not-allowed;
}

.lv-status {
	font-size: 14px;
	margin-top: 20px;
	text-align: center;
	min-height: 1.4em;
}

.lv-start-wrap {
	text-align: center;
	margin-top: 20px;
}

.lv-start-btn,
.lv-stop-btn {
	color: #FFF;
	width: 100px;
	padding: 10px;
	cursor: pointer;
	font-weight: bold;
	border-radius: 3px;
	border: 1px solid #333;
	background-color: #333;
	font: bold 13.3333px -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
}

.lv-start-btn,
.lv-start-btn:hover {
	border-color: green;
	background-color: green;
}

.lv-stop-btn,
.lv-stop-btn:hover {
	border-color: red;
	background-color: red;
}

.lv-start-btn[hidden],
.lv-stop-btn[hidden] {
	display: none !important;
}

/* Dual-handle range slider (replaces jQuery UI slider + touch-punch). */
.lv-range {
	position: relative;
	height: 3px;
	min-width: 200px;
	background: #aaa;
	border-radius: 2px;
	margin: 30px 24px 10px 8px;
	touch-action: none;
	cursor: pointer;
}

.lv-range.lv-disabled {
	opacity: 0.8;
	cursor: not-allowed;
}

.lv-range-fill {
	position: absolute;
	top: 0;
	height: 100%;
	background: red;
	z-index: 1;
}

.lv-range-handle {
	position: absolute;
	top: 50%;
	width: 17px;
	height: 17px;
	margin: 0;
	transform: translate(-50%, -50%);
	border-radius: 50%;
	background: red;
	z-index: 10;
	cursor: grab;
	touch-action: none;
}

.lv-range-handle::before {
	/* Larger invisible hit target for fingers. */
	content: "";
	position: absolute;
	inset: -10px;
}

.lv-range-handle:active,
.lv-range-handle.lv-active {
	cursor: grabbing;
}

.lv-range-handle:focus-visible {
	outline: 2px solid #333;
	outline-offset: 3px;
}

.lv-range.lv-disabled .lv-range-handle {
	cursor: not-allowed;
}

.lv-red {
	color: red !important;
}

@media screen and (min-width: 768px) {
	div.lv-video {
		min-height: 300px;
	}

	.lv-loop-controls input,
	.lv-length-text {
		padding: 6px;
		font-size: 20px;
		max-width: 100px;
	}
}
