/* PDF Viewer Styles */
.pdf-viewer {
  width: 100%;
  max-width: 100%;
  border-radius: 8px;
  overflow: hidden;
  background: #f5f5f5;
}

/* PDF Controls */
.pdf-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  background: #fff;
  flex-wrap: wrap;
  gap: 16px;
}

.pdf-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 8px 16px;
  border: 1px solid #d0d0d0;
  border-radius: 6px;
  background: #fff;
  color: #4f4e4e;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: inherit;
}

/* Round navigation buttons */
.pdf-btn.pdf-prev,
.pdf-btn.pdf-next {
  width: 52px;
  height: 52px;
  min-width: 36px;
  min-height: 36px;
  padding: 0;
  border-radius: 50%;
  gap: 0;
}

.pdf-btn:hover:not(:disabled) {
  background: #f0f0f0;
  border-color: #999;
}

.pdf-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  background: #f9f9f9;
}

.pdf-btn svg {
  flex-shrink: 0;
}

/* Page info */
.pdf-page-info {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 500;
  color: #333;
}

.pdf-separator {
  color: #7a7a7a;
  font-weight: 400;
}

/* Zoom controls - Hidden */
.pdf-zoom-controls {
  display: none;
}

/* PDF Viewport */
.pdf-viewport {
  position: relative;
  background: #fff;
  text-align: center;
  padding: 18px 12px;
  min-height: 400px;
  overflow: auto;
}

.pdf-canvas {
  display: block !important;
  margin: 0 auto;
  max-width: 100%;
  height: auto;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  border-radius: 12px;
  transition: opacity 0.3s ease;
  background: white;
  border: 1px solid #ddd;
  opacity: 1 !important;
}

/* Loading indicator */
.pdf-loading {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.9);
  padding: 20px 40px;
  /* border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1); */
  font-size: 16px;
  color: #333;
  z-index: 10;
  white-space: nowrap;
}

.pdf-loading::after {
  content: '';
  width: 20px;
  height: 20px;
  border: 2px solid #ddd;
  border-top-color: #666;
  border-radius: 50%;
  animation: pdf-spinner 1s linear infinite;
  margin-left: 12px;
  flex-shrink: 0;
  display: block;
}

/* pdf-spinner keyframe moved to animations.css */

/* Error state */
.pdf-error {
  text-align: center;
  padding: 60px 20px;
  color: #666;
}

.pdf-error p {
  font-size: 16px;
  margin-bottom: 20px;
}

.pdf-retry {
  background: #007acc;
  color: white;
  border: none;
  padding: 12px 24px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
}

.pdf-retry:hover {
  background: #005a99;
}

/* Responsive design */
@media (max-width: 768px) {
  .pdf-controls {
    flex-direction: row;
    justify-content: center;
    gap: 12px;
    padding: 12px 16px;
  }

  .pdf-btn {
    justify-content: center;
    padding: 8px 12px;
    font-size: 14px;
  }

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

  .pdf-viewport {
    padding: 14px 12px;
    min-height: 400px;
  }

  .pdf-canvas {
    max-width: 100%;
  }
  
  /* Ensure spinner stays circular on mobile */
  .pdf-loading::after {
    width: 20px;
    height: 20px;
    min-width: 20px;
    min-height: 20px;
    max-width: 20px;
    max-height: 20px;
    border-radius: 50%;
    aspect-ratio: 1 / 1;
  }
}

@media (max-width: 480px) {
  .pdf-controls {
    padding: 12px 16px;
  }

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

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

  .pdf-viewport {
    min-height: 150px;
  }

  .pdf-canvas {
    max-width: 100%;
  }
  
  /* Extra mobile fixes for spinner */
  .pdf-loading {
    padding: 16px 32px;
  }
  
  .pdf-loading::after {
    width: 18px;
    height: 18px;
    min-width: 18px;
    min-height: 18px;
    max-width: 18px;
    max-height: 18px;
    border-width: 2px;
    border-radius: 50%;
    aspect-ratio: 1 / 1;
    margin-left: 10px;
  }
}
