/**
 * OLS Dekho Jivan Sathi — Site-wide Content Protection Stylesheet
 * Version: 2.6
 * Comprehensive text selection prevention, image drag blocking, and print deterrence.
 * Strictly preserves accessibility, editing, and selection for form controls and inputs.
 */

/* 1. Global Text-Selection & Drag Prevention on User-Facing Content */
html,
body,
p,
span,
div,
h1,
h2,
h3,
h4,
h5,
h6,
a,
li,
table,
td,
th,
article,
section,
main,
aside,
header,
footer,
.profile-card,
.match-card,
.card-photo-wrapper,
.profile-section,
.biodata-section,
.candidate-details,
.unlocked-profile-card,
.unlocked-contact-card,
.chat-messages-container,
.chat-bubble,
.proposal-card,
[data-protected="true"] {
  -webkit-user-select: none !important;
  -moz-user-select: none !important;
  -ms-user-select: none !important;
  user-select: none !important;
  -webkit-touch-callout: none !important;
}

/* 2. Protected Imagery Dragging Suppression */
img,
svg,
picture,
video,
canvas {
  -webkit-user-select: none !important;
  -moz-user-select: none !important;
  -ms-user-select: none !important;
  user-select: none !important;
  -webkit-user-drag: none !important;
  -khtml-user-drag: none !important;
  -moz-user-drag: none !important;
  -o-user-drag: none !important;
  user-drag: none !important;
  -webkit-touch-callout: none !important;
}

/* 3. STRICT FORM & INTERACTIVE ELEMENT EXEMPTIONS */
/* Never block typing, selecting, copying, or editing in legitimate form fields */
input,
textarea,
select,
button,
label,
option,
[contenteditable="true"],
.auth-input,
.form-input,
.chat-input,
.search-input,
.otp-digit,
.allow-select,
.allow-copy,
[data-allow-select="true"] {
  -webkit-user-select: text !important;
  -moz-user-select: text !important;
  -ms-user-select: text !important;
  user-select: text !important;
  -webkit-touch-callout: default !important;
}

/* 3.1 ADMIN CONSOLE FULL EXEMPTION */
.admin-layout,
.admin-layout * {
  -webkit-user-select: text !important;
  -moz-user-select: text !important;
  -ms-user-select: text !important;
  user-select: text !important;
  -webkit-user-drag: auto !important;
  user-drag: auto !important;
  -webkit-touch-callout: default !important;
}

/* 3.2 Dynamic Watermark Overlay with Viewer Member ID */
.watermark-overlay,
.card-photo-wrapper,
.biodata-section,
.unlocked-profile-card,
.chat-messages-container {
  position: relative;
}

.watermark-overlay::after,
.card-photo-wrapper::after,
.biodata-section::after,
.unlocked-profile-card::after,
.chat-messages-container::after {
  content: var(--viewer-watermark, "OLS JIVAN SATHI");
  position: absolute;
  inset: 0;
  pointer-events: none !important;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 2px;
  color: rgba(6, 95, 70, 0.08);
  transform: rotate(-22deg);
  z-index: 3;
  overflow: hidden;
}

/* 3.3 Protected Contact Badge Styling */
.protected-contact-badge {
  display: inline-block;
  vertical-align: middle;
  height: 22px;
  max-height: 24px;
  border-radius: 6px;
  pointer-events: none !important;
  -webkit-user-drag: none !important;
  user-drag: none !important;
  -webkit-user-select: none !important;
  user-select: none !important;
}

/* 4. Privacy Blur Shield (Active during focus loss or screenshot capture) */
body.ols-privacy-shield-active > *:not(#ols-protection-warning-modal) {
  filter: blur(28px) grayscale(90%) !important;
  -webkit-filter: blur(28px) grayscale(90%) !important;
  opacity: 0.25 !important;
  transition: filter 0.08s ease, opacity 0.08s ease !important;
  pointer-events: none !important;
}

.shield-blur {
  filter: blur(28px) grayscale(90%) !important;
  -webkit-filter: blur(28px) grayscale(90%) !important;
  opacity: 0.25 !important;
  transition: filter 0.15s ease, opacity 0.15s ease !important;
  pointer-events: none !important;
}

/* 5. Watermark Overlay for Biodata Cards & Sensitive Text Areas */
.content-watermark-overlay {
  position: relative;
  overflow: hidden;
}

.content-watermark-overlay::after {
  content: attr(data-watermark);
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: 13px;
  font-weight: 800;
  color: rgba(6, 95, 70, 0.07);
  transform: rotate(-24deg);
  pointer-events: none;
  z-index: 5;
  text-transform: uppercase;
  letter-spacing: 2.5px;
  white-space: nowrap;
}

/* 6. PRINT MEDIA SUPPRESSION */
@media print {
  body * {
    visibility: hidden !important;
    display: none !important;
  }

  body::before {
    content: "🔒 Printing Disabled: Matrimonial biodata, contact details, and photographs on OLS Dekho Jivan Sathi are protected for candidate privacy and family modesty.";
    visibility: visible !important;
    display: block !important;
    position: fixed !important;
    top: 30% !important;
    left: 10% !important;
    right: 10% !important;
    padding: 30px 24px !important;
    background: #FEF2F2 !important;
    border: 2px solid #EF4444 !important;
    color: #991B1B !important;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif !important;
    font-size: 18px !important;
    font-weight: 700 !important;
    text-align: center !important;
    line-height: 1.6 !important;
    border-radius: 12px !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1) !important;
    z-index: 99999999 !important;
  }
}
