/* ==========================================================================
   A4 Document Styles & Print Formatting (Balanced Single-Page A4 Edition)
   Bio Data, CV & Resume Maker — Smart Cyber Cafe Suite
   Accurate A4 sizing (210mm x 297mm) & Complete Bottom-Grounded Fill
   ========================================================================== */

/* --- Document Canvas Container --- */
.a4-document {
  width: 210mm;
  height: 297mm;
  min-height: 297mm;
  max-height: 297mm;
  background: #ffffff;
  color: #1e293b;
  padding: 10mm 13mm;
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.12), 0 2px 6px rgba(15, 23, 42, 0.05);
  border: 1px solid #e2e8f0;
  border-radius: 4px;
  box-sizing: border-box;
  font-family: 'Plus Jakarta Sans', 'Inter', -apple-system, sans-serif;
  position: relative;
  transition: transform 0.2s ease;
  line-height: 1.5;
  word-wrap: break-word;
  overflow-wrap: break-word;
  -webkit-font-smoothing: antialiased;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  overflow: hidden;
}

/* PDF Export State (ensures exact 1-page A4 canvas capture without collapse or spillover) */
.a4-document.exporting-pdf {
  box-shadow: none !important;
  border-radius: 0 !important;
  width: 210mm !important;
  height: 296mm !important;
  min-height: 296mm !important;
  max-height: 296mm !important;
  box-sizing: border-box !important;
  display: flex !important;
  flex-direction: column !important;
  justify-content: space-between !important;
  overflow: hidden !important;
  margin: 0 !important;
}

/* ==========================================================================
   1. BIO DATA TEMPLATE STYLES (Traditional Indian Format - Refined Edition)
   ========================================================================== */
.biodata-document {
  font-family: 'Merriweather', 'Georgia', 'Times New Roman', serif;
  color: #111827;
  font-size: 12px;
  line-height: 1.5;
  padding: 10mm 13mm;
  border: 3.5px double #1a3566;
  background: #ffffff;
}

.bio-header-container {
  display: block;
  text-align: center;
  margin-bottom: 2px;
  position: relative;
  flex-shrink: 0;
}

.bio-title-wrapper {
  text-align: center;
  padding: 0;
}

.bio-title-ornament-top {
  width: 100px;
  height: 1.5px;
  background: #1a3566;
  margin: 0 auto 4px;
}

.bio-main-title {
  font-family: 'Playfair Display', 'Merriweather', Georgia, serif;
  font-size: 26px;
  font-weight: 800;
  letter-spacing: 0.22em;
  color: #0f172a;
  text-transform: uppercase;
  margin: 0 auto 3px;
  line-height: 1.2;
}

.bio-title-ornament-bottom {
  width: 220px;
  height: 3px;
  border-top: 1px solid #1a3566;
  border-bottom: 1px solid #1a3566;
  margin: 4px auto 0;
}

/* Bio Sections */
.bio-section {
  margin-bottom: 0;
  page-break-inside: avoid;
  flex-shrink: 0;
}

.bio-section-title {
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: 0.05em;
  color: #1a3566;
  border-bottom: 1.5px solid #1a3566;
  padding-bottom: 4px;
  margin-bottom: 6px;
  text-transform: uppercase;
  display: flex;
  align-items: center;
  gap: 8px;
}

.bio-section-badge {
  font-size: 10px;
  background: #1a3566;
  color: #ffffff;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-weight: 700;
  flex-shrink: 0;
}

/* Personal Details Grid (Left Details Table, Right Passport Photo) */
.bio-personal-grid {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.bio-personal-left {
  flex: 1;
}

.bio-personal-right {
  width: 35mm;
  flex-shrink: 0;
}

.bio-photo-box {
  width: 35mm;
  height: 45mm;
  border: 2px solid #1a3566;
  padding: 2px;
  background: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.1);
  border-radius: 2px;
  overflow: hidden;
}

.bio-photo-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
  display: block;
}

.bio-photo-placeholder {
  width: 100%;
  height: 100%;
  border: 1px dashed #94a3b8;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  color: #94a3b8;
  text-align: center;
  padding: 4px;
  box-sizing: border-box;
}

.bio-photo-placeholder i {
  font-size: 18px;
  color: #64748b;
}

.bio-photo-placeholder span {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.04em;
  line-height: 1.25;
  color: #64748b;
}

/* Bio Details Key-Value Table */
.bio-details-table {
  width: 100%;
  border-collapse: collapse;
}

.bio-details-table td {
  padding: 4px 5px;
  vertical-align: top;
  font-size: 12px;
}

.bio-details-table tbody tr {
  border-bottom: 1px dashed #e2e8f0;
}

.bio-details-table tbody tr:last-child {
  border-bottom: none;
}

.bio-field-label {
  width: 155px;
  font-weight: 700;
  color: #1e293b;
}

.bio-field-sep {
  width: 14px;
  text-align: center;
  font-weight: 700;
  color: #1a3566;
}

.bio-field-value {
  color: #0f172a;
}

.bio-field-value.strong-text {
  font-size: 13px;
  font-weight: 700;
  color: #0a1324;
}

.bio-field-value.address-cell {
  line-height: 1.4;
}

/* Education Table in Bio Data */
.bio-edu-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 2px;
}

.bio-edu-table th,
.bio-edu-table td {
  border: 1px solid #cbd5e1;
  padding: 6px 8px;
  font-size: 11.5px;
}

.bio-edu-table th {
  background: #1a3566;
  color: #ffffff;
  font-weight: 700;
  text-align: center;
  letter-spacing: 0.03em;
  white-space: nowrap;
  border-color: #1a3566;
}

.bio-edu-table tbody tr:nth-child(even) {
  background: #f8fafc;
}

.bio-edu-table td.font-medium {
  font-weight: 600;
}

.bio-edu-table td.score-cell {
  font-weight: 700;
  color: #1a3566;
}

.bio-other-table td {
  padding: 4.5px 5px;
  font-size: 12px;
}

.text-center {
  text-align: center;
}

.text-right {
  text-align: right;
}

/* Bio Declaration & Signature Box (Anchored to Bottom of A4) */
.bio-declaration-box {
  border-top: 1.5px solid #cbd5e1;
  padding-top: 9px;
  margin-top: 0;
  page-break-inside: avoid;
  flex-shrink: 0;
}

.bio-decl-heading {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  margin-bottom: 3px;
  color: #1a3566;
}

.bio-decl-text {
  font-size: 11.5px;
  font-style: italic;
  line-height: 1.5;
  color: #334155;
  margin-bottom: 10px;
}

.bio-decl-footer {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
}

.bio-decl-left {
  font-size: 11.5px;
  line-height: 1.6;
}

.bio-decl-right {
  text-align: center;
}

.bio-signature-space {
  height: 36px;
}

.bio-signature-line {
  width: 170px;
  border-bottom: 1.5px solid #0f172a;
  margin-bottom: 3px;
}

.bio-signature-label {
  font-size: 11px;
  font-weight: 700;
  color: #1e293b;
}

/* ==========================================================================
   2. CURRICULUM VITAE (CV) TEMPLATE STYLES (Executive Redesign Edition)
   ========================================================================== */
.cv-document {
  font-family: 'Plus Jakarta Sans', 'Inter', -apple-system, sans-serif;
  color: #334155;
  font-size: 12px;
  line-height: 1.5;
  padding: 10mm 13mm;
}

.cv-header-exec {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding-bottom: 9px;
  border-bottom: 2px solid #0f224a;
  margin-bottom: 0;
  gap: 16px;
  flex-shrink: 0;
}

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

.cv-name {
  font-family: 'Playfair Display', 'Merriweather', Georgia, serif;
  font-size: 28px;
  font-weight: 700;
  color: #0f224a;
  letter-spacing: 0.01em;
  line-height: 1.15;
  margin-bottom: 3px;
}

.cv-headline {
  font-size: 12.5px;
  font-weight: 700;
  color: #b45309;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 6px;
}

.cv-contact-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 5px 14px;
  font-size: 11px;
  color: #475569;
}

.cv-contact-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.cv-contact-pill i {
  color: #0f224a;
  font-size: 11px;
}

.cv-photo-frame {
  width: 30mm;
  height: 38mm;
  border: 2px solid #0f224a;
  border-radius: 4px;
  padding: 2px;
  background: #ffffff;
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.08);
  flex-shrink: 0;
  overflow: hidden;
  box-sizing: border-box;
}

.cv-photo-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
  display: block;
  border-radius: 2px;
}

.cv-photo-placeholder {
  width: 100%;
  height: 100%;
  border: 1px dashed #94a3b8;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  color: #94a3b8;
  text-align: center;
  padding: 2px;
  box-sizing: border-box;
}

.cv-photo-placeholder i {
  font-size: 16px;
  color: #64748b;
}

.cv-photo-placeholder span {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 7.5px;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: #64748b;
}

/* CV Sections */
.cv-section {
  margin-bottom: 0;
  page-break-inside: avoid;
  flex-shrink: 0;
}

.cv-section-title {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 5px;
}

.cv-sec-title-text {
  font-size: 12px;
  font-weight: 800;
  color: #0f224a;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  white-space: nowrap;
}

.cv-sec-title-line {
  flex: 1;
  height: 2px;
  background: linear-gradient(90deg, #0f224a 65%, #d97706 100%);
}

.cv-summary-text {
  font-size: 12px;
  color: #334155;
  line-height: 1.55;
  text-align: justify;
  margin: 0;
}

/* CV Timeline */
.cv-experience-timeline {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.cv-exp-block {
  position: relative;
  padding-left: 12px;
  border-left: 2px solid #cbd5e1;
  page-break-inside: avoid;
}

.cv-exp-block::before {
  content: '';
  position: absolute;
  left: -5px;
  top: 4px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #0f224a;
  border: 2px solid #ffffff;
  box-shadow: 0 0 0 1px #0f224a;
}

.cv-exp-top-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 2px;
}

.cv-job-title {
  font-size: 13px;
  font-weight: 700;
  color: #0f172a;
  line-height: 1.25;
}

.cv-company-tag {
  font-size: 11.5px;
  color: #475569;
}

.cv-company-bold {
  font-weight: 700;
  color: #1e3a8a;
}

.cv-company-sep {
  margin: 0 4px;
  color: #94a3b8;
}

.cv-company-loc {
  color: #64748b;
}

.cv-exp-date-badge {
  font-size: 11px;
  font-weight: 600;
  color: #475569;
  background: #f8fafc;
  padding: 2px 8px;
  border-radius: 3px;
  border: 1px solid #e2e8f0;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.cv-bullet-points {
  margin: 3px 0 0 14px;
  padding: 0;
  list-style: square;
  color: #0f224a;
}

.cv-bullet-points li {
  font-size: 11.5px;
  color: #334155;
  line-height: 1.5;
  margin-bottom: 2px;
}

/* CV Structured Education Table */
.cv-edu-table-wrap {
  border: 1px solid #cbd5e1;
  border-radius: 4px;
  overflow: hidden;
}

.cv-edu-structured-table {
  width: 100%;
  border-collapse: collapse;
}

.cv-edu-structured-table th {
  background: #0f224a;
  color: #ffffff;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 6px 10px;
  border-bottom: 1.5px solid #0f224a;
  text-align: left;
  white-space: nowrap;
}

.cv-edu-structured-table td {
  padding: 5.5px 10px;
  font-size: 11.5px;
  border-bottom: 1px solid #f1f5f9;
  vertical-align: middle;
}

.cv-edu-structured-table tr:last-child td {
  border-bottom: none;
}

.cv-edu-deg-cell strong {
  color: #0f172a;
}

.cv-edu-inst-cell {
  color: #475569;
}

.cv-edu-year-cell {
  color: #64748b;
  font-weight: 600;
}

.cv-score-pill {
  display: inline-block;
  background: #eff6ff;
  color: #1e4080;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 3px;
  font-size: 11px;
  border: 1px solid #bfdbfe;
  white-space: nowrap;
}

/* CV Lower Grid (Balanced 2-Column Section) */
.cv-lower-grid {
  display: flex;
  gap: 16px;
  flex-shrink: 0;
}

.cv-lower-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.cv-cert-list {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

/* CV Skills Grid */
.cv-skills-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 4px 12px;
}

.cv-skill-item {
  display: flex;
  align-items: baseline;
  gap: 7px;
  font-size: 11.5px;
  font-weight: 600;
  color: #1e293b;
  line-height: 1.4;
}

.cv-skill-bullet {
  color: #d97706;
  font-size: 9px;
  flex-shrink: 0;
  line-height: 1;
}

.cv-skill-name {
  flex: 1;
}

/* CV Certifications */
.cv-cert-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 6px;
}

.cv-cert-card {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-left: 3px solid #0f224a;
  border-radius: 3px;
  padding: 5px 8px;
}

.cv-cert-name {
  font-size: 11.5px;
  color: #0f172a;
  display: flex;
  align-items: center;
  gap: 5px;
}

.cv-cert-name i {
  color: #d97706;
  font-size: 9.5px;
}

.cv-cert-meta {
  font-size: 10.5px;
  color: #64748b;
  margin-top: 1px;
}

/* CV Projects */
.cv-project-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.cv-project-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-left: 3px solid #d97706;
  border-radius: 3px;
  padding: 6px 10px;
}

.cv-proj-title {
  font-size: 12px;
  font-weight: 700;
  color: #0f172a;
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 2px;
}

.cv-proj-title i {
  color: #0f224a;
  font-size: 10px;
}

.cv-proj-desc {
  font-size: 11px;
  color: #475569;
  line-height: 1.45;
  margin: 0;
}

.cv-lang-text {
  font-size: 11.5px;
  color: #334155;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
}

.cv-lang-text i {
  color: #0f224a;
}

/* CV Declaration Footer (Anchored to Bottom of A4) */
.cv-declaration-box {
  border-top: 1.5px solid #cbd5e1;
  padding-top: 8px;
  margin-top: 0;
  page-break-inside: avoid;
  flex-shrink: 0;
}

.cv-decl-text {
  font-size: 11px;
  font-style: italic;
  line-height: 1.45;
  color: #475569;
  margin-bottom: 8px;
}

.cv-decl-footer {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
}

.cv-decl-left {
  font-size: 11px;
  color: #334155;
}

.cv-decl-date-gap {
  margin-left: 18px;
}

.cv-decl-right {
  text-align: center;
}

.cv-signature-space {
  height: 28px;
}

.cv-signature-line {
  width: 150px;
  border-bottom: 1.5px solid #0f172a;
  margin-bottom: 3px;
}

.cv-signature-label {
  font-size: 10.5px;
  font-weight: 700;
  color: #334155;
}

/* ==========================================================================
   3. RESUME TEMPLATE STYLES (Balanced Executive Single-Page Corporate)
   ========================================================================== */
.resume-document-v2 {
  font-family: 'Plus Jakarta Sans', -apple-system, sans-serif;
  color: #334155;
  font-size: 12px;
  line-height: 1.5;
  padding: 10mm 13mm;
}

/* Resume Modern Header */
.resume-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding-bottom: 9px;
  border-bottom: 2.5px solid #0f172a;
  margin-bottom: 0;
  gap: 16px;
  flex-shrink: 0;
}

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

.resume-name {
  font-size: 28px;
  font-weight: 800;
  color: #0f172a;
  letter-spacing: -0.02em;
  line-height: 1.15;
  margin-bottom: 2px;
}

.resume-headline {
  font-size: 12.5px;
  font-weight: 700;
  color: #2563eb;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 6px;
}

.resume-contact-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 5px 14px;
  font-size: 11px;
  color: #475569;
}

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

.resume-contact-item i {
  color: #2563eb;
  font-size: 11px;
}

.resume-photo-frame {
  width: 28mm;
  height: 35mm;
  border-radius: 4px;
  border: 2px solid #cbd5e1;
  overflow: hidden;
  flex-shrink: 0;
  box-sizing: border-box;
  padding: 2px;
  background: #ffffff;
}

.resume-photo-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
  display: block;
  border-radius: 2px;
}

.resume-photo-placeholder {
  width: 100%;
  height: 100%;
  border: 1px dashed #94a3b8;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  color: #94a3b8;
  text-align: center;
  padding: 2px;
  box-sizing: border-box;
}

.resume-photo-placeholder i {
  font-size: 15px;
  color: #64748b;
}

.resume-photo-placeholder span {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 7.5px;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: #64748b;
}

/* Resume Sections */
.resume-section {
  margin-bottom: 0;
  page-break-inside: avoid;
  flex-shrink: 0;
}

.resume-section-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 5px;
}

.resume-section-title {
  font-size: 12px;
  font-weight: 800;
  color: #0f172a;
  letter-spacing: 0.07em;
  white-space: nowrap;
  text-transform: uppercase;
  margin: 0;
}

.resume-title-line {
  flex: 1;
  height: 2px;
  background: #e2e8f0;
}

.resume-summary-text {
  font-size: 12px;
  line-height: 1.55;
  color: #334155;
  margin: 0;
  text-align: justify;
}

/* Resume Skills Grid */
.resume-skills-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 5px 12px;
}

.resume-skill-pill {
  display: flex;
  align-items: center;
  gap: 7px;
  background: #f8fafc;
  border: 1px solid #cbd5e1;
  padding: 4px 10px;
  border-radius: 5px;
  font-size: 11.5px;
  font-weight: 600;
  color: #0f172a;
}

.resume-skill-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #2563eb;
  flex-shrink: 0;
}

/* Resume Experience */
.resume-exp-list {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.resume-exp-item {
  page-break-inside: avoid;
}

.resume-exp-heading {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 6px;
  margin-bottom: 2px;
}

.resume-exp-role-box {
  font-size: 12.5px;
}

.resume-exp-title {
  font-weight: 700;
  color: #0f172a;
}

.resume-exp-sep {
  margin: 0 4px;
  color: #94a3b8;
}

.resume-exp-company {
  font-weight: 700;
  color: #2563eb;
}

.resume-exp-loc {
  color: #64748b;
  font-size: 11px;
  margin-left: 2px;
}

.resume-exp-period {
  font-size: 11px;
  font-weight: 600;
  color: #475569;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  padding: 2px 8px;
  border-radius: 3px;
  white-space: nowrap;
}

.resume-bullet-list {
  margin: 3px 0 0 14px;
  padding: 0;
  list-style: square;
  color: #2563eb;
}

.resume-bullet-list li {
  font-size: 11.5px;
  color: #334155;
  line-height: 1.5;
  margin-bottom: 2px;
}

/* Resume Education Table */
.resume-edu-table-wrap {
  border: 1px solid #cbd5e1;
  border-radius: 4px;
  overflow: hidden;
}

.resume-edu-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 11.5px;
}

.resume-edu-table th {
  background: #0f172a;
  color: #ffffff;
  padding: 6px 10px;
  font-weight: 700;
  border-bottom: 1.5px solid #0f172a;
  text-align: left;
  white-space: nowrap;
  font-size: 11px;
}

.resume-edu-table td {
  padding: 5.5px 10px;
  border-bottom: 1px solid #f1f5f9;
}

.resume-edu-table tr:last-child td {
  border-bottom: none;
}

.resume-edu-table td.font-bold {
  font-weight: 700;
  color: #0f172a;
}

.resume-score-pill {
  display: inline-block;
  background: #eff6ff;
  color: #1d4ed8;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 3px;
  font-size: 11px;
  border: 1px solid #bfdbfe;
  white-space: nowrap;
}

/* Resume Bottom Grid (Certifications & Languages) */
.resume-bottom-grid {
  display: flex;
  gap: 16px;
  margin-top: 0;
  flex-shrink: 0;
}

.resume-bottom-col {
  flex: 1;
}

.resume-sub-list {
  margin: 0;
  padding-left: 14px;
  list-style: disc;
  color: #2563eb;
  font-size: 11.5px;
  line-height: 1.45;
}

.resume-sub-list li {
  color: #334155;
  margin-bottom: 2px;
}

.resume-lang-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.resume-lang-badge {
  background: #f1f5f9;
  color: #1e293b;
  font-size: 11px;
  font-weight: 600;
  padding: 3px 9px;
  border-radius: 3px;
  border: 1px solid #cbd5e1;
}

.text-muted {
  color: #64748b;
}

/* Resume Declaration / Verification Footer (Anchored to Bottom of A4) */
.resume-footer-bar {
  border-top: 1.5px solid #e2e8f0;
  padding-top: 8px;
  margin-top: 0;
  page-break-inside: avoid;
  flex-shrink: 0;
}

.resume-footer-decl {
  font-size: 11px;
  font-style: italic;
  line-height: 1.45;
  color: #64748b;
  margin-bottom: 8px;
}

.resume-footer-row {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
}

.resume-footer-left {
  font-size: 11px;
  color: #475569;
}

.resume-footer-date-gap {
  margin-left: 18px;
}

.resume-footer-right {
  text-align: center;
}

.resume-signature-space {
  height: 28px;
}

.resume-signature-line {
  width: 150px;
  border-bottom: 1.5px solid #0f172a;
  margin-bottom: 3px;
}

.resume-signature-label {
  font-size: 10.5px;
  font-weight: 700;
  color: #334155;
}

/* ==========================================================================
   Mobile Screen Preview Optimization
   ========================================================================== */
@media screen and (max-width: 640px) {
  .preview-canvas-container {
    padding: 12px 6px 60px;
  }

  .a4-document {
    padding: 12px 10px;
    font-size: 11px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.06);
    height: auto !important;
    min-height: auto !important;
    max-height: none !important;
  }

  .biodata-document {
    font-size: 10.5px;
    padding: 10px 8px;
  }

  .bio-field-label {
    width: 105px;
    font-size: 10.5px;
  }

  .bio-main-title {
    font-size: 18px;
  }

  .cv-name {
    font-size: 20px;
  }

  .resume-name {
    font-size: 20px;
  }

  .cv-skills-grid {
    grid-template-columns: 1fr;
  }

  .cv-cert-grid {
    grid-template-columns: 1fr;
  }

  .resume-skills-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .resume-bottom-grid {
    flex-direction: column;
    gap: 10px;
  }

  .bio-edu-table th, .bio-edu-table td {
    padding: 3px 4px;
    font-size: 9.5px;
  }

  .bio-photo-box,
  .cv-photo-frame {
    width: 24mm;
    height: 30mm;
  }

  .resume-photo-frame {
    width: 20mm;
    height: 26mm;
  }
}

/* ==========================================================================
/* Screen media: hide isolated print container completely */
@media screen {
  #scc-print-isolated-root,
  .scc-print-isolated-root {
    display: none !important;
    visibility: hidden !important;
    position: fixed !important;
    top: -99999px !important;
    left: -99999px !important;
  }
}

/* ==========================================================================
   4. PRINT MEDIA STYLES (@media print)
   ========================================================================== */
@media print {
  @page {
    size: A4 portrait;
    margin: 0;
  }

  html,
  body.doc-maker-body {
    background: #ffffff !important;
    color: #000000 !important;
    margin: 0 !important;
    padding: 0 !important;
    width: 210mm !important;
    min-height: 297mm !important;
    height: auto !important;
    max-height: none !important;
    overflow: visible !important;
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }

  /* When isolated print root is populated, hide everything else in body */
  body.doc-maker-body > *:not(#scc-print-isolated-root) {
    display: none !important;
  }

  /* Dedicated unscaled print root */
  #scc-print-isolated-root,
  .scc-print-isolated-root {
    display: block !important;
    position: static !important;
    visibility: visible !important;
    width: 210mm !important;
    min-height: 297mm !important;
    margin: 0 !important;
    padding: 0 !important;
    background: #ffffff !important;
    box-shadow: none !important;
  }

  #scc-print-isolated-root .a4-document {
    box-shadow: none !important;
    border-radius: 0 !important;
    width: 210mm !important;
    height: 297mm !important;
    min-height: 297mm !important;
    max-height: 297mm !important;
    box-sizing: border-box !important;
    display: flex !important;
    flex-direction: column !important;
    justify-content: space-between !important;
    overflow: hidden !important;
    margin: 0 !important;
    transform: none !important;
  }

  /* Fallback: Direct DOM printing support if isolated root is empty */
  .app-navbar,
  .l2-nav-wrap,
  #tools-header-placeholder,
  #tools-footer-placeholder,
  .doc-subnav,
  .doc-action-bar,
  .tool-faq-drawer,
  .tool-faq-section,
  .feedback-widget,
  .editor-form-panel,
  .preview-toolbar,
  .mobile-view-toggle,
  .scc-toast-container,
  .landing-view,
  .operator-banner {
    display: none !important;
  }

  .editor-workspace {
    display: block !important;
    height: auto !important;
    overflow: visible !important;
    background: transparent !important;
  }

  .editor-preview-panel {
    display: block !important;
    height: auto !important;
    overflow: visible !important;
    background: transparent !important;
    width: 210mm !important;
  }

  .preview-canvas-container {
    padding: 0 !important;
    margin: 0 !important;
    display: block !important;
    width: 100% !important;
  }

  .preview-zoom-outer,
  .preview-zoom-wrapper {
    display: block !important;
    position: static !important;
    transform: none !important;
    width: 210mm !important;
    height: 297mm !important;
    box-shadow: none !important;
    margin: 0 !important;
    padding: 0 !important;
  }

  .a4-document {
    box-shadow: none !important;
    border-radius: 0 !important;
    width: 210mm !important;
    height: 297mm !important;
    min-height: 297mm !important;
    max-height: 297mm !important;
    box-sizing: border-box !important;
    display: flex !important;
    flex-direction: column !important;
    justify-content: space-between !important;
    overflow: hidden !important;
    margin: 0 !important;
    transform: none !important;
  }

  .biodata-document {
    border: 3.5px double #1a3566 !important;
  }

  /* Prevent page breaks inside critical elements */
  .bio-section,
  .cv-section,
  .resume-section,
  .bio-details-table tr,
  .bio-edu-table tr,
  .cv-edu-structured-table tr,
  .resume-edu-table tr,
  .cv-exp-block,
  .resume-exp-item,
  .bio-declaration-box,
  .cv-declaration-box,
  .resume-footer-bar {
    page-break-inside: avoid !important;
    break-inside: avoid !important;
  }
}
