/**
 * NSFW Content Blurrer — Frontend Styles
 *
 * @version 1.1.0
 * @license GPL-2.0-or-later
 */

/* ===================================================
   Toggle Button
   =================================================== */
.nsfwcb-toggle {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	cursor: pointer;
	font-size: 0.875rem;
	font-weight: 500;
	padding: 6px 14px;
	border-radius: 20px;
	border: 2px solid currentColor;
	background: transparent;
	color: inherit;
	transition: all 0.3s ease;
	white-space: nowrap;
	font-family: inherit;
	line-height: 1.4;
}

.nsfwcb-toggle:hover {
	opacity: 0.8;
}

.nsfwcb-toggle:focus-visible {
	outline: 2px solid currentColor;
	outline-offset: 2px;
}

.nsfwcb-toggle-indicator {
	display: inline-block;
	width: 10px;
	height: 10px;
	border-radius: 50%;
	flex-shrink: 0;
	transition: background-color 0.3s ease;
}

.nsfwcb-toggle[data-active="true"] .nsfwcb-toggle-indicator {
	background-color: #e74c3c;
}

.nsfwcb-toggle[data-active="false"] .nsfwcb-toggle-indicator {
	background-color: #2ecc71;
}

/* Position: fixed variants */
.nsfwcb-toggle--fixed {
	position: fixed;
	z-index: 9998;
	background: rgba(255, 255, 255, 0.95);
	color: #333;
	backdrop-filter: blur(10px);
	-webkit-backdrop-filter: blur(10px);
	box-shadow: 0 2px 12px rgba(0, 0, 0, 0.15);
}

.nsfwcb-toggle--fixed-top-right {
	top: 16px;
	right: 16px;
}

.nsfwcb-toggle--fixed-top-left {
	top: 16px;
	left: 16px;
}

.nsfwcb-toggle--fixed-bottom-right {
	bottom: 16px;
	right: 16px;
}

/* ===================================================
   Blur Effect on NSFW Elements
   =================================================== */
.nsfwcb-blurred {
	position: relative;
	filter: blur(var(--nsfwcb-blur, 10px));
	pointer-events: none;
	user-select: none;
	-webkit-user-select: none;
	transition: filter 0.5s ease;
}

.nsfwcb-blurred * {
	pointer-events: none;
}

/* Overlay on blurred blocks */
.nsfwcb-overlay {
	position: absolute;
	top: 0;
	left: 0;
	right: 0;
	bottom: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	z-index: 10;
	pointer-events: none;
}

.nsfwcb-overlay-label {
	background: rgba(0, 0, 0, 0.7);
	color: #fff;
	padding: 8px 20px;
	border-radius: 6px;
	font-size: 0.875rem;
	font-weight: 600;
	letter-spacing: 0.5px;
	text-transform: uppercase;
	filter: none;
}

/* Revealed state */
.nsfwcb-revealed {
	filter: none !important;
	pointer-events: auto !important;
	user-select: auto !important;
	-webkit-user-select: auto !important;
}

/* Wrapper for overlay positioning */
.nsfwcb-wrapper {
	position: relative;
	display: block;
}

/* ===================================================
   Modal
   =================================================== */
.nsfwcb-modal {
	position: fixed;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	z-index: 99999;
	display: flex;
	align-items: center;
	justify-content: center;
}

.nsfwcb-modal[hidden] {
	display: none !important;
}

.nsfwcb-modal-backdrop {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	background: rgba(0, 0, 0, 0.6);
	backdrop-filter: blur(4px);
	-webkit-backdrop-filter: blur(4px);
}

.nsfwcb-modal-content {
	position: relative;
	background: #fff;
	border-radius: 16px;
	padding: 40px;
	max-width: 480px;
	width: 90%;
	box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
	animation: nsfwcb-modal-in 0.3s ease;
	text-align: center;
}

@keyframes nsfwcb-modal-in {
	from {
		opacity: 0;
		transform: scale(0.9) translateY(20px);
	}
	to {
		opacity: 1;
		transform: scale(1) translateY(0);
	}
}

.nsfwcb-modal-content h2 {
	margin: 0 0 12px;
	font-size: 1.5rem;
	color: #1a1a1a;
}

.nsfwcb-modal-content > p {
	color: #555;
	margin: 0 0 24px;
	font-size: 0.95rem;
	line-height: 1.5;
}

/* Date of birth inputs */
.nsfwcb-modal-dob {
	display: flex;
	align-items: flex-end;
	justify-content: center;
	gap: 12px;
	margin-bottom: 20px;
}

.nsfwcb-modal-dob-field {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 4px;
}

.nsfwcb-modal-dob-field label {
	font-size: 0.75rem;
	font-weight: 600;
	color: #888;
	text-transform: uppercase;
	letter-spacing: 0.5px;
}

.nsfwcb-modal-dob-field input {
	width: 72px;
	padding: 10px 8px;
	border: 2px solid #ddd;
	border-radius: 8px;
	text-align: center;
	font-size: 1.1rem;
	font-family: inherit;
	transition: border-color 0.2s;
	background: #fafafa;
	color: #333;
	-moz-appearance: textfield;
}

.nsfwcb-modal-dob-field input::-webkit-outer-spin-button,
.nsfwcb-modal-dob-field input::-webkit-inner-spin-button {
	-webkit-appearance: none;
	margin: 0;
}

.nsfwcb-modal-dob-field input:focus {
	outline: none;
	border-color: #e74c3c;
	background: #fff;
}

/* Error message */
.nsfwcb-modal-error {
	color: #e74c3c;
	font-size: 0.875rem;
	margin: 0 0 16px;
	font-weight: 500;
}

/* Buttons */
.nsfwcb-modal-actions {
	display: flex;
	gap: 12px;
	justify-content: center;
}

.nsfwcb-btn {
	padding: 10px 24px;
	border: none;
	border-radius: 8px;
	font-size: 0.95rem;
	font-weight: 600;
	cursor: pointer;
	transition: all 0.2s;
	font-family: inherit;
}

.nsfwcb-btn:focus-visible {
	outline: 2px solid #333;
	outline-offset: 2px;
}

.nsfwcb-btn-primary {
	background: #e74c3c;
	color: #fff;
}

.nsfwcb-btn-primary:hover {
	background: #c0392b;
}

.nsfwcb-btn-secondary {
	background: #f0f0f0;
	color: #555;
}

.nsfwcb-btn-secondary:hover {
	background: #e0e0e0;
}

/* Version link in modal */
.nsfwcb-modal-version {
	margin: 20px 0 0;
	font-size: 0.75rem;
	color: #aaa;
}

.nsfwcb-modal-version a {
	color: #aaa;
	text-decoration: none;
	transition: color 0.2s;
}

.nsfwcb-modal-version a:hover {
	color: #e74c3c;
}

/* ===================================================
   Responsive
   =================================================== */
@media (max-width: 600px) {
	.nsfwcb-modal-content {
		padding: 28px 20px;
		border-radius: 12px;
	}

	.nsfwcb-modal-dob {
		gap: 8px;
	}

	.nsfwcb-modal-dob-field input {
		width: 60px;
		padding: 8px 4px;
		font-size: 1rem;
	}

	.nsfwcb-toggle--fixed {
		font-size: 0.8rem;
		padding: 5px 10px;
	}

	.nsfwcb-btn {
		padding: 8px 18px;
		font-size: 0.875rem;
	}
}
