/* =========================================================
   PORTFOLIO ADVANCED CLIENT-SIDE SECURITY & DEFENSE SUITE
   - Anti-Screenshot & Screen-Recording Privacy Curtain
   - Anti-Inspect & DevTools Lockout Protection
   - Anti-Copy, Anti-Drag, and Anti-Tamper Hardening
   - Print-Blocker Guard
   ========================================================= */

/* 1. Global Anti-Selection & Anti-Drag */
html, body {
  -webkit-user-select: none !important;
  -moz-user-select: none !important;
  -ms-user-select: none !important;
  user-select: none !important;
  -webkit-touch-callout: none !important;
}

img, svg, video, canvas {
  -webkit-user-drag: none !important;
  -webkit-touch-callout: none !important;
}

/* Allow interaction on real form controls and links */
a, button, input, textarea, select {
  -webkit-touch-callout: default;
}

/* 2. Privacy Curtain (Active on Window Blur / Screenshot / Focus-Loss) */
#screen-privacy-curtain {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  z-index: 999999;
  background: rgba(10, 10, 12, 0.96);
  backdrop-filter: blur(28px);
  -webkit-backdrop-filter: blur(28px);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.18s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.18s cubic-bezier(0.16, 1, 0.3, 1);
}

.security-privacy-active #screen-privacy-curtain {
  opacity: 1 !important;
  visibility: visible !important;
  pointer-events: auto !important;
}

.security-privacy-active body > *:not(#screen-privacy-curtain):not(#security-devtools-curtain):not(#security-toast) {
  filter: blur(50px) opacity(0.04) !important;
  pointer-events: none !important;
  transition: filter 0.12s ease, opacity 0.12s ease;
}

.privacy-card {
  max-width: 440px;
  width: calc(100% - 40px);
  background: rgba(22, 22, 26, 0.92);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 16px;
  padding: 32px 24px;
  text-align: center;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(255, 255, 255, 0.05);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  color: #f1f5f9;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  animation: curtainCardPop 0.24s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes curtainCardPop {
  0% { transform: scale(0.94); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}

.privacy-icon-badge {
  width: 54px;
  height: 54px;
  border-radius: 50%;
  background: rgba(59, 130, 246, 0.12);
  border: 1px solid rgba(59, 130, 246, 0.25);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #60a5fa;
  margin-bottom: 4px;
}

.privacy-title {
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: #ffffff;
  margin: 0;
}

.privacy-desc {
  font-size: 13.5px;
  line-height: 1.55;
  color: #94a3b8;
  margin: 0;
}

.privacy-badge-sub {
  font-size: 11.5px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #38bdf8;
  background: rgba(56, 189, 248, 0.1);
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid rgba(56, 189, 248, 0.2);
}

/* 3. DevTools Lockout Overlay */
#security-devtools-curtain {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  z-index: 10000000;
  background: #09090b;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.2s ease, visibility 0.2s ease;
}

.security-devtools-active #security-devtools-curtain {
  opacity: 1 !important;
  visibility: visible !important;
  pointer-events: auto !important;
}

.security-devtools-active body > *:not(#security-devtools-curtain) {
  display: none !important;
}

.devtools-card {
  max-width: 480px;
  width: calc(100% - 40px);
  background: #111114;
  border: 1px solid rgba(239, 68, 68, 0.35);
  border-radius: 14px;
  padding: 36px 28px;
  text-align: center;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.8), 0 0 40px rgba(239, 68, 68, 0.15);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  color: #f8fafc;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

.devtools-icon-badge {
  width: 58px;
  height: 58px;
  border-radius: 50%;
  background: rgba(239, 68, 68, 0.14);
  border: 1px solid rgba(239, 68, 68, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ef4444;
}

.devtools-title {
  font-size: 19px;
  font-weight: 700;
  color: #ffffff;
  margin: 0;
}

.devtools-desc {
  font-size: 13.5px;
  line-height: 1.6;
  color: #cbd5e1;
  margin: 0;
}

.devtools-instruction {
  font-size: 12px;
  color: #f87171;
  background: rgba(239, 68, 68, 0.1);
  border: 1px dashed rgba(239, 68, 68, 0.35);
  padding: 8px 16px;
  border-radius: 8px;
  margin-top: 4px;
}

/* 4. Security Interactive Toast Alert */
#security-toast {
  position: fixed;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: rgba(15, 17, 23, 0.94);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #f8fafc;
  padding: 10px 18px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 10px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.45);
  z-index: 9999999;
  opacity: 0;
  visibility: hidden;
  transition: transform 0.22s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.22s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.22s cubic-bezier(0.16, 1, 0.3, 1);
  pointer-events: none;
  white-space: nowrap;
}

#security-toast.active {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
  visibility: visible;
}

#security-toast .toast-icon {
  color: #f59e0b;
  display: flex;
  align-items: center;
}

/* 5. Print Blocker Override */
#print-security-notice {
  display: none !important;
}

@media print {
  /* Suppress all page elements during print attempts */
  html, body {
    background: #ffffff !important;
    color: #000000 !important;
  }

  body > *:not(#print-security-notice) {
    display: none !important;
    visibility: hidden !important;
  }

  #print-security-notice {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    min-height: 80vh !important;
    text-align: center !important;
    padding: 60pt 20pt !important;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif !important;
  }

  #print-security-notice h1 {
    font-size: 18pt !important;
    font-weight: 800 !important;
    color: #0f172a !important;
    margin-bottom: 8pt !important;
  }

  #print-security-notice p {
    font-size: 10.5pt !important;
    color: #475569 !important;
    line-height: 1.5 !important;
    max-width: 400pt !important;
  }

  #print-security-notice .watermark-foot {
    font-size: 8.5pt !important;
    color: #94a3b8 !important;
    margin-top: 24pt !important;
  }
}
