@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@400;600;700&family=JetBrains+Mono:wght@500&display=swap');

:root {
	--bg: #0b0c10;
	--bg-2: #151821;
	--panel: #12141a;
	--panel-2: #1b1f2a;
	--accent: #00e5a8;
	--accent-2: #2ee6ff;
	--warning: #ffb347;
	--danger: #ff5e6c;
	--text: #e8edf2;
	--muted: #9aa4b2;
	--outline: rgba(255, 255, 255, 0.08);
	--shadow: 0 12px 40px rgba(0, 0, 0, 0.35);
	--radius: 16px;
}

* {
	margin: 0;
	padding: 0;
	box-sizing: border-box;
}

body {
	font-family: 'Space Grotesk', system-ui, sans-serif;
	color: var(--text);
	min-height: 100vh;
	background: radial-gradient(1200px 600px at 10% 0%, #1b2434 0%, transparent 60%),
		radial-gradient(800px 500px at 100% 20%, #102532 0%, transparent 55%),
		linear-gradient(160deg, var(--bg) 0%, var(--bg-2) 70%);
	padding: 32px 18px 48px;
}

.shell {
	max-width: 1100px;
	margin: 0 auto;
	display: grid;
	gap: 24px;
}

header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
}

.brand {
	display: flex;
	flex-direction: column;
	gap: 6px;
}

.brand h1 {
	font-size: 28px;
	letter-spacing: 0.5px;
}

.brand p {
	color: var(--muted);
	font-size: 14px;
}

.meta {
	font-family: 'JetBrains Mono', monospace;
	font-size: 12px;
	padding: 8px 12px;
	border-radius: 999px;
	background: rgba(255, 255, 255, 0.04);
	border: 1px solid var(--outline);
}

.view {
	display: grid;
	background: var(--panel);
	border-radius: var(--radius);
	border: 1px solid var(--outline);
	box-shadow: var(--shadow);
	padding: 28px;
	gap: 24px;
	position: relative;
	overflow: hidden;
}

.view.active {
	display: grid;
}

[x-cloak] {
	display: none !important;
}

.view::after {
	content: '';
	position: absolute;
	inset: 0;
	background: radial-gradient(400px 200px at 80% 0%, rgba(46, 230, 255, 0.08), transparent 60%);
	pointer-events: none;
}

.grid-2 {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
	gap: 20px;
}

.card {
	background: var(--panel-2);
	border-radius: 14px;
	padding: 20px;
	border: 1px solid var(--outline);
}

.field {
	display: grid;
	gap: 10px;
}

.radio-group {
	display: grid;
	gap: 12px;
	margin-top: 8px;
}

.radio-option {
	display: flex;
	align-items: center;
	gap: 10px;
	cursor: pointer;
	padding: 8px;
	border-radius: 8px;
	transition: background-color 0.2s;
}

.radio-option:hover {
	background: rgba(255, 255, 255, 0.05);
}

.radio-option input[type="radio"] {
	width: 18px;
	height: 18px;
	margin: 0;
	accent-color: var(--accent);
}

.radio-option span {
	font-size: 14px;
	color: var(--text);
}

.recordings-list {
	max-height: 400px;
	overflow-y: auto;
	margin-top: 20px;
}

.recording-item {
	display: flex;
	justify-content: space-between;
	align-items: center;
	padding: 12px;
	background: var(--panel-2);
	border-radius: 8px;
	margin-bottom: 8px;
	border: 1px solid var(--outline);
}

.recording-info {
	flex: 1;
}

.recording-filename {
	font-weight: 600;
	color: var(--text);
	margin-bottom: 4px;
}

.recording-meta {
	font-size: 12px;
	color: var(--muted);
}

.btn-download {
	background: var(--accent);
	color: var(--bg);
	padding: 6px 12px;
	border: none;
	border-radius: 6px;
	cursor: pointer;
	font-size: 12px;
	font-weight: 600;
	transition: all 0.2s;
}

.btn-download:hover {
	background: var(--accent-2);
	transform: translateY(-1px);
}

.no-recordings {
	text-align: center;
	color: var(--muted);
	padding: 40px 20px;
	font-style: italic;
}

.loading {
	text-align: center;
	color: var(--muted);
	padding: 20px;
}

label {
	font-size: 14px;
	color: var(--muted);
}

input {
	background: #0d1118;
	border: 1px solid var(--outline);
	color: var(--text);
	padding: 12px 14px;
	border-radius: 12px;
	font-size: 16px;
	outline: none;
}

input:focus {
	border-color: rgba(46, 230, 255, 0.6);
	box-shadow: 0 0 0 3px rgba(46, 230, 255, 0.15);
}

.actions {
	display: flex;
	flex-wrap: wrap;
	gap: 12px;
}

button {
	border: none;
	border-radius: 12px;
	padding: 12px 18px;
	font-size: 15px;
	font-weight: 600;
	cursor: pointer;
	transition: transform 0.2s ease, box-shadow 0.2s ease;
}

button:hover {
	transform: translateY(-2px);
	box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.btn-primary {
	background: linear-gradient(120deg, var(--accent) 0%, var(--accent-2) 100%);
	color: #06121a;
	flex: 1 1 220px;
}

.btn-outline {
	background: transparent;
	border: 1px solid var(--outline);
	color: var(--text);
}

.btn-duration {
	background: #101521;
	border: 1px solid var(--outline);
	color: var(--text);
	min-width: 140px;
}

.btn-duration.active {
	border-color: var(--accent);
	box-shadow: 0 0 0 2px rgba(0, 229, 168, 0.2);
}

.btn-danger {
	background: var(--danger);
	color: #fff;
}

.video-wrap {
	background: #050607;
	border-radius: 14px;
	overflow: hidden;
	border: 1px solid rgba(255, 255, 255, 0.05);
	aspect-ratio: 16 / 9;
	position: relative;
}

video {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

.status-pill {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	padding: 6px 12px;
	border-radius: 999px;
	background: rgba(255, 255, 255, 0.06);
	border: 1px solid var(--outline);
	font-size: 13px;
}

.dot {
	width: 10px;
	height: 10px;
	border-radius: 50%;
	background: var(--warning);
}

.dot.live {
	background: var(--danger);
	animation: pulse 1.2s ease-in-out infinite;
}

@keyframes pulse {
	0%, 100% { opacity: 1; }
	50% { opacity: 0.4; }
}

.notice {
	color: var(--muted);
	font-size: 14px;
	line-height: 1.6;
}

.qris-box {
	border: 1px dashed rgba(46, 230, 255, 0.4);
	background: rgba(255, 255, 255, 0.7);
	border-radius: 16px;
	padding: 24px;
	text-align: center;
	min-height: 360px;
	display: grid;
	place-items: center;
	gap: 12px;
}

.qris-box > * {
	border-radius: 0 !important;
}

.qr-container {
	padding: 50px;
	background: white;
	border-radius: 0;
}

.helper {
	font-size: 12px;
	color: var(--muted);
}

.error {
	color: #ffd4d4;
	background: rgba(255, 94, 108, 0.15);
	border: 1px solid rgba(255, 94, 108, 0.4);
	padding: 10px 12px;
	border-radius: 12px;
	font-size: 13px;
	display: none;
}

.error.show {
	display: block;
}

@media (max-width: 640px) {
	.view {
		padding: 20px;
	}

	header {
		flex-direction: column;
		align-items: flex-start;
	}
}

/* Modal */
.modal {
	position: fixed;
	inset: 0;
	background: rgba(0, 0, 0, 0.8);
	display: flex;
	align-items: center;
	justify-content: center;
	z-index: 1000;
}

.modal-content {
	background: var(--panel);
	padding: 20px;
	border-radius: 12px;
	max-width: 400px;
	width: 90%;
	text-align: center;
	border: 1px solid var(--outline);
}

.modal-content h3 {
	margin-bottom: 10px;
}
