/* ==========================================================================
   Screenshot & Demo Protection Guard Stylesheet
   Defends against Windows Snipping Tool (Win+Shift+S), PrintScreen, Print,
   DevTools, DOM scraping, and unauthorized captures.
   ========================================================================== */

/* Universal text & element selection lockdown */
body.demo-guard-active,
body.demo-guard-active .main-content,
body.demo-guard-active .target-card,
body.demo-guard-active .overview-grid,
body.demo-guard-active .overview-card,
body.demo-guard-active .results-section,
body.demo-guard-active .metric-item,
body.demo-guard-active .checks-list,
body.demo-guard-active .check-card,
body.demo-guard-active .rule-item-modern {
  -webkit-user-select: none !important;
  -moz-user-select: none !important;
  -ms-user-select: none !important;
  user-select: none !important;
  -webkit-touch-callout: none !important;
}

/* ==========================================================================
   WHOLE-SCREEN GAUSSIAN BLUR ON SCREENSHOT / CAPTURE TRIGGER
   Applies high-intensity root blur across <html> and <body> so the entire screen
   is completely blurred and illegible in any capture buffer.
   ========================================================================== */
html.screen-capture-blur,
body.screen-capture-blur {
  filter: blur(28px) brightness(0.65) contrast(1.1) !important;
  -webkit-filter: blur(28px) brightness(0.65) contrast(1.1) !important;
  pointer-events: none !important;
  user-select: none !important;
  overflow: hidden !important;
  transition: filter 0.04s ease !important;
}

/* Fullscreen Privacy Shield Overlay (High-Intensity Blur & Frosted Backdrop) */
#app-shield {
  position: fixed;
  inset: 0;
  z-index: 2147483647; /* Maximum possible z-index */
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: rgba(7, 9, 14, 0.72);
  backdrop-filter: blur(25px);
  -webkit-backdrop-filter: blur(25px);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: none !important; /* Zero latency — no transition delays */
  padding: 24px;
}

#app-shield.active {
  opacity: 1 !important;
  visibility: visible !important;
  pointer-events: all !important;
  transition: none !important;
}

.shield-card {
  max-width: 520px;
  width: 90%;
  background: rgba(18, 24, 38, 0.95);
  border: 1px solid rgba(239, 68, 68, 0.35);
  border-radius: 20px;
  padding: 36px 32px;
  text-align: center;
  box-shadow: 0 25px 60px -15px rgba(0, 0, 0, 0.8), 0 0 50px rgba(239, 68, 68, 0.2);
  animation: shieldPop 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes shieldPop {
  0% {
    transform: scale(0.94);
    opacity: 0;
  }

  100% {
    transform: scale(1);
    opacity: 1;
  }
}

.shield-icon-wrap {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: rgba(239, 68, 68, 0.15);
  border: 2px solid rgba(239, 68, 68, 0.4);
  color: #ef4444;
  margin-bottom: 20px;
  animation: shieldPulse 1.8s infinite;
}

@keyframes shieldPulse {

  0%,
  100% {
    box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.4);
  }

  50% {
    box-shadow: 0 0 0 16px rgba(239, 68, 68, 0);
  }
}

.shield-title {
  font-size: 22px;
  font-weight: 700;
  color: #ffffff;
  margin-bottom: 10px;
  letter-spacing: -0.02em;
}

.shield-reason {
  display: inline-block;
  padding: 4px 12px;
  background: rgba(239, 68, 68, 0.2);
  border: 1px solid rgba(239, 68, 68, 0.4);
  border-radius: 9999px;
  color: #fca5a5;
  font-size: 12px;
  font-weight: 600;
  margin-bottom: 14px;
}

.shield-desc {
  font-size: 14px;
  color: #94a3b8;
  line-height: 1.6;
  margin-bottom: 24px;
}

.shield-tip {
  font-size: 13px;
  color: #38bdf8;
  background: rgba(56, 189, 248, 0.08);
  border: 1px dashed rgba(56, 189, 248, 0.25);
  border-radius: 10px;
  padding: 10px 14px;
}

/* Forensic Watermark Canvas Overlay */
#demo-watermark-canvas {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  z-index: 2147483640;
  /* Below shield, above everything else */
  pointer-events: none !important;
  opacity: 0.22;
  mix-blend-mode: overlay;
  transition: opacity 0.2s ease;
}

/* Presenter Demo Guard Status Pill in Navbar */
.demo-guard-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  background: rgba(34, 197, 94, 0.12);
  border: 1px solid rgba(34, 197, 94, 0.3);
  border-radius: 9999px;
  color: #4ade80;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  user-select: none;
}

.demo-guard-pill:hover {
  background: rgba(34, 197, 94, 0.2);
  border-color: rgba(34, 197, 94, 0.5);
  transform: translateY(-1px);
}

.demo-guard-pill.inactive {
  background: rgba(148, 163, 184, 0.1);
  border-color: rgba(148, 163, 184, 0.25);
  color: #94a3b8;
}

.guard-pill-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #22c55e;
  box-shadow: 0 0 10px #22c55e;
  animation: guardDotPulse 2s infinite;
}

.demo-guard-pill.inactive .guard-pill-dot {
  background: #94a3b8;
  box-shadow: none;
  animation: none;
}

@keyframes guardDotPulse {

  0%,
  100% {
    opacity: 1;
    transform: scale(1);
  }

  50% {
    opacity: 0.5;
    transform: scale(0.85);
  }
}

/* Toast Warning Message for Blocked Actions */
#demo-guard-toast {
  position: fixed;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  z-index: 2147483646;
  background: rgba(15, 23, 42, 0.95);
  border: 1px solid rgba(239, 68, 68, 0.4);
  color: #ffffff;
  padding: 12px 24px;
  border-radius: 9999px;
  font-size: 13px;
  font-weight: 600;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.6), 0 0 20px rgba(239, 68, 68, 0.25);
  display: flex;
  align-items: center;
  gap: 10px;
  opacity: 0;
  pointer-events: none;
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.25s ease;
}

#demo-guard-toast.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

#demo-guard-toast svg {
  color: #ef4444;
  flex-shrink: 0;
}

/* Presenter Demo Guard Configuration Modal */
#demoGuardModal {
  position: fixed;
  inset: 0;
  z-index: 2147483646;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s ease, visibility 0.2s ease;
}

#demoGuardModal.open {
  opacity: 1;
  visibility: visible;
}

.demo-modal-box {
  width: 90%;
  max-width: 480px;
  background: #111827;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 16px;
  padding: 24px 28px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.8);
}

.demo-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  padding-bottom: 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.demo-modal-title {
  font-size: 18px;
  font-weight: 700;
  color: #ffffff;
  display: flex;
  align-items: center;
  gap: 8px;
}

.demo-modal-close {
  background: none;
  border: none;
  color: #94a3b8;
  font-size: 24px;
  cursor: pointer;
  line-height: 1;
  transition: color 0.15s;
}

.demo-modal-close:hover {
  color: #ffffff;
}

.demo-modal-group {
  margin-bottom: 18px;
}

.demo-modal-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: #cbd5e1;
  margin-bottom: 6px;
}

.demo-modal-input {
  width: 100%;
  padding: 10px 14px;
  border-radius: 8px;
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #ffffff;
  font-size: 14px;
  outline: none;
  transition: border-color 0.2s;
}

.demo-modal-input:focus {
  border-color: #38bdf8;
}

.demo-toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 0;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.demo-toggle-label {
  font-size: 14px;
  color: #e2e8f0;
  font-weight: 500;
}

.demo-toggle-sub {
  display: block;
  font-size: 12px;
  color: #64748b;
  margin-top: 2px;
}

/* Switch styling */
.demo-switch {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
}

.demo-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.demo-slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background-color: #334155;
  transition: .3s;
  border-radius: 24px;
}

.demo-slider:before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: .3s;
  border-radius: 50%;
}

input:checked+.demo-slider {
  background-color: #22c55e;
}

input:checked+.demo-slider:before {
  transform: translateX(20px);
}

/* ==========================================================================
   PRINT MEDIA PROTECTION LAYER
   Guarantees that standard browser printing or "Save as PDF" produces zero data
   ========================================================================== */
@media print {

  /* Complete blanking of all HTML DOM elements */
  html,
  body {
    background: #000000 !important;
    color: #ffffff !important;
    height: 100% !important;
    overflow: hidden !important;
  }

  body * {
    display: none !important;
    visibility: hidden !important;
  }

  /* Insert non-suppressible security banner on printout */
  body::after {
    display: block !important;
    visibility: visible !important;
    content: "RESTRICTED MATERIAL — CONFIDENTIAL CLIENT DEMONSTRATION. Printing, PDF export, and physical capture are strictly prohibited by security policy.";
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif !important;
    font-size: 20pt !important;
    font-weight: 800 !important;
    color: #dc2626 !important;
    text-align: center !important;
    margin-top: 30vh !important;
    padding: 40px !important;
    border: 3pt solid #dc2626 !important;
    background: #ffffff !important;
    text-transform: uppercase !important;
    letter-spacing: 0.05em !important;
  }
}