/* ==========================================================================
   Dabour Hub — Comprehensive Content Guard & Anti-Screenshot System v4.0
   Dual-Tone High-Visibility Watermark + Instant Blur on Focus-Loss
   ========================================================================== */

/* 1. Global Copy & Selection Protection */
html.dh-protected,
html.dh-protected body,
body.dh-protected {
  -webkit-user-select: none !important;
  -moz-user-select: none !important;
  -ms-user-select: none !important;
  user-select: none !important;
  -webkit-touch-callout: none !important;
  -webkit-tap-highlight-color: transparent !important;
}

/* Strict exemptions for inputs */
html.dh-protected input,
html.dh-protected textarea,
html.dh-protected select,
html.dh-protected [contenteditable="true"],
body.dh-protected input,
body.dh-protected textarea,
body.dh-protected select,
body.dh-protected [contenteditable="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;
}

/* 2. Media Drag & Save Protection */
html.dh-protected img,
html.dh-protected svg,
html.dh-protected canvas,
html.dh-protected video,
html.dh-protected figure,
body.dh-protected img,
body.dh-protected svg,
body.dh-protected canvas,
body.dh-protected video,
body.dh-protected figure {
  -webkit-user-drag: none !important;
  -khtml-user-drag: none !important;
  -moz-user-drag: none !important;
  user-drag: none !important;
  pointer-events: auto;
}

/* 3. Instant Blur on Focus Loss / App Switching */
html.dh-blurred body {
  filter: blur(35px) !important;
  opacity: 0.1 !important;
  pointer-events: none !important;
  transition: none !important;
}

/* 4. Full-Screen Anti-Screenshot Shield */
#dh-screen-shield {
  position: fixed !important;
  inset: 0 !important;
  width: 100vw !important;
  height: 100vh !important;
  z-index: 2147483646 !important;
  background: rgba(11, 21, 35, 0.98) !important;
  -webkit-backdrop-filter: blur(50px) saturate(180%) !important;
  backdrop-filter: blur(50px) saturate(180%) !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  padding: 24px !important;
  box-sizing: border-box !important;
  opacity: 0 !important;
  visibility: hidden !important;
  pointer-events: none !important;
  transition: opacity 0.15s ease-out, visibility 0.15s !important;
}

#dh-screen-shield.active {
  opacity: 1 !important;
  visibility: visible !important;
  pointer-events: auto !important;
}

.dh-shield-card {
  max-width: 480px !important;
  width: 100% !important;
  background: #142236 !important;
  border: 1px solid rgba(255, 107, 107, 0.4) !important;
  border-radius: 20px !important;
  padding: 32px 24px !important;
  text-align: center !important;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.6) !important;
  color: #ffffff !important;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Cairo", Tahoma, sans-serif !important;
  direction: inherit !important;
}

.dh-shield-icon {
  font-size: 52px !important;
  margin-bottom: 16px !important;
  display: inline-block !important;
}

.dh-shield-title {
  margin: 0 0 12px 0 !important;
  font-size: 20px !important;
  font-weight: 700 !important;
  color: #ff7b7b !important;
}

.dh-shield-desc {
  margin: 0 0 20px 0 !important;
  font-size: 14px !important;
  line-height: 1.7 !important;
  color: #cbd5e1 !important;
}

.dh-shield-badge {
  display: inline-block !important;
  background: rgba(255, 255, 255, 0.08) !important;
  border: 1px solid rgba(255, 255, 255, 0.15) !important;
  padding: 6px 16px !important;
  border-radius: 999px !important;
  font-size: 12px !important;
  color: #94a3b8 !important;
  font-weight: 600 !important;
}

/* 5. Permanent Dual-Tone High-Visibility Watermark Layer */
#dh-watermark-overlay {
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  width: 100vw !important;
  height: 100vh !important;
  pointer-events: none !important;
  z-index: 2147483640 !important; /* Above all content, modals, and LMS cards */
  background-repeat: repeat !important;
  background-size: 320px 190px !important;
  opacity: 1 !important;
}

/* Fallback local card watermarks */
.dhq-q::after,
.lx-step::after,
figure.qfig::after,
.lesson-article::after,
.dhn-qcard::after,
.dhn-qrun::after {
  content: "" !important;
  position: absolute !important;
  inset: 0 !important;
  pointer-events: none !important;
  z-index: 2 !important;
  border-radius: inherit !important;
  background-image: var(--dh-wm-url) !important;
  background-repeat: repeat !important;
  background-size: 320px 190px !important;
}

/* 6. Security Toast */
#dhg-t {
  position: fixed !important;
  left: 50% !important;
  bottom: 85px !important;
  transform: translate(-50%, 25px) !important;
  z-index: 2147483647 !important;
  padding: 12px 20px !important;
  border-radius: 14px !important;
  background: rgba(10, 21, 37, 0.96) !important;
  -webkit-backdrop-filter: blur(16px) !important;
  backdrop-filter: blur(16px) !important;
  border: 1px solid rgba(255, 122, 122, 0.6) !important;
  color: #ffd4d4 !important;
  font-family: system-ui, -apple-system, sans-serif !important;
  font-size: 14px !important;
  font-weight: 700 !important;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5) !important;
  opacity: 0 !important;
  visibility: hidden !important;
  pointer-events: none !important;
  transition: opacity 0.2s, transform 0.2s, visibility 0.2s !important;
  white-space: nowrap !important;
  max-width: 90vw !important;
}

#dhg-t.on {
  opacity: 1 !important;
  visibility: visible !important;
  transform: translate(-50%, 0) !important;
}

/* 7. Mobile Policy Badge */
#dh-guard-badge {
  position: fixed !important;
  bottom: 18px !important;
  right: 18px !important;
  z-index: 9999 !important;
  background: rgba(15, 23, 42, 0.92) !important;
  border: 1px solid rgba(225, 29, 72, 0.4) !important;
  color: #fb7185 !important;
  padding: 7px 14px !important;
  border-radius: 999px !important;
  font-family: system-ui, -apple-system, sans-serif !important;
  font-size: 11.5px !important;
  font-weight: 700 !important;
  cursor: pointer !important;
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.35) !important;
  display: flex !important;
  align-items: center !important;
  gap: 6px !important;
  -webkit-user-select: none !important;
  user-select: none !important;
}

[dir="rtl"] #dh-guard-badge {
  right: auto !important;
  left: 18px !important;
}

/* 8. Total Print Blanking */
@media print {
  html, body {
    background: #ffffff !important;
    color: #000000 !important;
  }
  html body * {
    display: none !important;
    visibility: hidden !important;
  }
  html body::before {
    content: "⚠️ تنبيه أمني: طباعة أو تصدير هذا المحتوى غير مسموح به نهائياً. جميع حقوق الطبع والنشر محفوظة لأكاديمية دكتور دبور (dabour-hub.com)." !important;
    display: block !important;
    visibility: visible !important;
    font-family: system-ui, -apple-system, sans-serif !important;
    font-size: 20px !important;
    font-weight: bold !important;
    color: #dc2626 !important;
    text-align: center !important;
    margin-top: 40vh !important;
    padding: 24px !important;
  }
}

#dh-watermark-overlay{display:none!important}
:root{--dh-wm-url:none!important}
