/* ResumeATS — Interactive Builder & Clean A4 Print Styles */
:root {
  --bg: #050814;
  --panel: #0c1224;
  --panel-2: #131c36;
  --border: rgba(148, 163, 184, 0.16);
  --text: #f8fafc;
  --muted: #94a3b8;
  --accent: #38bdf8;
  --emerald: #34d399;
  --font: "Plus Jakarta Sans", "Inter", -apple-system, BlinkMacSystemFont, sans-serif;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: var(--font); background: var(--bg); color: var(--text); min-height: 100vh; }

.topbar {
  position: sticky; top: 0; z-index: 40;
  background: rgba(5, 8, 20, 0.92); backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
  padding: 12px 20px; display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap;
}
.top-left, .top-right { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.brand { display: inline-flex; align-items: center; gap: 9px; font-weight: 800; color: #fff; text-decoration: none; font-size: 1rem; }
.brand-mark { width: 30px; height: 30px; border-radius: 8px; background: linear-gradient(135deg, #38bdf8, #6366f1); display: grid; place-items: center; font-weight: 900; font-size: 0.72rem; }

.score-pill { display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px; border-radius: 999px; background: var(--panel); border: 1px solid var(--border); font-size: 0.82rem; font-weight: 700; }
.score-pill strong { color: var(--emerald); font-size: 0.92rem; }

.btn { display: inline-flex; align-items: center; gap: 6px; padding: 8px 14px; border-radius: 9px; font-family: inherit; font-weight: 700; font-size: 0.83rem; cursor: pointer; border: 1px solid transparent; transition: 0.15s ease; }
.btn:hover { transform: translateY(-1px); }
.btn-primary { background: linear-gradient(135deg, #38bdf8, #6366f1); color: #fff; }
.btn-ghost { background: var(--panel); color: #fff; border-color: var(--border); }
.btn-pro { background: linear-gradient(135deg, #f59e0b, #d97706); color: #1c1917; }
.btn-danger { background: rgba(239, 68, 68, 0.14); color: #fca5a5; border-color: rgba(239, 68, 68, 0.3); }

.workspace { display: grid; grid-template-columns: minmax(370px, 490px) 1fr; min-height: calc(100vh - 58px); }
.editor { background: var(--panel); border-right: 1px solid var(--border); padding: 18px; overflow-y: auto; max-height: calc(100vh - 58px); }

.card { background: rgba(5, 8, 20, 0.58); border: 1px solid var(--border); border-radius: 12px; padding: 14px; margin-bottom: 14px; }
.card-title { font-size: 0.75rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.08em; color: var(--accent); margin-bottom: 10px; display: flex; justify-content: space-between; align-items: center; }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.field { display: flex; flex-direction: column; gap: 5px; margin-bottom: 10px; }
.field:last-child { margin-bottom: 0; }
.field label { font-size: 0.75rem; font-weight: 600; color: var(--muted); }
.field input, .field select, .field textarea {
  width: 100%; padding: 9px 11px; border-radius: 8px;
  border: 1px solid var(--border); background: var(--bg); color: #fff;
  font-family: inherit; font-size: 0.85rem;
}
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--accent); }

.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.chip { font-size: 0.75rem; font-weight: 700; padding: 4px 10px; border-radius: 999px; border: 1px solid transparent; }
.chip.ok { background: rgba(52, 211, 153, 0.14); color: #6ee7b7; border-color: rgba(52, 211, 153, 0.3); }
.chip.miss { background: rgba(245, 158, 11, 0.14); color: #fcd34d; border-color: rgba(245, 158, 11, 0.35); cursor: pointer; }
.chip.miss:hover { background: rgba(245, 158, 11, 0.28); }

.exp-block { border: 1px solid var(--border); border-radius: 9px; padding: 10px; margin-bottom: 10px; background: rgba(255,255,255,0.02); }
.exp-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; font-size: 0.78rem; color: var(--muted); font-weight: 700; }

/* Right Live A4 Preview */
.preview-pane {
  padding: 28px; overflow-y: auto; max-height: calc(100vh - 58px);
  display: flex; flex-direction: column; align-items: center;
  background: radial-gradient(circle at 50% 0%, rgba(56,189,248,0.08), transparent 60%), #090e1c;
}

.paper {
  width: 100%; max-width: 780px; background: #fff; color: #0f172a;
  border-radius: 10px; padding: 42px 48px; box-shadow: 0 24px 70px rgba(0, 0, 0, 0.5);
  line-height: 1.5;
}
.paper.tpl-executive { border-top: 6px solid #2563eb; }
.paper.tpl-compact { padding: 30px 36px; font-size: 0.92rem; }

.r-name { font-size: 1.85rem; font-weight: 900; letter-spacing: -0.03em; color: #0f172a; }
.r-role { font-size: 1rem; font-weight: 600; color: #2563eb; margin-bottom: 6px; }
.r-contact { font-size: 0.84rem; color: #475569; margin-bottom: 18px; padding-bottom: 14px; border-bottom: 2px solid #0f172a; }
.paper.tpl-executive .r-contact { border-bottom-color: #2563eb; }

.r-sec { margin-bottom: 18px; }
.r-sec-title { font-size: 0.78rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.1em; color: #0f172a; border-bottom: 1px solid #cbd5e1; padding-bottom: 4px; margin-bottom: 10px; }
.paper.tpl-executive .r-sec-title { color: #2563eb; border-bottom-color: #bfdbfe; }
.r-summary { font-size: 0.9rem; color: #334155; }

.r-item { margin-bottom: 12px; }
.r-item-top { display: flex; justify-content: space-between; gap: 12px; font-weight: 700; font-size: 0.94rem; }
.r-item-sub { font-size: 0.84rem; color: #475569; margin-bottom: 4px; }
.r-bullets { margin-left: 18px; font-size: 0.88rem; color: #334155; }
.r-bullets li { margin-bottom: 3px; }
.r-skills { font-size: 0.88rem; color: #1e293b; }
.watermark { text-align: center; margin-top: 22px; padding-top: 10px; border-top: 1px dashed #e2e8f0; font-size: 0.74rem; color: #94a3b8; }

.modal-backdrop { position: fixed; inset: 0; background: rgba(2, 6, 23, 0.78); backdrop-filter: blur(6px); display: none; place-items: center; z-index: 100; padding: 20px; }
.modal-backdrop.open { display: grid; }
.modal { background: var(--panel); border: 1px solid var(--border); border-radius: 16px; width: 100%; max-width: 520px; padding: 24px; }
.modal-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; }
.modal-close { background: none; border: none; color: var(--muted); font-size: 1.4rem; cursor: pointer; }
.toast { position: fixed; bottom: 20px; right: 20px; background: #34d399; color: #022c22; font-weight: 800; padding: 10px 18px; border-radius: 10px; opacity: 0; transform: translateY(10px); transition: 0.25s ease; pointer-events: none; z-index: 120; }
.toast.show { opacity: 1; transform: translateY(0); }

@media (max-width: 960px) {
  .workspace { grid-template-columns: 1fr; }
  .editor, .preview-pane { max-height: none; }
}

@media print {
  body { background: #fff !important; }
  .topbar, .editor, .modal-backdrop, .toast { display: none !important; }
  .workspace { display: block !important; }
  .preview-pane { padding: 0 !important; background: #fff !important; max-height: none !important; overflow: visible !important; }
  .paper { box-shadow: none !important; max-width: 100% !important; border-radius: 0 !important; padding: 18px 22px !important; }
}
