/**
 * DBW Contact Popup - Frontend Styles
 *
 * Developed by Dennis Buchwald, dbw media (www.dbw-media.de)
 */

/* Alle Outlines im Popup entfernen */
.dbwcp-overlay *,
.dbwcp-overlay *:focus,
.dbwcp-overlay *:active,
.dbwcp-popup *,
.dbwcp-popup *:focus,
.dbwcp-popup *:active {
	outline: none !important;
	box-shadow: none !important;
}

/* Overlay - Vollbild fixiert */
.dbwcp-overlay {
	position: fixed;
	top: 0;
	left: 0;
	right: 0;
	bottom: 0;
	z-index: 999999;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 20px;
	overflow-y: auto;
	transition: opacity 0.3s ease-in-out;
	opacity: 0;
}

/* Overlay sichtbar wenn nicht hidden */
.dbwcp-overlay:not([hidden]) {
	opacity: 1;
}

/* Popup Container */
.dbwcp-popup {
	position: relative;
	width: 100%;
	padding: 30px;
	box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
	animation: dbwcp-slide-in 0.3s ease-out;
	margin: auto;
}

/* Slide-in Animation */
@keyframes dbwcp-slide-in {
	from {
		transform: translateY(-30px);
		opacity: 0;
	}
	to {
		transform: translateY(0);
		opacity: 1;
	}
}

/* Close Button */
.dbwcp-close {
	position: absolute;
	top: 15px;
	right: 15px;
	width: 32px;
	height: 32px;
	padding: 0;
	border: none;
	background: rgba(0, 0, 0, 0.1);
	color: inherit;
	font-size: 24px;
	line-height: 1;
	cursor: pointer;
	border-radius: 50%;
	transition: background-color 0.2s ease;
	display: flex;
	align-items: center;
	justify-content: center;
}

.dbwcp-close:hover {
	background: rgba(0, 0, 0, 0.2);
}

.dbwcp-close:focus {
	background: rgba(0, 0, 0, 0.2);
	outline: none !important;
}

.dbwcp-close span {
	display: block;
}

/* Popup Inhalt */
.dbwcp-content {
	margin-bottom: 20px;
	line-height: 1.6;
}

.dbwcp-content:last-child {
	margin-bottom: 0;
}

.dbwcp-content > *:first-child {
	margin-top: 0;
}

.dbwcp-content > *:last-child {
	margin-bottom: 0;
}

/* Button Container - für zentrierten Button */
.dbwcp-popup > .dbwcp-button {
	display: block;
	width: fit-content;
	margin-left: auto;
	margin-right: auto;
}

/* Button */
.dbwcp-button {
	display: inline-block;
	padding: 12px 24px;
	margin: 0 auto;
	text-decoration: none !important;
	font-weight: 600;
	text-align: center;
	transition: opacity 0.2s ease, transform 0.1s ease;
	cursor: pointer;
	border: none;
	font-size: 16px;
	line-height: 1.4;
}

.dbwcp-button:hover {
	transform: translateY(-2px);
	text-decoration: none !important;
	opacity: 0.9;
	outline: none;
}

.dbwcp-button:focus {
	outline: none !important;
	opacity: 0.9;
}

.dbwcp-button:active {
	transform: translateY(0);
}

/* Button Text */
.dbwcp-button-text {
	display: inline-block;
	color: white !important;
}

/* Screen Reader Only - Visuell versteckter Text für Barrierefreiheit */
.dbwcp-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 - Mobile Optimierungen */
@media (max-width: 600px) {
	.dbwcp-overlay {
		padding: 15px;
	}

	.dbwcp-popup {
		padding: 25px 20px;
		max-width: 100% !important;
	}

	.dbwcp-close {
		top: 10px;
		right: 10px;
		width: 28px;
		height: 28px;
		font-size: 20px;
	}

	.dbwcp-button {
		display: block;
		width: 100%;
		padding: 14px 20px;
	}

	.dbwcp-content {
		font-size: 15px;
	}
}

/* Fokus-Sichtbarkeit für Barrierefreiheit */
.dbwcp-popup:focus {
	outline: none !important;
}

/* Verhindere Scroll im Body wenn Popup offen ist */
body.dbwcp-no-scroll {
	overflow: hidden;
}

/* Animations-Präferenzen respektieren */
@media (prefers-reduced-motion: reduce) {
	.dbwcp-overlay,
	.dbwcp-popup,
	.dbwcp-close,
	.dbwcp-button {
		animation: none;
		transition: none;
	}

	@keyframes dbwcp-slide-in {
		from,
		to {
			transform: none;
			opacity: 1;
		}
	}
}
