:root{
	--primary: #3b82f6;
	--primary-dark: #2563eb;
	--secondary: #64748b;
	--bg: #0f172a;
	--card: #1e293b;
	--text: #f1f5f9;
	--text-dim: #94a3b8;
	--border: #334155;
	--accent: #22d3ee;
	--success: #10b981;
	--drop-bg: #1e293b;
	--qr-bg: #0f172a;
	--progress-bg: #0f172a;
	--input-bg: #0f172a;
}

/* Light mode theme */
[data-theme="light"] {
	--primary: #2563eb;
	--primary-dark: #1d4ed8;
	--secondary: #0891b2;
	--bg: #f1f5f9;
	--card: #ffffff;
	--text: #0f172a;
	--text-dim: #64748b;
	--border: #cbd5e1;
	--accent: #0ea5e9;
	--success: #059669;
	--drop-bg: #f8fafc;
	--qr-bg: #e0f2fe;
	--progress-bg: #e0f2fe;
	--input-bg: #f8fafc;
}

/* Minimal centered layout */
.hero {
	text-align: center;
	margin-bottom: 3rem;
	padding-top: 2rem;
	position: relative;
}
.hero h1 {
	font-size: clamp(2.5rem, 6vw, 3.5rem);
	font-weight: 700;
	margin: 0 0 0.5rem 0;
	color: var(--text);
	letter-spacing: -0.03em;
}
.hero .subtitle {
	color: var(--text-dim);
	font-size: 1.1rem;
	margin: 0;
}

/* Theme Switch Toggle */
.theme-switch-wrapper {
	position: absolute;
	top: 0;
	right: 0;
}

.theme-switch {
	position: relative;
	display: inline-block;
	width: 60px;
	height: 32px;
	cursor: pointer;
}

.theme-switch input {
	opacity: 0;
	width: 0;
	height: 0;
}

.slider {
	position: absolute;
	top: 0;
	left: 0;
	right: 0;
	bottom: 0;
	background-color: var(--border);
	border-radius: 34px;
	transition: all 0.3s ease;
	box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
}

.slider:before {
	content: "";
	position: absolute;
	height: 24px;
	width: 24px;
	left: 4px;
	bottom: 4px;
	background-color: white;
	border-radius: 50%;
	transition: all 0.3s ease;
	box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.slider-icon {
	position: absolute;
	top: 50%;
	transform: translateY(-50%);
	font-size: 1rem;
	transition: all 0.3s ease;
	left: 8px;
	opacity: 0;
}

input:checked + .slider {
	background-color: var(--primary);
}

input:checked + .slider:before {
	transform: translateX(28px);
}

input:checked + .slider .slider-icon {
	left: 8px;
	opacity: 1;
}

input:not(:checked) + .slider .slider-icon {
	left: auto;
	right: 8px;
	opacity: 1;
}

.slider:hover {
	box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.15), 0 0 0 2px var(--primary);
}

/* Light mode - show sun icon */
[data-theme="light"] .slider-icon {
	filter: grayscale(1) brightness(0.4);
}

@media (max-width: 640px) {
	.theme-switch-wrapper {
		position: fixed;
		top: 1rem;
		right: 1rem;
		z-index: 100;
	}
}

.main-card {
	max-width: 700px;
	margin: 0 auto;
	background: var(--card);
	border: 1px solid var(--border);
	border-radius: 16px;
	padding: 0;
	overflow: hidden;
	transition: background-color 0.3s ease, border-color 0.3s ease;
}

.section {
	padding: 2rem;
}

.section-header {
	display: flex;
	align-items: center;
	gap: 0.75rem;
	margin-bottom: 1.5rem;
}
.section-header .emoji {
	font-size: 1.5rem;
}
.section-header h2 {
	font-size: 1.25rem;
	font-weight: 600;
	margin: 0;
	color: var(--text);
}

.divider {
	height: 1px;
	background: var(--border);
	margin: 0;
}
/* Buttons */
.button-group {
	display: flex;
	gap: 0.75rem;
	margin-bottom: 1.5rem;
	flex-wrap: wrap;
}

.btn-primary, .btn-secondary {
	padding: 0.75rem 2rem;
	border: none;
	border-radius: 8px;
	font-size: 1rem;
	font-weight: 600;
	cursor: pointer;
	transition: all 0.2s;
}

.btn-primary {
	background: var(--primary);
	color: white;
	flex: 1;
	min-width: 120px;
}
.btn-primary:hover {
	background: var(--primary-dark);
	transform: translateY(-1px);
}

.btn-secondary {
	background: var(--secondary);
	color: white;
	flex: 1;
	min-width: 120px;
}
.btn-secondary:hover {
	background: var(--accent);
	transform: translateY(-1px);
}

.button-group input {
	flex: 2;
	min-width: 140px;
	background: var(--input-bg);
	color: var(--text);
	border: 1px solid var(--border);
	border-radius: 8px;
	padding: 0.75rem 1rem;
	font-size: 1rem;
	text-align: center;
	text-transform: uppercase;
	letter-spacing: 2px;
	font-weight: 600;
	transition: all 0.3s ease;
}
.button-group input:focus {
	outline: none;
	border-color: var(--primary);
}
.button-group input::placeholder {
	color: var(--text-dim);
	text-transform: none;
	letter-spacing: 0;
	font-weight: 400;
}
/* QR Section */
.qr-section {
	text-align: center;
	padding: 1.5rem;
	background: var(--qr-bg);
	border-radius: 12px;
	margin-bottom: 1rem;
	min-height: 100px;
	border: 1px solid var(--border);
	transition: all 0.3s ease;
}
.qr-section:empty {
	display: none;
}
.qr-section canvas, .qr-section img {
	border-radius: 8px;
	margin-top: 1rem;
}
.status {
	text-align: center;
	padding: 0.75rem;
	background: var(--bg);
	border-radius: 8px;
	color: var(--text-dim);
	font-size: 0.9rem;
	border: 1px solid var(--border);
	transition: all 0.3s ease;
}
.status.connected {
	color: var(--success);
	border-color: var(--success);
	background: rgba(16, 185, 129, 0.1);
}

/* Safari warning banner */
.safari-warning {
	text-align: center;
	padding: 0.75rem 1rem;
	background: rgba(245, 158, 11, 0.15);
	border-radius: 8px;
	color: var(--text);
	font-size: 0.85rem;
	border: 1px solid rgba(245, 158, 11, 0.3);
	margin-top: 0.75rem;
	animation: fadeIn 0.3s ease;
}
[data-theme="light"] .safari-warning {
	background: rgba(245, 158, 11, 0.1);
	border-color: rgba(245, 158, 11, 0.4);
}

/* Drop area */
.drop-area {
	border: 2px dashed var(--border);
	border-radius: 12px;
	padding: 3rem 2rem;
	text-align: center;
	background: var(--drop-bg);
	transition: all 0.2s;
	cursor: pointer;
	margin-bottom: 1.5rem;
	user-select: none;
}
.drop-area:hover {
	border-color: var(--primary);
	background: rgba(59, 130, 246, 0.05);
}
.drop-area.drag {
	border-color: var(--accent);
	background: rgba(34, 211, 238, 0.1);
	transform: scale(1.02);
}
.drop-content {
	pointer-events: none;
}
.drop-icon {
	font-size: 3rem;
	display: block;
	margin-bottom: 1rem;
	opacity: 0.5;
}
.drop-area p {
	margin: 0;
	color: var(--text-dim);
	font-size: 1rem;
}
.link {
	color: var(--primary);
	cursor: pointer;
	text-decoration: underline;
	font-weight: 600;
}
.link:hover {
	color: var(--accent);
}
/* Progress */
.progress-section {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 1rem;
	margin-bottom: 1.5rem;
}
.progress-item label {
	display: block;
	font-size: 0.85rem;
	color: var(--text-dim);
	margin-bottom: 0.5rem;
	text-transform: uppercase;
	letter-spacing: 0.5px;
	font-weight: 600;
}
.progress-item progress {
	width: 100%;
	height: 8px;
	border-radius: 4px;
	border: none;
	background: var(--progress-bg);
	overflow: hidden;
}
.progress-item progress::-webkit-progress-bar {
	background: var(--progress-bg);
	border-radius: 4px;
}
.progress-item progress::-webkit-progress-value {
	background: var(--primary);
	border-radius: 4px;
	transition: all 0.3s ease;
}
.progress-item progress::-moz-progress-bar {
	background: var(--primary);
	border-radius: 4px;
	transition: all 0.3s ease;
}
/* Media Gallery */
.media-gallery {
	display: flex;
	gap: 0.75rem;
	overflow-x: auto;
	overflow-y: hidden;
	padding: 1rem 0.5rem;
	margin-bottom: 1rem;
	scroll-behavior: smooth;
	-webkit-overflow-scrolling: touch;
	scrollbar-width: thin;
	scrollbar-color: var(--primary) var(--bg);
}

.media-gallery::-webkit-scrollbar {
	height: 8px;
}

.media-gallery::-webkit-scrollbar-track {
	background: var(--bg);
	border-radius: 4px;
}

.media-gallery::-webkit-scrollbar-thumb {
	background: var(--primary);
	border-radius: 4px;
}

.media-gallery::-webkit-scrollbar-thumb:hover {
	background: var(--primary-dark);
}

.media-item {
	position: relative;
	flex-shrink: 0;
	width: 180px;
	height: 180px;
	border-radius: 8px;
	overflow: hidden;
	background: var(--drop-bg);
	border: 1px solid var(--border);
	transition: all 0.2s;
	cursor: pointer;
}

.media-item:hover {
	transform: translateY(-2px);
	box-shadow: 0 4px 12px rgba(59, 130, 246, 0.2);
	border-color: var(--primary);
}

.media-item img,
.media-item video {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

.media-item-overlay {
	position: absolute;
	bottom: 0;
	left: 0;
	right: 0;
	background: linear-gradient(to top, rgba(0,0,0,0.8), transparent);
	padding: 0.75rem 0.5rem 0.5rem;
	display: flex;
	align-items: center;
	justify-content: space-between;
	opacity: 0;
	transition: opacity 0.2s;
}

.media-item:hover .media-item-overlay {
	opacity: 1;
}

.media-item-name {
	font-size: 0.75rem;
	color: white;
	font-weight: 600;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
	max-width: 100px;
}

.media-item-actions {
	display: flex;
	gap: 0.25rem;
}

.media-action-btn {
	background: rgba(0, 0, 0, 0.7);
	border: 1px solid rgba(255, 255, 255, 0.3);
	color: white;
	width: 32px;
	height: 32px;
	border-radius: 6px;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 0.95rem;
	transition: all 0.2s;
	backdrop-filter: blur(8px);
	box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}

.media-action-btn:hover {
	background: rgba(0, 0, 0, 0.85);
	border-color: rgba(255, 255, 255, 0.5);
	transform: scale(1.1);
	box-shadow: 0 3px 8px rgba(0, 0, 0, 0.4);
}

.media-action-btn:active {
	transform: scale(0.95);
	box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

/* Downloads */
.downloads {
	background: var(--bg);
	border-radius: 8px;
	padding: 1rem;
	min-height: 60px;
	border: 1px solid var(--border);
	transition: all 0.3s ease;
}
.downloads:empty::before {
	content: "Received files appear here";
	color: var(--text-dim);
	font-size: 0.9rem;
}
.downloads a {
	display: inline-block;
	padding: 0.5rem 1rem;
	background: var(--primary);
	color: white;
	text-decoration: none;
	border-radius: 6px;
	font-size: 0.9rem;
	font-weight: 600;
	margin: 0.25rem 0.5rem 0.25rem 0;
	transition: all 0.2s;
}
.downloads a:hover {
	background: var(--primary-dark);
	transform: translateY(-1px);
}
/* Footer */
.footer {
	text-align: center;
	margin-top: 3rem;
	padding: 2rem 1rem 1.5rem;
	border-top: 1px solid var(--border);
}

.footer-main {
	margin-bottom: 1rem;
}

.footer-tagline {
	margin: 0;
	color: var(--text-dim);
	font-size: 0.9rem;
	font-weight: 500;
}

.footer-links {
	display: flex;
	justify-content: center;
	align-items: center;
	gap: 0.75rem;
	flex-wrap: wrap;
	margin-bottom: 0.75rem;
}

.footer-links a {
	color: var(--text-dim);
	text-decoration: none;
	font-size: 0.85rem;
	transition: color 0.2s;
}

.footer-links a:hover {
	color: var(--primary);
}

.footer-links span {
	color: var(--border);
	font-size: 0.75rem;
}

.footer-meta {
	color: var(--secondary);
	font-size: 0.8rem;
	opacity: 0.6;
}

@media (max-width: 640px) {
	.footer-links {
		flex-direction: column;
		gap: 0.5rem;
	}
	.footer-links span {
		display: none;
	}
}
/* Image Viewer */
.image-viewer {
	display: none;
	position: fixed;
	top: 50%;
	left: 50%;
	transform: translate(-50%, -50%);
	max-width: 90vw;
	max-height: 90vh;
	background: var(--card);
	border: 1px solid var(--border);
	border-radius: 12px;
	padding: 1.5rem;
	z-index: 1000;
}
.image-viewer.show {
	display: block;
}
.viewer-stage {
	text-align: center;
	margin-bottom: 1rem;
}
.viewer-stage img {
	max-width: 100%;
	max-height: 60vh;
	border-radius: 8px;
}
.viewer-controls {
	display: flex;
	justify-content: center;
	gap: 0.5rem;
	flex-wrap: wrap;
}
.viewer-btn {
	padding: 0.5rem 1rem;
	background: var(--bg);
	border: 1px solid var(--border);
	border-radius: 6px;
	color: var(--text);
	cursor: pointer;
	font-size: 0.9rem;
	font-weight: 500;
	transition: all 0.2s;
}
.viewer-btn:hover {
	background: var(--primary);
	border-color: var(--primary);
}
.viewer-btn[disabled] {
	opacity: 0.3;
	cursor: not-allowed;
}

@media (max-width: 768px) {
	.control-row { flex-direction: column; }
	.control-row input { min-width: auto; }
	.progress-row { grid-template-columns: 1fr; }
}

/* Base */
* {
	box-sizing: border-box;
	margin: 0;
	padding: 0;
}

body {
	background: var(--bg);
	color: var(--text);
	font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', sans-serif;
	line-height: 1.6;
	padding: 2rem 1rem;
	min-height: 100vh;
	-webkit-font-smoothing: antialiased;
	transition: background-color 0.3s ease, color 0.3s ease;
}

.container {
	max-width: 750px;
	margin: 0 auto;
}

/* Responsive */
@media (max-width: 640px) {
	.button-group {
		flex-direction: column;
	}
	.button-group input,
	.btn-primary,
	.btn-secondary {
		width: 100%;
		min-width: auto;
	}
	.progress-section {
		grid-template-columns: 1fr;
	}
	.section {
		padding: 1.5rem;
	}
}

/* Toast Notification */
.toast {
	position: fixed;
	bottom: 2rem;
	left: 50%;
	transform: translateX(-50%) translateY(100px);
	background: rgba(0, 0, 0, 0.9);
	color: white;
	padding: 1rem 1.5rem;
	border-radius: 8px;
	font-size: 0.95rem;
	font-weight: 600;
	box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
	z-index: 10000;
	opacity: 0;
	transition: all 0.3s ease;
	backdrop-filter: blur(10px);
	border: 1px solid rgba(255, 255, 255, 0.1);
	max-width: 90%;
	text-align: center;
}

.toast.show {
	opacity: 1;
	transform: translateX(-50%) translateY(0);
}

/* Light mode toast */
[data-theme="light"] .toast {
	background: rgba(15, 23, 42, 0.95);
	border-color: rgba(255, 255, 255, 0.2);
}

