/* Ad Builder Styles - Canva-like Interface */

.mylisting-ad-builder-wrapper {
	font-family: var(--font-family, 'Inter', sans-serif);
	background: #f8fafc;
	height: calc(100vh - 100px);
	min-height: 700px;
	border-radius: 12px;
	overflow: hidden;
	box-shadow: 0 4px 20px rgba(0,0,0,0.05);
	position: relative;
	margin: 20px 0;
}

#mylisting-ad-builder-app {
	display: flex;
	flex-direction: column;
	height: 100%;
}

.ad-builder-loading {
	display: flex;
	align-items: center;
	justify-content: center;
	height: 100%;
	font-size: 18px;
	color: #64748b;
}

/* Header */
.ad-builder-header {
	height: 60px;
	background: #ffffff;
	border-bottom: 1px solid #e2e8f0;
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 0 20px;
	z-index: 10;
}

.ad-builder-title {
	font-weight: 600;
	color: #1e293b;
	font-size: 16px;
	display: flex;
	align-items: center;
	gap: 10px;
}

.ad-builder-title input {
	border: 1px solid transparent;
	padding: 4px 8px;
	border-radius: 4px;
	font-size: 16px;
	font-weight: 600;
	color: #1e293b;
	transition: all 0.2s;
}

.ad-builder-title input:focus, .ad-builder-title input:hover {
	border-color: #cbd5e1;
	background: #f1f5f9;
	outline: none;
}

.ad-builder-actions {
	display: flex;
	gap: 10px;
}

.ad-btn {
	padding: 8px 16px;
	border-radius: 6px;
	font-weight: 600;
	cursor: pointer;
	border: none;
	transition: all 0.2s;
	display: inline-flex;
	align-items: center;
	gap: 6px;
	font-size: 14px;
}

.ad-btn-outline {
	background: transparent;
	border: 1px solid #cbd5e1;
	color: #475569;
}

.ad-btn-outline:hover {
	background: #f8fafc;
	border-color: #94a3b8;
}

.ad-btn-primary {
	background: #6366f1;
	color: white;
}

.ad-btn-primary:hover {
	background: #4f46e5;
}

.ad-btn-success {
	background: #10b981;
	color: white;
}

.ad-btn-success:hover {
	background: #059669;
}

/* Main Area */
.ad-builder-main {
	display: flex;
	flex: 1;
	overflow: hidden;
}

/* Sidebar */
.ad-builder-sidebar {
	width: 340px;
	background: #ffffff;
	border-right: 1px solid #e2e8f0;
	display: flex;
	flex-direction: column;
	z-index: 5;
}

.ad-builder-tabs {
	display: flex;
	border-bottom: 1px solid #e2e8f0;
}

.ad-tab {
	flex: 1;
	padding: 12px 5px;
	text-align: center;
	font-size: 12px;
	font-weight: 600;
	color: #64748b;
	cursor: pointer;
	border-bottom: 2px solid transparent;
	transition: all 0.2s;
}

.ad-tab.active {
	color: #6366f1;
	border-bottom-color: #6366f1;
}

.ad-tab:hover:not(.active) {
	background: #f8fafc;
}

.ad-tab-content {
	flex: 1;
	overflow-y: auto;
	padding: 20px;
	display: none;
}

.ad-tab-content.active {
	display: block;
}

.ad-templates-grid {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 12px;
}

.ad-template-item {
	background: #f1f5f9;
	border-radius: 8px;
	height: 120px;
	cursor: pointer;
	border: 2px solid transparent;
	transition: all 0.2s;
	display: flex;
	align-items: center;
	justify-content: center;
	overflow: hidden;
	position: relative;
}

.ad-template-item:hover {
	border-color: #6366f1;
	box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}

.ad-template-item img {
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.ad-tool-btn {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	padding: 12px 15px;
	background: #f8fafc;
	border: 1px solid #e2e8f0;
	border-radius: 8px;
	margin-bottom: 12px;
	text-align: center;
	font-weight: 600;
	color: #1e293b;
	cursor: pointer;
	transition: all 0.2s;
}

.ad-tool-btn:hover {
	background: #f1f5f9;
	border-color: #cbd5e1;
}

.ad-form-group {
	margin-bottom: 15px;
}

.ad-form-group label {
	display: block;
	font-size: 12px;
	font-weight: 600;
	color: #64748b;
	margin-bottom: 5px;
}

.ad-select, .ad-input {
	width: 100%;
	padding: 8px 12px;
	border: 1px solid #e2e8f0;
	border-radius: 6px;
	font-family: inherit;
	font-size: 13px;
	color: #1e293b;
}

/* Workspace */
.ad-builder-workspace {
	flex: 1;
	background: #e2e8f0;
	display: flex;
	flex-direction: column;
	position: relative;
	overflow: hidden;
}

.ad-builder-toolbar {
	min-height: 50px;
	background: #ffffff;
	border-bottom: 1px solid #cbd5e1;
	display: flex;
	align-items: center;
	padding: 5px 15px;
	gap: 15px;
	box-shadow: 0 2px 4px rgba(0,0,0,0.02);
	flex-wrap: wrap;
}

.ad-builder-canvas-container {
	flex: 1;
	display: flex;
	align-items: center;
	justify-content: center;
	overflow: auto;
	padding: 20px;
}

.canvas-wrapper {
	box-shadow: 0 10px 40px rgba(0,0,0,0.15);
	background: white;
}

/* Toolbar tools */
.ad-toolbar-group {
	display: flex;
	align-items: center;
	gap: 5px;
	border-right: 1px solid #e2e8f0;
	padding-right: 15px;
}

.ad-toolbar-group:last-child {
	border-right: none;
	padding-right: 0;
}

.ad-icon-btn {
	width: 32px;
	height: 32px;
	display: flex;
	align-items: center;
	justify-content: center;
	border-radius: 6px;
	border: 1px solid transparent;
	background: transparent;
	cursor: pointer;
	color: #475569;
	transition: all 0.2s;
	font-weight: bold;
}

.ad-icon-btn:hover {
	background: #f1f5f9;
	border-color: #cbd5e1;
}

.ad-color-picker {
	width: 32px;
	height: 32px;
	padding: 0;
	border: none;
	border-radius: 6px;
	cursor: pointer;
	overflow: hidden;
}

.ad-color-picker::-webkit-color-swatch-wrapper {
	padding: 0;
}

.ad-color-picker::-webkit-color-swatch {
	border: 1px solid #cbd5e1;
	border-radius: 6px;
}

.ad-toolbar-label {
	font-size: 11px;
	font-weight: 600;
	color: #64748b;
	margin-right: 5px;
	text-transform: uppercase;
}

/* Dashboard Designs List View */
.ad-dashboard-designs {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
	gap: 20px;
	padding: 20px 0;
}

.ad-design-card {
	background: white;
	border-radius: 12px;
	border: 1px solid #e2e8f0;
	overflow: hidden;
	transition: all 0.2s;
	box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}

.ad-design-card:hover {
	box-shadow: 0 10px 20px rgba(0,0,0,0.08);
	transform: translateY(-4px);
}

.ad-design-preview {
	height: 180px;
	background: #f8fafc;
	display: flex;
	align-items: center;
	justify-content: center;
	border-bottom: 1px solid #e2e8f0;
	position: relative;
}

.ad-design-preview img {
	max-width: 100%;
	height: 100%;
	object-fit: cover;
}

.ad-design-status {
	position: absolute;
	top: 10px;
	right: 10px;
	background: rgba(0,0,0,0.7);
	color: white;
	font-size: 11px;
	padding: 4px 10px;
	border-radius: 12px;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.5px;
}

.ad-design-status.purchased {
	background: #10b981;
}

.ad-design-info {
	padding: 15px;
}

.ad-design-title {
	font-weight: 700;
	font-size: 16px;
	margin: 0 0 5px 0;
	color: #1e293b;
}

.ad-design-meta {
	font-size: 12px;
	color: #64748b;
	margin-bottom: 15px;
}

.ad-design-actions {
	display: flex;
	gap: 8px;
}

.ad-design-actions .ad-btn {
	flex: 1;
	justify-content: center;
	padding: 8px 10px;
	font-size: 13px;
}

.ad-designs-header {
	display: flex;
	justify-content: space-between;
	align-items: center;
	margin-bottom: 20px;
}

.ad-designs-header h2 {
	margin: 0;
	font-size: 24px;
	font-weight: 800;
}
