/* MongTruyen - Content Protection (Phase 4) */

.mt-protect-content {
  -webkit-user-select: none !important;
  user-select: none !important;
  -webkit-touch-callout: none !important;
  -webkit-tap-highlight-color: transparent;
}

.mt-protect-content,
.mt-protect-content * {
  -webkit-user-drag: none !important;
  user-drag: none !important;
}

.mt-protect-content ::selection {
  background: transparent;
  color: inherit;
}

.mt-protect-content ::-moz-selection {
  background: transparent;
  color: inherit;
}

/* Hidden watermark - ẩn trên web nhưng hiện khi export */
.mt-hidden-watermark {
  position: absolute !important;
  left: -9999px !important;
  top: -9999px !important;
  opacity: 0 !important;
  pointer-events: none !important;
  font-size: 1px !important;
  color: transparent !important;
  /* Khi export EPUB, các style inline thường bị strip, watermark sẽ hiện */
}

/* Anti-extension: ẩn nội dung khi detect extension */
body.mt-extension-detected .mt-protect-content {
  filter: blur(30px) !important;
  pointer-events: none !important;
}

body.mt-extension-detected .mt-protect-content::after {
  content: 'Phát hiện công cụ tải nội dung. Vui lòng tắt extension và tải lại trang.';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: rgba(255, 0, 0, 0.9);
  color: white;
  padding: 20px 40px;
  border-radius: 10px;
  font-size: 18px;
  font-weight: bold;
  z-index: 9999;
  text-align: center;
}

body.mt-protect .mt-screen-shield {
  position: fixed;
  inset: 0;
  background: #fff;
  display: none;
  z-index: 2147483647;
}

body.mt-protect .mt-screen-shield.is-active {
  display: block;
}

body.mt-protect.mt-protect-blur #noi_dung_truyen,
body.mt-protect.mt-protect-blur .mt-protect-content {
  filter: blur(20px) !important;
}

@page {
  margin: 0;
}

@media print {
  body.mt-protect-print,
  body.mt-protect-print * {
    visibility: hidden !important;
  }

  html,
  body {
    background: #fff !important;
  }
  
  /* Hiện watermark khi in */
  .mt-hidden-watermark {
    position: static !important;
    left: auto !important;
    top: auto !important;
    opacity: 1 !important;
    font-size: 24px !important;
    color: red !important;
    display: block !important;
    text-align: center;
    padding: 20px;
  }
}

