/* ==========================================================================
   Protected PDF Reader & Canvas Viewer Styles
   ========================================================================== */

/* Security Printing Lockdown */
@media print {
  html, body, #pdf-viewer-modal, #pdf-canvas, canvas, #reader-container, .pdf-render-area {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
  }
}

/* Modal Reader Container */
#pdf-viewer-modal {
  position: fixed;
  inset: 0;
  z-index: 100000;
  background-color: rgba(2, 6, 23, 0.98);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  color: #FFFFFF;
  user-select: none;
  -webkit-user-select: none;
  overflow: hidden;
  display: none;
  flex-direction: column;
}

#pdf-viewer-modal.active {
  display: flex;
}

/* Reader Top Header */
.pdf-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 24px;
  background-color: rgba(15, 23, 42, 0.92);
  border-bottom: 1px solid rgba(51, 65, 85, 0.8);
  flex-shrink: 0;
}

.pdf-header-title-box {
  display: flex;
  align-items: center;
  gap: 12px;
}

.pdf-icon-badge {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  background: rgba(14, 165, 233, 0.2);
  color: #38BDF8;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 12px;
  letter-spacing: 0.05em;
  border: 1px solid rgba(14, 165, 233, 0.35);
}

.pdf-header-title {
  font-size: 15px;
  font-weight: 800;
  color: #FFFFFF;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.pdf-protected-pill {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  background-color: rgba(16, 185, 129, 0.2);
  color: #34D399;
  padding: 2px 8px;
  border-radius: 9999px;
  border: 1px solid rgba(16, 185, 129, 0.35);
}

.pdf-header-meta {
  font-size: 11.5px;
  color: #94A3B8;
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 2px;
}

/* Controls */
.pdf-header-controls {
  display: flex;
  align-items: center;
  gap: 8px;
}

.pdf-ctrl-btn {
  padding: 8px;
  border-radius: 10px;
  background-color: rgba(30, 41, 59, 0.85);
  color: #E2E8F0;
  border: 1px solid rgba(51, 65, 85, 0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.pdf-ctrl-btn:hover {
  background-color: rgba(51, 65, 85, 0.95);
  color: #FFFFFF;
}

.pdf-zoom-val {
  font-size: 12px;
  font-family: monospace;
  font-weight: 700;
  color: #CBD5E1;
  width: 44px;
  text-align: center;
}

.pdf-close-btn {
  padding: 8px 12px;
  border-radius: 10px;
  background-color: rgba(239, 68, 68, 0.2);
  color: #FCA5A5;
  border: 1px solid rgba(239, 68, 68, 0.35);
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 700;
  transition: all 0.2s ease;
}

.pdf-close-btn:hover {
  background-color: rgba(239, 68, 68, 0.35);
  color: #FFFFFF;
}

/* Warning Sub-Banner */
.pdf-security-banner {
  background-color: rgba(245, 158, 11, 0.12);
  border-bottom: 1px solid rgba(245, 158, 11, 0.25);
  color: #FCD34D;
  padding: 8px 16px;
  font-size: 12px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-align: center;
}

/* Viewport Canvas Wrapper */
.pdf-canvas-viewport {
  position: relative;
  flex: 1;
  overflow: auto;
  padding: 30px 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  background-color: #020617;
}

.pdf-card-shadow {
  position: relative;
  z-index: 10;
  background-color: #FFFFFF;
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 25px 60px -15px rgba(0, 0, 0, 0.7);
  border: 1px solid rgba(51, 65, 85, 0.6);
  transition: filter 0.2s ease, opacity 0.2s ease;
}

/* Security Anti-Screenshot Blur Shield */
.pdf-blur-shield {
  position: absolute;
  inset: 0;
  z-index: 50;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background-color: rgba(2, 6, 23, 0.96);
  backdrop-filter: blur(28px);
  -webkit-backdrop-filter: blur(28px);
  text-align: center;
  padding: 24px;
}

.pdf-blur-shield.active {
  display: flex;
}

.shield-icon {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background-color: rgba(239, 68, 68, 0.18);
  color: #F87171;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 18px;
  border: 1px solid rgba(239, 68, 68, 0.35);
}

.shield-title {
  font-size: 20px;
  font-weight: 800;
  color: #FFFFFF;
  margin-bottom: 8px;
}

.shield-desc {
  font-size: 14px;
  color: #94A3B8;
  max-width: 440px;
  line-height: 1.6;
}

.shield-hint {
  margin-top: 18px;
  font-size: 12px;
  font-weight: 700;
  color: #FBBF24;
  background: rgba(245, 158, 11, 0.12);
  padding: 6px 16px;
  border-radius: 9999px;
  border: 1px solid rgba(245, 158, 11, 0.25);
}

/* Expired Link Notice */
.pdf-expired-screen {
  position: absolute;
  inset: 0;
  z-index: 60;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background-color: rgba(2, 6, 23, 0.98);
  text-align: center;
  padding: 30px;
}

.pdf-expired-screen.active {
  display: flex;
}

/* ==========================================================================
   Responsive Adaptations for Mobile & Tablet Viewers
   ========================================================================== */
@media (max-width: 768px) {
  .pdf-modal-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
    padding: 12px 16px;
  }
  .pdf-header-controls {
    width: 100%;
    justify-content: space-between;
    padding-top: 8px;
    border-top: 1px solid rgba(51, 65, 85, 0.6);
  }
  .pdf-header-title {
    font-size: 13.5px;
  }
  .pdf-header-meta {
    font-size: 10.5px;
    flex-wrap: wrap;
  }
  .pdf-security-banner {
    font-size: 11px;
    padding: 6px 12px;
  }
  .pdf-canvas-viewport {
    padding: 16px 8px;
  }
}

@media (max-width: 480px) {
  .pdf-icon-badge {
    width: 32px;
    height: 32px;
    font-size: 11px;
  }
  .pdf-zoom-val {
    width: 38px;
    font-size: 11px;
  }
  .pdf-close-btn {
    padding: 6px 10px;
    font-size: 11px;
  }
}
