:root {
	/* Primary Colors */
	--primary: #4361ee;
	--primary-hover: #3a56d4;
	--primary-light: #eef2ff;

	/* Accent Colors */
	--accent: #06d6a0;
	--accent-hover: #05b888;

	/* Danger Colors */
	--danger: #ef476f;
	--danger-hover: #d63e65;

	/* Warning Colors */
	--warning: #ffd166;

	/* Neutral Colors */
	--bg: #f8f9fa;
	--bg-secondary: #f1f3f5;
	--card: #ffffff;
	--text: #212529;
	--text-secondary: #495057;
	--muted: #868e96;
	--border: #dee2e6;
	--border-light: #e9ecef;

	/* UI Elements */
	--radius: 12px;
	--radius-sm: 8px;
	--radius-lg: 16px;
	--shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
	--shadow-md: 0 4px 12px rgba(0, 0, 0, 0.1);
	--shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.12);
	--shadow-inset: inset 0 1px 2px rgba(0, 0, 0, 0.05);

	/* Transitions */
	--transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
	--transition-fast: all 0.15s ease;

	/* Spacing */
	--space-xs: 0.25rem;
	--space-sm: 0.5rem;
	--space-md: 1rem;
	--space-lg: 1.5rem;
	--space-xl: 2rem;
	--space-xxl: 3rem;
}

[data-theme="dark"] {
	--bg: #121212;
	--bg-secondary: #1e1e1e;
	--card: #2d2d2d;
	--text: #f8f9fa;
	--text-secondary: #adb5bd;
	--muted: #6c757d;
	--border: #3d3d3d;
	--border-light: #2d2d2d;
	--shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
	--shadow-md: 0 4px 12px rgba(0, 0, 0, 0.35);
	--shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.4);
}

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

body,
html {
	font-family: 'Noto Serif Bengali', serif;
	background: var(--bg);
	color: var(--text);
	line-height: 1.6;
	overflow-x: hidden;
	scroll-behavior: smooth;
}

/* Typography */
h1,
h2,
h3,
h4,
h5,
h6 {
	font-weight: 600;
	line-height: 1.3;
	margin-bottom: var(--space-md);
}

a {
	color: var(--primary);
	text-decoration: none;
	transition: var(--transition-fast);
}

a:hover {
	color: var(--primary-hover);
}

/* Layout */
.container {
	width: 100%;
	max-width: 1100px;
	margin: 0 auto;
	padding: 0 var(--space-md);

}

.app {
	min-height: 100vh;
	display: flex;
	flex-direction: column;
	transition: var(--transition);
}

/* Header Styles */
.header {
	background: var(--card);
	box-shadow: var(--shadow);
	border-bottom: 1px solid var(--border);
	padding: var(--space-md) 0;
	position: sticky;
	top: 0;
	z-index: 100;
	transition: var(--transition);
}

.header-content {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: var(--space-md);
}

.logo {
	font-size: 1.5rem;
	font-weight: 700;
	color: var(--primary);
	display: flex;
	align-items: center;
	gap: var(--space-sm);
}

.logo i {
	font-size: 1.8rem;
}

.theme-toggle {
	background: var(--bg-secondary);
	border: none;
	border-radius: var(--radius-sm);
	padding: var(--space-sm);
	cursor: pointer;
	font-size: 1.25rem;
	color: var(--text);
	transition: var(--transition);
	display: flex;
	align-items: center;
	justify-content: center;
	width: 42px;
	height: 42px;
	position: absolute;
	top: 10px;
	left: 10px;
}

.theme-toggle:hover {
	background: var(--primary);
	color: white;
	transform: scale(1.05);
}

/* Main Content */
.main {
	flex: 1;
	/* padding: var(--space-xl) 0; */
	display: flex;
	flex-direction: column;
	gap: var(--space-xl);
}

/* Section Styles */
.section-header {
	margin-bottom: var(--space-lg);
}

.section-title {
	font-size: 1.5rem;
	display: flex;
	align-items: center;
	gap: var(--space-sm);
	color: var(--text);
}

.section-title i {
	font-size: 1.3em;
	color: var(--primary);
}

.form-section {
	margin-bottom: var(--space-lg);
}

.form-section-title {
	font-size: 1.1rem;
	margin-bottom: var(--space-md);
	color: var(--text-secondary);
	display: flex;
	align-items: center;
	gap: var(--space-sm);
}

.form-section-title i {
	font-size: 1em;
}

/* Template Selection */
.template-filters {
	display: flex;
	justify-content: space-between;
	align-items: center;
	flex-wrap: wrap;
	gap: var(--space-md);
	margin-top: var(--space-md);
}

.filter-group {
	position: relative;
}

.template-count {
	color: var(--text-secondary);
	font-size: 0.9rem;
}

.category-select {
	background: var(--bg-secondary);
	border: 1px solid var(--border);
	border-radius: var(--radius-sm);
	padding: var(--space-sm) var(--space-md);
	font-size: 1rem;
	color: var(--text);
	cursor: pointer;
	transition: var(--transition);
	min-width: 200px;
	appearance: none;
	padding-right: 2.5rem;
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='%23868e96' viewBox='0 0 16 16'%3E%3Cpath d='M7.247 11.14 2.451 5.658C1.885 5.013 2.345 4 3.204 4h9.592a1 1 0 0 1 .753 1.659l-4.796 5.48a1 1 0 0 1-1.506 0z'/%3E%3C/svg%3E");
	background-repeat: no-repeat;
	background-position: right var(--space-sm) center;
	background-size: 16px;
}

.category-select:focus {
	outline: none;
	border-color: var(--primary);
	box-shadow: 0 0 0 3px rgba(67, 97, 238, 0.15);
}

.template-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
	gap: var(--space-md);
}

.template-card {
	background: var(--card);
	border-radius: var(--radius);
	overflow: hidden;
	cursor: pointer;
	transition: var(--transition);
	border: 2px solid transparent;
	position: relative;
	box-shadow: var(--shadow);
}

.template-card:hover {
	transform: translateY(-4px);
	box-shadow: var(--shadow-lg);
	border-color: var(--primary-light);
}

.template-card.selected {
	border-color: var(--primary);
	box-shadow: 0 0 0 4px rgba(67, 97, 238, 0.15);
}

.template-card.selected .template-select-indicator {
	opacity: 1;
	transform: scale(1);
}

.template-card.loading-template::after {
	content: '';
	position: absolute;
	inset: 0;
	background: rgba(0, 0, 0, 0.3);
	border-radius: inherit;
}

.template-thumbnail {
	position: relative;
	overflow: hidden;
	height: 160px;
}

.template-thumbnail img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
	transition: var(--transition);
}

.template-card:hover .template-thumbnail img {
	transform: scale(1.05);
}

.template-badge {
	position: absolute;
	top: var(--space-sm);
	right: var(--space-sm);
	background: var(--accent);
	color: white;
	font-size: 0.75rem;
	font-weight: 600;
	padding: 0.25rem 0.5rem;
	border-radius: var(--radius-sm);
	box-shadow: var(--shadow);
}

.template-name {
	padding: var(--space-sm);
	font-size: 0.95rem;
	font-weight: 500;
	text-align: center;
	color: var(--text);
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
	display: none;
}

.template-select-indicator {
	position: absolute;
	top: var(--space-sm);
	left: var(--space-sm);
	background: var(--primary);
	color: white;
	width: 24px;
	height: 24px;
	border-radius: 50%;
	display: flex;
	align-items: center;
	justify-content: center;
	opacity: 0;
	transform: scale(0.5);
	transition: var(--transition);
	box-shadow: var(--shadow);
}

/* Editor Section */
.editor-section {
	/* display: grid;
	grid-template-columns: 1fr 1fr;
	gap: var(--space-xl);
	align-items: start; */
}

@media (max-width: 992px) {
	.editor-section {
		grid-template-columns: 1fr;
	}
}

.editor-panel {
	background: var(--card);
	/* border-radius: var(--radius-lg); */
	box-shadow: var(--shadow);
	padding: var(--space-lg);
	border: 1px solid var(--border);
	transition: var(--transition);
}

.editor-panel:hover {
	box-shadow: var(--shadow-md);
}

.editor-tools {
	position: sticky;
	top: calc(72px + var(--space-xl));
}

/* Upload Area */
.upload-area {
	background: var(--bg-secondary);
	border: 2px dashed var(--border);
	border-radius: var(--radius);
	padding: var(--space-xl);
	text-align: center;
	cursor: pointer;
	transition: var(--transition);
	position: relative;
	overflow: hidden;
}

.upload-area:hover {
	border-color: var(--primary);
	background: rgba(67, 97, 238, 0.05);
}

.upload-area.drag-over {
	border-color: var(--primary);
	background: rgba(67, 97, 238, 0.1);
}

.upload-area.has-image {
	padding: 0;
	border-style: solid;
}

.upload-content {
	padding: var(--space-md);
}

.upload-icon {
	font-size: 2.5rem;
	color: var(--primary);
	margin-bottom: var(--space-sm);
}

.upload-text {
	font-size: 1.1rem;
	color: var(--text);
	margin-bottom: var(--space-xs);
	font-weight: 500;
}

.upload-hint {
	font-size: 0.9rem;
	color: var(--text-secondary);
	margin-bottom: var(--space-sm);
}

.upload-formats {
	font-size: 0.8rem;
	color: var(--muted);
	font-weight: 500;
}

.upload-area input[type="file"] {
	position: absolute;
	inset: 0;
	opacity: 0;
	cursor: pointer;
}

.image-preview-container {
	position: relative;
}

.image-preview {
	position: relative;
	padding-top: 56.25%;
	/* 16:9 Aspect Ratio */
	background: var(--bg);
}

.image-preview img {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	object-fit: contain;
}

.image-actions {
	display: flex;
	gap: var(--space-sm);
	padding: var(--space-md);
	background: var(--bg-secondary);
	border-top: 1px solid var(--border);
}

/* Form Controls */
.form-group {
	margin-bottom: var(--space-md);
}

.form-label {
	display: block;
	font-size: 0.95rem;
	font-weight: 500;
	color: var(--text);
	margin-bottom: var(--space-sm);
}

.form-control {
	width: 100%;
	background: var(--bg-secondary);
	border: 1px solid var(--border);
	border-radius: var(--radius-sm);
	padding: var(--space-sm) var(--space-md);
	font-size: 1rem;
	color: var(--text);
	transition: var(--transition);
	font-family: inherit;
}

.form-control:focus {
	outline: none;
	border-color: var(--primary);
	box-shadow: 0 0 0 3px rgba(67, 97, 238, 0.15);
}

.input-with-counter {
	position: relative;
}

.char-counter {
	position: absolute;
	bottom: var(--space-sm);
	right: var(--space-sm);
	font-size: 0.75rem;
	color: var(--muted);
	background: var(--bg-secondary);
	padding: 0.1rem 0.3rem;
	border-radius: var(--radius-sm);
}

.caption-editor {
	min-height: 100px;
	resize: vertical;
}

.date-input-group {
	display: flex;
	gap: var(--space-sm);
}

.date-input-group .form-control {
	flex: 1;
}

/* Buttons */
.btn {
	background: var(--primary);
	color: white;
	border: none;
	border-radius: var(--radius-sm);
	padding: var(--space-sm) var(--space-md);
	font-size: 0.95rem;
	cursor: pointer;
	transition: var(--transition);
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: var(--space-sm);
	font-weight: 500;
	line-height: 1;
}

.btn:hover {
	background: var(--primary-hover);
	transform: translateY(-1px);
	box-shadow: var(--shadow);
}

.btn:active {
	transform: translateY(0);
}

.btn:disabled {
	background: var(--muted);
	cursor: not-allowed;
	transform: none !important;
	box-shadow: none !important;
	opacity: 0.7;
}

.btn-icon {
	padding: var(--space-sm);
	width: 42px;
	height: 42px;
}

.btn-icon-text {
	padding: var(--space-sm) var(--space-md);
}

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

.btn-danger:hover {
	background: var(--danger-hover);
}

.btn-success {
	background: var(--accent);
}

.btn-success:hover {
	background: var(--accent-hover);
}

.btn-primary {
	background: var(--primary);
}

.btn-primary:hover {
	background: var(--primary-hover);
}

/* Action Buttons */
.action-group {
	display: flex;
	gap: var(--space-sm);
	flex-wrap: wrap;
}

/* Preview Panel */
.preview-panel {
	display: flex;
	flex-direction: column;
	gap: var(--space-lg);
}

.preview-header {
	display: flex;
	justify-content: space-between;
	align-items: center;
	gap: var(--space-md);
}

.preview-actions {
	display: flex;
	gap: var(--space-sm);
}

.preview-container {
	position: relative;
	margin: 0 auto;
	width: 100%;
	/* max-width: 400px; */
	transform: scale(var(--preview-zoom)) rotate(var(--preview-rotate));
	transition: var(--transition);
}

/* .preview-device-frame {
	position: relative;
	background: var(--card);
	border-radius: 0;
	padding: 9px;
	box-shadow:
		0 0 0 1px var(--border),
		0 10px 30px rgba(0, 0, 0, 0.1),
		inset 0 0 0 1px rgba(255, 255, 255, 0.1);
} */

[data-theme="dark"] .preview-device-frame {
	box-shadow:
		0 0 0 1px var(--border),
		0 10px 30px rgba(0, 0, 0, 0.3),
		inset 0 0 0 1px rgba(255, 255, 255, 0.05);
}

.preview-area {
	width: 1000px;
	height: 1000px;
	aspect-ratio: 1;
	background-size: cover;
	background-position: center;
	/* border-radius: var(--radius); */
	position: relative;
	overflow: hidden;
	box-shadow: var(--shadow-inset);
}

.preview-image-container {
	position: absolute;
	transition: var(--transition);
}

.preview-image {
	position: relative;
	object-fit: cover;
	border-radius: var(--radius-sm);
	box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
	cursor: grab;
	transition: var(--transition);
	user-select: none;
	touch-action: none;
}

.preview-image:hover {
	box-shadow: 0 6px 30px rgba(0, 0, 0, 0.3);
}

.preview-caption {
	font-weight: 700;
	text-align: center;
	word-wrap: break-word;
	line-height: 1.3;
}

.preview-date {
	font-size: 25px;
	font-weight: 700;
}

/* Export Section */
.export-section {
	margin-top: auto;
}

.export-actions {
	display: flex;
	gap: var(--space-sm);
	flex-wrap: wrap;
}

.export-actions .btn {
	flex: 1;
	min-width: 120px;
}

.preview-note {
	text-align: center;
	color: var(--text-secondary);
	font-size: 0.9rem;
	display: flex;
	align-items: center;
	justify-content: center;
	gap: var(--space-sm);
	margin-top: var(--space-md);
}

.preview-note i {
	color: var(--primary);
}

/* Footer */
.footer {
	background: var(--card);
	border-top: 1px solid var(--border);
	padding: var(--space-lg) 0;
}

.footer-content {
	display: flex;
	justify-content: space-between;
	align-items: center;
	flex-wrap: wrap;
	gap: var(--space-md);
}

.footer-left {
	display: flex;
	flex-direction: column;
	gap: var(--space-xs);
}

.footer-logo {
	display: flex;
	align-items: center;
	gap: var(--space-sm);
	font-weight: 600;
	color: var(--text);
}

.footer-logo i {
	color: var(--primary);
	font-size: 1.2rem;
}

.footer-copyright {
	font-size: 0.85rem;
	color: var(--text-secondary);
}

.footer-right {
	display: flex;
	flex-direction: column;
	gap: var(--space-md);
}

.footer-links {
	display: flex;
	gap: var(--space-md);
}

.footer-link {
	font-size: 0.9rem;
	color: var(--text-secondary);
}

.footer-link:hover {
	color: var(--primary);
}

.footer-social {
	display: flex;
	gap: var(--space-sm);
	justify-content: flex-end;
}

.social-link {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 36px;
	height: 36px;
	border-radius: 50%;
	background: var(--bg-secondary);
	color: var(--text-secondary);
	transition: var(--transition);
}

.social-link:hover {
	background: var(--primary);
	color: white;
	transform: translateY(-2px);
}

/* Modal Styles */
.modal-overlay {
	position: fixed;
	inset: 0;
	background: rgba(0, 0, 0, 0.8);
	backdrop-filter: blur(5px);
	z-index: 1000;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: var(--space-md);
}

.modal {
	background: var(--card);
	border-radius: var(--radius-lg);
	padding: var(--space-lg);
	box-shadow: var(--shadow-lg);
	width: 100%;
	max-width: 800px;
	max-height: 90vh;
	overflow: auto;
	border: 1px solid var(--border);
}

.modal-header {
	display: flex;
	justify-content: space-between;
	align-items: center;
	margin-bottom: var(--space-lg);
}

.modal-title {
	font-size: 1.5rem;
	font-weight: 600;
	color: var(--text);
}

.modal-close {
	background: none;
	border: none;
	font-size: 1.5rem;
	cursor: pointer;
	color: var(--text-secondary);
	transition: var(--transition);
	width: 40px;
	height: 40px;
	display: flex;
	align-items: center;
	justify-content: center;
	border-radius: var(--radius-sm);
}

.modal-close:hover {
	background: var(--bg-secondary);
	color: var(--danger);
}

.cropper-container {
	width: 100%;
	height: 400px;
	margin-bottom: var(--space-md);
}

.cropper-actions {
	display: flex;
	gap: var(--space-sm);
	justify-content: center;
}

/* Notification */
.notification {
	position: fixed;
	top: var(--space-md);
	right: var(--space-md);
	background: var(--accent);
	color: white;
	padding: var(--space-sm) var(--space-lg);
	border-radius: var(--radius-sm);
	box-shadow: var(--shadow-lg);
	z-index: 1001;
	display: flex;
	align-items: center;
	gap: var(--space-sm);
	max-width: 400px;
}

.notification.error {
	background: var(--danger);
}

.notification.warning {
	background: var(--warning);
	color: var(--text);
}

.notification i {
	font-size: 1.2rem;
}

/* Loading Overlay */
.loading-overlay {
	position: fixed;
	inset: 0;
	background: rgba(0, 0, 0, 0.7);
	backdrop-filter: blur(5px);
	z-index: 1002;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: var(--space-md);
}

.loading-spinner {
	width: 50px;
	height: 50px;
	border: 4px solid rgba(255, 255, 255, 0.3);
	border-radius: 50%;
	border-top-color: var(--primary);
	animation: spin 1s ease-in-out infinite;
}

.loading-text {
	color: white;
	font-size: 1.1rem;
}

@keyframes spin {
	to {
		transform: rotate(360deg);
	}
}

/* Transition Animations */
.slide-fade-enter-active,
.slide-fade-leave-active {
	transition: all 0.3s ease;
}

.slide-fade-enter-from,
.slide-fade-leave-to {
	transform: translateX(20px);
	opacity: 0;
}

/* Accessibility */
.sr-only {
	position: absolute;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border-width: 0;
}

/* Responsive Design */
@media (max-width: 768px) {
	.header-content {
		flex-direction: column;
		align-items: flex-start;
	}

	.template-grid {
		grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
	}

	.footer-content {
		flex-direction: column;
		align-items: flex-start;
	}

	.footer-right {
		align-items: flex-start;
	}

	.footer-links {
		flex-direction: column;
		gap: var(--space-sm);
	}

	.footer-social {
		justify-content: flex-start;
	}
}

@media (max-width: 576px) {
	.template-grid {
		grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
	}

	.export-actions .btn {
		min-width: 100%;
	}

	.modal {
		padding: var(--space-md);
	}

	.cropper-container {
		height: 300px;
	}
}

.placeholder-text {
	text-align: center;
	line-height: 1.6;
}

.preview-image-container.has-image {
	border: none;
	background-color: transparent;
}

.preview-image-container:hover:not(.has-image) {
	border-color: var(--primary);
	background-color: rgba(var(--primary-rgb), 0.05);
}

.upload-prompt {
	text-align: center;
	padding: 1rem;
	color: var(--text-secondary);
}

.upload-prompt i {
	font-size: 2rem;
	color: var(--primary);
	margin-bottom: 0.5rem;
}

.upload-prompt p {
	margin-bottom: 0.25rem;
	font-weight: 500;
}

.upload-prompt small {
	font-size: 0.8rem;
	opacity: 0.8;
}

.footer {
	background: linear-gradient(135deg, #1f2937 0%, #374151 100%);
	color: white;
	padding: 30px;
	text-align: center;
}

.footer-text {
	font-size: 1rem;
	opacity: 0.9;
}

.header {
	background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
	color: white;
	padding: 2rem;
	text-align: center;
	position: relative;
	overflow: hidden;
}

.header::before {
	content: '';
	position: absolute;
	top: 0;
	left: 0;
	right: 0;
	bottom: 0;
	background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="grid" width="10" height="10" patternUnits="userSpaceOnUse"><path d="M 10 0 L 0 0 0 10" fill="none" stroke="rgba(255,255,255,0.1)" stroke-width="1"/></pattern></defs><rect width="100" height="100" fill="url(%23grid)"/></svg>');
	opacity: 0.3;
}

.header h1 {
	font-size: 2.5rem;
	font-weight: 700;
	margin-bottom: 0.5rem;
	position: relative;
	z-index: 1;
}

.header p {
	font-size: 1.1rem;
	opacity: 0.9;
	position: relative;
	z-index: 1;
}


/* ======= Preview CSS ======== */
.preview-area.template1 {
	background-size: cover;
	background-position: center;
	padding-top: 106px;
	padding-left: 60px;
	padding-right: 63px;

	.image-wrapper {
		width: 100%;
		height: 510px;
		border-radius: 95px 0 95px 0;
		overflow: hidden;
		margin-bottom: 25px;

		.preview-image-container {
			background-size: cover;
			background-position: center;
			background-repeat: no-repeat;
			display: flex;
			align-items: center;
			justify-content: center;
			color: #666;
			font-size: 18px;
			transition: all 0.3s ease;
			position: relative;
			overflow: hidden;
			border: 3px dashed #ddd;

			&.has-image {
				border: none;
				background-color: transparent;
			}
		}
	}

	.caption-wrapper {
		display: flex;
		align-items: center;
		height: 280px;
		justify-content: center;
	}

	.preview-date {
		position: absolute;
		bottom: 15px;
		left: 0;
		padding: 0 30px;
		background-color: #fff;
	}
}

.preview-area.template-template2 {
	/* স্টাইল */
}