/* Plantcam Button & Overlay */

.plantcam-button {
	position: fixed;
	bottom: 20px;
	left: 20px;
	z-index: 9999;
	display: none;
	cursor: pointer;
}

.plantcam-button .wp-block-button__link {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
	line-height: 1.3;
	padding: 10px 20px !important;
}

.plantcam-button__text {
	text-align: left;
	font-size: 13px;
}

.plantcam-button__text span {
	display: block;
	font-size: 11px;
}

.plantcam-pulse {
	width: 10px;
	height: 10px;
	background-color: var(--wp--preset--color--green);
	border-radius: 50%;
	display: inline-block;
	animation: plantcam-pulse 1.5s ease-in-out infinite;
	flex-shrink: 0;
}

@keyframes plantcam-pulse {
	0% {
		box-shadow: 0 0 0 0 rgba(76, 175, 80, 0.7);
	}
	70% {
		box-shadow: 0 0 0 8px rgba(76, 175, 80, 0);
	}
	100% {
		box-shadow: 0 0 0 0 rgba(76, 175, 80, 0);
	}
}

/* Overlay */

.plantcam-overlay {
	position: fixed;
	bottom: 20px;
	left: 20px;
	z-index: 10000;
	display: none;
	border: 3px solid var(--wp--preset--color--green);
	border-radius: 8px;
	overflow: hidden;
	background: #fff;
	box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
	width: 480px;
	max-width: min(50vw, 480px);
}

.plantcam-overlay__header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	background: var(--wp--preset--color--green);
	color: #fff;
	padding: 8px 12px;
	font-size: 14px;
	font-weight: 600;
}

.plantcam-overlay__title {
	display: flex;
	align-items: center;
	gap: 8px;
}

.plantcam-overlay__close {
	background: none;
	border: none;
	color: #fff;
	font-size: 28px;
	cursor: pointer;
	line-height: 1;
	padding: 0 8px;
	opacity: 0.8;
	transition: opacity 0.2s;
}

.plantcam-overlay__close:hover {
	opacity: 1;
}

.plantcam-overlay__body {
	position: relative;
	line-height: 0;
	aspect-ratio: 16 / 9;
	background: #f0f0f0 var(--plantcam-offline-img) center / cover no-repeat;
}

.plantcam-overlay__body.is-loading::after {
	content: '';
	position: absolute;
	top: 50%;
	left: 50%;
	width: 30px;
	height: 30px;
	margin: -15px 0 0 -15px;
	border: 3px solid #ccc;
	border-top-color: var(--wp--preset--color--green);
	border-radius: 50%;
	animation: plantcam-spin 0.8s linear infinite;
}

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

.plantcam-img {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
	z-index: 0;
}

.plantcam-img.is-active {
	z-index: 1;
}

/* Offline Overlay */

.plantcam-offline-badge {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	display: flex;
	align-items: center;
	justify-content: center;
	background: rgba(0, 0, 0, 0.5);
}

.plantcam-offline-badge span {
	color: #fff;
	font-size: 28px;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 4px;
}

/* Smartphone: komplett ausblenden */

@media (max-width: 767px) {
	.plantcam-button,
	.plantcam-overlay {
		display: none !important;
	}
}
