/* ==========================================================================
   V1Portfolio — Public Resume Page Styles
   Covers: topbar, page wrapper, and all three ATS resume templates.
   ========================================================================== */

/* ── Variables ───────────────────────────────────────────────────────────── */
:root {
  --resume-font:    'Inter', 'Segoe UI', Arial, sans-serif;
  --resume-text:    #1a1a2e;
  --resume-muted:   #555e7a;
  --resume-border:  #d1d5db;
  --resume-bg:      #f5f6fa;
  --resume-white:   #ffffff;
  --resume-primary: var(--clr-primary, #6c63ff);
}

/* ── Base ────────────────────────────────────────────────────────────────── */
.resume-body {
  margin: 0;
  padding: 0;
  background: var(--resume-bg);
  font-family: var(--resume-font);
  color: var(--resume-text);
}

/* ── Topbar ──────────────────────────────────────────────────────────────── */
.resume-topbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(12, 12, 20, .95);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(255, 255, 255, .07);
  padding: .75rem 1.5rem;
  gap: 1rem;
}

.resume-topbar-back {
  color: rgba(255, 255, 255, .7);
  text-decoration: none;
  font-size: .875rem;
  display: flex;
  align-items: center;
  gap: .5rem;
  transition: color .2s;
}
.resume-topbar-back:hover { color: #fff; }

.resume-topbar-center {
  font-size: .875rem;
  font-weight: 600;
  color: rgba(255, 255, 255, .85);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.resume-topbar-right {
  display: flex;
  align-items: center;
  gap: .75rem;
  flex-shrink: 0;
}

/* ── Page Wrapper ────────────────────────────────────────────────────────── */
.resume-body:not(.print-mode):not(.preview-mode):not(.thumbnail-mode) .resume-page-wrapper {
  padding-top: 4.5rem;
  padding-bottom: 3rem;
  display: flex;
  justify-content: center;
}

.resume-body.preview-mode .resume-page-wrapper {
  padding: 2rem;
  display: flex;
  justify-content: center;
}

.resume-body.thumbnail-mode .resume-page-wrapper {
  padding: 0;
  display: block;
  overflow: hidden;
}

.resume-body.thumbnail-mode {
  background: #f5f6fa;
  overflow: hidden;
}

.resume-body.print-mode .resume-page-wrapper {
  padding: 0;
}

/* ── Resume preview (shared) ─────────────────────────────────────────────── */
.resume-preview {
  background: var(--resume-white);
  width: 210mm;
  min-height: 297mm;
  box-shadow: 0 4px 40px rgba(0, 0, 0, .15);
  font-family: var(--resume-font);
  color: var(--resume-text);
  font-size: 10.5pt;
  line-height: 1.6;
  overflow: hidden;
  word-break: break-word;
  overflow-wrap: break-word;
}

/* ═══════════════════════════════════════════════════════
   TEMPLATE 1 — Classic ATS
══════════════════════════════════════════════════════ */
.resume-t1 {
  padding: 2.5rem 2.75rem;
}

.rt1-header {
  text-align: center;
  margin-bottom: 1.5rem;
  padding-bottom: 1.25rem;
  border-bottom: 2px solid var(--resume-primary);
}

.rt1-name {
  font-size: 24pt;
  font-weight: 800;
  color: var(--resume-text);
  margin: 0 0 .3rem;
  letter-spacing: -.02em;
}

.rt1-tagline {
  font-size: 10.5pt;
  color: var(--resume-primary);
  font-weight: 500;
  margin: 0 0 .75rem;
}

.rt1-contact {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: .25rem 1.25rem;
  font-size: 9pt;
  color: var(--resume-muted);
}

.rt1-contact span {
  display: flex;
  align-items: center;
  gap: .35rem;
}

.rt1-contact span i {
  color: var(--resume-primary);
  font-size: 8pt;
}

/* Sections */
.rt1-section {
  margin-bottom: 1.5rem;
}

.rt1-section-title {
  font-size: 10pt;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: var(--resume-primary);
  margin: 0 0 .6rem;
  padding-bottom: .25rem;
  border-bottom: 1px solid var(--resume-border);
}

.rt1-summary {
  font-size: 9.5pt;
  color: var(--resume-muted);
  margin: 0;
  word-break: break-word;
  overflow-wrap: break-word;
}

/* Entries */
.rt1-entry {
  margin-bottom: 1rem;
}

.rt1-entry-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: .25rem;
}

.rt1-entry-title {
  display: block;
  font-size: 10pt;
  font-weight: 700;
  color: var(--resume-text);
}

.rt1-entry-org {
  display: block;
  font-size: 9.5pt;
  color: var(--resume-muted);
  margin-top: .125rem;
}

.rt1-entry-period {
  font-size: 8.5pt;
  color: var(--resume-primary);
  font-weight: 600;
  white-space: nowrap;
  flex-shrink: 0;
}

.rt1-entry-desc {
  font-size: 9pt;
  color: var(--resume-muted);
  margin-top: .35rem;
  word-break: break-word;
  overflow-wrap: break-word;
}

/* Skills */
.rt1-skills-grid {
  display: flex;
  flex-direction: column;
  gap: .4rem;
}

.rt1-skill-cat {
  font-size: 9pt;
}

.rt1-skill-cat-label {
  font-weight: 700;
  color: var(--resume-text);
}

.rt1-skill-list {
  color: var(--resume-muted);
  margin-left: .35rem;
  word-break: break-word;
  overflow-wrap: break-word;
}

/* Cert entry inline */
.rt1-entry--cert {
  display: flex;
  flex-wrap: wrap;
  gap: .25rem .75rem;
  align-items: center;
  margin-bottom: .5rem;
}
.rt1-entry--cert .rt1-entry-title,
.rt1-entry--cert .rt1-entry-org,
.rt1-entry--cert .rt1-entry-period,
.rt1-entry--cert .rt1-entry-meta {
  display: inline;
  margin: 0;
}
.rt1-entry-meta {
  font-size: 8pt;
  color: var(--resume-muted);
}

/* ═══════════════════════════════════════════════════════
   TEMPLATE 2 — Modern Two-Column
══════════════════════════════════════════════════════ */
.resume-t2 {
  display: flex;
  flex-direction: column;
}

.rt2-header {
  background: var(--resume-primary);
  color: #fff;
  padding: 1.75rem 2.5rem 1.5rem;
}

.rt2-name {
  font-size: 22pt;
  font-weight: 800;
  margin: 0;
  color: #fff;
}

.rt2-tagline {
  font-size: 9.5pt;
  opacity: .85;
  margin: .35rem 0 0;
}

.rt2-body {
  display: flex;
  flex: 1;
}

/* Sidebar */
.rt2-sidebar {
  width: 36%;
  background: #f0f1f8;
  padding: 1.75rem 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.rt2-widget {}

.rt2-widget-title {
  font-size: 9pt;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: var(--resume-primary);
  margin: 0 0 .75rem;
  padding-bottom: .35rem;
  border-bottom: 2px solid var(--resume-primary);
}

.rt2-contact-row {
  font-size: 8.5pt;
  color: var(--resume-muted);
  margin: .3rem 0;
  display: flex;
  align-items: center;
  gap: .4rem;
  word-break: break-word;
  overflow-wrap: break-word;
}
.rt2-contact-row i { color: var(--resume-primary); font-size: 8pt; flex-shrink: 0; }

/* Skill groups */
.rt2-skill-group { margin-bottom: .75rem; }
.rt2-skill-cat {
  display: block;
  font-size: 8pt;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--resume-text);
  margin-bottom: .35rem;
}
.rt2-skill-tags { display: flex; flex-wrap: wrap; gap: .25rem; }
.rt2-skill-tag {
  background: var(--resume-primary);
  color: #fff;
  font-size: 7.5pt;
  padding: .15rem .5rem;
  border-radius: 999px;
}

/* Education / Certs */
.rt2-edu-entry, .rt2-cert-entry { margin-bottom: .75rem; }
.rt2-edu-degree, .rt2-cert-name {
  display: block;
  font-size: 8.5pt;
  font-weight: 700;
  color: var(--resume-text);
}
.rt2-edu-inst, .rt2-cert-issuer {
  display: block;
  font-size: 8pt;
  color: var(--resume-muted);
}
.rt2-edu-period, .rt2-cert-date {
  display: block;
  font-size: 7.5pt;
  color: var(--resume-primary);
  font-weight: 600;
}
.rt2-cert-id {
  display: block;
  font-size: 7.5pt;
  color: var(--resume-muted);
}

/* Main */
.rt2-main {
  flex: 1;
  padding: 1.75rem 2rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.rt2-section {}

.rt2-section-title {
  font-size: 10pt;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: var(--resume-primary);
  margin: 0 0 .75rem;
  padding-bottom: .3rem;
  border-bottom: 1px solid var(--resume-border);
}

.rt2-summary {
  font-size: 9.5pt;
  color: var(--resume-muted);
  margin: 0;
  word-break: break-word;
  overflow-wrap: break-word;
}

.rt2-exp-entry { margin-bottom: .875rem; }

.rt2-exp-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: .2rem;
}

.rt2-exp-title {
  display: block;
  font-size: 10pt;
  font-weight: 700;
  color: var(--resume-text);
}
.rt2-exp-company {
  display: block;
  font-size: 9pt;
  color: var(--resume-muted);
}
.rt2-exp-period {
  font-size: 8.5pt;
  color: var(--resume-primary);
  font-weight: 600;
  white-space: nowrap;
  flex-shrink: 0;
}
.rt2-exp-desc {
  font-size: 9pt;
  color: var(--resume-muted);
  margin-top: .3rem;
  word-break: break-word;
  overflow-wrap: break-word;
}

/* ═══════════════════════════════════════════════════════
   TEMPLATE 3 — Executive
══════════════════════════════════════════════════════ */
.resume-t3 {
  padding: 0;
}

.rt3-header {
  background: var(--resume-text);
  color: #fff;
  padding: 2rem 2.75rem;
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  flex-wrap: wrap;
  gap: 1.5rem;
}

.rt3-name {
  font-size: 22pt;
  font-weight: 800;
  margin: 0;
  color: #fff;
}

.rt3-tagline {
  font-size: 9.5pt;
  color: var(--resume-primary);
  margin: .4rem 0 0;
  font-weight: 500;
}

.rt3-header-contact {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: .25rem;
}

.rt3-contact-item {
  display: flex;
  align-items: center;
  gap: .4rem;
  font-size: 8.5pt;
  color: rgba(255, 255, 255, .75);
}
.rt3-contact-item i { color: var(--resume-primary); font-size: 8pt; }

/* Sections */
.rt3-section {
  padding: 1.5rem 2.75rem 1rem;
  border-bottom: 1px solid var(--resume-border);
}
.rt3-section:last-child { border-bottom: none; }

.rt3-section-rule {
  display: flex;
  align-items: center;
  margin-bottom: .75rem;
}

.rt3-section-title {
  font-size: 9pt;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .14em;
  color: var(--resume-primary);
  margin: 0;
  white-space: nowrap;
  padding-right: 1rem;
}

.rt3-summary {
  font-size: 9.5pt;
  color: var(--resume-muted);
  margin: 0;
  word-break: break-word;
  overflow-wrap: break-word;
}

/* Skills inline */
.rt3-skills-inline {
  font-size: 9.5pt;
  color: var(--resume-muted);
  margin: 0;
  line-height: 2;
  word-break: break-word;
  overflow-wrap: break-word;
}

/* Experience */
.rt3-exp-entry { margin-bottom: 1.1rem; }

.rt3-exp-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: .5rem;
  margin-bottom: .25rem;
}

.rt3-exp-title {
  display: block;
  font-size: 10.5pt;
  font-weight: 700;
  color: var(--resume-text);
}
.rt3-exp-company {
  display: block;
  font-size: 9pt;
  color: var(--resume-muted);
}
.rt3-exp-period {
  font-size: 8.5pt;
  color: var(--resume-primary);
  font-weight: 600;
  white-space: nowrap;
}
.rt3-exp-desc {
  font-size: 9pt;
  color: var(--resume-muted);
  margin-top: .4rem;
  word-break: break-word;
  overflow-wrap: break-word;
}

/* Education */
.rt3-edu-entry { margin-bottom: .875rem; }
.rt3-edu-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: .5rem;
  margin-bottom: .2rem;
}
.rt3-edu-degree {
  display: block;
  font-size: 10pt;
  font-weight: 700;
  color: var(--resume-text);
}
.rt3-edu-inst {
  display: block;
  font-size: 9pt;
  color: var(--resume-muted);
}
.rt3-edu-period {
  font-size: 8.5pt;
  color: var(--resume-primary);
  font-weight: 600;
  white-space: nowrap;
}
.rt3-edu-desc {
  font-size: 9pt;
  color: var(--resume-muted);
  margin-top: .3rem;
  word-break: break-word;
  overflow-wrap: break-word;
}

/* Certifications */
.rt3-cert-list {
  display: flex;
  flex-direction: column;
  gap: .5rem;
}
.rt3-cert-entry {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .25rem .75rem;
}
.rt3-cert-name {
  font-size: 9.5pt;
  font-weight: 700;
  color: var(--resume-text);
}
.rt3-cert-issuer {
  font-size: 9pt;
  color: var(--resume-muted);
}
.rt3-cert-date {
  font-size: 8.5pt;
  color: var(--resume-primary);
  font-weight: 600;
}
.rt3-cert-id {
  font-size: 8pt;
  color: var(--resume-muted);
}

/* ── Buttons (reuse public/css/style.css .btn patterns, add outline variant) */
.btn {
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  padding: .5rem 1rem;
  border-radius: 6px;
  font-size: .875rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  text-decoration: none;
  transition: all .2s;
}
.btn-primary {
  background: var(--resume-primary);
  color: #fff;
}
.btn-primary:hover { opacity: .9; }

.btn-ghost {
  background: rgba(255, 255, 255, .08);
  color: rgba(255, 255, 255, .8);
  border: 1px solid rgba(255, 255, 255, .15);
}
.btn-ghost:hover { background: rgba(255, 255, 255, .15); color: #fff; }

.btn-sm { padding: .375rem .75rem; font-size: .8125rem; }

/* ── Print Styles ────────────────────────────────────────────────────────── */
@media print {
  .resume-topbar { display: none !important; }
  .resume-body { background: none; }
  .resume-page-wrapper { padding: 0; }
  .resume-preview {
    width: 100%;
    box-shadow: none;
    min-height: 0;
    overflow: visible;
  }

  /* Zero out template top/bottom padding so @page margin is the sole source of
     spacing on all 4 sides — template side padding (2.75rem ≈ 15.5mm) naturally
     matches the 15mm @page top/bottom, keeping all 4 sides in sync on every page */
  .resume-t1 { padding-top: 0; padding-bottom: 0; }
  .rt1-section:last-child { margin-bottom: 0; }

  .rt2-header { padding-top: 0; }
  .rt2-main   { padding-bottom: 0; }

  .rt3-header                { padding-top: 0; }
  .rt3-section:last-child    { padding-bottom: 0; }

  /* Keep individual entries together — avoid splitting across pages */
  .rt1-entry,
  .rt2-exp-entry,
  .rt2-edu-entry,
  .rt2-cert-entry,
  .rt3-exp-entry,
  .rt3-edu-entry,
  .rt3-cert-entry { break-inside: avoid; }

  /* Keep section headings with the content that follows them */
  .rt1-section-title,
  .rt2-section-title,
  .rt2-widget-title,
  .rt3-section-rule { break-after: avoid; }

  #v1sec-toast { display: none !important; }

  @page { size: A4; margin: 15mm 0; }
}

/* ── Security enforcement toast (#v1sec-toast) ────────────────────────────── */
#v1sec-toast {
  position: fixed;
  top: 18px;
  left: 50%;
  transform: translateX(-50%) translateY(-80px);
  z-index: 2147483647;
  background: rgba(15,15,30,.97);
  border: 1px solid rgba(108,99,255,.45);
  border-radius: 12px;
  padding: .85rem 1.35rem;
  display: flex;
  align-items: center;
  gap: .7rem;
  min-width: 240px;
  max-width: 420px;
  box-shadow: 0 8px 32px rgba(0,0,0,.55), 0 0 0 1px rgba(108,99,255,.15);
  opacity: 0;
  transition: transform .28s cubic-bezier(.34,1.56,.64,1), opacity .22s ease;
  pointer-events: none;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}
#v1sec-toast.v1sec-show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}
#v1sec-toast .v1sec-icon {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(108,99,255,.2);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: .95rem;
  color: #a78bfa;
}
#v1sec-toast .v1sec-body  { flex: 1; min-width: 0; }
#v1sec-toast .v1sec-title {
  font-size: .75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: #a78bfa;
  margin-bottom: .18rem;
}
#v1sec-toast .v1sec-msg {
  font-size: .875rem;
  color: rgba(255,255,255,.87);
  line-height: 1.45;
}

@media (max-width: 380px) {
  #v1sec-toast {
    min-width: calc(100vw - 2rem);
    max-width: calc(100vw - 2rem);
    font-size: .8rem;
    padding: .7rem 1rem;
  }
}
