/* Erthiox Resume Builder v2 - dedicated styles.
   Loaded by platform/career.html. Placed after the page <style> block so these
   rules win ties against career.html's own rules.
   This file owns ALL builder layout, including every responsive rule that
   used to live in career.html's <style> block (consolidated 2026-11-13). */

#editor-container { flex-direction: row; height: 100%; border-top: 1px solid #eef2f7; overflow: visible; }

/* Desktop workspace: the editor keeps a 400-480px column so its two-column
   form rows stay usable; the preview takes whatever is left. */
.editor-pane { flex: 0 1 480px; min-width: 400px; width: auto; border-right: 1px solid #eef2f7; background: #fff; display: flex; flex-direction: column; overflow-y: auto; }
.preview-pane { flex: 1 1 0; min-width: 0; width: auto; background: #e8eaed; padding: 24px; overflow: hidden; display: flex; flex-direction: column; position: relative; }
.preview-viewport { flex: 1; min-height: 0; width: 100%; overflow: auto; display: flex; border-radius: 12px; }
.preview-scaler { margin: auto; flex-shrink: 0; transition: transform 0.18s ease-out; }

/* Desktop three-column workspace: sidebar / workspace. The workspace holds
   #editor-container, which is the flex row of editor + preview panes, so the
   visual result is sidebar | editor | preview. */
.engine-body { display: grid; grid-template-columns: 260px minmax(0, 1fr); }
.resume-sidebar { width: auto; min-width: 0; }
.workspace { min-width: 0; }

.pane-header { padding: 14px 24px; border-bottom: 1px solid #eef2f7; background: #fafbfc; position: sticky; top: 0; z-index: 10; display: flex; flex-direction: column; gap: 10px; }
.pane-header-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.pane-title { font-weight: 700; color: #202124; font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.5px; }

/* Slim preview header: title + pages pill + zoom cluster only. Pan lives in
   the floating .pan-pad overlay at the bottom-right of the preview pane. */
.preview-pane-header { width: 100%; padding: 10px 16px; }

.form-content { padding: 28px 24px; flex-grow: 1; }
.form-section { margin-bottom: 36px; }
.section-header-title { font-size: 1.05rem; font-weight: 700; color: #1a73e8; border-bottom: 2px solid #eef2f7; padding-bottom: 8px; margin-bottom: 16px; }

.form-group { margin-bottom: 18px; }
.form-label { display: block; font-size: 0.85rem; font-weight: 600; color: #3c4043; margin-bottom: 8px; }
.form-input, .form-textarea { width: 100%; padding: 12px 14px; border: 1px solid #dadce0; border-radius: 8px; font-family: 'Roboto', sans-serif; font-size: 1rem; transition: border-color 0.2s; background: #fff; box-sizing: border-box; }
.form-input:focus, .form-textarea:focus { border-color: #1a73e8; outline: none; box-shadow: 0 0 0 2px rgba(26,115,232,0.2); }
.form-textarea { resize: vertical; min-height: 96px; }
.form-row { display: flex; gap: 16px; }
.form-row > .form-group { flex: 1; min-width: 0; }

/* Template switcher */
.template-switch { display: inline-flex; background: #f1f3f4; border-radius: 100px; padding: 3px; gap: 2px; }
.template-switch button { border: none; background: none; padding: 8px 16px; border-radius: 100px; font-size: 0.82rem; font-weight: 600; color: #5f6368; cursor: pointer; min-height: 36px; }
.template-switch button.active { background: #fff; color: #1a73e8; box-shadow: 0 1px 4px rgba(0,0,0,0.12); }
.ats-pill { display: inline-flex; align-items: center; gap: 6px; font-size: 0.8rem; font-weight: 700; padding: 6px 12px; border-radius: 100px; background: rgba(52,168,83,0.1); color: #1e7e34; }
.ats-pill.warn { background: rgba(251,188,4,0.15); color: #b06000; }

/* ATS checklist card */
.ats-card { background: #f8faff; border: 1px solid #d2e3fc; border-radius: 12px; padding: 18px; margin-bottom: 32px; }
.ats-card-title { display: flex; align-items: center; gap: 8px; font-weight: 700; color: #202124; margin-bottom: 12px; font-size: 0.95rem; }
.ats-check { display: flex; align-items: flex-start; gap: 10px; font-size: 0.87rem; color: #3c4043; padding: 5px 0; line-height: 1.45; }
.ats-check .material-symbols-outlined { font-size: 18px; flex-shrink: 0; margin-top: 1px; }
.ats-check.ok .material-symbols-outlined { color: #34a853; }
.ats-check.todo .material-symbols-outlined { color: #fbbc04; }

/* Dynamic lists */
.list-item-card { background: #fafbfc; border: 1px solid #eef2f7; border-radius: 10px; padding: 16px; margin-bottom: 14px; position: relative; }
.btn-remove-item { position: absolute; top: 12px; right: 12px; color: #ea4335; background: none; border: none; cursor: pointer; opacity: 0.6; padding: 8px; min-width: 40px; min-height: 40px; }
.btn-remove-item:hover { opacity: 1; }
.btn-add-item { background: #f1f3f4; color: #3c4043; border: 1px dashed #dadce0; padding: 12px 16px; border-radius: 8px; font-weight: 500; cursor: pointer; width: 100%; text-align: center; transition: background 0.2s; margin-top: 8px; min-height: 48px; font-size: 0.95rem; box-sizing: border-box; }
.btn-add-item:hover { background: #e8eaed; }

/* Action bar */
.editor-actions { padding: 14px 24px; border-top: 1px solid #eef2f7; background: #fff; position: sticky; bottom: 0; display: flex; justify-content: space-between; align-items: center; gap: 12px; z-index: 10; flex-wrap: wrap; }
.draft-indicator { display: inline-flex; align-items: center; gap: 6px; font-size: 0.8rem; color: #80868b; }
.btn-ghost { padding: 12px 18px; background: #fff; border: 1px solid #dadce0; border-radius: 8px; color: #3c4043; font-weight: 600; font-size: 0.9rem; cursor: pointer; display: inline-flex; align-items: center; gap: 8px; min-height: 48px; box-sizing: border-box; }
.btn-ghost:hover { background: #f8f9fa; }

/* Live preview - the canvas is scaled with transform, so transform-origin
   MUST be top left (it is the element that gets scaled by fitPreview()). */
.a4-canvas { background: #fff; width: 210mm; min-height: 297mm; box-shadow: 0 4px 16px rgba(0,0,0,0.1); margin-bottom: 40px; zoom: 1; transform-origin: top left; }

.tpl-minimalist { padding: 40px; font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; color: #333; line-height: 1.5; }
.tpl-minimalist .tpl-header { border-bottom: 2px solid #222; padding-bottom: 16px; margin-bottom: 24px; text-align: center; }
.tpl-minimalist .tpl-name { font-size: 28px; font-weight: 700; color: #111; margin-bottom: 8px; letter-spacing: 1px; text-transform: uppercase; }
.tpl-minimalist .tpl-contact { font-size: 13px; color: #555; }
.tpl-minimalist .tpl-contact span { margin: 0 8px; }
.tpl-minimalist .tpl-section-title { font-size: 14px; font-weight: 700; color: #222; text-transform: uppercase; letter-spacing: 1px; margin-bottom: 12px; margin-top: 24px; border-bottom: 1px solid #eee; padding-bottom: 4px; }

.tpl-modern { padding: 40px; font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; color: #333; line-height: 1.5; }
.tpl-modern .tpl-header { border-left: 6px solid #1a73e8; padding-left: 20px; margin-bottom: 24px; }
.tpl-modern .tpl-name { font-size: 30px; font-weight: 800; color: #1a73e8; margin-bottom: 6px; letter-spacing: -0.5px; }
.tpl-modern .tpl-contact { font-size: 13px; color: #555; }
.tpl-modern .tpl-contact span { margin-right: 12px; }
.tpl-modern .tpl-section-title { font-size: 14px; font-weight: 800; color: #1a73e8; text-transform: uppercase; letter-spacing: 1px; margin-bottom: 12px; margin-top: 24px; padding-bottom: 4px; border-bottom: 2px solid #d2e3fc; }

.tpl-compact { padding: 32px; font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; color: #333; line-height: 1.4; }
.tpl-compact .tpl-header { margin-bottom: 14px; }
.tpl-compact .tpl-name { font-size: 22px; font-weight: 700; color: #111; margin-bottom: 4px; text-transform: uppercase; letter-spacing: 0.5px; }
.tpl-compact .tpl-contact { font-size: 11.5px; color: #555; }
.tpl-compact .tpl-contact span { margin-right: 10px; }
.tpl-compact .tpl-section-title { font-size: 12px; font-weight: 700; color: #111; text-transform: uppercase; letter-spacing: 1px; margin-bottom: 8px; margin-top: 16px; border-bottom: 1px solid #ddd; padding-bottom: 3px; }

.tpl-summary { font-size: 13px; margin-bottom: 16px; }
.tpl-compact .tpl-summary { font-size: 11.5px; margin-bottom: 10px; }
.tpl-item { margin-bottom: 16px; }
.tpl-compact .tpl-item { margin-bottom: 10px; }
.tpl-item-header { display: flex; justify-content: space-between; margin-bottom: 4px; align-items: baseline; gap: 12px; }
.tpl-item-title { font-weight: 700; font-size: 14px; color: #111; }
.tpl-compact .tpl-item-title { font-size: 12.5px; }
.tpl-item-subtitle { font-style: italic; font-size: 13px; color: #444; }
.tpl-compact .tpl-item-subtitle { font-size: 11.5px; }
.tpl-item-dates { font-size: 12px; color: #666; white-space: nowrap; }
.tpl-compact .tpl-item-dates { font-size: 11px; }
.tpl-bullets { margin: 0; padding-left: 16px; font-size: 13px; }
.tpl-compact .tpl-bullets { font-size: 11.5px; }
.tpl-bullets li { margin-bottom: 4px; }
.tpl-compact .tpl-bullets li { margin-bottom: 2px; }
.tpl-skills-list { font-size: 13px; line-height: 1.6; }
.tpl-compact .tpl-skills-list { font-size: 11.5px; }

/* Preview zoom controls */
.zoom-controls { display: inline-flex; align-items: center; gap: 4px; background: #f1f3f4; border-radius: 100px; padding: 3px; }
.zoom-controls button { border: none; background: none; width: 36px; height: 36px; border-radius: 50%; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; color: #3c4043; }
.zoom-controls button:hover { background: #fff; }
.zoom-controls .material-symbols-outlined { font-size: 18px; }
.zoom-label { font-size: 0.8rem; font-weight: 600; color: #5f6368; min-width: 42px; text-align: center; }
.pages-pill { font-size: 0.8rem; font-weight: 700; padding: 6px 12px; border-radius: 100px; background: #f1f3f4; color: #5f6368; }

/* D-pad: move the zoomed document around. Floating overlay, bottom-right of
   the preview pane, so the slim header stays one row tall. */
.pan-pad { position: absolute; right: 16px; bottom: 16px; z-index: 5; display: flex; flex-direction: column; align-items: center; gap: 2px; background: rgba(255,255,255,0.94); border: 1px solid #eef2f7; border-radius: 14px; padding: 4px; box-shadow: 0 4px 16px rgba(0,0,0,0.12); }
.pan-pad-row { display: flex; gap: 2px; }
.pan-pad button { border: none; background: none; width: 34px; height: 34px; border-radius: 9px; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; color: #3c4043; padding: 0; }
.pan-pad button:hover { background: #f1f3f4; color: #1a73e8; }
.pan-pad .material-symbols-outlined { font-size: 20px; }

/* Sidebar item actions (delete / duplicate) */
.resume-item { position: relative; }
.resume-item-actions { position: absolute; top: 10px; right: 10px; display: none; gap: 2px; }
.resume-item:hover .resume-item-actions { display: flex; }
.resume-item-actions button { border: 1px solid #eef2f7; background: #fff; border-radius: 6px; width: 32px; height: 32px; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; color: #5f6368; box-shadow: 0 1px 4px rgba(0,0,0,0.08); padding: 0; }
.resume-item-actions button:hover { color: #1a73e8; }
.resume-item-actions button.danger:hover { color: #ea4335; }
.resume-item-actions .material-symbols-outlined { font-size: 16px; }

/* Saved-list scroller: arrows only appear in the stacked layout */
.resume-scroller { display: contents; }
.resume-nav-arrow { display: none; }

/* ============ Stacked layout: tablets, split-screen, phones ============ */
@media (max-width: 1100px) {
    .engine-header { flex-direction: column; align-items: flex-start; gap: 12px; padding: 16px; }
    .engine-controls { width: 100%; justify-content: flex-end; gap: 8px; }

    .engine-body { display: flex; flex-direction: column; }
    .resume-sidebar { width: 100%; border-right: none; border-bottom: 1px solid #eef2f7; max-height: 230px; }
    .resume-list { display: flex; flex-direction: row; overflow-x: auto; overflow-y: hidden; gap: 8px; padding: 8px 12px; }
    .resume-item { min-width: 170px; flex-shrink: 0; margin-bottom: 0; }
    .resume-item-actions { display: flex; } /* no hover on touch */

    /* Saved-list arrows + snap scrolling */
    .resume-scroller { display: flex; align-items: stretch; gap: 4px; padding: 0 4px; }
    .resume-scroller .resume-list { flex: 1; min-width: 0; scroll-snap-type: x proximity; }
    .resume-item { scroll-snap-align: start; }
    .resume-nav-arrow { display: inline-flex; align-items: center; justify-content: center; align-self: center; flex-shrink: 0; width: 44px; height: 44px; border-radius: 50%; border: 1px solid #dadce0; background: #fff; color: #3c4043; cursor: pointer; box-shadow: 0 1px 4px rgba(0,0,0,0.08); padding: 0; }
    .resume-nav-arrow:hover { color: #1a73e8; border-color: #d2e3fc; }
    .resume-nav-arrow.is-disabled { opacity: 0.3; pointer-events: none; }
    .resume-nav-arrow .material-symbols-outlined { font-size: 22px; }

    #editor-container { flex-direction: column; }
    .editor-pane, .preview-pane { width: 100%; border-right: none; max-height: none !important; flex: none; min-width: 0; }
    .editor-pane { overflow: visible; }
    .preview-pane { background: #f1f3f4; max-height: 85vh; max-height: 85dvh; padding: 16px; }
    .preview-viewport { border-radius: 8px; }
    .a4-canvas { zoom: 1 !important; margin-bottom: 24px; }

    .form-row { flex-direction: column; gap: 0; }
    .form-content { padding: 20px 16px; }
    .pane-header { padding: 12px 16px; position: static; }
    .editor-actions { padding: 12px 16px; }
    .btn-ghost, .editor-actions .btn-primary { min-height: 48px; }
}

/* ============ Consolidated from career.html (was @media max-width: 900px) ============
   Only the rules that actually won the cascade are kept here; pure duplicates
   of the 1100px block above, and rules the later-file cascade already beat,
   are dropped (see BUILD_NOTES.md). */
@media (max-width: 900px) {
    .engine-name { font-size: 0.95rem; }
    .sidebar-header { padding: 12px 16px; font-size: 0.8rem; }
    #workspace-welcome { padding: 32px 16px !important; }
    .welcome-title { font-size: 1.4rem !important; }
    .welcome-desc { font-size: 0.9rem !important; }
    .editor-pane { border-bottom: 1px solid #eef2f7; }
    .preview-pane { min-height: 50vh; }
    .form-content { padding: 16px !important; }
    .section-header-title { font-size: 1rem !important; }
    .list-item-card { padding: 12px !important; }
    .pane-header { padding: 12px 16px !important; flex-wrap: wrap; gap: 8px; }
    #resume-doc-title { width: 100% !important; }
    .editor-actions { padding: 12px 16px !important; }
}

/* ============ Phones ============ */
@media (max-width: 640px) {
    .career-container { padding: 20px 12px; }
    .form-content { padding: 16px 12px !important; }
    .ats-card { padding: 14px; }
    .list-item-card { padding: 12px; }
    .template-switch button { padding: 8px 12px; }
    .editor-actions { flex-direction: column; align-items: stretch; }
    .editor-actions > div { display: flex; gap: 8px; }
    .editor-actions .btn-ghost, .editor-actions .btn-primary { flex: 1; justify-content: center; }
    .draft-indicator { justify-content: center; }
}

@media (max-width: 480px) {
    .engine-controls .btn-surface,
    .engine-controls .btn-primary { padding: 6px 10px !important; font-size: 0.8rem !important; }
}

@media (pointer: coarse) {
    .btn-add-item { min-height: 52px; }
    .template-switch button { min-height: 44px; }
    .zoom-controls button { width: 44px; height: 44px; }
    .pan-pad button { width: 40px; height: 40px; }
}
