/* Gravity Forms Video Recorder - frontend */

/*
 * Defeat theme/Gravity-Forms rules that override the [hidden] attribute with
 * an explicit display rule. Without this, Start/Stop/Re-record all remain
 * visible regardless of the JS state.
 */
.ginput_container_video_recorder [hidden] {
	display: none !important;
}

.ginput_container_video_recorder .gfvr-wrapper {
	display: flex;
	flex-direction: column;
	gap: 12px;
	max-width: 640px;
	padding: 16px;
	background: #f6f7f7;
	border: 1px solid #dcdcde;
	border-radius: 8px;
}

.ginput_container_video_recorder .gfvr-video-frame {
	position: relative;
	width: 100%;
	background: #000;
	border-radius: 6px;
	overflow: hidden;
}

.ginput_container_video_recorder .gfvr-preview {
	display: block;
	width: 100%;
	aspect-ratio: 16 / 9;
	background: #000;
	object-fit: cover;
}

/* Fallback for browsers that don't honor aspect-ratio cleanly. */
@supports not (aspect-ratio: 16 / 9) {
	.ginput_container_video_recorder .gfvr-preview {
		height: 0;
		padding-bottom: 56.25%;
	}
}

.ginput_container_video_recorder .gfvr-recording-indicator {
	position: absolute;
	top: 10px;
	left: 10px;
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 4px 10px;
	background: rgba( 0, 0, 0, 0.65 );
	color: #fff;
	font: 600 12px/1 system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
	border-radius: 999px;
}

.ginput_container_video_recorder .gfvr-recording-dot {
	width: 8px;
	height: 8px;
	border-radius: 50%;
	background: #d63638;
	animation: gfvr-pulse 1.2s ease-in-out infinite;
}

@keyframes gfvr-pulse {
	0%, 100% { opacity: 1; }
	50%      { opacity: 0.35; }
}

.ginput_container_video_recorder .gfvr-timer {
	font-variant-numeric: tabular-nums;
}

.ginput_container_video_recorder .gfvr-status {
	min-height: 1.25em;
	font-size: 13px;
	color: #50575e;
}

.ginput_container_video_recorder .gfvr-progress {
	width: 100%;
	height: 6px;
	background: #dcdcde;
	border-radius: 3px;
	overflow: hidden;
}

.ginput_container_video_recorder .gfvr-progress-bar {
	height: 100%;
	width: 0;
	background: #2271b1;
	transition: width 0.2s ease;
}

.ginput_container_video_recorder .gfvr-controls {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
}

.ginput_container_video_recorder .gfvr-btn {
	padding: 8px 14px;
	font: 500 14px/1.2 inherit;
	border-radius: 4px;
	border: 1px solid #2271b1;
	background: #fff;
	color: #2271b1;
	cursor: pointer;
	transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.ginput_container_video_recorder .gfvr-btn:hover,
.ginput_container_video_recorder .gfvr-btn:focus {
	background: #f0f6fc;
	outline: none;
}

.ginput_container_video_recorder .gfvr-btn:focus-visible {
	box-shadow: 0 0 0 2px rgba( 34, 113, 177, 0.35 );
}

.ginput_container_video_recorder .gfvr-btn-primary {
	background: #2271b1;
	color: #fff;
}

.ginput_container_video_recorder .gfvr-btn-primary:hover,
.ginput_container_video_recorder .gfvr-btn-primary:focus {
	background: #135e96;
	color: #fff;
}

.ginput_container_video_recorder .gfvr-btn-secondary {
	background: #fff;
	color: #50575e;
	border-color: #8c8f94;
}

.ginput_container_video_recorder .gfvr-saved-indicator {
	display: flex;
	align-items: center;
	gap: 8px;
	padding: 10px 12px;
	background: #edfaef;
	border: 1px solid #9cd5a6;
	border-radius: 6px;
	color: #1d6b30;
	font: 500 13px/1.3 inherit;
}

.ginput_container_video_recorder .gfvr-saved-check {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 20px;
	height: 20px;
	flex: 0 0 20px;
	border-radius: 50%;
	background: #00a32a;
	color: #fff;
	font-size: 12px;
	font-weight: 700;
}

.ginput_container_video_recorder .gfvr-btn:disabled {
	opacity: 0.55;
	cursor: not-allowed;
}

.ginput_container_video_recorder .gfvr-hint {
	margin: 0;
	font-size: 12px;
	color: #646970;
}

.ginput_container_video_recorder .gfvr-existing {
	margin-top: 12px;
	padding-top: 12px;
	border-top: 1px solid #dcdcde;
}

.ginput_container_video_recorder .gfvr-existing-label {
	margin: 0 0 8px;
	font-size: 13px;
	color: #50575e;
}

.ginput_container_video_recorder .gfvr-existing video {
	display: block;
	max-width: 100%;
	border-radius: 4px;
}
