/* Policy Reader Styles */

/* PDF Viewer Styles */
.react-pdf__Page {
  margin: 0 auto;
  display: block;
}

.react-pdf__Page__canvas {
  max-width: 100%;
  height: auto;
  display: block;
  margin: 0 auto;
}

.react-pdf__Page__textContent {
  -webkit-user-select: text;
     -moz-user-select: text;
          user-select: text;
}

.react-pdf__Page__annotations {
  pointer-events: auto;
}

/* Mobile-specific styles */
@media (max-width: 768px) {
  .react-pdf__Page {
    margin: 0;
  }
  
  .react-pdf__Page__canvas {
    width: 100% !important;
    height: auto !important;
  }
}

/* DOCX Viewer Styles */
.docx-content {
  line-height: 1.6;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.docx-content p {
  margin-bottom: 1rem;
}

.docx-content h1, 
.docx-content h2, 
.docx-content h3, 
.docx-content h4, 
.docx-content h5, 
.docx-content h6 {
  margin-top: 1.5rem;
  margin-bottom: 0.5rem;
  font-weight: 600;
  line-height: 1.3;
}

.docx-content h1 { font-size: 1.875rem; }
.docx-content h2 { font-size: 1.5rem; }
.docx-content h3 { font-size: 1.25rem; }
.docx-content h4 { font-size: 1.125rem; }
.docx-content h5 { font-size: 1rem; }
.docx-content h6 { font-size: 0.875rem; }

.docx-content ul, 
.docx-content ol {
  margin-bottom: 1rem;
  padding-left: 1.5rem;
}

.docx-content li {
  margin-bottom: 0.25rem;
}

.docx-content table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 1rem;
  font-size: 0.875rem;
}

.docx-content td, 
.docx-content th {
  border: 1px solid #e5e7eb;
  padding: 0.5rem;
  text-align: left;
  vertical-align: top;
}

.docx-content th {
  background-color: #f9fafb;
  font-weight: 600;
}

.docx-content blockquote {
  border-left: 4px solid #e5e7eb;
  padding-left: 1rem;
  margin: 1rem 0;
  font-style: italic;
  color: #6b7280;
}

.docx-content code {
  background-color: #f3f4f6;
  padding: 0.125rem 0.25rem;
  border-radius: 0.25rem;
  font-family: 'Courier New', monospace;
  font-size: 0.875em;
}

.docx-content pre {
  background-color: #f3f4f6;
  padding: 1rem;
  border-radius: 0.5rem;
  overflow-x: auto;
  margin: 1rem 0;
}

.docx-content pre code {
  background-color: transparent;
  padding: 0;
}

/* Dark mode styles */
@media (prefers-color-scheme: dark) {
  .docx-content td, 
  .docx-content th {
    border-color: #374151;
  }
  
  .docx-content th {
    background-color: #1f2937;
  }
  
  .docx-content blockquote {
    border-left-color: #374151;
    color: #9ca3af;
  }
  
  .docx-content code {
    background-color: #374151;
    color: #e5e7eb;
  }
  
  .docx-content pre {
    background-color: #374151;
  }
}

/* Mobile responsive adjustments */
@media (max-width: 768px) {
  .docx-content {
    font-size: 0.9rem;
  }
  
  .docx-content h1 { font-size: 1.5rem; }
  .docx-content h2 { font-size: 1.25rem; }
  .docx-content h3 { font-size: 1.125rem; }
  .docx-content h4 { font-size: 1rem; }
  .docx-content h5 { font-size: 0.9rem; }
  .docx-content h6 { font-size: 0.8rem; }
  
  .docx-content table {
    font-size: 0.75rem;
  }
  
  .docx-content td, 
  .docx-content th {
    padding: 0.375rem;
  }
  
  .docx-content ul, 
  .docx-content ol {
    padding-left: 1rem;
  }
}

/* Quiz Modal Styles */
.quiz-question-card {
  transition: all 0.2s ease-in-out;
}

.quiz-question-card:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.quiz-results-card {
  background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
}

.quiz-results-card.failed {
  background: linear-gradient(135deg, #fef2f2 0%, #fee2e2 100%);
}

/* Reading metrics animations */
.reading-stats {
  animation: fadeInUp 0.5s ease-out;
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Progress bar enhancements */
.reading-progress {
  transition: width 0.3s ease-in-out;
}

/* Mobile-first responsive design */
@media (max-width: 640px) {
  .policy-reader-container {
    padding: 0.5rem;
  }
  
  .policy-reader-header {
    flex-direction: column;
    gap: 1rem;
  }
  
  .policy-reader-stats {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.5rem;
  }
  
  .policy-reader-navigation {
    flex-direction: column;
    gap: 0.5rem;
  }
  
  .policy-reader-navigation button {
    width: 100%;
  }
}

/* Accessibility improvements */
@media (prefers-reduced-motion: reduce) {
  .reading-stats,
  .quiz-question-card,
  .reading-progress {
    animation: none;
    transition: none;
  }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
  .docx-content td, 
  .docx-content th {
    border-width: 2px;
  }
  
  .quiz-question-card {
    border-width: 2px;
  }
}
