/* ============================================================
 *  Design Preview Component Styles
 * ============================================================*/

/* --- Preview Container --- */
.dp-container {
	background: #f8fafb;
	border-radius: 1rem;
	overflow: hidden;
}

/* --- Device Switcher --- */
.dp-device-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	padding: 0.5rem;
	border-radius: 0.375rem;
	color: #9ca3af;
	background: transparent;
	border: none;
	cursor: pointer;
	transition: all 0.15s ease;
}
.dp-device-btn:hover {
	color: #2A9D8F;
}
.dp-device-btn.is-active {
	color: #2A9D8F;
	background: rgba(42, 157, 143, 0.1);
}
.dp-device-btn svg {
	width: 1.8rem;
	height: 1.8rem;
}

/* --- Fullscreen Link --- */
.dp-fullscreen-link {
	display: inline-flex;
	align-items: center;
	gap: 0.2rem;
	margin-left: 0.75rem;
	font-size: 0.75rem;
	letter-spacing: 0.03rem;
	color: #2A9D8F;
	text-decoration: none;
	white-space: nowrap;
	border-bottom: 1px solid transparent;
	padding-bottom: 1px;
	transition: border-color 0.15s ease, opacity 0.15s ease;
}
.dp-fullscreen-link:hover {
	border-bottom-color: #2A9D8F;
}
.dp-fullscreen-icon {
	width: 0.7rem;
	height: 0.7rem;
	stroke-width: 1.3;
	flex-shrink: 0;
}

/* --- Mockup Frame --- */
.dp-mockup-wrapper {
	position: relative;
	width: 100%;
	display: flex;
	justify-content: center;
	align-items: center;
	padding: 1.5rem 1rem;
	min-height: 300px;
	overflow: hidden;
}

/* PC Frame */
.dp-frame-pc {
	position: relative;
	width: 87%;
	max-width: 87%;
	background: #1a1a2e;
	border-radius: 0.75rem 0.75rem 0 0;
	padding: 1.75rem 0.5rem 0.5rem;
	box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
}
.dp-frame-pc::before {
	content: '';
	position: absolute;
	top: 0.65rem;
	left: 50%;
	transform: translateX(-50%);
	width: 3rem;
	height: 0.35rem;
	background: #333;
	border-radius: 1rem;
}
.dp-frame-pc .dp-frame-stand {
	display: block;
	width: 30%;
	height: 1.25rem;
	margin: 0 auto;
	background: linear-gradient(to bottom, #1a1a2e 0%, #2a2a3e 100%);
	border-radius: 0 0 0.5rem 0.5rem;
}

/* Tablet Frame */
.dp-frame-tablet {
	position: relative;
	width: 370px;
	max-width: 79%;
	background: #1a1a2e;
	border-radius: 1rem;
	padding: 1.25rem 0.75rem;
	box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
}
.dp-frame-tablet::before {
	content: '';
	position: absolute;
	top: 0.4rem;
	left: 50%;
	transform: translateX(-50%);
	width: 2rem;
	height: 0.2rem;
	background: #333;
	border-radius: 1rem;
}

/* Mobile Frame */
.dp-frame-mobile {
	position: relative;
	width: 260px;
	max-width: 56%;
	background: #1a1a2e;
	border-radius: 1.5rem;
	padding: 2.5rem 0.5rem 2rem;
	box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
}
.dp-frame-mobile::before {
	content: '';
	position: absolute;
	top: 0.75rem;
	left: 50%;
	transform: translateX(-50%);
	width: 3rem;
	height: 0.25rem;
	background: #333;
	border-radius: 1rem;
}
.dp-frame-mobile::after {
	content: '';
	position: absolute;
	bottom: 0.4rem;
	left: 50%;
	transform: translateX(-50%);
	width: 2rem;
	height: 0.25rem;
	background: #333;
	border-radius: 1rem;
}

/* --- Iframe Viewport --- */
.dp-iframe-viewport {
	position: relative;
	width: 100%;
	overflow: hidden;
	background: #fff;
	border-radius: 0.25rem;
}
.dp-iframe-viewport iframe {
	display: block;
	border: none;
	max-width: none;
	transform-origin: top left;
}

/* --- Loading Overlay --- */
.dp-loading-overlay {
	position: absolute;
	inset: 0;
	background: rgba(255, 255, 255, 0.85);
	display: flex;
	align-items: center;
	justify-content: center;
	z-index: 10;
	opacity: 0;
	pointer-events: none;
	transition: opacity 0.2s ease;
	border-radius: 0.25rem;
}
.dp-loading-overlay.is-loading {
	opacity: 1;
	pointer-events: auto;
}
.dp-spinner {
	width: 2rem;
	height: 2rem;
	border: 3px solid #e5e7eb;
	border-top-color: #2A9D8F;
	border-radius: 50%;
	animation: dp-spin 0.7s linear infinite;
}
@keyframes dp-spin {
	to { transform: rotate(360deg); }
}

/* --- Color Swatches --- */
.dp-swatch-list {
	display: flex;
	gap: 0.5rem;
	flex-wrap: wrap;
	align-items: center;
}
.dp-swatch {
	width: 1.75rem;
	height: 1.75rem;
	border-radius: 50%;
	border: 2.5px solid transparent;
	cursor: pointer;
	transition: all 0.15s ease;
	box-shadow: 0 1px 3px rgba(0,0,0,0.12);
	position: relative;
}
.dp-swatch:hover {
	transform: scale(1.15);
}
.dp-swatch.is-active {
	border-color: transparent;
	box-shadow: none;
}
.dp-swatch.is-active::after {
	content: '';
	position: absolute;
	top: 50%;
	left: 50%;
	transform: translate(-50%, -50%);
	width: 0.65rem;
	height: 0.65rem;
	border-radius: 50%;
	background: #fff;
	box-shadow: 0 0 2px rgba(0,0,0,0.3);
}

/* --- Responsive adjustments --- */
@media (max-width: 640px) {
	.dp-mockup-wrapper {
		padding: 1rem 0.5rem;
	}
	.dp-frame-tablet {
		width: 100%;
		max-width: 100%;
	}
	.dp-frame-mobile {
		width: 220px;
	}
	.dp-device-btn {
		padding: 0.4rem 0.7rem;
		font-size: 0.65rem;
	}
	.dp-swatch {
		width: 1.5rem;
		height: 1.5rem;
	}
}
