/**
 * Content Protection Styles
 * Prevents text selection and hides content when printing
 * Settings-aware version - uses conditional body classes
 *
 * Note: Text selection prevention rules are in inline CSS (content-protection.php)
 * for immediate protection before this stylesheet loads. This file contains
 * form field exceptions and print/notification styles.
 */

/* ==========================================================================
   Form Field Exceptions
   Allow selection in form fields for usability
   ========================================================================== */

body.content-protected input,
body.content-protected textarea,
body.content-protected select,
body.content-protected [contenteditable="true"] {
	-webkit-user-select: text;
	-moz-user-select: text;
	-ms-user-select: text;
	user-select: text;
}

/* Prevent image dragging - applies when text selection is disabled */
body.content-protected.text-selection-disabled img {
	-webkit-user-drag: none;
	-khtml-user-drag: none;
	-moz-user-drag: none;
	-o-user-drag: none;
	user-drag: none;
	pointer-events: none;
}

/* Re-enable pointer events for clickable images (links) */
body.content-protected.text-selection-disabled a img {
	pointer-events: auto;
}

/* ==========================================================================
   Print Prevention
   Only applies when .print-disabled class is present
   Uses visibility instead of display to preserve pseudo-element message
   ========================================================================== */

@media print {
	/* Hide all body children when printing (not using * which hides pseudo-elements) */
	body.content-protected.print-disabled > * {
		visibility: hidden !important;
	}

	/* White background overlay */
	body.content-protected.print-disabled::before {
		display: block !important;
		visibility: visible !important;
		position: fixed;
		top: 0;
		left: 0;
		right: 0;
		bottom: 0;
		background: #fff;
		z-index: 999999;
		content: "";
	}

	/* Protection message */
	body.content-protected.print-disabled::after {
		display: block !important;
		visibility: visible !important;
		position: fixed;
		top: 50%;
		left: 50%;
		transform: translate(-50%, -50%);
		content: "This content is protected and cannot be printed. Please view online.";
		font-size: 24px;
		font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
		text-align: center;
		color: #333;
		padding: 40px;
		max-width: 600px;
		line-height: 1.5;
		z-index: 9999999;
	}
}

/* ==========================================================================
   Dynamic Protection Notification
   Shows briefly when a blocked action is triggered
   ========================================================================== */

.cp-notification {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%) translateY(8px);
    padding: 12px 24px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    color: #374151;
    font-size: 14px;
    font-weight: 500;
    letter-spacing: 0.01em;
    border-radius: 8px;
    border: 1px solid rgba(0, 0, 0, 0.06);
    box-shadow:
        0 4px 6px -1px rgba(0, 0, 0, 0.08),
        0 2px 4px -2px rgba(0, 0, 0, 0.05),
        0 0 0 1px rgba(0, 0, 0, 0.03);
    z-index: 999999;
    opacity: 0;
    visibility: hidden;
    transition:
        opacity 0.25s cubic-bezier(0.4, 0, 0.2, 1),
        visibility 0.25s cubic-bezier(0.4, 0, 0.2, 1),
        transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
}

.cp-notification::before {
    content: "";
    display: inline-block;
    width: 6px;
    height: 6px;
    background: #9ca3af;
    border-radius: 50%;
    margin-right: 10px;
    vertical-align: middle;
}

.cp-notification.visible {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}

/* Positioned notification (for right-click) - override centered transform */
.cp-notification.positioned {
    transform: none;
    bottom: auto;
    left: auto;
}

/* When positioned and visible, don't apply centered transform */
.cp-notification.positioned.visible {
    transform: none;
}

