
	/* ===== CSS VARIABLES ===== */
	:root {
		--upload-primary: #7c3aed;
		--upload-primary-light: #a78bfa;
		--upload-success: #22c55e;
		--upload-success-dark: #16a34a;
		--upload-text-dark: #1a1a2e;
		--upload-text-muted: #6b7280;
		--upload-text-light: #9ca3af;
		--upload-bg: #ffffff;
		--upload-bg-soft: #fafafa;
		--upload-bg-accent: #f8f7ff;
		--upload-border: rgba(0, 0, 0, 0.06);
		--upload-border-accent: rgba(124, 58, 237, 0.08);
	}

	/* ===== OVERLAY ===== */
	.upload-modal-overlay {
		position: fixed;
		inset: 0;
		z-index: 9999;
		display: flex;
		align-items: center;
		justify-content: center;
		padding: 16px;
		background: rgba(255, 255, 255, 0.50);
		backdrop-filter: blur(12px);
		-webkit-backdrop-filter: blur(7px);
		overflow: hidden;
	}

	/* ===== MODAL CARD ===== */
	.upload-modal-card {
		position: relative;
		width: 100%;
		max-width: 580px;
		max-height: calc(100vh - 32px);
		max-height: calc(100dvh - 32px);
		background: var(--upload-bg);
		border-radius: 24px;
		border: 1px solid var(--upload-border);
		box-shadow: 
			0 0 0 1px rgba(0, 0, 0, 0.02),
			0 20px 40px -10px rgba(0, 0, 0, 0.12),
			0 8px 16px -6px rgba(124, 58, 237, 0.06);
		font-family: 'Outfit', -apple-system, BlinkMacSystemFont, sans-serif;
		animation: cardAppear 0.4s cubic-bezier(0.16, 1, 0.3, 1);
		display: flex;
		flex-direction: column;
		overflow: hidden;
	}

	@keyframes cardAppear {
		from {
			opacity: 0;
			transform: translateY(20px) scale(0.97);
		}
		to {
			opacity: 1;
			transform: translateY(0) scale(1);
		}
	}

	/* ===== HEADER ===== */
	.upload-modal-header {
		padding: 20px 20px 16px;
		display: flex;
		align-items: center;
		gap: 14px;
		background: linear-gradient(180deg, var(--upload-bg-soft) 0%, var(--upload-bg) 100%);
		border-bottom: 1px solid var(--upload-border);
		flex-shrink: 0;
	}

	.header-icon-container {
		position: relative;
		width: 48px;
		height: 48px;
		flex-shrink: 0;
	}

	.icon-pulse-ring {
		position: absolute;
		inset: 0;
		border-radius: 50%;
		border: 2px solid rgba(124, 58, 237, 0.2);
		animation: pulseRing 2s ease-out infinite;
	}

	.icon-pulse-ring.delay-1 { animation-delay: 0.4s; }
	.icon-pulse-ring.delay-2 { animation-delay: 0.8s; }

	@keyframes pulseRing {
		0% { transform: scale(1); opacity: 1; }
		100% { transform: scale(1.5); opacity: 0; }
	}

	.header-icon {
		position: absolute;
		inset: 0;
		display: flex;
		align-items: center;
		justify-content: center;
		background: linear-gradient(135deg, var(--upload-primary) 0%, var(--upload-primary-light) 100%);
		border-radius: 50%;
		box-shadow: 
			0 6px 16px rgba(124, 58, 237, 0.3),
			0 3px 6px rgba(124, 58, 237, 0.15);
	}

	.header-icon svg {
		width: 22px;
		height: 22px;
		color: white;
		animation: iconBounce 2s ease-in-out infinite;
	}

	@keyframes iconBounce {
		0%, 100% { transform: translateY(0); }
		50% { transform: translateY(-2px); }
	}

	.header-text {
		flex: 1;
		min-width: 0;
	}

	.header-title {
		display: flex;
		align-items: center;
		gap: 6px;
		margin: 0 0 2px;
		font-size: 1.125rem;
		font-weight: 700;
		letter-spacing: -0.02em;
		color: var(--upload-text-dark);
	}

	.title-text {
		color: var(--upload-text-dark);
	}

	.loading-dots {
		display: flex;
		gap: 3px;
	}

	.loading-dots span {
		width: 3px;
		height: 3px;
		background: var(--upload-primary);
		border-radius: 50%;
		animation: dotBounce 1.4s ease-in-out infinite;
	}

	.loading-dots span:nth-child(1) { animation-delay: 0s; }
	.loading-dots span:nth-child(2) { animation-delay: 0.2s; }
	.loading-dots span:nth-child(3) { animation-delay: 0.4s; }

	@keyframes dotBounce {
		0%, 80%, 100% { transform: translateY(0); }
		40% { transform: translateY(-4px); }
	}

	.header-description {
		margin: 0;
		font-size: 0.8125rem;
		color: var(--upload-text-muted);
		font-weight: 400;
	}

	/* ===== STATS BAR ===== */
	.stats-bar {
		display: flex;
		align-items: center;
		justify-content: center;
		gap: 0;
		padding: 12px 16px;
		margin: 12px 16px;
		background: var(--upload-bg-accent);
		border-radius: 12px;
		border: 1px solid var(--upload-border-accent);
		flex-shrink: 0;
	}

	.stat-item {
		flex: 1;
		display: flex;
		flex-direction: column;
		align-items: center;
		gap: 3px;
	}

	.stat-icon {
		width: 28px;
		height: 28px;
		border-radius: 8px;
		display: flex;
		align-items: center;
		justify-content: center;
	}

	.stat-icon svg {
		width: 14px;
		height: 14px;
	}

	.stat-icon.completed-icon {
		background: rgba(34, 197, 94, 0.12);
		color: var(--upload-success-dark);
	}

	.stat-icon.processing-icon {
		background: rgba(124, 58, 237, 0.12);
		color: var(--upload-primary);
		animation: spinSlow 3s linear infinite;
	}

	@keyframes spinSlow {
		from { transform: rotate(0deg); }
		to { transform: rotate(360deg); }
	}

	.stat-icon.pending-icon {
		background: rgba(0, 0, 0, 0.04);
		color: var(--upload-text-light);
	}

	.stat-value {
		font-size: 1rem;
		font-weight: 700;
		color: var(--upload-text-dark);
		line-height: 1;
	}

	.stat-label {
		font-size: 0.5625rem;
		color: var(--upload-text-muted);
		text-transform: uppercase;
		letter-spacing: 0.04em;
		font-weight: 600;
	}

	.stat-divider {
		width: 1px;
		height: 32px;
		background: linear-gradient(180deg, transparent, rgba(124, 58, 237, 0.12), transparent);
	}

	/* ===== MASTER PROGRESS ===== */
	.master-progress {
		padding: 0 20px 12px;
		flex-shrink: 0;
	}

	.progress-header {
		display: flex;
		justify-content: space-between;
		align-items: center;
		margin-bottom: 6px;
	}

	.progress-label {
		font-size: 0.75rem;
		color: var(--upload-text-muted);
		font-weight: 500;
	}

	.progress-value {
		font-size: 0.75rem;
		font-weight: 700;
		color: var(--upload-primary);
	}

	.progress-bar-container {
		position: relative;
	}

	.progress-bar-track {
		height: 6px;
		background: #f3f4f6;
		border-radius: 100px;
		overflow: hidden;
	}

	.progress-bar-fill {
		height: 100%;
		background: linear-gradient(90deg, var(--upload-primary) 0%, var(--upload-primary-light) 100%);
		border-radius: 100px;
		position: relative;
		transition: width 0.5s cubic-bezier(0.16, 1, 0.3, 1);
	}

	.progress-bar-shine {
		position: absolute;
		inset: 0;
		background: linear-gradient(90deg, 
			transparent 0%, 
			rgba(255,255,255,0.5) 50%, 
			transparent 100%
		);
		animation: shineMove 2s ease-in-out infinite;
	}

	@keyframes shineMove {
		0% { transform: translateX(-100%); }
		100% { transform: translateX(100%); }
	}

	/* ===== UPLOAD ITEMS ===== */
	.upload-items-container {
		flex: 1;
		overflow-y: auto;
		overflow-x: hidden;
		padding: 4px 16px 16px;
		min-height: 80px;
		-webkit-overflow-scrolling: touch;
		overscroll-behavior: contain;
	}

	.upload-items-grid {
		display: grid;
		grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
		gap: 10px;
	}

	/* Animation for cards - only first 12 get staggered delay */
	.upload-card {
		position: relative;
		animation: cardSlideIn 0.35s cubic-bezier(0.16, 1, 0.3, 1) backwards;
	}

	.upload-card:nth-child(1) { animation-delay: 0.02s; }
	.upload-card:nth-child(2) { animation-delay: 0.04s; }
	.upload-card:nth-child(3) { animation-delay: 0.06s; }
	.upload-card:nth-child(4) { animation-delay: 0.08s; }
	.upload-card:nth-child(5) { animation-delay: 0.10s; }
	.upload-card:nth-child(6) { animation-delay: 0.12s; }
	.upload-card:nth-child(7) { animation-delay: 0.14s; }
	.upload-card:nth-child(8) { animation-delay: 0.16s; }
	.upload-card:nth-child(9) { animation-delay: 0.18s; }
	.upload-card:nth-child(10) { animation-delay: 0.20s; }
	.upload-card:nth-child(11) { animation-delay: 0.22s; }
	.upload-card:nth-child(12) { animation-delay: 0.24s; }
	.upload-card:nth-child(n+13) { animation-delay: 0.25s; }

	@keyframes cardSlideIn {
		from {
			opacity: 0;
			transform: translateY(10px) scale(0.96);
		}
		to {
			opacity: 1;
			transform: translateY(0) scale(1);
		}
	}

	.upload-card-inner {
		background: var(--upload-bg);
		border: 1px solid var(--upload-border);
		border-radius: 10px;
		overflow: hidden;
		transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
		box-shadow: 0 1px 4px rgba(0, 0, 0, 0.03);
	}

	/* Disable hover effects on touch devices */
	@media (hover: hover) {
		.upload-card:hover .upload-card-inner {
			transform: translateY(-2px);
			border-color: rgba(124, 58, 237, 0.18);
			box-shadow: 
				0 8px 16px rgba(0, 0, 0, 0.06),
				0 2px 8px rgba(124, 58, 237, 0.06);
		}
	}

	.upload-thumbnail {
		position: relative;
		aspect-ratio: 1;
		overflow: hidden;
		background: #f3f4f6;
	}

	.upload-thumbnail img {
		width: 100%;
		height: 100%;
		object-fit: cover;
		transition: filter 0.3s ease;
	}

	.thumbnail-overlay {
		position: absolute;
		inset: 0;
		display: flex;
		align-items: center;
		justify-content: center;
		transition: all 0.25s ease;
	}

	.thumbnail-overlay.completed {
		background: linear-gradient(180deg, 
			rgba(34, 197, 94, 0.08) 0%, 
			rgba(34, 197, 94, 0.22) 100%
		);
	}

	.upload-card.completed .upload-thumbnail img {
		filter: brightness(0.65) saturate(0.9);
	}

	.thumbnail-overlay.uploading {
		background: linear-gradient(180deg, 
			rgba(0, 0, 0, 0.12) 0%, 
			rgba(0, 0, 0, 0.45) 100%
		);
	}

	.upload-card.uploading .upload-thumbnail img {
		filter: brightness(0.55) saturate(0.8);
	}

	.thumbnail-overlay.pending {
		background: rgba(0, 0, 0, 0.45);
	}

	.upload-card.pending .upload-thumbnail img {
		filter: brightness(0.45) saturate(0.5);
	}

	/* Success badge */
	.success-badge {
		width: 32px;
		height: 32px;
		background: linear-gradient(135deg, var(--upload-success) 0%, var(--upload-success-dark) 100%);
		border-radius: 50%;
		display: flex;
		align-items: center;
		justify-content: center;
		box-shadow: 
			0 0 0 2px rgba(34, 197, 94, 0.18),
			0 6px 14px rgba(34, 197, 94, 0.3);
		animation: successPop 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
	}

	.success-badge svg {
		width: 16px;
		height: 16px;
		color: white;
	}

	@keyframes successPop {
		from { transform: scale(0) rotate(-15deg); opacity: 0; }
		to { transform: scale(1) rotate(0); opacity: 1; }
	}

	/* Circular progress */
	.circular-progress {
		position: relative;
		width: 38px;
		height: 38px;
	}

	.circular-progress svg {
		width: 100%;
		height: 100%;
		animation: progressRotate 1.8s linear infinite;
	}

	@keyframes progressRotate {
		from { transform: rotate(0deg); }
		to { transform: rotate(360deg); }
	}

	.circular-progress .progress-text {
		position: absolute;
		inset: 0;
		display: flex;
		align-items: center;
		justify-content: center;
		font-size: 0.5625rem;
		font-weight: 700;
		color: white;
		animation: none;
		text-shadow: 0 1px 2px rgba(0,0,0,0.25);
	}

	/* Pending badge */
	.pending-badge {
		width: 30px;
		height: 30px;
		display: flex;
		align-items: center;
		justify-content: center;
		color: rgba(255, 255, 255, 0.5);
		animation: pendingFloat 2.5s ease-in-out infinite;
	}

	.pending-badge svg {
		width: 18px;
		height: 18px;
	}

	@keyframes pendingFloat {
		0%, 100% { transform: translateY(0); opacity: 0.5; }
		50% { transform: translateY(-2px); opacity: 0.75; }
	}

	/* Card footer */
	.upload-card-footer {
		padding: 6px 8px;
		display: flex;
		align-items: center;
		justify-content: space-between;
		background: var(--upload-bg-soft);
		border-top: 1px solid var(--upload-border);
	}

	.footer-status {
		display: flex;
		align-items: center;
		gap: 4px;
	}

	.status-indicator {
		width: 5px;
		height: 5px;
		border-radius: 50%;
		flex-shrink: 0;
	}

	.status-indicator.completed {
		background: var(--upload-success);
		box-shadow: 0 0 5px rgba(34, 197, 94, 0.45);
	}

	.status-indicator.uploading {
		background: var(--upload-primary);
		box-shadow: 0 0 5px rgba(124, 58, 237, 0.45);
		animation: indicatorPulse 1s ease-in-out infinite;
	}

	.status-indicator.pending {
		background: #d1d5db;
	}

	@keyframes indicatorPulse {
		0%, 100% { opacity: 1; }
		50% { opacity: 0.4; }
	}

	.status-label {
		font-size: 0.5rem;
		font-weight: 600;
		color: var(--upload-text-muted);
		text-transform: uppercase;
		letter-spacing: 0.02em;
		white-space: nowrap;
	}

	.upload-card.completed .status-label {
		color: var(--upload-success-dark);
	}

	.upload-card.pending .status-label {
		color: var(--upload-text-light);
	}

	.file-size {
		font-size: 0.5rem;
		color: var(--upload-text-light);
		font-weight: 500;
		white-space: nowrap;
	}

	/* Card progress bar */
	.upload-card-progress-bar {
		position: absolute;
		bottom: 0;
		left: 0;
		right: 0;
		height: 2px;
		background: rgba(124, 58, 237, 0.08);
	}

	.upload-card-progress-bar .inner-progress {
		height: 100%;
		background: linear-gradient(90deg, var(--upload-primary), var(--upload-primary-light));
		box-shadow: 0 0 6px rgba(124, 58, 237, 0.35);
		transition: width 0.35s ease;
	}

	/* ===== SCROLLBAR ===== */
	.upload-items-container::-webkit-scrollbar {
		width: 3px;
	}

	.upload-items-container::-webkit-scrollbar-track {
		background: transparent;
	}

	.upload-items-container::-webkit-scrollbar-thumb {
		background: rgba(124, 58, 237, 0.18);
		border-radius: 10px;
	}

	.upload-items-container::-webkit-scrollbar-thumb:hover {
		background: rgba(124, 58, 237, 0.3);
	}

	/* Firefox scrollbar */
	.upload-items-container {
		scrollbar-width: thin;
		scrollbar-color: rgba(124, 58, 237, 0.18) transparent;
	}

	/* ===== RESPONSIVE - TABLETS ===== */
	@media (min-width: 600px) {
		.upload-modal-overlay {
			padding: 24px;
		}

		.upload-modal-card {
			max-height: calc(100vh - 48px);
			border-radius: 28px;
		}

		.upload-modal-header {
			padding: 24px 24px 20px;
			gap: 16px;
		}

		.header-icon-container {
			width: 52px;
			height: 52px;
		}

		.header-icon svg {
			width: 24px;
			height: 24px;
		}

		.header-title {
			font-size: 1.25rem;
		}

		.header-description {
			font-size: 0.875rem;
		}

		.stats-bar {
			margin: 14px 20px;
			padding: 14px 20px;
		}

		.stat-icon {
			width: 30px;
			height: 30px;
		}

		.stat-value {
			font-size: 1.0625rem;
		}

		.stat-label {
			font-size: 0.625rem;
		}

		.master-progress {
			padding: 0 24px 14px;
		}

		.progress-bar-track {
			height: 7px;
		}

		.upload-items-container {
			padding: 4px 20px 20px;
		}

		.upload-items-grid {
			grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
			gap: 12px;
		}

		.upload-card-inner {
			border-radius: 12px;
		}

		.success-badge {
			width: 36px;
			height: 36px;
		}

		.success-badge svg {
			width: 18px;
			height: 18px;
		}

		.circular-progress {
			width: 42px;
			height: 42px;
		}

		.circular-progress .progress-text {
			font-size: 0.5625rem;
		}

		.upload-card-footer {
			padding: 7px 9px;
		}

		.status-label,
		.file-size {
			font-size: 0.5625rem;
		}
	}

	/* ===== RESPONSIVE - DESKTOP ===== */
	@media (min-width: 768px) {
		.upload-modal-card {
			max-width: 620px;
		}

		.upload-items-grid {
			grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
		}

		.header-title {
			font-size: 1.375rem;
		}

		.stat-value {
			font-size: 1.125rem;
		}
	}

	/* ===== RESPONSIVE - SMALL MOBILE ===== */
	@media (max-width: 380px) {
		.upload-modal-overlay {
			padding: 10px;
		}

		.upload-modal-card {
			border-radius: 18px;
			max-height: calc(100vh - 20px);
			max-height: calc(100dvh - 20px);
		}

		.upload-modal-header {
			padding: 16px 14px 12px;
			gap: 10px;
		}

		.header-icon-container {
			width: 40px;
			height: 40px;
		}

		.header-icon svg {
			width: 18px;
			height: 18px;
		}

		.header-title {
			font-size: 1rem;
			gap: 5px;
		}

		.loading-dots span {
			width: 2.5px;
			height: 2.5px;
		}

		.header-description {
			font-size: 0.75rem;
		}

		.stats-bar {
			margin: 10px 12px;
			padding: 10px 12px;
			border-radius: 10px;
		}

		.stat-icon {
			width: 24px;
			height: 24px;
			border-radius: 6px;
		}

		.stat-icon svg {
			width: 12px;
			height: 12px;
		}

		.stat-value {
			font-size: 0.875rem;
		}

		.stat-label {
			font-size: 0.5rem;
		}

		.stat-divider {
			height: 26px;
		}

		.master-progress {
			padding: 0 14px 10px;
		}

		.progress-header {
			margin-bottom: 5px;
		}

		.progress-label,
		.progress-value {
			font-size: 0.6875rem;
		}

		.progress-bar-track {
			height: 5px;
		}

		.upload-items-container {
			padding: 2px 12px 14px;
		}

		.upload-items-grid {
			grid-template-columns: repeat(2, 1fr);
			gap: 8px;
		}

		.upload-card-inner {
			border-radius: 8px;
		}

		.success-badge {
			width: 28px;
			height: 28px;
		}

		.success-badge svg {
			width: 14px;
			height: 14px;
		}

		.circular-progress {
			width: 32px;
			height: 32px;
		}

		.circular-progress .progress-text {
			font-size: 0.5rem;
		}

		.pending-badge {
			width: 26px;
			height: 26px;
		}

		.pending-badge svg {
			width: 15px;
			height: 15px;
		}

		.upload-card-footer {
			padding: 5px 6px;
		}

		.status-indicator {
			width: 4px;
			height: 4px;
		}

		.status-label {
			font-size: 0.4375rem;
		}

		.file-size {
			font-size: 0.4375rem;
		}
	}

	/* ===== SINGLE IMAGE OPTIMIZATION ===== */
	.upload-items-grid:has(.upload-card:only-child) {
		grid-template-columns: 1fr;
		max-width: 180px;
		margin: 0 auto;
	}

	/* Fallback for browsers without :has() support */
	@supports not selector(:has(*)) {
		.upload-items-grid.single-item {
			grid-template-columns: 1fr;
			max-width: 180px;
			margin: 0 auto;
		}
	}

	/* ===== LANDSCAPE MOBILE ===== */
	@media (max-height: 500px) and (orientation: landscape) {
		.upload-modal-card {
			max-height: calc(100vh - 20px);
			max-height: calc(100dvh - 20px);
			flex-direction: row;
			flex-wrap: wrap;
			max-width: 90vw;
		}

		.upload-modal-header {
			width: 100%;
			padding: 12px 16px;
		}

		.header-icon-container {
			width: 36px;
			height: 36px;
		}

		.stats-bar {
			width: calc(40% - 24px);
			margin: 8px 12px;
			flex-direction: column;
			gap: 8px;
		}

		.stat-item {
			flex-direction: row;
			justify-content: flex-start;
			gap: 8px;
		}

		.stat-divider {
			width: 100%;
			height: 1px;
		}

		.master-progress {
			width: calc(60% - 24px);
			padding: 8px 12px;
		}

		.upload-items-container {
			width: 100%;
			padding: 4px 12px 12px;
			max-height: 45vh;
		}

		.upload-items-grid {
			grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
		}
	}

	/* ===== REDUCE MOTION ===== */
	@media (prefers-reduced-motion: reduce) {
		.upload-modal-card,
		.upload-card,
		.upload-card-inner,
		.progress-bar-fill,
		.inner-progress {
			animation: none;
			transition: none;
		}

		.icon-pulse-ring,
		.loading-dots span,
		.progress-bar-shine,
		.stat-icon.processing-icon,
		.circular-progress svg,
		.pending-badge {
			animation: none;
		}

		.header-icon svg {
			animation: none;
		}
	}