/* =============================================
   RESUMIST – Resume Builder UI Styles
   ============================================= */

/* Builder Layout */
.rb-builder-wrap {
    display: grid;
    grid-template-columns: 340px 1fr;
    gap: 24px;
    min-height: 800px;
    align-items: start;
}

@media (max-width: 1024px) {
    .rb-builder-wrap { grid-template-columns: 1fr; }
}

/* Editor Panel */
.rb-editor-panel {
    background: var(--rb-white);
    border: 1px solid var(--rb-border);
    border-radius: var(--rb-radius);
    box-shadow: var(--rb-shadow-sm);
    position: sticky;
    top: 20px;
    overflow: hidden;
}

.rb-editor-header {
    background: var(--rb-secondary);
    color: #fff;
    padding: 16px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.rb-editor-header h3 { margin: 0; font-size: 15px; font-family: var(--rb-font-heading); }

.rb-editor-sections { padding: 12px; }
.rb-section-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 10px 12px;
    border: none;
    background: transparent;
    border-radius: 8px;
    cursor: pointer;
    font-family: var(--rb-font);
    font-size: 14px;
    font-weight: 500;
    color: var(--rb-text);
    transition: var(--rb-transition);
    text-align: left;
}
.rb-section-btn:hover { background: var(--rb-primary-light); color: var(--rb-primary); }
.rb-section-btn.active { background: var(--rb-primary-light); color: var(--rb-primary); font-weight: 600; }
.rb-section-btn .rb-section-icon { width: 28px; height: 28px; border-radius: 6px; background: var(--rb-bg); display: flex; align-items: center; justify-content: center; font-size: 14px; }
.rb-section-btn.active .rb-section-icon { background: var(--rb-primary); }

.rb-section-complete { margin-left: auto; color: var(--rb-success); font-size: 16px; }

/* Section Form */
.rb-section-form { padding: 20px; display: none; }
.rb-section-form.active { display: block; }
.rb-section-form h4 {
    font-family: var(--rb-font-heading);
    font-size: 16px;
    color: var(--rb-secondary);
    margin: 0 0 16px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--rb-primary-light);
}

/* Repeater */
.rb-repeater-item {
    background: var(--rb-bg);
    border: 1px solid var(--rb-border);
    border-radius: var(--rb-radius-sm);
    padding: 16px;
    margin-bottom: 12px;
    position: relative;
}
.rb-repeater-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    cursor: pointer;
}
.rb-repeater-title { font-size: 14px; font-weight: 600; color: var(--rb-text); }
.rb-repeater-actions { display: flex; gap: 6px; }
.rb-remove-btn {
    background: #fee2e2;
    color: var(--rb-danger);
    border: none;
    border-radius: 6px;
    padding: 4px 10px;
    font-size: 13px;
    cursor: pointer;
    font-family: var(--rb-font);
}
.rb-remove-btn:hover { background: var(--rb-danger); color: #fff; }
.rb-add-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    background: none;
    border: 2px dashed var(--rb-border);
    border-radius: var(--rb-radius-sm);
    padding: 10px;
    width: 100%;
    cursor: pointer;
    color: var(--rb-text-muted);
    font-size: 14px;
    font-family: var(--rb-font);
    transition: var(--rb-transition);
    justify-content: center;
}
.rb-add-btn:hover { border-color: var(--rb-primary); color: var(--rb-primary); background: var(--rb-primary-light); }

/* Range Input (skill level) */
.rb-range { width: 100%; accent-color: var(--rb-primary); }

/* Preview Panel */
.rb-preview-panel {
    background: var(--rb-white);
    border: 1px solid var(--rb-border);
    border-radius: var(--rb-radius);
    box-shadow: var(--rb-shadow-sm);
    overflow: hidden;
}

.rb-preview-header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--rb-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--rb-bg);
}
.rb-preview-header h3 { margin: 0; font-size: 15px; color: var(--rb-secondary); font-family: var(--rb-font-heading); }
.rb-preview-actions { display: flex; gap: 8px; }

.rb-preview-frame {
    padding: 30px;
    min-height: 700px;
    background: #f1f5f9;
    overflow: auto;
}

/* Template Selector */
.rb-template-selector {
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    gap: 6px;
    padding: 10px;
    border-bottom: 1px solid var(--rb-border);
    background: var(--rb-bg);
}
.rb-template-thumb {
    border: 2px solid var(--rb-border);
    border-radius: 6px;
    padding: 6px;
    cursor: pointer;
    transition: var(--rb-transition);
    text-align: center;
}
.rb-template-thumb:hover  { border-color: var(--rb-primary); transform: translateY(-2px); box-shadow: 0 4px 12px rgba(37,99,235,.15); }
.rb-template-thumb.active { border-color: var(--rb-primary); box-shadow: 0 0 0 3px rgba(37,99,235,.2); background: #fff; }
.rb-template-preview-mini {
    width: 100%; height: 72px; border-radius: 3px; overflow: hidden;
    position: relative; display: block; background: #fff; border: 1px solid #f0f0f0;
}
/* Modern */
.rb-tpl-modern::before { content: ''; position: absolute; top: 0; left: 0; right: 0; height: 18px; background: linear-gradient(90deg,#1e3a5f,#2563eb); }
.rb-tpl-modern::after  { content: ''; position: absolute; top: 22px; left: 5px; right: 5px; height: 2px; background: #c7d7f8; border-radius: 2px; box-shadow: 0 5px 0 #e5e7eb, 0 10px 0 #c7d7f8, 0 15px 0 #e5e7eb, 0 20px 0 #c7d7f8, 0 25px 0 #eff6ff, 0 30px 0 #eff6ff, 0 35px 0 #eff6ff, 0 40px 0 #eff6ff; }
/* Classic */
.rb-tpl-classic::before { content: ''; position: absolute; top: 7px; left: 12px; right: 12px; height: 8px; background: #222; border-radius: 1px; }
.rb-tpl-classic::after  { content: ''; position: absolute; top: 20px; left: 5px; right: 5px; height: 1px; background: #333; box-shadow: 0 6px 0 #e5e7eb, 0 12px 0 #e5e7eb, 0 18px 0 #e5e7eb, 0 24px 0 #e5e7eb, 0 30px 0 #e5e7eb, 0 36px 0 #e5e7eb; }
/* Executive */
.rb-tpl-executive::before { content: ''; position: absolute; top: 0; left: 0; right: 0; height: 22px; background: #1e3a5f; }
.rb-tpl-executive::after  { content: ''; position: absolute; top: 26px; left: 5px; right: 5px; height: 2px; background: #e5e7eb; border-radius: 2px; box-shadow: 0 7px 0 #e5e7eb, 0 14px 0 #e5e7eb, 0 21px 0 #e5e7eb, 0 28px 0 #e5e7eb, 0 35px 0 #e5e7eb; }
/* Minimal */
.rb-tpl-minimal::before { content: ''; position: absolute; top: 9px; left: 7px; width: 30px; height: 5px; background: #111; border-radius: 1px; }
.rb-tpl-minimal::after  { content: ''; position: absolute; top: 20px; left: 7px; right: 7px; height: 1px; background: #ddd; box-shadow: 0 9px 0 #eee, 0 16px 0 #eee, 0 23px 0 #eee, 0 30px 0 #eee, 0 37px 0 #eee, 0 44px 0 #eee; }
/* Creative */
.rb-tpl-creative::before { content: ''; position: absolute; top: 0; left: 0; width: 20px; bottom: 0; background: #1e3a5f; }
.rb-tpl-creative::after  { content: ''; position: absolute; top: 8px; left: 25px; right: 5px; height: 2px; background: #e5e7eb; box-shadow: 0 8px 0 #e5e7eb, 0 16px 0 #e5e7eb, 0 24px 0 #eff6ff, 0 32px 0 #eff6ff, 0 40px 0 #eff6ff, 0 48px 0 #eff6ff; }
.rb-template-name { font-size: 10px; color: var(--rb-text-muted); margin-top: 5px; font-weight: 600; text-transform: uppercase; letter-spacing: .3px; }
.rb-template-thumb.active .rb-template-name { color: var(--rb-primary); }
/* Elegant – rose gold */
.rb-tpl-elegant::before { content: ''; position: absolute; top: 0; left: 0; right: 0; height: 5px; background: linear-gradient(90deg,#c9a96e,#e8c99e,#c9a96e); }
.rb-tpl-elegant::after  { content: ''; position: absolute; top: 13px; left: 10px; right: 10px; height: 7px; background: #2c1a0e; border-radius: 1px; box-shadow: 0 10px 0 #e5e7eb, 0 18px 0 #e5e7eb, 0 26px 0 #e5e7eb, 0 34px 0 #e5e7eb, 0 42px 0 #e5e7eb; }
/* Tech – dark */
.rb-tpl-tech { background: #0f172a !important; border-color: #334155 !important; }
.rb-tpl-tech::before { content: ''; position: absolute; top: 6px; left: 6px; right: 6px; height: 14px; background: #1e293b; border-radius: 3px; border: 1px solid #334155; }
.rb-tpl-tech::after  { content: ''; position: absolute; top: 26px; left: 6px; right: 6px; height: 2px; background: #22d3ee44; border-radius: 1px; box-shadow: 0 7px 0 #334155, 0 14px 0 #334155, 0 21px 0 #334155, 0 28px 0 #334155, 0 35px 0 #22d3ee44; }
/* Timeline – green */
.rb-tpl-timeline::before { content: ''; position: absolute; top: 0; left: 0; width: 4px; bottom: 0; background: #16a34a; }
.rb-tpl-timeline::after  { content: ''; position: absolute; top: 10px; left: 12px; right: 6px; height: 2px; background: #e5e7eb; box-shadow: 0 9px 0 #e5e7eb, 0 18px 0 #dcfce7, 0 27px 0 #e5e7eb, 0 36px 0 #dcfce7, 0 45px 0 #e5e7eb; }

/* Resume Live Preview */
.rb-resume-preview {
    background: #fff;
    box-shadow: 0 4px 32px rgba(0,0,0,.15);
    width: 100%;
    max-width: 680px;
    margin: 0 auto;
    min-height: 900px;
    font-family: 'Helvetica Neue', Arial, sans-serif;
    font-size: 11pt;
    color: #333;
}

/* Completion Bar */
.rb-completion-bar {
    padding: 12px 20px;
    background: var(--rb-white);
    border-bottom: 1px solid var(--rb-border);
}
.rb-completion-info { display: flex; justify-content: space-between; font-size: 12px; color: var(--rb-text-muted); margin-bottom: 6px; }
.rb-completion-info strong { color: var(--rb-primary); }

/* Download Modal */
.rb-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.5);
    z-index: 99998;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(4px);
}
.rb-modal {
    background: var(--rb-white);
    border-radius: var(--rb-radius);
    padding: 32px;
    max-width: 480px;
    width: 90%;
    box-shadow: 0 20px 60px rgba(0,0,0,.2);
    animation: rb-modalIn .3s ease;
}
@keyframes rb-modalIn { from { transform: scale(.9); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.rb-modal h3 { font-family: var(--rb-font-heading); color: var(--rb-secondary); margin: 0 0 6px; }
.rb-modal p { color: var(--rb-text-muted); font-size: 14px; margin-bottom: 24px; }

.rb-download-options { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.rb-download-option {
    border: 2px solid var(--rb-border);
    border-radius: var(--rb-radius-sm);
    padding: 16px;
    text-align: center;
    cursor: pointer;
    transition: var(--rb-transition);
}
.rb-download-option:hover { border-color: var(--rb-primary); background: var(--rb-primary-light); }
.rb-download-option .rb-dl-icon { font-size: 32px; margin-bottom: 8px; display: block; }
.rb-download-option span { font-size: 14px; font-weight: 600; color: var(--rb-text); }
.rb-download-option small { display: block; color: var(--rb-text-muted); font-size: 12px; }

/* Cover Letter Builder */
.rb-cover-wrap { max-width:100%; margin: 0 auto; }
.rb-cover-output {
    background: var(--rb-white);
    border: 1px solid var(--rb-border);
    border-radius: var(--rb-radius);
    padding: 32px 40px;
    margin-top: 24px;
    white-space: pre-wrap;
    font-family: Georgia, serif;
    font-size: 14px;
    line-height: 1.8;
    color: var(--rb-text);
    min-height: 400px;
    position: relative;
}
.rb-cover-output-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 16px;
}


/* =============================================
   COVER LETTER GENERATOR LAYOUT
   ============================================= */

.rb-cl-layout {
    display: grid;
    grid-template-columns: 400px 1fr;
    gap: 24px;
    align-items: start;
}

@media (max-width: 1100px) {
    .rb-cl-layout { grid-template-columns: 1fr; }
}

/* Form Panel */
.rb-cl-form-panel {
    background: var(--rb-white);
    border: 1px solid var(--rb-border);
    border-radius: var(--rb-radius);
    box-shadow: var(--rb-shadow-sm);
    overflow: hidden;
    position: sticky;
    top: 20px;
}

.rb-cl-form-section {
    padding: 18px 20px;
    border-bottom: 1px solid var(--rb-border);
}
.rb-cl-form-section:last-child { border-bottom: none; }

.rb-cl-section-heading {
    font-family: var(--rb-font-heading);
    font-size: 13px;
    font-weight: 700;
    color: var(--rb-secondary);
    margin: 0 0 14px;
    text-transform: uppercase;
    letter-spacing: .5px;
}

/* Design Picker */
.rb-cl-design-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 8px;
}

.rb-cl-design-thumb {
    border: 2px solid var(--rb-border);
    border-radius: 6px;
    padding: 4px;
    cursor: pointer;
    text-align: center;
    background: var(--rb-white);
    transition: var(--rb-transition);
}
.rb-cl-design-thumb:hover  { border-color: var(--rb-primary); transform: translateY(-2px); }
.rb-cl-design-thumb.active { border-color: var(--rb-primary); box-shadow: 0 0 0 3px rgba(37,99,235,.15); }
.rb-cl-design-thumb span   { font-size: 9px; font-weight: 600; color: var(--rb-text-muted); display: block; margin-top: 4px; text-transform: uppercase; letter-spacing: .3px; }
.rb-cl-design-thumb.active span { color: var(--rb-primary); }

/* Design mini previews */
.rb-cl-design-mini {
    width: 100%;
    height: 60px;
    border-radius: 3px;
    position: relative;
    overflow: hidden;
    background: #fff;
    border: 1px solid #f0f0f0;
    display: block;
}

/* Modern CL */
.rb-cld-modern::before { content:''; position:absolute; top:0; left:0; right:0; height:20px; background:linear-gradient(135deg,#1e3a5f,#2563eb); }
.rb-cld-modern::after  { content:''; position:absolute; top:24px; left:6px; right:6px; height:2px; background:#c7d7f8; box-shadow:0 6px 0 #e5e7eb, 0 12px 0 #e5e7eb, 0 18px 0 #c7d7f8, 0 24px 0 #e5e7eb, 0 30px 0 #e5e7eb; }

/* Classic CL */
.rb-cld-classic::before { content:''; position:absolute; top:7px; left:12px; right:12px; height:8px; background:#222; border-radius:1px; }
.rb-cld-classic::after  { content:''; position:absolute; top:20px; left:6px; right:6px; height:1px; background:#333; box-shadow:0 8px 0 #e5e7eb, 0 15px 0 #e5e7eb, 0 22px 0 #e5e7eb, 0 29px 0 #e5e7eb; }

/* Executive CL */
.rb-cld-executive::before { content:''; position:absolute; top:0; left:0; width:8px; bottom:0; background:#1e3a5f; }
.rb-cld-executive::after  { content:''; position:absolute; top:0; left:8px; right:0; height:22px; background:#fff; border-bottom:4px solid #c9a96e; box-shadow:inset 0 0 0 0 transparent; }

/* Minimal CL */
.rb-cld-minimal::before { content:''; position:absolute; top:8px; left:8px; width:28px; height:5px; background:#111; border-radius:1px; }
.rb-cld-minimal::after  { content:''; position:absolute; top:19px; left:8px; right:8px; height:1px; background:#e5e7eb; box-shadow:0 9px 0 #eee, 0 17px 0 #eee, 0 25px 0 #eee, 0 33px 0 #eee; }

/* Bold CL */
.rb-cld-bold::before { content:''; position:absolute; top:0; left:0; right:0; height:22px; background:#dc2626; }
.rb-cld-bold::after  { content:''; position:absolute; top:26px; left:6px; right:6px; height:2px; background:#fca5a544; box-shadow:0 7px 0 #e5e7eb, 0 14px 0 #e5e7eb, 0 21px 0 #e5e7eb, 0 28px 0 #e5e7eb; }

/* Generate button full width */
.rb-cl-form-section > .rb-btn-block { margin: 4px 0; }
#cl-generate-btn { margin: 16px 20px; width: calc(100% - 40px); display: flex; }

/* Preview Panel */
.rb-cl-preview-panel {
    background: var(--rb-white);
    border: 1px solid var(--rb-border);
    border-radius: var(--rb-radius);
    box-shadow: var(--rb-shadow-sm);
    overflow: hidden;
}

.rb-cl-preview-header {
    padding: 14px 20px;
    border-bottom: 1px solid var(--rb-border);
    background: var(--rb-bg);
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.rb-cl-preview-header h3 { margin: 0; font-size: 14px; color: var(--rb-secondary); font-family: var(--rb-font-heading); }
.rb-cl-preview-header > div { display: flex; gap: 8px; }

.rb-cl-preview-frame {
    min-height: 700px;
    background: #f1f5f9;
    padding: 24px;
    overflow: auto;
}

#cl-rendered {
    background: #fff;
    box-shadow: 0 4px 32px rgba(0,0,0,.12);
    max-width: 720px;
    margin: 0 auto;
    min-height: 800px;
}
