/* ==========================================================================
   CareerFlora Resume Studio — Integrated Header, Footer & Dark-Mode Polish
   ========================================================================== */

:root {
    --rs-surface: #ffffff;
    --rs-surface-2: #f8fafc;
    --rs-border: #e2e8f0;
    --rs-text: #0f172a;
    --rs-muted: #475569;
    --rs-brand: #d62828;
    --rs-brand-soft: rgba(214, 40, 40, 0.08);
    --rs-brand-border: rgba(214, 40, 40, 0.24);
}

html[data-cf-theme="dark"] {
    --rs-surface: #111a2e;
    --rs-surface-2: #0b1120;
    --rs-border: #22304d;
    --rs-text: #f1f5f9;
    --rs-muted: #94a3b8;
    --rs-brand: #ef4444;
    --rs-brand-soft: rgba(239, 68, 68, 0.14);
    --rs-brand-border: rgba(239, 68, 68, 0.32);
    --bg: #0b1120;
    --ink: #f1f5f9;
    --mut: #94a3b8;
    --line: #22304d;
    --cf: #ef4444;
    --cf-dark: #dc2626;
    --cf-soft: rgba(239, 68, 68, 0.16);
}

/* Keep main-header, sticky builder panels, & main-footer aligned cleanly with CareerFlora */
html, body {
    overflow-x: clip !important;
    scroll-padding-top: 84px;
}

body {
    background: var(--rs-surface-2);
    color: var(--rs-text);
}

.main-header .header-inner {
    min-height: 70px;
}

.wrap {
    width: min(1240px, calc(100% - 32px));
}

.rb-panel {
    top: 86px;
    max-height: calc(100vh - 104px);
}

.rb-toolbar {
    top: 74px;
}

/* Studio Quick Sub-Header Bar */
.rb-studio-bar {
    background: var(--rs-surface);
    border-bottom: 1px solid var(--rs-border);
    padding: 10px 0;
    box-shadow: 0 2px 10px rgba(15, 23, 42, 0.03);
}

.rb-studio-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    flex-wrap: wrap;
}

.rb-studio-brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
}

.rb-studio-badge {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    background: var(--rs-brand-soft);
    border: 1px solid var(--rs-brand-border);
    color: var(--rs-brand);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 15px;
    flex-shrink: 0;
}

.rb-studio-title {
    display: flex;
    flex-direction: column;
    line-height: 1.2;
}

.rb-studio-title strong {
    font-size: 14.5px;
    font-weight: 800;
    color: var(--rs-text);
}

.rb-studio-title strong span {
    color: var(--rs-brand);
}

.rb-studio-title small {
    font-size: 11px;
    font-weight: 600;
    color: var(--rs-muted);
}

.rb-studio-nav {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.rb-studio-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6.5px 12px;
    border-radius: 999px;
    border: 1px solid var(--rs-border);
    background: var(--rs-surface-2);
    color: var(--rs-muted);
    font-size: 12.5px;
    font-weight: 700;
    text-decoration: none;
    transition: all 0.16s ease;
}

.rb-studio-link:hover,
.rb-studio-link.is-active {
    background: var(--rs-brand-soft);
    border-color: var(--rs-brand-border);
    color: var(--rs-brand);
}

.rb-studio-cta {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 8px 15px;
    border-radius: 10px;
    background: var(--rs-brand);
    color: #ffffff;
    font-size: 13px;
    font-weight: 700;
    text-decoration: none;
    box-shadow: 0 4px 12px rgba(214, 40, 40, 0.2);
    transition: background 0.16s ease, transform 0.16s ease;
}

.rb-studio-cta:hover {
    background: #b81d1d;
    color: #ffffff;
    transform: translateY(-1px);
}

/* Hero Enhancement inside .wrap */
.rb-hero {
    background:
        radial-gradient(circle at 92% 16%, rgba(214, 40, 40, 0.08), transparent 44%),
        linear-gradient(135deg, var(--rs-surface) 0%, var(--rs-surface-2) 100%);
    border: 1px solid var(--rs-border);
    border-radius: 18px;
    padding: 30px 28px;
    margin: 22px 0 22px;
    box-shadow: 0 4px 18px rgba(15, 23, 42, 0.04);
}

.rb-hero h1 {
    color: var(--rs-text) !important;
}

.rb-hero h1 span {
    color: var(--rs-brand) !important;
}

.rb-hero p {
    color: var(--rs-muted) !important;
}

html[data-cf-theme="dark"] .rb-hero {
    background:
        radial-gradient(circle at 92% 16%, rgba(239, 68, 68, 0.16), transparent 44%),
        linear-gradient(135deg, #111a2e 0%, #0b1120 100%) !important;
    border: 1px solid var(--rs-border) !important;
    color: var(--rs-text) !important;
}

html[data-cf-theme="dark"] .rb-hero :is(h1, h2, h3) {
    color: var(--rs-text) !important;
}

html[data-cf-theme="dark"] .rb-hero h1 span {
    color: var(--rs-brand) !important;
}

html[data-cf-theme="dark"] .rb-hero p {
    color: var(--rs-muted) !important;
}

.rb-trust-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 16px;
}

.rb-trust-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 11px;
    border-radius: 999px;
    background: var(--rs-surface-2);
    border: 1px solid var(--rs-border);
    color: var(--rs-muted);
    font-size: 12px;
    font-weight: 700;
}

.rb-trust-pill i {
    color: var(--rs-brand);
}

/* Ensure gallery cards & filter bars harmonize with CareerFlora crimson accent + dark mode */
.btn-primary {
    background: var(--rs-brand);
}

.btn-primary:hover {
    background: #b81d1d;
}

.btn-ghost {
    background: var(--rs-surface);
    color: var(--rs-text);
    border-color: var(--rs-border);
}

.btn-ghost:hover {
    border-color: var(--rs-brand);
    color: var(--rs-brand);
}

html[data-cf-theme="dark"] .gallery-tools,
html[data-cf-theme="dark"] .rb-card,
html[data-cf-theme="dark"] .rb-panel,
html[data-cf-theme="dark"] .entry,
html[data-cf-theme="dark"] .ats-card,
html[data-cf-theme="dark"] .photo-editor,
html[data-cf-theme="dark"] .preview-dialog {
    background: var(--rs-surface);
    border-color: var(--rs-border);
    color: var(--rs-text);
}

html[data-cf-theme="dark"] .gallery-tools input,
html[data-cf-theme="dark"] .gallery-tools select,
html[data-cf-theme="dark"] .fld input,
html[data-cf-theme="dark"] .fld textarea,
html[data-cf-theme="dark"] .fld select {
    background: var(--rs-surface-2);
    border-color: var(--rs-border);
    color: var(--rs-text);
}

html[data-cf-theme="dark"] .rb-card-info > strong,
html[data-cf-theme="dark"] .gallery-summary strong,
html[data-cf-theme="dark"] .panel-top h1 {
    color: var(--rs-text);
}

html[data-cf-theme="dark"] .rb-card-meta,
html[data-cf-theme="dark"] .gallery-tools label,
html[data-cf-theme="dark"] .fld span,
html[data-cf-theme="dark"] .gallery-summary,
html[data-cf-theme="dark"] .muted,
html[data-cf-theme="dark"] .privacy-note {
    color: var(--rs-muted);
}

html[data-cf-theme="dark"] .rb-card-info .card-actions .favorite-btn {
    background: var(--rs-surface-2);
    border-color: var(--rs-border);
    color: #fda4af;
}

html[data-cf-theme="dark"] .rb-stage {
    background: #17223a;
}

html[data-cf-theme="dark"] .preview-head,
html[data-cf-theme="dark"] .preview-foot,
html[data-cf-theme="dark"] .rb-toolbar,
html[data-cf-theme="dark"] .rb-card-tags span,
html[data-cf-theme="dark"] .chip,
html[data-cf-theme="dark"] .pill {
    background: var(--rs-surface);
    border-color: var(--rs-border);
    color: var(--rs-text);
}

html[data-cf-theme="dark"] .rb-panel h2,
html[data-cf-theme="dark"] .rb-panel h3,
html[data-cf-theme="dark"] .preview-head strong {
    color: var(--rs-text);
}

html[data-cf-theme="dark"] .rb-card-thumb {
    background: #17223a;
    border-bottom-color: var(--rs-border);
}

html[data-cf-theme="dark"] .export-menu-panel,
html[data-cf-theme="dark"] .pagination button,
html[data-cf-theme="dark"] .dialog-close,
html[data-cf-theme="dark"] .preview-dialog-actions,
html[data-cf-theme="dark"] .preview-zoom-row,
html[data-cf-theme="dark"] .search-box {
    background: var(--rs-surface);
    border-color: var(--rs-border);
    color: var(--rs-text);
}

html[data-cf-theme="dark"] .pagination button.active {
    background: var(--rs-brand);
    border-color: var(--rs-brand);
    color: #ffffff;
}

/* Override site-wide .pagination span { width: 38px; height: 38px } collision on #pageInfo */
.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 28px;
    padding: 4px 0 36px;
}

.pagination #pageInfo {
    width: auto !important;
    min-width: 112px;
    height: auto !important;
    min-height: 40px;
    padding: 8px 18px !important;
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    border-radius: 999px !important;
    background: var(--rs-surface) !important;
    border: 1px solid var(--rs-border) !important;
    color: var(--rs-muted) !important;
    font-size: 13px !important;
    font-weight: 700 !important;
    line-height: 1.25 !important;
    white-space: nowrap !important;
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.04) !important;
}

.pagination .btn {
    min-height: 40px;
    padding: 8px 16px;
    border-radius: 10px;
    font-weight: 700;
}

@media (max-width: 640px) {
    .rb-hero {
        padding: 22px 18px;
        margin: 16px 0;
    }
    .rb-studio-nav {
        width: 100%;
    }
}
