/**
 * SnapMatch Frontend Styles
 */

/* Floating Launcher */
.snapmatch-floating-launcher {
	width: 58px;
	height: 58px;
	border-radius: 50%;
	border: none;
	cursor: pointer;
	box-shadow: 0 4px 16px rgba(0, 0, 0, 0.22);
	display: flex;
	align-items: center;
	justify-content: center;
	transition: all 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.275);
	outline: none;
}

.snapmatch-floating-launcher:hover {
	transform: scale(1.1);
	box-shadow: 0 6px 22px rgba(0, 0, 0, 0.32);
}

.snapmatch-icon-camera_black {
	background: #111827;
	color: #ffffff;
}

.snapmatch-icon-camera_white {
	background: #ffffff;
	color: #111827;
}

.snapmatch-icon-logo {
	background: linear-gradient(135deg, #4f46e5, #06b6d4);
	color: #ffffff;
}

.snapmatch-launcher-icon svg {
	width: 26px;
	height: 26px;
	display: block;
}

/* Shortcode & Block Button */
.snapmatch-shortcode-btn {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	padding: 10px 18px;
	background: #111827;
	color: #ffffff;
	border: 1px solid transparent;
	border-radius: 6px;
	font-size: 14px;
	font-weight: 600;
	cursor: pointer;
	transition: all 0.2s ease;
	text-decoration: none;
}

.snapmatch-shortcode-btn:hover {
	background: #374151;
	color: #ffffff;
}

/* Modal Overlay */
#snapmatch-modal-overlay {
	position: fixed;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	background: rgba(15, 23, 42, 0.65);
	backdrop-filter: blur(5px);
	-webkit-backdrop-filter: blur(5px);
	z-index: 1000000;
	display: none;
	align-items: center;
	justify-content: center;
	opacity: 0;
	transition: opacity 0.25s ease;
}

#snapmatch-modal-overlay.active {
	display: flex;
	opacity: 1;
}

/* Modal Window */
.snapmatch-modal {
	background: #ffffff;
	width: 92%;
	max-width: 540px;
	max-height: 90vh;
	border-radius: 16px;
	padding: 26px;
	position: relative;
	box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
	transform: translateY(20px);
	transition: transform 0.25s ease;
	overflow-y: auto;
	box-sizing: border-box;
}

#snapmatch-modal-overlay.active .snapmatch-modal {
	transform: translateY(0);
}

.snapmatch-modal-close {
	position: absolute;
	top: 14px;
	right: 14px;
	background: #f1f5f9;
	border: none;
	width: 32px;
	height: 32px;
	border-radius: 50%;
	font-size: 20px;
	line-height: 1;
	cursor: pointer;
	color: #475569;
	display: flex;
	align-items: center;
	justify-content: center;
	transition: background 0.15s;
}

.snapmatch-modal-close:hover {
	background: #e2e8f0;
	color: #0f172a;
}

.snapmatch-modal-brand {
	display: flex;
	align-items: center;
	gap: 8px;
	margin-bottom: 12px;
}

.snapmatch-modal-brand img {
	height: 24px;
	width: auto;
}

.snapmatch-modal-description {
	color: #64748b;
	font-size: 14px;
	margin: 0 0 18px 0;
	line-height: 1.4;
}

/* Drop Zone */
.snapmatch-drop-zone {
	border: 2px dashed #cbd5e1;
	border-radius: 12px;
	padding: 36px 20px;
	text-align: center;
	cursor: pointer;
	transition: all 0.2s ease;
	background: #f8fafc;
}

.snapmatch-drop-zone:hover {
	border-color: #4f46e5;
	background: #f1f5f9;
}

.snapmatch-drop-zone.dragover {
	border-color: #4f46e5;
	background: #eef2ff;
}

.snapmatch-drop-icon svg {
	width: 44px;
	height: 44px;
	color: #64748b;
	margin-bottom: 8px;
}

.snapmatch-drop-title {
	font-size: 15px;
	font-weight: 600;
	color: #1e293b;
}

.snapmatch-drop-hint {
	font-size: 12px;
	color: #94a3b8;
	margin-top: 4px;
}

/* Spinner Loader */
.snapmatch-loader {
	display: none;
	margin: 30px auto;
	width: 42px;
	height: 42px;
	border: 3px solid #f1f5f9;
	border-top: 3px solid #4f46e5;
	border-radius: 50%;
	animation: snapmatch-spin 0.9s linear infinite;
}

@keyframes snapmatch-spin {
	0% { transform: rotate(0deg); }
	100% { transform: rotate(360deg); }
}

/* Results Grid */
.snapmatch-results {
	margin-top: 18px;
	max-height: 420px;
	overflow-y: auto;
	display: grid;
	grid-template-columns: repeat(2, 1fr);
	gap: 14px;
}

.snapmatch-item {
	border: 1px solid #e2e8f0;
	border-radius: 10px;
	overflow: hidden;
	text-decoration: none;
	color: inherit;
	background: #ffffff;
	transition: all 0.2s ease;
	display: flex;
	flex-direction: column;
}

.snapmatch-item:hover {
	transform: translateY(-3px);
	box-shadow: 0 8px 16px -4px rgba(0, 0, 0, 0.1);
	border-color: #cbd5e1;
}

.snapmatch-item-thumb {
	width: 100%;
	height: 150px;
	object-fit: cover;
	background: #f8fafc;
}

.snapmatch-item-details {
	padding: 10px;
	display: flex;
	flex-direction: column;
	gap: 4px;
	flex-grow: 1;
}

.snapmatch-item-title {
	font-size: 13px;
	font-weight: 600;
	color: #0f172a;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.snapmatch-item-price {
	font-size: 13px;
	font-weight: 700;
	color: #4f46e5;
}

.snapmatch-item-score {
	font-size: 11px;
	font-weight: 600;
	color: #16a34a;
	background: #dcfce7;
	padding: 2px 6px;
	border-radius: 4px;
	align-self: flex-start;
}

/* Multi-object selection */
.snapmatch-object-preview-wrap {
	position: relative;
	max-width: 100%;
	margin-bottom: 16px;
	border-radius: 8px;
	overflow: hidden;
	display: inline-block;
}

.snapmatch-object-preview-img {
	display: block;
	max-width: 100%;
	max-height: 280px;
	border-radius: 8px;
}

.snapmatch-object-box {
	position: absolute;
	border: 3px solid #4f46e5;
	border-radius: 6px;
	background: rgba(79, 70, 229, 0.15);
	box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.8), 0 4px 12px rgba(0,0,0,0.3);
	cursor: pointer;
	z-index: 10;
	transition: all 0.2s ease;
}

.snapmatch-object-box:hover {
	border-color: #06b6d4;
	background: rgba(6, 182, 212, 0.3);
	transform: scale(1.02);
}

.snapmatch-change-image-btn {
	margin-top: 14px;
	width: 100%;
	padding: 8px;
	background: #f1f5f9;
	border: 1px solid #e2e8f0;
	border-radius: 6px;
	font-size: 13px;
	font-weight: 600;
	color: #475569;
	cursor: pointer;
	transition: background 0.2s;
}

.snapmatch-change-image-btn:hover {
	background: #e2e8f0;
	color: #0f172a;
}

/* Waking Up Hibernation Notice */
.snapmatch-waking-up-box {
	grid-column: 1 / -1;
	text-align: center;
	padding: 26px 14px;
	background: #eff6ff;
	border: 1px solid #bfdbfe;
	border-radius: 10px;
	color: #1e40af;
	font-size: 14px;
	line-height: 1.5;
}

.snapmatch-waking-up-box svg {
	width: 36px;
	height: 36px;
	color: #3b82f6;
	margin: 0 auto 10px;
	display: block;
}

@media (max-width: 480px) {
	.snapmatch-results {
		grid-template-columns: 1fr;
	}
	.snapmatch-modal {
		padding: 20px 16px;
	}
}
