/* =============================================================================
   PDF Modal Styles - Privacy Policy (Same as OSPA)
   ============================================================================= */

/* Modal Overlay */
.pdf-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.7);
  z-index: 10000;
  display: flex;
  justify-content: center;
  align-items: center;
}

/* =============================================================================
   Loading Screen
   ============================================================================= */

.pdf-loading-modal {
  background: rgba(0, 0, 0, 0.85);
}

.pdf-loading-content {
  width: auto;
  max-width: 500px;
  height: auto;
  background: #ffffff;
  border-radius: 8px;
  padding: 40px;
  box-shadow: 0 24px 38px 3px rgba(0, 0, 0, 0.14),
              0 9px 46px 8px rgba(0, 0, 0, 0.12),
              0 11px 15px -7px rgba(0, 0, 0, 0.2);
}

.pdf-loading-container {
  text-align: center;
}

.pdf-loading-icon {
  margin-bottom: 24px;
  display: flex;
  justify-content: center;
  align-items: center;
}

.pdf-loading-spinner {
  width: 48px;
  height: 48px;
  border: 4px solid #e0e0e0;
  border-top-color: #757575;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin: 0 auto 24px;
}

.pdf-loading-container h3 {
  margin: 0 0 12px 0;
  font-size: 20px;
  font-weight: 500;
  color: #212121;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

.pdf-loading-container p {
  margin: 0 0 24px 0;
  font-size: 14px;
  color: #757575;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

.pdf-loading-steps {
  display: flex;
  flex-direction: column;
  gap: 12px;
  text-align: left;
  margin-top: 24px;
  padding-top: 24px;
  border-top: 1px solid #e0e0e0;
}

.pdf-loading-step {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 14px;
  color: #9e9e9e;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  transition: color 0.3s ease;
}

.pdf-loading-step .step-icon {
  font-size: 8px;
  color: #e0e0e0;
  transition: color 0.3s ease;
}

.pdf-loading-step.active {
  color: #616161;
  font-weight: 500;
}

.pdf-loading-step.active .step-icon {
  color: #757575;
  animation: pulse 1.5s ease-in-out infinite;
}

.pdf-loading-step.completed {
  color: #757575;
}

.pdf-loading-step.completed .step-icon {
  color: #757575;
}

@keyframes pulse {
  0%, 100% {
    opacity: 1;
    transform: scale(1);
  }
  50% {
    opacity: 0.6;
    transform: scale(1.2);
  }
}

/* =============================================================================
   Modern Compact Loading Screen
   ============================================================================= */

.pdf-loading-content-modern {
  width: auto;
  max-width: 420px;
  background: #ffffff;
  border-radius: 12px;
  padding: 32px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.pdf-loading-container-modern {
  display: flex;
  gap: 24px;
  align-items: center;
}

/* Icon Wrapper with Progress Ring */
.pdf-loading-icon-wrapper {
  flex-shrink: 0;
  position: relative;
  width: 80px;
  height: 80px;
}

.pdf-loading-progress-ring {
  position: relative;
  width: 80px;
  height: 80px;
}

.pdf-loading-progress-ring svg {
  transform: rotate(-90deg);
}

.pdf-doc-icon-center {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  display: flex;
  align-items: center;
  justify-content: center;
}

.pdf-loading-doc-icon {
  animation: iconBreathe 2s ease-in-out infinite;
}

@keyframes iconBreathe {
  0%, 100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.05);
  }
}

/* Info Section */
.pdf-loading-info-modern {
  flex: 1;
  min-width: 0;
}

.pdf-loading-info-modern h3 {
  margin: 0 0 4px 0;
  font-size: 18px;
  font-weight: 600;
  color: #212121;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

.pdf-loading-subtitle {
  margin: 0 0 16px 0;
  font-size: 13px;
  color: #757575;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

/* Progress Bar */
.pdf-progress-bar-container {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.pdf-progress-bar {
  flex: 1;
  height: 6px;
  background: #e0e0e0;
  border-radius: 3px;
  overflow: hidden;
  position: relative;
}

.pdf-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #009EAC 0%, #00BCD4 100%);
  border-radius: 3px;
  transition: width 0.3s ease;
  position: relative;
  overflow: hidden;
}

.pdf-progress-fill::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
  animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
  0% {
    transform: translateX(-100%);
  }
  100% {
    transform: translateX(100%);
  }
}

.pdf-progress-text {
  font-size: 14px;
  font-weight: 600;
  color: #009EAC;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  min-width: 42px;
  text-align: right;
}

/* Current Step */
.pdf-current-step {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: #616161;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  margin-bottom: 12px;
  font-weight: 500;
}

.step-dot {
  width: 6px;
  height: 6px;
  background: #009EAC;
  border-radius: 50%;
  animation: pulse 1.5s ease-in-out infinite;
}

/* Why This Takes Time */
.pdf-loading-reason {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  font-size: 11px;
  color: #9e9e9e;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  line-height: 1.4;
  padding-top: 8px;
  border-top: 1px solid #f0f0f0;
}

.pdf-loading-reason svg {
  flex-shrink: 0;
  margin-top: 1px;
  opacity: 0.6;
}

/* Responsive for Smaller Screens */
@media only screen and (max-width: 600px) {
  .pdf-loading-content-modern {
    max-width: 90%;
    padding: 24px;
  }
  
  .pdf-loading-container-modern {
    flex-direction: column;
    text-align: center;
    gap: 20px;
  }
  
  .pdf-loading-info-modern h3 {
    font-size: 16px;
  }
  
  .pdf-loading-subtitle {
    font-size: 12px;
  }
  
  .pdf-current-step {
    justify-content: center;
  }
  
  .pdf-loading-reason {
    justify-content: center;
    text-align: center;
  }
}

/* Modal Content Container */
.pdf-modal-content {
  background: #fff;
  width: 90%;
  max-width: 1200px;
  height: 90%;
  max-height: 900px;
  border-radius: 8px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: 0 24px 38px 3px rgba(0, 0, 0, 0.14),
              0 9px 46px 8px rgba(0, 0, 0, 0.12),
              0 11px 15px -7px rgba(0, 0, 0, 0.2);
}

/* Modal Header */
.pdf-modal-header {
  padding: 16px 24px;
  background: #f5f5f5;
  border-bottom: 1px solid #ddd;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-shrink: 0;
}

.pdf-modal-header h3 {
  margin: 0;
  font-size: 20px;
  font-weight: 500;
  color: #333;
}

/* Close Button */
.pdf-modal-close {
  background: none;
  border: none;
  font-size: 32px;
  line-height: 1;
  cursor: pointer;
  color: #666;
  padding: 0;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  transition: background-color 0.2s ease, color 0.2s ease;
}

.pdf-modal-close:hover {
  background: #e0e0e0;
  color: #333;
}

/* Modal Body - PDF Container */
.pdf-modal-body {
  flex: 1;
  position: relative;
  overflow: hidden;
  background: #525659;
  min-height: 0;
}

.pdf-modal-body iframe {
  width: 100%;
  height: 100%;
  border: none;
  transition: opacity 0.3s ease;
  display: block;
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
}

/* Loading Spinner */
.pdf-modal-loading {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
  color: #fff;
  z-index: 1;
}

.spinner {
  border: 4px solid rgba(255, 255, 255, 0.3);
  border-top-color: #fff;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  animation: spin 1s linear infinite;
  margin: 0 auto 12px;
}

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

.pdf-modal-loading div {
  font-size: 14px;
  margin-top: 8px;
}

/* =============================================================================
   Mobile PDF Viewer (PDF.js)
   ============================================================================= */

.pdf-mobile-viewer {
  display: flex;
  flex-direction: column;
  height: 100%;
  background: #525659;
}

.pdf-mobile-controls {
  background: #323639;
  padding: 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-shrink: 0;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.pdf-nav-btn {
  background: #525659;
  color: #fff;
  border: none;
  padding: 8px 16px;
  font-size: 14px;
  border-radius: 4px;
  cursor: pointer;
  transition: background 0.2s ease;
  font-weight: 500;
}

.pdf-nav-btn:hover:not(:disabled) {
  background: #626669;
}

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

.pdf-page-info {
  color: #fff;
  font-size: 14px;
}

.pdf-canvas-container {
  flex: 1;
  overflow: auto;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #525659;
}

.pdf-mobile-loading {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
  color: #fff;
}

#pdf-canvas {
  max-width: 100%;
  height: auto;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

/* =============================================================================
   Responsive Design
   ============================================================================= */

@media only screen and (max-width: 768px) {
  .pdf-modal-content {
    width: 95%;
    height: 95%;
    max-height: 100vh;
    border-radius: 4px;
  }

  .pdf-modal-header {
    padding: 12px 16px;
  }

  .pdf-modal-header h3 {
    font-size: 18px;
  }

  .pdf-modal-close {
    font-size: 28px;
  }

  .pdf-nav-btn {
    padding: 6px 12px;
    font-size: 13px;
  }

  .pdf-page-info {
    font-size: 13px;
  }

  /* Loading screen mobile */
  .pdf-loading-content {
    width: 90%;
    padding: 32px 24px;
  }

  .pdf-loading-container h3 {
    font-size: 18px;
  }

  .pdf-loading-container p {
    font-size: 13px;
  }

  .pdf-loading-step {
    font-size: 13px;
  }
}

@media only screen and (max-width: 480px) {
  .pdf-modal-content {
    width: 100%;
    height: 100%;
    border-radius: 0;
  }

  .pdf-modal-header {
    padding: 10px 12px;
  }

  .pdf-modal-header h3 {
    font-size: 16px;
  }

  .pdf-mobile-controls {
    padding: 8px;
  }

  .pdf-nav-btn {
    padding: 6px 10px;
    font-size: 12px;
  }

  .pdf-page-info {
    font-size: 12px;
  }

  /* Loading screen small mobile */
  .pdf-loading-content {
    width: 95%;
    padding: 24px 20px;
  }

  .pdf-loading-icon svg {
    width: 48px;
    height: 48px;
  }

  .pdf-loading-spinner {
    width: 40px;
    height: 40px;
    margin-bottom: 20px;
  }

  .pdf-loading-container h3 {
    font-size: 16px;
  }

  .pdf-loading-container p {
    font-size: 12px;
  }

  .pdf-loading-steps {
    margin-top: 20px;
    padding-top: 20px;
    gap: 10px;
  }

  .pdf-loading-step {
    font-size: 12px;
  }
}

/* =============================================================================
   Accessibility
   ============================================================================= */

.pdf-modal-close:focus,
.pdf-nav-btn:focus {
  outline: 2px solid #1976d2;
  outline-offset: 2px;
}

/* =============================================================================
   Scrollbar Styling
   ============================================================================= */

.pdf-canvas-container::-webkit-scrollbar {
  width: 12px;
  height: 12px;
}

.pdf-canvas-container::-webkit-scrollbar-track {
  background: #424242;
}

.pdf-canvas-container::-webkit-scrollbar-thumb {
  background: #757575;
  border-radius: 6px;
}

.pdf-canvas-container::-webkit-scrollbar-thumb:hover {
  background: #9e9e9e;
}

/* =============================================================================
   Print Styles
   ============================================================================= */

@media print {
  .pdf-modal {
    position: static;
    background: none;
  }

  .pdf-modal-content {
    width: 100%;
    height: auto;
    max-width: 100%;
    max-height: none;
    box-shadow: none;
  }

  .pdf-modal-header {
    display: none;
  }

  .pdf-modal-body {
    height: auto;
    background: white;
  }

  .pdf-mobile-controls {
    display: none;
  }
}
