/* A4 Resume Preview Enhancement */
/* This file provides enhanced A4 paper-like styling for resume previews */

.preview-container {
  background: #f5f5f5;
  padding: 2rem;
  border-radius: var(--radius-lg);
  min-height: 100vh;
  overflow-y: auto;
  /* Force container to expand with content */
  height: auto;
  max-height: none;
}

/* Ensure preview wrapper doesn't constrain content */
.resume-preview-wrapper {
  overflow: visible !important;
  max-height: none !important;
  height: auto !important;
}

/* Ensure preview container can grow */
#resume-preview {
  overflow: visible !important;
  max-height: none !important;
  height: auto !important;
}

/* Fix for editor layout that might be constraining height */
.editor-section-content {
  overflow: visible !important;
  max-height: none !important;
  height: auto !important;
}

.resume-preview {
  /* A4 paper dimensions: 210mm x 297mm (8.27in x 11.69in) */
  width: 8.27in;
  min-height: 11.69in;
  height: auto;
  margin: 0 auto;
  background: white;
  
  /* Paper-like shadow effect */
  box-shadow: 
    0 0 10px rgba(0, 0, 0, 0.1),
    0 4px 20px rgba(0, 0, 0, 0.15),
    0 8px 40px rgba(0, 0, 0, 0.1);
  
  border-radius: 4px;
  overflow: visible;
  position: relative;
  
  /* Remove the old styling */
  padding: 0;
  max-height: none;
  
  /* Ensure proper page rendering */
  page-break-inside: avoid;
}

/* Add subtle paper texture */
.resume-preview::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: 
    radial-gradient(circle at 50% 50%, rgba(0,0,0,0.01) 1px, transparent 1px);
  background-size: 20px 20px;
  pointer-events: none;
  z-index: 1;
}

.resume-preview-content {
  /* Standard document margins (0.75 inch on all sides for tighter layout) */
  padding: 0.75in 0.75in 2in 0.75in; /* Extra bottom padding */
  margin: 0;
  width: 100%;
  min-height: calc(11.69in - 1.5in); /* A4 height minus padding */
  box-sizing: border-box;
  
  /* Ensure content is above the texture */
  position: relative;
  z-index: 2;
  
  /* Traditional resume font settings */
  font-family: 'Times New Roman', serif;
  font-size: 10pt;
  line-height: 1.3;
  color: #000000;
  
  /* Ensure proper text rendering */
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Header styling for professional look - Traditional Resume Style */
.preview-header {
  text-align: center;
  margin-bottom: 20pt;
  padding-bottom: 0;
  border-bottom: none;
}

.preview-name {
  font-size: 16pt;
  font-weight: 700;
  margin-bottom: 4pt;
  color: #000000;
  letter-spacing: 2pt;
  text-transform: uppercase;
  font-family: 'Times New Roman', serif;
}

.preview-contact-info {
  font-size: 10pt;
  color: #000000;
  line-height: 1.2;
  font-weight: 400;
  margin-bottom: 4pt;
}

.preview-contact-info a {
  color: #000000;
  text-decoration: none;
}

.preview-contact-info a:hover {
  text-decoration: underline;
}

/* Section styling - Traditional Resume Format */
.preview-section {
  margin-bottom: 16pt;
  page-break-inside: avoid;
}

.preview-section-title {
  font-size: 11pt;
  font-weight: 700;
  color: #000000;
  text-transform: uppercase;
  letter-spacing: 1pt;
  border-bottom: 1pt solid #000000;
  padding-bottom: 2pt;
  margin-bottom: 8pt;
  font-family: 'Times New Roman', serif;
}

.preview-item {
  margin-bottom: 10pt;
  page-break-inside: avoid;
}

.preview-item-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 4pt;
}

.preview-job-info {
  flex: 1;
}

.preview-job-title {
  font-size: 10pt;
  font-weight: 700;
  margin: 0 0 2pt 0;
  color: #000000;
  font-family: 'Times New Roman', serif;
}

.preview-company {
  font-size: 10pt;
  font-style: italic;
  color: #000000;
  margin: 0;
  font-weight: 400;
  font-family: 'Times New Roman', serif;
}

.preview-date-location {
  font-size: 10pt;
  color: #000000;
  text-align: right;
  white-space: nowrap;
  margin-left: 20pt;
  font-weight: 400;
  font-family: 'Times New Roman', serif;
}

.preview-bullet-list {
  margin: 4pt 0 0 18pt;
  padding: 0;
  list-style-type: disc;
}

.preview-bullet-list li {
  margin-bottom: 2pt;
  line-height: 1.3;
  color: #000000;
  font-size: 10pt;
  font-family: 'Times New Roman', serif;
}

.preview-summary {
  text-align: justify;
  line-height: 1.3;
  color: #000000;
  margin: 0;
  font-size: 10pt;
  font-family: 'Times New Roman', serif;
}

.preview-skills {
  line-height: 1.3;
  color: #000000;
  margin: 0;
  font-size: 10pt;
  font-family: 'Times New Roman', serif;
}

.preview-gpa,
.preview-additional-info {
  font-size: 10pt;
  color: #000000;
  margin: 2pt 0 0 0;
  line-height: 1.3;
  font-family: 'Times New Roman', serif;
}

.preview-project-link {
  color: #000000;
  text-decoration: none;
  font-size: 10pt;
  margin-left: 8pt;
  font-family: 'Times New Roman', serif;
}

.preview-project-link:hover {
  text-decoration: underline;
}

/* Preview actions styling */
.preview-actions {
  background: white;
  padding: 1.5rem;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  margin-bottom: 1rem;
  display: flex;
  gap: 1rem;
  justify-content: center;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  position: sticky;
  top: 0;
  z-index: 10;
}

.preview-actions .btn {
  padding: 0.75rem 1.5rem;
  border-radius: 6px;
  font-weight: 600;
  transition: all 0.2s ease;
  border: none;
  cursor: pointer;
}

.preview-actions .btn-primary {
  background: var(--primary-green, #10b981);
  color: white;
}

.preview-actions .btn-primary:hover {
  background: var(--primary-green-dark, #059669);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

.preview-actions .btn-secondary {
  background: #6b7280;
  color: white;
}

.preview-actions .btn-secondary:hover {
  background: #4b5563;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(107, 114, 128, 0.3);
}

/* Responsive design for smaller screens */
@media (max-width: 1200px) {
  .resume-preview {
    width: 95%;
    max-width: 8.27in;
  }
  
  .preview-container {
    padding: 1rem;
  }
}

@media (max-width: 768px) {
  .resume-preview {
    width: 100%;
    min-height: auto;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  }
  
  .resume-preview-content {
    padding: 0.5in 0.5in 1.5in 0.5in; /* Extra bottom padding on mobile */
    font-size: 10pt;
  }
  
  .preview-name {
    font-size: 16pt;
  }
  
  .preview-section-title {
    font-size: 11pt;
  }
  
  .preview-actions {
    flex-direction: column;
    align-items: center;
  }
  
  .preview-item-header {
    flex-direction: column;
    align-items: flex-start;
  }
  
  .preview-date-location {
    margin-left: 0;
    margin-top: 4pt;
    text-align: left;
  }
}

/* Print styles */
@media print {
  .preview-container {
    background: white;
    padding: 0;
  }
  
  .preview-actions {
    display: none !important;
  }
  
  .resume-preview {
    box-shadow: none;
    margin: 0;
    width: 100%;
    min-height: auto;
  }
  
  .resume-preview::before {
    display: none;
  }
  
  .resume-preview-content {
    padding: 0.5in;
  }
  
  .preview-section {
    page-break-inside: avoid;
  }
  
  .preview-item {
    page-break-inside: avoid;
  }
}

/* Accessibility enhancements */
@media (prefers-reduced-motion: reduce) {
  .preview-actions .btn {
    transition: none;
  }
  
  .preview-actions .btn:hover {
    transform: none;
  }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
  .preview-container {
    background: #1f2937;
  }
  
  .preview-actions {
    background: #374151;
    color: white;
  }
}

/* High contrast mode */
@media (prefers-contrast: high) {
  .resume-preview {
    border: 2px solid #000;
  }
  
  .preview-name,
  .preview-section-title {
    color: #000;
  }
  
  .preview-contact-info a,
  .preview-project-link {
    color: #0000ee;
  }
}

/* Zoom controls for better preview experience */
.preview-zoom-controls {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: white;
  border-radius: 6px;
  padding: 0.5rem;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  display: flex;
  gap: 0.5rem;
  z-index: 15;
}

.preview-zoom-controls button {
  background: #f3f4f6;
  border: 1px solid #d1d5db;
  border-radius: 4px;
  padding: 0.25rem 0.5rem;
  cursor: pointer;
  font-size: 0.875rem;
  transition: all 0.2s ease;
}

.preview-zoom-controls button:hover {
  background: #e5e7eb;
}

.preview-zoom-controls button:active {
  background: #d1d5db;
}

/* Preview scale classes for zoom functionality */
.resume-preview.scale-75 {
  transform: scale(0.75);
  transform-origin: top center;
}

.resume-preview.scale-90 {
  transform: scale(0.9);
  transform-origin: top center;
}

.resume-preview.scale-110 {
  transform: scale(1.1);
  transform-origin: top center;
}

.resume-preview.scale-125 {
  transform: scale(1.25);
  transform-origin: top center;
}
