/* ==========================================================
   ATS RESUME TEMPLATES & PRINT ENGINE
   Designed for 100% Machine-Readability (ATS Parsing Friendly)
   Standard Headings, Zero Complex Multi-column Grids for Parsers,
   Full Arabic & English Bidirectionality
   ========================================================== */

/* Font Family Presets */
.font-cairo {
  font-family: 'Cairo', system-ui, sans-serif;
}

.font-alexandria {
  font-family: 'Alexandria', system-ui, sans-serif;
}

.font-jakarta {
  font-family: 'Plus Jakarta Sans', system-ui, sans-serif;
}

.font-times {
  font-family: 'Times New Roman', Times, serif;
}

/* ==========================================================
   TEMPLATE 1: EXECUTIVE CLASSIC ATS (DEFAULT)
   ========================================================== */
.template-classic {
  color: #111827;
  background-color: #ffffff;
  line-height: 1.55;
  font-size: 13.5px;
}

.template-classic .cv-header {
  text-align: center;
  border-bottom: 2px solid #1f2937;
  padding-bottom: 16px;
  margin-bottom: 20px;
}

.template-classic .cv-name {
  font-size: 24px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #0f172a;
  margin-bottom: 4px;
}

.template-classic .cv-title {
  font-size: 15px;
  font-weight: 600;
  color: #374151;
  margin-bottom: 8px;
}

.template-classic .cv-contact-row {
  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 12px;
  color: #4b5563;
}

.template-classic .cv-contact-item {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.template-classic .cv-contact-item i {
  width: 13px;
  height: 13px;
  color: #4b5563;
}

/* Sections */
.template-classic .cv-section {
  margin-bottom: 20px;
}

.template-classic .cv-heading {
  font-size: 14px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #111827;
  border-bottom: 1.5px solid #d1d5db;
  padding-bottom: 4px;
  margin-bottom: 10px;
}

.template-classic .cv-text {
  font-size: 13px;
  color: #374151;
  text-align: justify;
  line-height: 1.6;
}

/* Items List (Experience & Education) */
.template-classic .cv-item {
  margin-bottom: 14px;
}

.template-classic .cv-item-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  width: 100%;
  gap: 12px;
  margin-bottom: 2px;
}

.template-classic .cv-item-role {
  font-size: 13.5px;
  font-weight: 700;
  color: #111827;
}

.template-classic .cv-item-company {
  font-size: 13px;
  font-weight: 600;
  color: #4b5563;
}

.template-classic .cv-item-date {
  font-size: 12px;
  font-weight: 500;
  color: #6b7280;
  white-space: nowrap;
  flex-shrink: 0;
}

.template-classic .cv-item-bullets {
  list-style-type: square;
  padding-inline-start: 18px;
  margin-top: 5px;
}

.template-classic .cv-item-bullets li {
  font-size: 12.8px;
  color: #374151;
  margin-bottom: 4px;
  line-height: 1.55;
  word-break: normal;
  overflow-wrap: break-word;
}

/* Skills Grid */
.template-classic .cv-skills-grid {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 12.8px;
}

.template-classic .cv-skill-line strong {
  color: #111827;
  font-weight: 700;
  margin-inline-end: 6px;
}

.template-classic .cv-skill-line span {
  color: #374151;
}

/* ==========================================================
   TEMPLATE 2: MODERN TECH MINIMALIST
   ========================================================== */
.template-tech {
  color: #1f2937;
  background-color: #ffffff;
  line-height: 1.5;
  font-size: 13px;
}

.template-tech .cv-header {
  border-inline-start: 4px solid #2563eb;
  padding-inline-start: 16px;
  padding-bottom: 12px;
  margin-bottom: 18px;
}

.template-tech .cv-name {
  font-size: 26px;
  font-weight: 800;
  color: #1e3a8a;
  letter-spacing: -0.01em;
  margin-bottom: 2px;
}

.template-tech .cv-title {
  font-size: 14.5px;
  font-weight: 600;
  color: #2563eb;
  margin-bottom: 8px;
}

.template-tech .cv-contact-row {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  font-size: 12px;
  color: #4b5563;
}

.template-tech .cv-contact-item {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.template-tech .cv-contact-item i {
  width: 12px;
  height: 12px;
  color: #2563eb;
}

.template-tech .cv-section {
  margin-bottom: 18px;
}

.template-tech .cv-heading {
  font-size: 13.5px;
  font-weight: 700;
  color: #1e3a8a;
  background: #f1f5f9;
  padding: 4px 8px;
  border-radius: 3px;
  margin-bottom: 10px;
}

.template-tech .cv-text {
  font-size: 12.8px;
  color: #334155;
  line-height: 1.55;
}

.template-tech .cv-item {
  margin-bottom: 12px;
}

.template-tech .cv-item-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  width: 100%;
  gap: 12px;
}

.template-tech .cv-item-role {
  font-size: 13.5px;
  font-weight: 700;
  color: #0f172a;
}

.template-tech .cv-item-company {
  font-size: 13px;
  color: #2563eb;
  font-weight: 600;
}

.template-tech .cv-item-date {
  font-size: 12px;
  color: #64748b;
  font-weight: 600;
  white-space: nowrap;
  flex-shrink: 0;
}

.template-tech .cv-item-bullets {
  list-style-type: disc;
  padding-inline-start: 18px;
  margin-top: 4px;
}

.template-tech .cv-item-bullets li {
  font-size: 12.5px;
  color: #334155;
  margin-bottom: 3px;
  line-height: 1.55;
  word-break: normal;
  overflow-wrap: break-word;
}

.template-tech .cv-skills-grid {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 12.5px;
}

.template-tech .cv-skill-line strong {
  color: #1e3a8a;
  margin-inline-end: 6px;
}

/* ==========================================================
   TEMPLATE 3: CORPORATE CLEAN LINE
   ========================================================== */
.template-corporate {
  color: #111827;
  background-color: #ffffff;
  line-height: 1.6;
  font-size: 13.5px;
}

.template-corporate .cv-header {
  text-align: center;
  padding-bottom: 14px;
  margin-bottom: 18px;
}

.template-corporate .cv-name {
  font-size: 25px;
  font-weight: 800;
  color: #111827;
  letter-spacing: 0.02em;
}

.template-corporate .cv-title {
  font-size: 14px;
  font-weight: 600;
  color: #4b5563;
  margin-bottom: 6px;
}

.template-corporate .cv-contact-row {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px;
  font-size: 12px;
  color: #374151;
}

.template-corporate .cv-contact-item::after {
  content: "•";
  margin-inline-start: 8px;
  color: #9ca3af;
}

.template-corporate .cv-contact-item:last-child::after {
  content: "";
}

.template-corporate .cv-section {
  margin-bottom: 20px;
}

.template-corporate .cv-heading {
  font-size: 13.5px;
  font-weight: 800;
  text-transform: uppercase;
  color: #111827;
  border-bottom: 2px solid #000000;
  padding-bottom: 3px;
  margin-bottom: 10px;
}

.template-corporate .cv-text {
  font-size: 13px;
  color: #374151;
}

.template-corporate .cv-item {
  margin-bottom: 14px;
}

.template-corporate .cv-item-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  width: 100%;
  gap: 12px;
}

.template-corporate .cv-item-role {
  font-size: 13.5px;
  font-weight: 700;
  color: #111827;
}

.template-corporate .cv-item-company {
  font-size: 13px;
  font-style: italic;
  color: #374151;
}

.template-corporate .cv-item-date {
  font-size: 12px;
  color: #4b5563;
  white-space: nowrap;
  flex-shrink: 0;
}

.template-corporate .cv-item-bullets {
  list-style-type: circle;
  padding-inline-start: 18px;
  margin-top: 4px;
}

.template-corporate .cv-item-bullets li {
  font-size: 12.8px;
  color: #374151;
  margin-bottom: 4px;
  line-height: 1.55;
  word-break: normal;
  overflow-wrap: break-word;
}

.template-corporate .cv-skills-grid {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 12.8px;
}

.template-corporate .cv-skill-line strong {
  font-weight: 700;
  margin-inline-end: 6px;
}

/* ==========================================================
   PRINT ENGINE OPTIMIZATION (@media print)
   ========================================================== */
@page {
  size: A4 portrait;
  margin: 10mm;
}

@media print {
  html, body {
    background: #ffffff !important;
    color: #000000 !important;
    padding: 0 !important;
    margin: 0 !important;
    width: 100% !important;
    height: auto !important;
    min-height: auto !important;
    overflow: visible !important;
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }

  /* 1. Hide all navigation, toolbar, footer, modals, steppers, and floating widgets */
  header, nav, footer,
  .top-nav, .sub-nav, .app-footer, .preview-toolbar, .ats-compliance-badge-bar,
  .toast-stack, .modal-backdrop, .modal, .no-print,
  .builder-mobile-toggle, #builderMobileToggle,
  .cv-page-break-line, .cv-page-break-pill,
  .wizard-footer, .editor-header, .wizard-stepper, #builderStepper,
  .density-popover, .card-actions-mini, .divider-line {
    display: none !important;
    visibility: hidden !important;
    width: 0 !important;
    height: 0 !important;
    overflow: hidden !important;
  }

  /* 2. CRITICAL: Force hide editor panel regardless of screen size or active tab */
  .builder-editor-panel,
  .builder-layout.show-editor .builder-editor-panel,
  .builder-layout.show-preview .builder-editor-panel,
  .builder-layout .builder-editor-panel,
  #builderLayout .builder-editor-panel {
    display: none !important;
    visibility: hidden !important;
    width: 0 !important;
    height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    border: none !important;
    overflow: hidden !important;
  }

  /* 3. Reset outer containers to full block layout */
  .app-layout, .main-content, .page-view, .page-view.active,
  .builder-layout, .builder-layout.show-editor, .builder-layout.show-preview, #builderLayout {
    display: block !important;
    width: 100% !important;
    max-width: none !important;
    height: auto !important;
    min-height: auto !important;
    padding: 0 !important;
    margin: 0 !important;
    border: none !important;
    box-shadow: none !important;
    background: #ffffff !important;
    overflow: visible !important;
  }

  /* 4. Force preview panel visible and transparent */
  .builder-preview-panel,
  .builder-layout.show-editor .builder-preview-panel,
  .builder-layout.show-preview .builder-preview-panel,
  #builderLayout .builder-preview-panel {
    display: block !important;
    visibility: visible !important;
    width: 100% !important;
    height: auto !important;
    min-height: auto !important;
    padding: 0 !important;
    margin: 0 !important;
    border: none !important;
    box-shadow: none !important;
    background: #ffffff !important;
    overflow: visible !important;
  }

  .resume-sheet-wrapper, #resumeSheetWrapper {
    display: block !important;
    width: 100% !important;
    height: auto !important;
    min-height: auto !important;
    padding: 0 !important;
    margin: 0 !important;
    border: none !important;
    box-shadow: none !important;
    background: #ffffff !important;
    background-image: none !important;
    overflow: visible !important;
  }

  /* 5. Resume canvas printable A4 layout */
  .resume-paper, #resumeCanvas {
    display: block !important;
    visibility: visible !important;
    width: 100% !important;
    max-width: 100% !important;
    min-height: auto !important;
    height: auto !important;
    padding: 0 !important;
    margin: 0 auto !important;
    border: none !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    background: #ffffff !important;
    color: #000000 !important;
    overflow: visible !important;
    page-break-after: auto !important;
    break-after: auto !important;
  }

  .cv-section {
    page-break-inside: auto !important;
    break-inside: auto !important;
  }

  .cv-item {
    page-break-inside: avoid !important;
    break-inside: avoid !important;
  }

  .cv-heading, .cv-item-header {
    break-after: avoid !important;
    page-break-after: avoid !important;
  }
}

