/**
 * 99tools SaaS Studio: Resume & CV Builder Stylesheet
 * High-performance A4 vector layout with ATS-friendly templates.
 *
 * @package 99tools
 */

/* ==========================================================================
   1. A4 RESUME SHEET CONTAINER (Extends .saas-a4-paper)
   ========================================================================== */
#saasResumePaper {
  background: #ffffff !important;
  color: #0f172a !important;
  width: 100%;
  max-width: 800px;
  min-height: 1060px;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.08), 0 8px 16px -4px rgba(0, 0, 0, 0.08), 0 24px 48px -12px rgba(0, 0, 0, 0.16) !important;
  border-radius: 4px;
  padding: 2.25rem 2.5rem;
  box-sizing: border-box;
  --resume-accent: #2563eb;
  --resume-font: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-family: var(--resume-font);
  line-height: 1.5;
}

#saasResumePaper.font-serif {
  --resume-font: 'Merriweather', Georgia, serif;
}

#saasResumePaper.font-mono {
  --resume-font: 'JetBrains Mono', 'Fira Code', monospace;
}

/* ==========================================================================
   2. RESUME HEADER SECTION
   ========================================================================== */
.resume-header {
  margin-bottom: 1.15rem;
  border-bottom: 2px solid var(--resume-accent);
  padding-bottom: 0.85rem;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1.25rem;
}

.resume-header-main {
  flex: 1;
}

.resume-name {
  font-size: 1.85rem;
  font-weight: 800;
  color: #0f172a !important;
  margin: 0 0 0.2rem;
  letter-spacing: -0.02em;
  line-height: 1.15;
}

.resume-role {
  font-size: 0.98rem;
  font-weight: 600;
  color: var(--resume-accent) !important;
  margin: 0 0 0.55rem;
  letter-spacing: -0.01em;
}

.resume-contact-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
  font-size: 0.77rem;
  color: #475569 !important;
  line-height: 1.4;
}

.resume-contact-item {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
}

.resume-contact-item svg {
  width: 13px;
  height: 13px;
  color: var(--resume-accent);
  flex-shrink: 0;
}

.resume-photo-wrap {
  flex-shrink: 0;
}

.resume-photo {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--resume-accent);
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.1);
  display: block;
}

/* ==========================================================================
   3. RESUME SECTION BLOCKS
   ========================================================================== */
.resume-section {
  margin-bottom: 1.1rem;
}

.resume-section-title {
  font-size: 0.82rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--resume-accent) !important;
  margin: 0 0 0.6rem;
  display: flex;
  align-items: center;
  gap: 0.45rem;
  border-bottom: 1px solid #e2e8f0;
  padding-bottom: 0.25rem;
}

.resume-summary-text {
  font-size: 0.81rem;
  color: #334155 !important;
  line-height: 1.55;
  margin: 0;
  white-space: pre-line;
}

/* Experience & Education Entries */
.resume-entry-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.resume-entry {
  position: relative;
  page-break-inside: avoid;
  break-inside: avoid;
}

.resume-entry-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 0.15rem;
}

.resume-entry-title {
  font-size: 0.88rem;
  font-weight: 700;
  color: #0f172a !important;
}

.resume-entry-company {
  font-size: 0.84rem;
  font-weight: 600;
  color: #475569 !important;
}

.resume-entry-dates {
  font-size: 0.75rem;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, monospace;
  font-weight: 600;
  color: #64748b !important;
  white-space: nowrap;
}

.resume-entry-bullets {
  margin: 0.25rem 0 0 1.15rem;
  padding: 0;
  font-size: 0.8rem;
  color: #334155 !important;
  line-height: 1.5;
}

.resume-entry-bullets li {
  margin-bottom: 0.2rem;
}

/* Skills Section */
.resume-skills-wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.45rem;
}

.resume-skill-tag {
  display: inline-flex;
  align-items: center;
  padding: 0.2rem 0.55rem;
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
  border-radius: 4px;
  font-size: 0.76rem;
  font-weight: 600;
  color: #1e293b !important;
}

/* Add Entry Buttons on Paper */
.btn-paper-add-entry {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  margin-top: 0.5rem;
  padding: 0.35rem 0.75rem;
  background: #f8fafc;
  border: 1px dashed #cbd5e1;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 600;
  color: #64748b;
  cursor: pointer;
  transition: all 0.15s ease;
}
.btn-paper-add-entry:hover {
  background: #f1f5f9;
  border-color: var(--resume-accent);
  color: var(--resume-accent);
}

.btn-entry-del {
  opacity: 0;
  position: absolute;
  right: -24px;
  top: 0;
  background: transparent;
  border: none;
  color: #ef4444;
  cursor: pointer;
  padding: 2px 4px;
  border-radius: 3px;
  font-size: 0.75rem;
  transition: opacity 0.15s ease;
}
.resume-entry:hover .btn-entry-del {
  opacity: 1;
}
.btn-entry-del:hover {
  background: rgba(239, 68, 68, 0.1);
}

/* ==========================================================================
   4. TEMPLATE VARIANTS
   ========================================================================== */
/* Template: Classic Harvard */
#saasResumePaper.template-classic .resume-header {
  text-align: center;
  border-bottom: 1.5px solid #0f172a;
  padding-bottom: 0.85rem;
  flex-direction: column;
  align-items: center;
}
#saasResumePaper.template-classic .resume-contact-bar {
  justify-content: center;
}
#saasResumePaper.template-classic .resume-section-title {
  border-bottom: 1px solid #0f172a;
  letter-spacing: 0.1em;
}
#saasResumePaper.template-classic .resume-skill-tag {
  background: transparent;
  border: none;
  padding: 0 0.5rem 0 0;
}
#saasResumePaper.template-classic .resume-skill-tag::after {
  content: "•";
  margin-left: 0.5rem;
  color: #94a3b8;
}
#saasResumePaper.template-classic .resume-skill-tag:last-child::after {
  content: "";
}

/* Template: Minimalist Clean */
#saasResumePaper.template-minimal {
  padding: 14mm 16mm;
}
#saasResumePaper.template-minimal .resume-header {
  border-bottom: none;
  padding-bottom: 0.5rem;
}
#saasResumePaper.template-minimal .resume-section-title {
  border-bottom: none;
  font-size: 0.82rem;
  color: #64748b !important;
}

/* ==========================================================================
   5. SIDEBAR CONTROLS STYLES
   ========================================================================== */
.resume-repeater-card {
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 0.65rem 0.75rem;
  margin-bottom: 0.5rem;
  position: relative;
}

.resume-repeater-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
}

.resume-repeater-title {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-primary);
}

.btn-repeater-del {
  background: transparent;
  border: none;
  color: #ef4444;
  cursor: pointer;
  font-size: 0.72rem;
  padding: 0.2rem 0.4rem;
  border-radius: var(--radius-sm);
}
.btn-repeater-del:hover {
  background: rgba(239, 68, 68, 0.15);
}

.color-swatch-picker {
  display: flex;
  gap: 0.45rem;
  margin-top: 0.35rem;
}

.color-swatch {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  cursor: pointer;
  border: 2px solid transparent;
  transition: transform 0.15s ease, border-color 0.15s ease;
}
.color-swatch:hover {
  transform: scale(1.15);
}
.color-swatch.is-active {
  border-color: #ffffff;
  box-shadow: 0 0 0 2px var(--brand-primary);
}

/* ==========================================================================
   6. RESPONSIVE SCREEN RULES (Screen only)
   ========================================================================== */
@media screen and (max-width: 900px) {
  #saasResumePaper {
    width: 100% !important;
    min-height: auto !important;
    padding: 1rem !important;
    box-shadow: none !important;
  }
  .resume-header {
    flex-direction: column !important;
    align-items: flex-start !important;
  }
  .resume-entry-header {
    flex-direction: column !important;
    align-items: flex-start !important;
  }
}

/* ==========================================================================
   7. PRINT MEDIA RULES (Pristine 1-Page / Exact Vector Output)
   ========================================================================== */
@page {
  size: A4 portrait;
  margin: 10mm 12mm;
}

@media print {
  html, body {
    margin: 0 !important;
    padding: 0 !important;
    background: #ffffff !important;
    color: #1e293b !important;
    height: auto !important;
    min-height: 0 !important;
    overflow: visible !important;
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }

  #wpadminbar,
  .site-header,
  .site-footer,
  .mobile-nav-drawer,
  .mobile-nav-backdrop,
  .search-modal-backdrop,
  .scroll-top-btn,
  .tool-app-topbar,
  .tool-specifications-section,
  .tool-editorial-content,
  .tool-editorial-wrap,
  .tool-faq-accordion-wrap,
  .tool-howto-section,
  .related-tools-section,
  .comments-area,
  #comments,
  .saas-studio-header,
  .saas-studio-sidebar,
  .saas-workspace-toolbar,
  .a4-crop-mark,
  .btn-paper-add-entry,
  .btn-entry-del {
    display: none !important;
    height: 0 !important;
    max-height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow: hidden !important;
    visibility: hidden !important;
  }

  main,
  #primary,
  .site-main,
  .site-container,
  .tool-single-app-page,
  .tool-workspace-container,
  .saas-studio-container,
  .saas-studio-body,
  .saas-studio-canvas,
  .saas-canvas-scroll-stage {
    display: block !important;
    position: static !important;
    margin: 0 !important;
    padding: 0 !important;
    border: none !important;
    box-shadow: none !important;
    background: transparent !important;
    width: 100% !important;
    max-width: 100% !important;
    height: auto !important;
    min-height: 0 !important;
    overflow: visible !important;
    transform: none !important;
  }

  #saasResumePaper {
    display: block !important;
    position: relative !important;
    width: 100% !important;
    max-width: 100% !important;
    min-height: 0 !important;
    margin: 0 auto !important;
    padding: 0 !important;
    border: none !important;
    box-shadow: none !important;
    border-radius: 0 !important;
    background: #ffffff !important;
    transform: none !important;
    box-sizing: border-box !important;
    page-break-inside: avoid !important;
    break-inside: avoid !important;
  }
}
