/* ==========================================================================
   JeetPhysics.in — Protected Online PDF Viewer Styles (Phase 5C-3)
   Hardened, Canvas-Based Academic Document Viewer
   ========================================================================== */

.protected-pdf-viewer {
  display: flex;
  flex-direction: column;
  background: #0f172a;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-lg, 12px);
  overflow: hidden;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  position: relative;
  user-select: none;
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  font-family: var(--font-body, 'Inter', sans-serif);
  color: #f1f5f9;
}

/* Toolbar */
.pv-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  background: #1e293b;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  gap: 12px;
  flex-wrap: wrap;
  z-index: 10;
}

.pv-toolbar-left,
.pv-toolbar-center,
.pv-toolbar-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.pv-doc-title {
  font-size: 0.88rem;
  font-weight: 600;
  color: #f8fafc;
  display: flex;
  align-items: center;
  gap: 8px;
  max-width: 280px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pv-doc-badge {
  font-size: 0.7rem;
  padding: 2px 7px;
  background: rgba(59, 130, 246, 0.2);
  color: var(--blue-400, #60a5fa);
  border: 1px solid rgba(59, 130, 246, 0.3);
  border-radius: 4px;
  font-weight: 600;
  letter-spacing: 0.5px;
}

/* Control Buttons */
.pv-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 6px 10px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 6px;
  color: #e2e8f0;
  font-size: 0.82rem;
  cursor: pointer;
  transition: all 0.15s ease;
}

.pv-btn:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.25);
  color: #fff;
}

.pv-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.pv-btn-close {
  background: rgba(239, 68, 68, 0.15);
  border-color: rgba(239, 68, 68, 0.3);
  color: #fca5a5;
}

.pv-btn-close:hover:not(:disabled) {
  background: rgba(239, 68, 68, 0.25);
  border-color: rgba(239, 68, 68, 0.5);
  color: #fff;
}

/* Page Input & Display */
.pv-page-control {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.82rem;
  color: #cbd5e1;
}

.pv-page-input {
  width: 44px;
  padding: 4px 6px;
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 4px;
  color: #f8fafc;
  font-size: 0.82rem;
  text-align: center;
  font-family: inherit;
}

.pv-page-input:focus {
  outline: none;
  border-color: var(--blue-500, #3b82f6);
}

.pv-zoom-label {
  font-size: 0.78rem;
  font-family: monospace;
  min-width: 44px;
  text-align: center;
  color: #94a3b8;
}

/* Viewport Area */
.pv-viewport {
  position: relative;
  overflow: auto;
  min-height: 480px;
  max-height: 80vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #090d16;
  padding: 24px 16px;
}

.pv-canvas-wrapper {
  position: relative;
  display: inline-block;
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.7);
  background: #ffffff;
  border-radius: 2px;
  line-height: 0;
  max-width: 100%;
}

.pv-canvas {
  display: block;
  max-width: 100%;
  height: auto;
}

/* Watermark Overlay */
.pv-watermark-overlay {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 5;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: space-around;
  align-items: center;
}

.pv-watermark-line {
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: 4px;
  color: rgba(30, 41, 59, 0.14);
  text-transform: uppercase;
  transform: rotate(-25deg);
  white-space: nowrap;
  user-select: none;
}

/* Loading & Error States */
.pv-overlay-state {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.92);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 30px;
  text-align: center;
  z-index: 20;
  gap: 16px;
}

.pv-spinner {
  width: 44px;
  height: 44px;
  border: 3px solid rgba(59, 130, 246, 0.2);
  border-top-color: var(--blue-500, #3b82f6);
  border-radius: 50%;
  animation: pv-spin 0.8s linear infinite;
}

@keyframes pv-spin {
  to { transform: rotate(360deg); }
}

.pv-state-title {
  font-size: 1.05rem;
  font-weight: 600;
  color: #f8fafc;
}

.pv-state-desc {
  font-size: 0.85rem;
  color: #94a3b8;
  max-width: 380px;
  line-height: 1.5;
}

/* Security Notice Pill */
.pv-footer-notice {
  padding: 6px 14px;
  background: rgba(15, 23, 42, 0.7);
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  font-size: 0.74rem;
  color: #64748b;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.pv-footer-notice span {
  display: flex;
  align-items: center;
  gap: 5px;
}

/* Toast Notifications */
.pv-toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(50px);
  background: #1e293b;
  border: 1px solid rgba(239, 68, 68, 0.4);
  color: #fca5a5;
  padding: 10px 18px;
  border-radius: 8px;
  font-size: 0.84rem;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 8px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.6);
  opacity: 0;
  pointer-events: none;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  z-index: 999999;
}

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

/* Fullscreen Modal Viewport (For Resource Archive) */
.pv-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(10, 15, 28, 0.88);
  backdrop-filter: blur(8px);
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: pv-fade-in 0.2s ease-out;
}

.pv-modal-container {
  width: 100%;
  max-width: 1050px;
  max-height: 94vh;
  display: flex;
  flex-direction: column;
}

@keyframes pv-fade-in {
  from { opacity: 0; transform: scale(0.98); }
  to { opacity: 1; transform: scale(1); }
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
  .pv-toolbar {
    padding: 8px 12px;
    gap: 8px;
  }
  .pv-toolbar-left {
    width: 100%;
    justify-content: space-between;
  }
  .pv-doc-title {
    max-width: 220px;
    font-size: 0.82rem;
  }
  .pv-viewport {
    padding: 12px 6px;
    min-height: 380px;
  }
  .pv-btn span {
    display: none;
  }
  .pv-modal-overlay {
    padding: 6px;
  }
}
