/* =============================================
   RESUMIST BUILDER – Main Stylesheet
   ============================================= */

:root {
    --rb-primary: #2563eb;
    --rb-primary-dark: #1d4ed8;
    --rb-primary-light: #eff6ff;
    --rb-secondary: #1e3a5f;
    --rb-accent: #f59e0b;
    --rb-success: #16a34a;
    --rb-danger: #dc2626;
    --rb-text: #1f2937;
    --rb-text-muted: #6b7280;
    --rb-border: #e5e7eb;
    --rb-bg: #f8fafc;
    --rb-white: #ffffff;
    --rb-radius: 12px;
    --rb-radius-sm: 8px;
    --rb-shadow: 0 4px 24px rgba(0,0,0,.08);
    --rb-shadow-sm: 0 2px 8px rgba(0,0,0,.06);
    --rb-font: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    --rb-font-heading: 'Poppins', 'Inter', sans-serif;
    --rb-transition: all .2s ease;
}

/* Global Reset for plugin elements */
.resumist-wrap * { box-sizing: border-box; }
.resumist-wrap { font-family: var(--rb-font); color: var(--rb-text); line-height: 1.6; }

/* Buttons */
.rb-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 22px;
    border-radius: var(--rb-radius-sm);
    font-family: var(--rb-font);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    border: 2px solid transparent;
    transition: var(--rb-transition);
    text-decoration: none;
    line-height: 1;
    white-space: nowrap;
}

.rb-btn-primary {
    background: var(--rb-primary);
    color: #fff;
    border-color: var(--rb-primary);
}
.rb-btn-primary:hover { background: var(--rb-primary-dark); border-color: var(--rb-primary-dark); color: #fff; }

.rb-btn-secondary {
    background: transparent;
    color: var(--rb-primary);
    border-color: var(--rb-primary);
}
.rb-btn-secondary:hover { background: var(--rb-primary-light); }

.rb-btn-success { background: var(--rb-success); color: #fff; border-color: var(--rb-success); }
.rb-btn-danger  { background: var(--rb-danger); color: #fff; border-color: var(--rb-danger); }
.rb-btn-lg      { padding: 14px 32px; font-size: 16px; }
.rb-btn-sm      { padding: 7px 14px; font-size: 13px; }
.rb-btn-block   { display: flex; width: 100%; justify-content: center; }

.rb-btn:disabled { opacity: .6; cursor: not-allowed; }

/* Cards */
.rb-card {
    background: var(--rb-white);
    border: 1px solid var(--rb-border);
    border-radius: var(--rb-radius);
    padding: 24px;
    box-shadow: var(--rb-shadow-sm);
    transition: var(--rb-transition);
}
.rb-card:hover { box-shadow: var(--rb-shadow); }

/* Form Elements */
.rb-form-group { margin-bottom: 18px; }
.rb-form-group label { display: block; font-size: 13px; font-weight: 600; color: var(--rb-text); margin-bottom: 6px; }
.rb-form-group label .required { color: var(--rb-danger); margin-left: 2px; }

.rb-input, .rb-textarea, .rb-select {
    width: 100%;
    padding: 10px 14px;
    border: 1.5px solid var(--rb-border);
    border-radius: var(--rb-radius-sm);
    font-family: var(--rb-font);
    font-size: 14px;
    color: var(--rb-text);
    background: var(--rb-white);
    transition: var(--rb-transition);
    outline: none;
}
.rb-input:focus, .rb-textarea:focus, .rb-select:focus {
    border-color: var(--rb-primary);
    box-shadow: 0 0 0 3px rgba(37,99,235,.12);
}
.rb-textarea { resize: vertical; min-height: 90px; }

/* Grid */
.rb-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.rb-grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.rb-grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }
@media (max-width: 768px) {
    .rb-grid-2, .rb-grid-3, .rb-grid-4 { grid-template-columns: 1fr; }
}

/* Section Heading */
.rb-section-title {
    font-family: var(--rb-font-heading);
    font-size: 28px;
    font-weight: 700;
    color: var(--rb-secondary);
    margin-bottom: 8px;
}
.rb-section-subtitle { color: var(--rb-text-muted); font-size: 15px; margin-bottom: 32px; }

/* Tabs */
.rb-tabs { display: flex; gap: 4px; background: var(--rb-bg); padding: 6px; border-radius: var(--rb-radius); margin-bottom: 24px; overflow-x: auto; }
.rb-tab {
    padding: 8px 18px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    border: none;
    background: transparent;
    color: var(--rb-text-muted);
    transition: var(--rb-transition);
    white-space: nowrap;
    font-family: var(--rb-font);
}
.rb-tab.active { background: var(--rb-white); color: var(--rb-primary); box-shadow: var(--rb-shadow-sm); font-weight: 600; }
.rb-tab-content { display: none; }
.rb-tab-content.active { display: block; }

/* Badges */
.rb-badge {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}
.rb-badge-primary { background: var(--rb-primary-light); color: var(--rb-primary); }
.rb-badge-success { background: #dcfce7; color: var(--rb-success); }
.rb-badge-warning { background: #fef3c7; color: #d97706; }

/* Alerts */
.rb-alert {
    padding: 12px 16px;
    border-radius: var(--rb-radius-sm);
    font-size: 14px;
    margin-bottom: 16px;
    display: flex;
    align-items: flex-start;
    gap: 10px;
}
.rb-alert-success { background: #dcfce7; color: #166534; border-left: 4px solid var(--rb-success); }
.rb-alert-error { background: #fee2e2; color: #991b1b; border-left: 4px solid var(--rb-danger); }
.rb-alert-info { background: var(--rb-primary-light); color: #1e40af; border-left: 4px solid var(--rb-primary); }

/* Loading Spinner */
.rb-spinner { display: inline-block; width: 18px; height: 18px; border: 2px solid rgba(255,255,255,.4); border-top-color: #fff; border-radius: 50%; animation: rb-spin .7s linear infinite; }
@keyframes rb-spin { to { transform: rotate(360deg); } }

/* Progress Bar */
.rb-progress { background: var(--rb-border); border-radius: 10px; height: 6px; overflow: hidden; }
.rb-progress-bar { background: var(--rb-primary); height: 100%; border-radius: 10px; transition: width .3s ease; }

/* Tags Input */
.rb-tags { display: flex; flex-wrap: wrap; gap: 6px; padding: 8px; border: 1.5px solid var(--rb-border); border-radius: var(--rb-radius-sm); min-height: 44px; cursor: text; }
.rb-tags.focused { border-color: var(--rb-primary); box-shadow: 0 0 0 3px rgba(37,99,235,.12); }
.rb-tag-item { background: var(--rb-primary-light); color: var(--rb-primary); padding: 3px 10px; border-radius: 20px; font-size: 13px; display: flex; align-items: center; gap: 4px; }
.rb-tag-item button { background: none; border: none; cursor: pointer; color: var(--rb-primary); padding: 0; line-height: 1; font-size: 14px; }
.rb-tags-input { border: none; outline: none; font-size: 14px; font-family: var(--rb-font); flex: 1; min-width: 120px; }

/* Notification Toast */
#rb-toast {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 99999;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.rb-toast-item {
    background: var(--rb-secondary);
    color: #fff;
    padding: 12px 20px;
    border-radius: var(--rb-radius-sm);
    font-size: 14px;
    font-weight: 500;
    box-shadow: var(--rb-shadow);
    animation: rb-slideIn .3s ease;
    max-width: 320px;
}
.rb-toast-item.success { background: var(--rb-success); }
.rb-toast-item.error { background: var(--rb-danger); }
@keyframes rb-slideIn { from { transform: translateX(100%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }

/* Hero Section */
.rb-hero {
    background: linear-gradient(135deg, var(--rb-secondary) 0%, var(--rb-primary) 100%);
    color: #fff;
    padding: 60px 40px;
    border-radius: var(--rb-radius);
    text-align: center;
    margin-bottom: 40px;
    position: relative;
    overflow: hidden;
}
.rb-hero::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -10%;
    width: 400px;
    height: 400px;
    background: rgba(255,255,255,.05);
    border-radius: 50%;
}
.rb-hero h1 { font-family: var(--rb-font-heading); font-size: 42px; font-weight: 700; margin: 0 0 12px; }
.rb-hero p { font-size: 18px; opacity: .85; margin: 0 0 28px; }
.rb-hero-btns { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.rb-hero .rb-btn { font-size: 16px; padding: 14px 32px; }

/* Email Capture */
.rb-email-capture {
    background: linear-gradient(135deg, #1e3a5f 0%, #2563eb 100%);
    border-radius: var(--rb-radius);
    padding: 48px 40px;
    text-align: center;
    color: #fff;
    margin: 40px 0;
}
.rb-email-capture h2 { font-family: var(--rb-font-heading); font-size: 32px; margin: 0 0 8px; }
.rb-email-capture p { font-size: 16px; opacity: .85; margin-bottom: 28px; }
.rb-email-form { display: flex; gap: 10px; max-width: 560px; margin: 0 auto; }
.rb-email-form .rb-input { border-color: rgba(255,255,255,.3); background: rgba(255,255,255,.15); color: #fff; }
.rb-email-form .rb-input::placeholder { color: rgba(255,255,255,.6); }
.rb-email-form .rb-input:focus { border-color: #fff; background: rgba(255,255,255,.2); }
@media (max-width: 600px) { .rb-email-form { flex-direction: column; } }

/* Job Cards */
.rb-job-card {
    background: var(--rb-white);
    border: 1px solid var(--rb-border);
    border-radius: var(--rb-radius);
    padding: 20px;
    transition: var(--rb-transition);
    cursor: pointer;
}
.rb-job-card:hover { border-color: var(--rb-primary); box-shadow: var(--rb-shadow); transform: translateY(-2px); }
.rb-job-card-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 12px; }
.rb-job-title { font-size: 16px; font-weight: 700; color: var(--rb-secondary); margin: 0; }
.rb-job-company { font-size: 14px; color: var(--rb-text-muted); }
.rb-job-meta { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 12px; }
.rb-job-meta span { font-size: 12px; color: var(--rb-text-muted); display: flex; align-items: center; gap: 4px; }

/* Salary Cards */
.rb-salary-card {
    background: var(--rb-white);
    border: 1px solid var(--rb-border);
    border-radius: var(--rb-radius);
    padding: 24px;
    text-align: center;
    transition: var(--rb-transition);
}
.rb-salary-card:hover { transform: translateY(-3px); box-shadow: var(--rb-shadow); }
.rb-salary-range { font-family: var(--rb-font-heading); font-size: 24px; font-weight: 700; color: var(--rb-primary); }
.rb-salary-role { font-size: 16px; font-weight: 600; color: var(--rb-secondary); margin: 6px 0; }
.rb-salary-location { font-size: 13px; color: var(--rb-text-muted); }

/* FAQ Accordion */
.rb-faq-item { border: 1px solid var(--rb-border); border-radius: var(--rb-radius-sm); margin-bottom: 10px; overflow: hidden; }
.rb-faq-question {
    padding: 16px 20px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--rb-white);
    transition: var(--rb-transition);
    user-select: none;
}
.rb-faq-question:hover { background: var(--rb-primary-light); color: var(--rb-primary); }
.rb-faq-question.open { background: var(--rb-primary-light); color: var(--rb-primary); }
.rb-faq-icon { font-size: 20px; font-weight: 300; transition: var(--rb-transition); }
.rb-faq-question.open .rb-faq-icon { transform: rotate(45deg); }
.rb-faq-answer { display: none; padding: 0 20px 16px; color: var(--rb-text-muted); font-size: 14px; line-height: 1.7; }
.rb-faq-answer.open { display: block; }

/* Interview Q&A */
.rb-qa-card {
    background: var(--rb-white);
    border: 1px solid var(--rb-border);
    border-radius: var(--rb-radius);
    overflow: hidden;
    margin-bottom: 16px;
}
.rb-qa-question { padding: 16px 20px; background: var(--rb-secondary); color: #fff; font-weight: 600; font-size: 15px; }
.rb-qa-answer { padding: 16px 20px; font-size: 14px; color: var(--rb-text-muted); line-height: 1.7; }

/* Guide Cards */
.rb-guide-card {
    background: var(--rb-white);
    border: 1px solid var(--rb-border);
    border-radius: var(--rb-radius);
    overflow: hidden;
    transition: var(--rb-transition);
}
.rb-guide-card:hover { transform: translateY(-4px); box-shadow: var(--rb-shadow); }
.rb-guide-img { width: 100%; height: 180px; object-fit: cover; background: linear-gradient(135deg, var(--rb-secondary), var(--rb-primary)); display: flex; align-items: center; justify-content: center; }
.rb-guide-body { padding: 20px; }
.rb-guide-category { font-size: 12px; font-weight: 600; color: var(--rb-primary); text-transform: uppercase; letter-spacing: .5px; margin-bottom: 6px; }
.rb-guide-title { font-size: 16px; font-weight: 700; color: var(--rb-secondary); margin-bottom: 8px; }
.rb-guide-excerpt { font-size: 13px; color: var(--rb-text-muted); }
.rb-guide-footer { padding: 12px 20px; border-top: 1px solid var(--rb-border); display: flex; justify-content: space-between; align-items: center; }
.rb-guide-footer a { color: var(--rb-primary); font-size: 13px; font-weight: 600; text-decoration: none; }

/* Filter Bar */
.rb-filter-bar {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 24px;
    padding: 16px;
    background: var(--rb-white);
    border: 1px solid var(--rb-border);
    border-radius: var(--rb-radius);
}
.rb-filter-bar .rb-select { width: auto; min-width: 140px; }
.rb-filter-bar .rb-input { width: auto; flex: 1; min-width: 200px; }

/* Responsive */
@media (max-width: 768px) {
    .rb-hero { padding: 40px 20px; }
    .rb-hero h1 { font-size: 28px; }
    .rb-email-capture { padding: 32px 20px; }
    .rb-email-capture h2 { font-size: 24px; }
    .rb-section-title { font-size: 22px; }
}

/* =============================================
   COVER LETTER LAYOUT (in resumist.css to ensure load)
   ============================================= */

.rb-cl-layout {
    display: grid !important;
    grid-template-columns: 400px 1fr;
    gap: 24px;
    align-items: start;
}
@media (max-width: 1100px) {
    .rb-cl-layout { grid-template-columns: 1fr !important; }
}

.rb-cl-form-panel {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0,0,0,.08);
    overflow: hidden;
    position: sticky;
    top: 20px;
}

.rb-cl-form-section {
    padding: 16px 18px;
    border-bottom: 1px solid #f0f0f0;
}
.rb-cl-form-section:last-of-type { border-bottom: none; }

.rb-cl-section-heading {
    font-size: 12px;
    font-weight: 700;
    color: #1e3a5f;
    margin: 0 0 12px;
    text-transform: uppercase;
    letter-spacing: .5px;
}

/* Cover Letter Design Selector - now a <select> dropdown inside Settings */
/* rb-cl-design-selector / rb-cl-design-thumb removed; design uses rb-select styling */

/* Modern CL mini */
.rb-cld-modern { background:#fff !important; }
.rb-cld-modern::before { content:'' !important; position:absolute !important; top:0; left:0; right:0; height:20px; background:linear-gradient(135deg,#1e3a5f,#2563eb) !important; }
.rb-cld-modern::after  { content:''; position:absolute; top:22px; left:5px; right:5px; height:2px; background:#c7d7f8; border-radius:1px; box-shadow:0 5px 0 #e5e7eb, 0 10px 0 #c7d7f8, 0 15px 0 #e5e7eb, 0 20px 0 #e5e7eb; }

/* Classic CL mini */
.rb-cld-classic { background:#fff !important; }
.rb-cld-classic::before { content:'' !important; position:absolute !important; top:8px; left:10px; right:10px; height:8px; background:#222 !important; border-radius:1px; }
.rb-cld-classic::after  { content:''; position:absolute; top:18px; left:5px; right:5px; height:1px; background:#555; box-shadow:0 7px 0 #e5e7eb, 0 13px 0 #e5e7eb, 0 19px 0 #e5e7eb, 0 25px 0 #e5e7eb; }

/* Executive CL mini */
.rb-cld-executive { background:#fff !important; }
.rb-cld-executive::before { content:'' !important; position:absolute !important; top:0; left:0; width:8px; bottom:0; background:#1e3a5f !important; }
.rb-cld-executive::after  { content:''; position:absolute; top:0; left:8px; right:0; height:20px; background:#fff; border-bottom:3px solid #c9a96e; }

/* Minimal CL mini */
.rb-cld-minimal { background:#fff !important; }
.rb-cld-minimal::before { content:'' !important; position:absolute !important; top:8px; left:7px; width:26px; height:4px; background:#111 !important; border-radius:1px; }
.rb-cld-minimal::after  { content:''; position:absolute; top:17px; left:7px; right:7px; height:1px; background:#e5e7eb; box-shadow:0 8px 0 #eee, 0 15px 0 #eee, 0 22px 0 #eee, 0 29px 0 #eee; }

/* Bold CL mini */
.rb-cld-bold { background:#fff !important; }
.rb-cld-bold::before { content:'' !important; position:absolute !important; top:0; left:0; right:0; height:22px; background:#dc2626 !important; }
.rb-cld-bold::after  { content:''; position:absolute; top:24px; left:5px; right:5px; height:2px; background:#fca5a566; box-shadow:0 6px 0 #e5e7eb, 0 12px 0 #e5e7eb, 0 18px 0 #e5e7eb; }

/* Preview Panel */
.rb-cl-preview-panel {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0,0,0,.08);
    overflow: hidden;
}

.rb-cl-preview-header {
    padding: 12px 18px;
    border-bottom: 1px solid #e5e7eb;
    background: #f9fafb;
    display: flex !important;
    align-items: center;
    justify-content: space-between;
}
.rb-cl-preview-header h3 {
    margin: 0;
    font-size: 14px;
    color: #1e3a5f;
    font-weight: 700;
}
#cl-preview-actions {
    display: flex !important;
    gap: 8px;
    align-items: center;
}

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

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

/* Generate button */
#cl-generate-btn {
    margin: 12px 18px 16px;
    width: calc(100% - 36px);
}

/* Design label in CL selector */
.rb-cl-design-selector .rb-template-name {
    font-size: 10px !important;
    font-weight: 700;
    color: #9ca3af;
    margin-top: 5px !important;
    text-transform: uppercase;
    letter-spacing: .3px;
    display: block !important;
    text-align: center;
}
.rb-cl-design-selector .rb-cl-design-thumb.active .rb-template-name {
    color: #2563eb !important;
}
