/* ============================================================
   CareerFlora — Persona Architecture & Selector Styling
   assets/css/cf-persona.css
============================================================ */

/* ── 1. Hero Persona Card (Replaces Smart Finder) ── */
.cf-hero-persona-card {
    position: relative;
    z-index: 3;
    flex: 0 0 min(470px, 42%);
    min-width: 0;
    padding: 22px 22px 20px;
    border: 1.5px solid rgba(226, 215, 210, 0.7);
    border-radius: 22px;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(16px);
    box-shadow: 0 20px 50px rgba(50, 25, 20, 0.08), 0 4px 16px rgba(0, 0, 0, 0.03);
    display: flex;
    flex-direction: column;
    gap: 13px;
    transition: border-color 0.25s ease, box-shadow 0.25s ease;
}

.cf-hero-persona-card:hover {
    border-color: #cbd5e1;
    box-shadow: 0 24px 60px rgba(50, 25, 20, 0.12), 0 6px 20px rgba(0, 0, 0, 0.04);
}

.cf-persona-card-header .hp-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--cf-red, #d62828);
    margin-bottom: 3px;
}

.cf-persona-card-header h2 {
    margin: 0;
    color: #1a202c;
    font-size: clamp(21px, 2.1vw, 26px);
    font-weight: 850;
    line-height: 1.18;
    letter-spacing: -0.025em;
}

.cf-persona-card-header p {
    margin: 4px 0 0;
    color: #5a6676;
    font-size: 12.5px;
    line-height: 1.45;
}

/* Active Persona Banner (Shown if a persona is currently selected) */
.cf-active-persona-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 9px 13px;
    background: var(--p-bg, #fef2f2);
    border: 1.5px solid var(--p-border, #fca5a5);
    border-radius: 13px;
    animation: cfFadeSlide 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes cfFadeSlide {
    from { opacity: 0; transform: translateY(-6px); }
    to { opacity: 1; transform: translateY(0); }
}

.cf-live-pulse-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    display: inline-block;
    flex-shrink: 0;
    animation: cfPulse 1.8s infinite;
}

@keyframes cfPulse {
    0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(214, 40, 40, 0.7); }
    70% { transform: scale(1); box-shadow: 0 0 0 6px rgba(214, 40, 40, 0); }
    100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(214, 40, 40, 0); }
}

.cf-active-persona-info {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.cf-active-persona-icon {
    width: 32px;
    height: 32px;
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    flex-shrink: 0;
}

.cf-active-persona-info strong {
    display: block;
    font-size: 12.5px;
    font-weight: 750;
    color: #1e293b;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.cf-active-persona-info small {
    display: block;
    font-size: 11px;
    color: #64748b;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.cf-persona-reset-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 5px 10px;
    background: #ffffff;
    border: 1px solid #cbd5e1;
    border-radius: 99px;
    font-size: 11px;
    font-weight: 700;
    color: #475569;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.18s ease;
}

.cf-persona-reset-btn:hover {
    background: #f1f5f9;
    border-color: #94a3b8;
    color: #0f172a;
    transform: rotate(-5deg);
}

/* Persona Selection Tiles Grid — Modern 2-Column Desktop Grid */
.cf-persona-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    padding: 0;
}

.cf-persona-tile {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 9px 10px;
    background: #ffffff;
    border: 1.5px solid #e8e2e0;
    border-radius: 12px;
    text-align: left;
    cursor: pointer;
    position: relative;
    font: inherit;
    transition: transform 0.18s cubic-bezier(0.16, 1, 0.3, 1), border-color 0.18s ease, background-color 0.18s ease, box-shadow 0.18s ease;
    min-width: 0;
}

.cf-persona-tile:hover {
    border-color: #cbd5e1;
    background: #fcfbfa;
    transform: translateY(-2px);
    box-shadow: 0 4px 14px rgba(30, 20, 15, 0.06);
}

.cf-persona-tile.is-active {
    border-color: var(--p-color, var(--cf-red, #d62828));
    background: var(--p-bg, #fff8f7);
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.08);
}

.cf-persona-tile-icon {
    width: 32px;
    height: 32px;
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    flex-shrink: 0;
    transition: transform 0.18s ease;
}

.cf-persona-tile:hover .cf-persona-tile-icon {
    transform: scale(1.08);
}

.cf-persona-tile-content {
    flex: 1;
    min-width: 0;
}

.cf-persona-tile-title {
    display: block;
    font-size: 12px;
    font-weight: 750;
    color: #1e293b;
    line-height: 1.25;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.cf-persona-tile-sub {
    display: block;
    font-size: 10.5px;
    color: #64748b;
    line-height: 1.3;
    margin-top: 1px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.cf-persona-check {
    width: 17px;
    height: 17px;
    border-radius: 50%;
    border: 1.5px solid #cbd5e1;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 8.5px;
    color: transparent;
    flex-shrink: 0;
    transition: all 0.18s cubic-bezier(0.16, 1, 0.3, 1);
}

.cf-persona-tile.is-active .cf-persona-check {
    border-color: var(--p-color, var(--cf-red, #d62828));
    background: var(--p-color, var(--cf-red, #d62828));
    color: #ffffff;
    transform: scale(1.05);
}

/* Action Buttons */
.cf-persona-actions {
    display: flex;
    flex-direction: column;
    gap: 7px;
    margin-top: 2px;
}

.cf-persona-apply-btn {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 11px 16px;
    background: linear-gradient(135deg, var(--cf-red, #d62828) 0%, #b91c1c 100%);
    color: #ffffff;
    border: none;
    border-radius: 12px;
    font-size: 13px;
    font-weight: 750;
    cursor: pointer;
    box-shadow: 0 4px 14px rgba(214, 40, 40, 0.22);
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.cf-persona-apply-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(214, 40, 40, 0.3);
}

.cf-persona-explore-all {
    background: none;
    border: none;
    color: #64748b;
    font-size: 11.5px;
    font-weight: 600;
    cursor: pointer;
    text-align: center;
    padding: 3px;
    transition: color 0.15s ease;
}

.cf-persona-explore-all:hover {
    color: var(--cf-red, #d62828);
    text-decoration: underline;
}

/* ── 2. Header Persona Switcher Pill ── */
.cf-header-persona-wrap {
    position: relative;
    display: inline-block;
}

.cf-header-persona-btn {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 6px 12px;
    background: #ffffff;
    border: 1.5px solid #e2e8f0;
    border-radius: 99px;
    font-size: 12px;
    font-weight: 750;
    color: #334155;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    white-space: nowrap;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.cf-header-persona-btn:hover {
    background: #f8fafc;
    border-color: #cbd5e1;
    color: #0f172a;
    transform: translateY(-1px);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.06);
}

.cf-header-persona-btn.has-persona {
    border-color: rgba(214, 40, 40, 0.25);
    background: #fff8f7;
    color: #991b1b;
}

.cf-hp-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    flex-shrink: 0;
}

.cf-hp-arrow {
    font-size: 9px;
    color: #94a3b8;
    margin-left: 2px;
    transition: transform 0.2s ease;
}

.cf-header-persona-btn[aria-expanded="true"] .cf-hp-arrow {
    transform: rotate(180deg);
}

/* Header Persona Dropdown Menu */
.cf-header-persona-menu {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    width: 310px;
    max-width: calc(100vw - 20px);
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    box-shadow: 0 16px 40px rgba(15, 23, 42, 0.12);
    z-index: 1000;
    padding: 8px;
    animation: cf-dropdown-appear 0.15s ease-out;
}

.cf-header-persona-menu[hidden] {
    display: none !important;
}

@keyframes cf-dropdown-appear {
    from { opacity: 0; transform: translateY(-4px); }
    to { opacity: 1; transform: translateY(0); }
}

.cf-hpm-head {
    padding: 8px 10px 10px;
    border-bottom: 1px solid #f1f5f9;
    margin-bottom: 6px;
}

.cf-hpm-head strong {
    display: block;
    font-size: 12.5px;
    font-weight: 800;
    color: #0f172a;
}

.cf-hpm-head small {
    display: block;
    font-size: 11px;
    color: #64748b;
    margin-top: 1px;
}

.cf-hpm-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
    max-height: 260px;
    overflow-y: auto;
}

.cf-hpm-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    border-radius: 10px;
    border: none;
    background: transparent;
    text-align: left;
    width: 100%;
    cursor: pointer;
    font: inherit;
    transition: background 0.15s ease;
}

.cf-hpm-item:hover {
    background: #f8fafc;
}

.cf-hpm-item.is-active {
    background: #fef2f2;
}

.cf-hpm-item i {
    font-size: 14px;
    width: 20px;
    text-align: center;
    flex-shrink: 0;
}

.cf-hpm-item div {
    flex: 1;
    min-width: 0;
}

.cf-hpm-item strong {
    display: block;
    font-size: 12px;
    font-weight: 700;
    color: #1e293b;
    line-height: 1.25;
}

.cf-hpm-item small {
    display: block;
    font-size: 10.5px;
    color: #64748b;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-top: 1px;
}

.cf-hpm-foot {
    margin-top: 6px;
    padding-top: 6px;
    border-top: 1px solid #f1f5f9;
}

.cf-hpm-reset {
    display: flex;
    align-items: center;
    gap: 7px;
    width: 100%;
    padding: 8px 10px;
    background: transparent;
    border: none;
    border-radius: 8px;
    font-size: 11.5px;
    font-weight: 700;
    color: #64748b;
    cursor: pointer;
    transition: all 0.15s ease;
}

.cf-hpm-reset:hover {
    background: #f1f5f9;
    color: #0f172a;
}

/* ── Category Ribbon Persona Styling & Reset Button ── */
.fk-cat-item.is-persona-focus {
    position: relative;
    font-weight: 700;
}
.fk-cat-item.cf-ribbon-reset {
    background: transparent;
    border: none;
    cursor: pointer;
    font-family: inherit;
    padding: 10px 14px 6px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}
.fk-cat-item.cf-ribbon-reset:hover .fk-cat-icon {
    background: #e2e8f0 !important;
    color: #0f172a !important;
    transform: rotate(-45deg);
    transition: transform 0.2s ease, background 0.15s ease;
}
.fk-cat-item.cf-ribbon-reset:hover .fk-cat-name {
    color: #0f172a !important;
}

/* ── 3. Page Banner Indicator (for category & search pages) ── */
.cf-persona-page-banner {
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
    padding: 10px 0;
    margin-bottom: 20px;
}

.cf-persona-page-banner-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.cf-persona-page-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 12.5px;
    font-weight: 700;
    color: #334155;
}

.cf-persona-page-badge .dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.cf-persona-page-reset {
    font-size: 12px;
    font-weight: 700;
    color: #d62828;
    background: none;
    border: none;
    cursor: pointer;
    text-decoration: underline;
}

/* ── 4. Responsive Breakpoints ── */
@media (max-width: 1099px) {
    .cf-hero-persona-card {
        order: 3;
        flex: none;
        width: 100%;
    }
}

@media (max-width: 560px) {
    .cf-hero-persona-card {
        padding: 18px 14px 16px;
        border-radius: 18px;
    }
    .cf-persona-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 7px;
    }
    .cf-header-persona-menu {
        right: 0;
        width: calc(100vw - 24px);
        max-width: 320px;
    }
}

@media (max-width: 420px) {
    .cf-persona-grid {
        grid-template-columns: 1fr;
    }
}
