<section id="screen-home-client" class="flex flex-col gap-12 max-w-7xl mx-auto h-full">
	<div class="flex justify-between items-center mb-4">
		<h2 class="text-2xl font-bold text-white tracking-tight">Client Dashboard</h2>
		<div class="flex gap-3">
			<button
				id="linkCameraBtn"
				class="btn btn-outline border-white/10 text-gray-300 hover:text-white hover:bg-white/5 rounded-xl gap-2 shadow-none"
			>
				<svg xmlns="http://www.w3.org/2000/svg" class="h-4 w-4" fill="none" viewBox="0 0 24 24" stroke="currentColor">
					<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M12 4v16m8-8H4" />
				</svg>
				Link Camera
			</button>
			<button
				id="refreshClientBtn"
				class="btn btn-ghost btn-square rounded-xl bg-white/5 border border-white/5 hover:bg-white/10"
				aria-label="Refresh linked cameras"
				title="Refresh linked cameras"
			>
				<svg xmlns="http://www.w3.org/2000/svg" class="h-4 w-4" fill="none" viewBox="0 0 24 24" stroke="currentColor">
					<path
						stroke-linecap="round"
						stroke-linejoin="round"
						stroke-width="2"
						d="M4 4v5h.582m15.356 2A8.001 8.001 0 004.582 9m0 0H9m11 11v-5h-.581m0 0a8.003 8.003 0 01-15.357-2m15.357 2H15"
					/>
				</svg>
			</button>
		</div>
	</div>

	<div class="glass-card rounded-3xl border border-white/5 p-5 shrink-0 mb-4">
		<h3 class="text-xs font-bold text-gray-400 uppercase tracking-wider mb-4">Your Cameras</h3>
		<div id="linkedCamerasList" class="flex overflow-x-auto gap-4 pb-2 snap-x">
			<div class="w-full text-center py-6 bg-black/20 rounded-2xl border border-dashed border-white/10">
				<p class="text-gray-500 text-sm">No cameras linked yet</p>
			</div>
		</div>
	</div>

	<div class="flex flex-col xl:flex-row gap-8 flex-1 min-h-0">
		<div
			id="clientStreamViewerWrapper"
			class="flex-1 glass-card rounded-3xl overflow-hidden border border-white/10 flex flex-col shadow-xl min-h-[400px] hidden"
		>
			<div class="px-5 py-4 border-b border-white/5 bg-black/20 flex justify-between items-center">
				<div class="flex items-center gap-3">
					<span class="w-2 h-2 rounded-full bg-red-500 animate-[pulse_2s_ease-in-out_infinite] hidden" id="clientLiveDot"></span>
					<h3 class="font-medium text-white tracking-wide" id="clientStreamViewerTitle">Live Feed Viewer</h3>
				</div>
				<button
					id="closeStreamViewerBtn"
					class="btn btn-ghost btn-sm btn-circle text-gray-400 hover:text-white"
					aria-label="Close stream viewer"
					title="Close stream viewer"
				>
					<svg xmlns="http://www.w3.org/2000/svg" class="h-4 w-4" fill="none" viewBox="0 0 24 24" stroke="currentColor">
						<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M6 18L18 6M6 6l12 12" />
					</svg>
				</button>
			</div>

			<div id="clientStreamContainer" class="flex-1 bg-black relative flex items-center justify-center">
				<video id="clientStreamVideo" class="absolute inset-0 w-full h-full object-contain hidden" playsinline></video>
				<img id="clientStreamImage" class="absolute inset-0 w-full h-full object-contain hidden" alt="Live stream frame" />

				<div id="clientStreamPlaceholder" class="flex flex-col items-center gap-4 animate-pulse">
					<svg xmlns="http://www.w3.org/2000/svg" class="h-12 w-12 text-gray-700" fill="none" viewBox="0 0 24 24" stroke="currentColor">
						<path
							stroke-linecap="round"
							stroke-linejoin="round"
							stroke-width="2"
							d="M15 10l4.553-2.276A1 1 0 0121 8.618v6.764a1 1 0 01-1.447.894L15 14M5 18h8a2 2 0 002-2V8a2 2 0 00-2-2H5a2 2 0 00-2 2v8a2 2 0 002 2z"
						></path>
					</svg>
					<p class="text-sm font-medium text-gray-500 tracking-wide uppercase">Select a camera to view</p>
				</div>
			</div>
		</div>

		<div class="xl:w-96 shrink-0 flex flex-col gap-6 overflow-y-auto pr-2">
			<div class="glass-card rounded-3xl border border-white/5 p-5 flex-1">
				<h3 class="text-xs font-bold text-gray-400 uppercase tracking-wider mb-4">Recent Recordings</h3>
				<div id="recordingsList" class="space-y-3"></div>
			</div>
		</div>
	</div>
</section>
