:root {
	--bg: #f8fffe;
	--fg: #1a202c;
	--muted: #4a5568;
	--card: #ffffff;
	--primary: #15A858;
	--accent: #A5C94D;
	--danger: #e53e3e;
	--success: #38a169;
	--warning: #d69e2e;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; height: 100%; }
body {
	font-family: system-ui, -apple-system, Segoe UI, Roboto, Ubuntu, Cantarell, Noto Sans, Helvetica, Arial, "Apple Color Emoji", "Segoe UI Emoji";
	background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
	min-height: 100vh;
	color: var(--fg);
	line-height: 1.6;
}

.container { max-width: 960px; margin: 0 auto; padding: 1rem; }

h1 { font-size: 1.5rem; margin: 0.5rem 0 0.25rem; }
header p { color: var(--muted); margin: 0 0 1rem; }

.tips {
	background: var(--card);
	border: 1px solid #1f2937;
	border-radius: 8px;
	padding: 1rem;
	margin: 1rem 0;
}
.tips h3 { margin: 0 0 0.5rem; font-size: 1rem; }
.tips ul { margin: 0; padding-left: 1.5rem; }
.tips li { margin: 0.25rem 0; color: var(--muted); }

		.card {
	background: #ffffff;
	border: 1px solid rgba(0, 0, 0, 0.1);
	border-radius: 16px;
	padding: 1.5rem;
	margin-bottom: 1.5rem;
	box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

.file-input input[type="file"] {
	width: 100%;
	padding: 0.75rem;
	background: rgba(255, 255, 255, 0.9);
	color: var(--fg);
	border: 2px dashed var(--accent);
	border-radius: 12px;
	transition: background-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.actions { display: flex; gap: 0.75rem; margin-top: 0.75rem; flex-wrap: wrap; }
button {
	background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
	border: none;
	color: white;
	padding: 0.75rem 1.25rem;
	border-radius: 12px;
	cursor: pointer;
	font-weight: 600;
	transition: background-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
	box-shadow: 0 2px 8px rgba(21, 168, 88, 0.2);
}
button:hover {
	transform: translateY(-1px);
	box-shadow: 0 4px 15px rgba(21, 168, 88, 0.3);
}
button:active {
	transform: translateY(0);
}
button[type="submit"] { 
	background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
	font-weight: 700;
}
button:disabled { 
	opacity: 0.6; 
	cursor: not-allowed; 
	transform: none;
	box-shadow: none;
}

.video-wrapper { 
	width: 100%; 
	aspect-ratio: 3/4; 
	background: rgba(255, 255, 255, 0.9); 
	border-radius: 12px; 
	overflow: hidden;
	border: 2px solid rgba(0, 0, 0, 0.1);
}
video { width: 100%; height: 100%; object-fit: cover; }

pre { 
	white-space: pre-wrap; 
	word-break: break-word; 
	background: rgba(255, 255, 255, 0.95); 
	padding: 1.5rem; 
	border-radius: 12px; 
	font-family: 'Courier New', monospace;
	font-size: 0.9rem;
	line-height: 1.6;
	border: 1px solid rgba(0, 0, 0, 0.1);
	color: var(--fg);
}

#result-content {
	background: rgba(255, 255, 255, 0.95);
	border-radius: 12px;
	border: 1px solid rgba(0, 0, 0, 0.1);
	padding: 1rem;
}

#result-content pre {
	background: transparent;
	border: none;
	padding: 0;
	margin: 0;
}

/* Modal Styles */
.modal {
	position: fixed;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	background: rgba(0, 0, 0, 0.8);
	display: none;
	align-items: center;
	justify-content: center;
	z-index: 1000;
	padding: 1rem;
}

.modal:not([hidden]) {
	display: flex;
}

.modal-content {
	background: var(--card);
	border: 1px solid #1f2937;
	border-radius: 12px;
	width: 100%;
	max-width: 500px;
	max-height: 85vh;
	overflow: hidden;
	display: flex;
	flex-direction: column;
}

.modal-header {
	display: flex;
	justify-content: space-between;
	align-items: center;
	padding: 1rem;
	border-bottom: 1px solid #1f2937;
}

.modal-header h3 {
	margin: 0;
	font-size: 1.1rem;
}

.close-btn {
	background: none;
	border: none;
	color: var(--muted);
	font-size: 1.5rem;
	cursor: pointer;
	padding: 0;
	width: 30px;
	height: 30px;
	display: flex;
	align-items: center;
	justify-content: center;
	border-radius: 4px;
}

.close-btn:hover {
	background: #1f2937;
	color: var(--fg);
}

.modal-body {
	padding: 1rem;
	flex: 1;
	display: flex;
	flex-direction: column;
	overflow-y: auto;
	min-height: 0;
}

.modal-body .video-wrapper {
	flex-shrink: 0;
	min-height: 300px;
	max-height: 400px;
}

.modal-body .actions {
	flex-shrink: 0;
	margin-top: 1rem;
	justify-content: center;
}

@media (min-width: 768px) {
	.video-wrapper { aspect-ratio: 16/9; }
	.modal-content { max-width: 600px; }
}
