/* ============================================================
   SOP Writer Fresher Resume Builder — v1.0.0
   CSS Custom Properties + Full Layout
   ============================================================ */
:root {
  --swfr-accent: #ea580c;
  --swfr-accent-light: #fff7ed;
  --swfr-accent-border: #fed7aa;
  --swfr-dark: #0f172a;
  --swfr-text: #1e293b;
  --swfr-muted: #64748b;
  --swfr-border: #e5e7eb;
  --swfr-bg: #f1f5f9;
  --swfr-white: #ffffff;
  --swfr-shadow: 0 2px 12px rgba(15,23,42,.06);
  --swfr-shadow-lg: 0 8px 32px rgba(15,23,42,.10);
  --swfr-radius: 12px;
  --swfr-font: "Inter","Segoe UI",system-ui,-apple-system,Arial,sans-serif;
}

/* Full-width page kill */
body.swfr-page .site-content,
body.swfr-page #primary,
body.swfr-page #main,
body.swfr-page .content-area,
body.swfr-page .container,
body.swfr-page .entry-content,
body.swfr-page main article {
  max-width: 100% !important;
  width: 100% !important;
  padding: 0 !important;
  margin: 0 !important;
}
body.swfr-page .entry-header,
body.swfr-page .entry-title { display: none !important; }

/* ============================================================
   MAIN LAYOUT
   ============================================================ */
.swfr-wrap {
  display: grid;
  grid-template-columns: 1fr;
  min-height: 100vh;
  background: var(--swfr-bg);
  font-family: var(--swfr-font);
}
@media (min-width: 1100px) {
  .swfr-wrap {
    grid-template-columns: minmax(440px, 580px) 1fr;
    min-height: 100vh;
  }
}
@media (min-width: 1440px) {
  .swfr-wrap { grid-template-columns: 640px 1fr; }
}

/* ============================================================
   TOOLBAR
   ============================================================ */
.swfr-toolbar {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--swfr-white);
  border-bottom: 1px solid var(--swfr-border);
  padding: 12px 18px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  box-shadow: var(--swfr-shadow);
}
.swfr-toolbar-left { display: flex; align-items: center; gap: 10px; }
.swfr-toolbar-right { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.swfr-logo { font-size: 15px; font-weight: 800; color: var(--swfr-dark); }
.swfr-badge {
  background: var(--swfr-accent);
  color: #fff;
  font-size: 10px;
  font-weight: 800;
  padding: 2px 8px;
  border-radius: 99px;
  text-transform: uppercase;
  letter-spacing: .05em;
}
.swfr-color-row { display: flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; color: var(--swfr-muted); }
.swfr-color-btn {
  width: 22px; height: 22px; border-radius: 50%;
  border: 2px solid transparent; cursor: pointer; padding: 0;
  transition: transform .15s, box-shadow .15s;
}
.swfr-color-btn:hover { transform: scale(1.1); }
.swfr-color-btn.active { border-color: #0f172a; box-shadow: 0 0 0 2px #fff, 0 0 0 4px #0f172a55; transform: scale(1.08); }

.swfr-btn {
  border: none; border-radius: 8px; font-size: 12px;
  font-weight: 700; cursor: pointer; padding: 8px 16px;
  font-family: var(--swfr-font); transition: all .15s;
}
.swfr-btn-reset { background: #f1f5f9; color: #334155; }
.swfr-btn-reset:hover { background: #e2e8f0; }
.swfr-btn-print { background: #e0f2fe; color: #0369a1; }
.swfr-btn-print:hover { background: #bae6fd; }
.swfr-btn-pdf {
  background: linear-gradient(135deg,#ea580c,#ec4899);
  color: #fff;
  box-shadow: 0 3px 12px rgba(234,88,12,.28);
}
.swfr-btn-pdf:hover { filter: brightness(1.06); box-shadow: 0 4px 16px rgba(234,88,12,.38); transform: translateY(-1px); }
.swfr-btn-pdf:disabled { opacity: .6; transform: none; }

/* ============================================================
   SECTION NAV
   ============================================================ */
.swfr-section-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  padding: 10px 16px;
  background: #f8fafc;
  border-bottom: 1px solid var(--swfr-border);
  position: sticky;
  top: 61px;
  z-index: 49;
}
.swfr-section-nav button {
  border: 1px solid var(--swfr-border);
  background: #fff;
  border-radius: 8px;
  font-size: 11.5px;
  font-weight: 600;
  color: #334155;
  padding: 5px 10px;
  cursor: pointer;
  font-family: var(--swfr-font);
  transition: all .15s;
  white-space: nowrap;
}
.swfr-section-nav button:hover { background: var(--swfr-accent-light); border-color: var(--swfr-accent-border); color: var(--swfr-accent); }

/* ============================================================
   EDITOR SECTIONS
   ============================================================ */
.swfr-sections { padding: 14px 16px 48px; display: flex; flex-direction: column; gap: 14px; }
.swfr-section {
  background: #fff;
  border: 1px solid var(--swfr-border);
  border-radius: var(--swfr-radius);
  overflow: hidden;
  box-shadow: var(--swfr-shadow);
}
.swfr-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px 10px;
  border-bottom: 1px solid #f1f5f9;
}
.swfr-section-header h3 {
  margin: 0;
  font-size: 13px;
  font-weight: 800;
  color: var(--swfr-dark);
  text-transform: uppercase;
  letter-spacing: .06em;
}
.swfr-add-btn {
  background: var(--swfr-accent-light);
  color: var(--swfr-accent);
  border: 1px solid var(--swfr-accent-border);
  border-radius: 8px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  padding: 6px 12px;
  font-family: var(--swfr-font);
  transition: all .15s;
  white-space: nowrap;
}
.swfr-add-btn:hover { background: #ffedd5; border-color: var(--swfr-accent); }
.swfr-opt-badge { background: #f0fdf4; color: #16a34a; font-size: 10px; font-weight: 700; padding: 2px 6px; border-radius: 4px; text-transform: uppercase; }

/* Fields */
.swfr-section > .swfr-field,
.swfr-section > .swfr-grid-2,
.swfr-section > .swfr-skills-quick,
.swfr-section > .swfr-field,
.swfr-section > .swfr-hint,
.swfr-section > p,
.swfr-section > label,
.swfr-section > div:not(.swfr-section-header):not(.swfr-list) {
  padding: 12px 18px;
}
.swfr-section > .swfr-grid-2 { padding-top: 14px; padding-bottom: 14px; }

.swfr-grid-2 { display: grid; grid-template-columns: 1fr; gap: 10px; }
@media (min-width: 600px) { .swfr-grid-2 { grid-template-columns: 1fr 1fr; } }
.swfr-grid-2 .swfr-field { margin: 0; }
.swfr-grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 10px; }
@media (max-width: 700px) { .swfr-grid-3 { grid-template-columns: 1fr 1fr; } }
@media (max-width: 440px) { .swfr-grid-3 { grid-template-columns: 1fr; } }

.swfr-field { margin-bottom: 10px; }
.swfr-field:last-child { margin-bottom: 0; }
.swfr-field label {
  display: block;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--swfr-muted);
  margin-bottom: 5px;
}
.swfr-opt { font-size: 10px; background: #f0fdf4; color: #16a34a; font-weight: 700; padding: 1px 5px; border-radius: 3px; text-transform: uppercase; letter-spacing: .04em; margin-left: 4px; font-style: normal; }
.swfr-field input,
.swfr-field select,
.swfr-field textarea {
  width: 100%;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  padding: 9px 12px;
  font-size: 13.5px;
  font-family: var(--swfr-font);
  color: var(--swfr-text);
  background: #fff;
  outline: none;
  transition: border-color .18s, box-shadow .18s;
  box-sizing: border-box;
}
.swfr-field input:focus,
.swfr-field select:focus,
.swfr-field textarea:focus {
  border-color: var(--swfr-accent);
  box-shadow: 0 0 0 3px rgba(234,88,12,.11);
}
.swfr-field textarea { resize: vertical; }
.swfr-hint { font-size: 11px; color: var(--swfr-muted); padding: 6px 18px 10px; margin: 0; }
.swfr-toggle-label { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; color: #334155; cursor: pointer; padding: 12px 18px; }
.swfr-toggle-label input { width: 16px; height: 16px; accent-color: var(--swfr-accent); }

/* Repeat box */
.swfr-repeat-box {
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  background: #f8fafc;
  margin: 12px 16px;
  padding: 14px 14px 10px;
}
.swfr-repeat-box + .swfr-repeat-box { margin-top: 0; }
.swfr-repeat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}
.swfr-repeat-title { font-size: 12px; font-weight: 700; color: #334155; }
.swfr-del-btn {
  background: #fef2f2;
  color: #dc2626;
  border: 1px solid #fecaca;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 700;
  padding: 4px 10px;
  cursor: pointer;
  font-family: var(--swfr-font);
}
.swfr-del-btn:hover { background: #fee2e2; }
.swfr-btn-sm {
  background: #f1f5f9;
  color: #334155;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 700;
  padding: 7px 14px;
  cursor: pointer;
  font-family: var(--swfr-font);
  transition: all .15s;
  white-space: nowrap;
}
.swfr-btn-sm:hover { background: var(--swfr-accent-light); border-color: var(--swfr-accent-border); color: var(--swfr-accent); }

/* Skills */
.swfr-skills-quick { padding: 8px 18px; display: flex; flex-wrap: wrap; gap: 6px; }
.swfr-skill-tag-label { font-size: 11px; font-weight: 700; color: var(--swfr-muted); width: 100%; margin-bottom: 4px; }
.swfr-quick-tag {
  display: inline-flex; align-items: center; gap: 4px;
  background: #f1f5f9; color: #334155;
  border: 1px solid #d1d5db; border-radius: 999px;
  font-size: 12px; font-weight: 600;
  padding: 4px 12px; cursor: pointer;
  transition: all .15s;
}
.swfr-quick-tag:hover { background: var(--swfr-accent-light); border-color: var(--swfr-accent-border); color: var(--swfr-accent); }
.swfr-quick-tag.selected { background: var(--swfr-accent); border-color: var(--swfr-accent); color: #fff; }
.swfr-skills-input-wrap { display: flex; gap: 8px; padding: 0 18px 12px; }
.swfr-skills-input-wrap input { flex: 1; border: 1px solid #d1d5db; border-radius: 8px; padding: 8px 12px; font-size: 13px; font-family: var(--swfr-font); outline: none; }
.swfr-skills-input-wrap input:focus { border-color: var(--swfr-accent); box-shadow: 0 0 0 3px rgba(234,88,12,.11); }
.swfr-skills-selected { padding: 0 18px 14px; display: flex; flex-wrap: wrap; gap: 6px; min-height: 24px; }
.swfr-skill-pill {
  display: inline-flex; align-items: center; gap: 5px;
  background: var(--swfr-accent); color: #fff;
  border-radius: 999px; font-size: 12px; font-weight: 600;
  padding: 4px 12px 4px 14px;
}
.swfr-skill-pill button {
  background: none; border: none; color: rgba(255,255,255,.7);
  cursor: pointer; font-size: 13px; line-height: 1; padding: 0; margin-left: 2px;
}
.swfr-skill-pill button:hover { color: #fff; }

/* ============================================================
   PREVIEW PANEL
   ============================================================ */
.swfr-preview-panel {
  background: #e8ecf0;
  padding: 24px 16px 48px;
  overflow-y: auto;
}
@media (min-width: 1100px) { .swfr-preview-panel { padding: 28px 24px 64px; } }
.swfr-preview-sticky { position: sticky; top: 24px; }
.swfr-tip { font-size: 12px; color: #64748b; margin-top: 14px; text-align: center; line-height: 1.6; }

/* A4 paper */
.swfr-a4 {
  width: 210mm;
  min-height: 297mm;
  background: #fff;
  margin: 0 auto;
  box-shadow: 0 6px 40px rgba(15,23,42,.14);
  border-radius: 4px;
  overflow: hidden;
  position: relative;
}
@media (max-width: 900px) {
  .swfr-a4 { width: 100%; max-width: 600px; min-height: auto; }
}

/* ============================================================
   RESUME INSIDE A4
   ============================================================ */
.swfr-resume { font-family: "Arial","Helvetica",sans-serif; color: #1e293b; }
.swfr-resume-header {
  padding: 24px 28px 20px;
  color: #fff;
  background: var(--swfr-accent);
}
.swfr-resume-name { font-size: 26px; font-weight: 900; letter-spacing: -.01em; color: #fff; line-height: 1.15; }
.swfr-resume-title { font-size: 13px; opacity: .9; margin-top: 2px; color: #fff; }
.swfr-resume-contact { display: flex; flex-wrap: wrap; gap: 6px 18px; margin-top: 10px; font-size: 11px; color: rgba(255,255,255,.88); }
.swfr-resume-contact span { display: flex; align-items: center; gap: 4px; }
.swfr-resume-body { padding: 18px 28px; }

.swfr-r-section { margin-bottom: 16px; }
.swfr-r-section-title {
  font-size: 10.5px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .08em;
  padding-bottom: 5px;
  margin-bottom: 10px;
  border-bottom: 1.5px solid;
  color: var(--swfr-accent);
  border-color: var(--swfr-accent);
}
.swfr-r-section-title.dark { color: #1e293b; border-color: #1e293b; }

/* Objective */
.swfr-r-objective { font-size: 13px; line-height: 1.65; color: #334155; }

/* Skills pills */
.swfr-r-skills { display: flex; flex-wrap: wrap; gap: 5px; }
.swfr-r-skill {
  display: inline-block;
  font-size: 11.5px; font-weight: 600;
  padding: 3px 11px; border-radius: 99px;
  background: rgba(234,88,12,.10);
  color: var(--swfr-accent);
  border: 1px solid rgba(234,88,12,.2);
}

/* Education */
.swfr-r-edu-item { margin-bottom: 10px; }
.swfr-r-edu-row { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.swfr-r-edu-degree { font-size: 13px; font-weight: 700; color: #1e293b; }
.swfr-r-edu-year { font-size: 11px; color: #64748b; white-space: nowrap; }
.swfr-r-edu-sub { font-size: 12px; color: #475569; }
.swfr-r-edu-result { font-size: 11.5px; color: #64748b; }

/* Project */
.swfr-r-proj-item { margin-bottom: 12px; }
.swfr-r-proj-name { font-size: 13px; font-weight: 700; color: #1e293b; }
.swfr-r-proj-meta { font-size: 11.5px; color: #64748b; margin-top: 2px; }
.swfr-r-proj-desc { font-size: 12.5px; color: #334155; margin-top: 4px; line-height: 1.6; }
.swfr-r-proj-links { font-size: 11.5px; margin-top: 4px; }
.swfr-r-proj-links a { color: var(--swfr-accent); text-decoration: underline; margin-right: 12px; }

/* Internship / Volunteer */
.swfr-r-exp-item { margin-bottom: 12px; }
.swfr-r-exp-row { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.swfr-r-exp-title { font-size: 13px; font-weight: 700; color: #1e293b; }
.swfr-r-exp-period { font-size: 11.5px; color: #64748b; white-space: nowrap; }
.swfr-r-exp-org { font-size: 12px; color: #475569; }
.swfr-r-exp-bullets { margin: 6px 0 0 18px; list-style: disc; font-size: 12.5px; color: #334155; line-height: 1.6; }

/* Training */
.swfr-r-cert-item { margin-bottom: 9px; display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; }
.swfr-r-cert-name { font-size: 13px; font-weight: 700; color: #1e293b; }
.swfr-r-cert-org { font-size: 12px; color: #475569; }
.swfr-r-cert-id { font-size: 11px; color: #64748b; }
.swfr-r-cert-date { font-size: 11.5px; color: #64748b; white-space: nowrap; }

/* Awards */
.swfr-r-award-item { margin-bottom: 9px; }
.swfr-r-award-name { font-size: 13px; font-weight: 700; color: #1e293b; }
.swfr-r-award-org { font-size: 12px; color: #475569; }
.swfr-r-award-desc { font-size: 12px; color: #334155; margin-top: 2px; }

/* Languages */
.swfr-r-langs { display: flex; flex-wrap: wrap; gap: 14px 24px; }
.swfr-r-lang { font-size: 13px; color: #334155; }
.swfr-r-lang strong { color: #1e293b; }
.swfr-r-lang-bar { display: flex; gap: 3px; margin-top: 3px; }
.swfr-r-lang-dot { width: 10px; height: 10px; border-radius: 50%; background: #e5e7eb; }
.swfr-r-lang-dot.filled { background: var(--swfr-accent); }

/* Interests */
.swfr-r-interests { display: flex; flex-wrap: wrap; gap: 5px; }
.swfr-r-interest { font-size: 12px; font-weight: 600; color: #334155; background: #f1f5f9; border-radius: 6px; padding: 3px 10px; }

/* References */
.swfr-r-refs { display: grid; gap: 14px; }
.swfr-r-ref-item { font-size: 12.5px; line-height: 1.6; }
.swfr-r-ref-name { font-weight: 700; color: #1e293b; }
.swfr-r-ref-pos { color: #475569; }
.swfr-r-ref-contact { color: #64748b; font-size: 12px; }
.swfr-r-ref-request { font-size: 13px; color: #64748b; font-style: italic; }

/* ============================================================
   PRINT / PDF STYLES
   ============================================================ */
@media print {
  body * { visibility: hidden !important; }
  .swfr-a4, .swfr-a4 * { visibility: visible !important; }
  .swfr-a4 {
    position: fixed; left: 0; top: 0; width: 210mm; min-height: 297mm;
    box-shadow: none !important; border-radius: 0 !important;
    margin: 0 !important; padding: 0 !important;
  }
  .no-print, .swfr-editor, .swfr-toolbar, .swfr-tip { display: none !important; }
  @page { size: A4; margin: 0; }
}
