/* =============================================================================
   JP Jobs — Favorites  |  favorites.css  |  v1.0.0
   ============================================================================= */

/* ── Card wrapper injected by JS ── */
.jp-fav-card-wrap {
    position: relative;
    display: block;
}

/* ── Heart button on each listing ── */
.jp-fav-btn {
    position: absolute;
    top: .85rem;
    right: 1rem;
    z-index: 2;
    width: 34px;
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, .92);
    border: 1.5px solid #e5e7eb;
    border-radius: 50%;
    font-size: 1.1rem;
    line-height: 1;
    color: #9ca3af;
    cursor: pointer;
    padding: 0;
    transition: color .15s, border-color .15s, transform .15s, box-shadow .15s;
    backdrop-filter: blur(4px);
}

.jp-fav-btn:hover {
    color: #ef4444;
    border-color: #fca5a5;
    box-shadow: 0 2px 8px rgba(239, 68, 68, .15);
    transform: scale(1.1);
}

.jp-fav-btn.is-saved {
    color: #ef4444;
    border-color: #fca5a5;
    background: #fff5f5;
}

/* Pop animation on save */
.jp-fav-btn.jp-fav-pop {
    animation: jp-fav-pop .3s cubic-bezier(.36, .07, .19, .97);
}

@keyframes jp-fav-pop {
    0%   { transform: scale(1); }
    40%  { transform: scale(1.35); }
    70%  { transform: scale(.9); }
    100% { transform: scale(1); }
}

/* ── Trigger button ── */
.jp-fav-trigger-wrap {
    margin-bottom: .75rem;
}

.jp-fav-trigger {
    display: flex;
    align-items: center;
    gap: .5rem;
    width: 100%;
    justify-content: center;
}

.jp-fav-trigger-icon {
    font-size: 1.1rem;
    line-height: 1;
    transition: color .15s;
}

.jp-fav-trigger-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    height: 20px;
    padding: 0 5px;
    background: #e5e7eb;
    color: #6b7280;
    border-radius: 10px;
    font-size: .75rem;
    font-weight: 700;
    transition: background .2s, color .2s;
}

.jp-fav-trigger-count.has-items {
    background: #ef4444;
    color: #fff;
}

/* ── Overlay ── */
.jp-fav-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, .35);
    z-index: 999;
    backdrop-filter: blur(2px);
    animation: jp-fav-fade-in .2s ease;
}

@keyframes jp-fav-fade-in {
    from { opacity: 0; }
    to   { opacity: 1; }
}

/* ── Slide-in panel ── */
.jp-fav-panel {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    width: min(380px, 94vw);
    background: #fff;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    box-shadow: -4px 0 24px rgba(0, 0, 0, .12);
    animation: jp-fav-slide-in .22s cubic-bezier(.22, .61, .36, 1);
}

@keyframes jp-fav-slide-in {
    from { transform: translateX(100%); }
    to   { transform: translateX(0); }
}

.jp-fav-panel[hidden] {
    display: none;
}

.jp-fav-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid #f3f4f6;
    flex-shrink: 0;
}

.jp-fav-panel-title {
    font-size: 1.1rem;
    font-weight: 700;
    margin: 0;
    color: #111827;
}

.jp-fav-panel-close {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    line-height: 1;
    background: none;
    border: none;
    color: #9ca3af;
    cursor: pointer;
    border-radius: 6px;
    padding: 0;
    transition: background .15s, color .15s;
}

.jp-fav-panel-close:hover {
    background: #f3f4f6;
    color: #111827;
}

/* ── Favorites list inside panel ── */
.jp-fav-list {
    flex: 1;
    overflow-y: auto;
    padding: 1rem 1.5rem;
}

.jp-fav-empty {
    color: #9ca3af;
    text-align: center;
    margin-top: 2rem;
    font-size: .95rem;
}

.jp-fav-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .75rem;
    padding: .85rem 0;
    border-bottom: 1px solid #f3f4f6;
}

.jp-fav-item:last-child {
    border-bottom: none;
}

.jp-fav-item-info {
    flex: 1;
    min-width: 0;
}

.jp-fav-item-title {
    font-size: .9rem;
    font-weight: 600;
    color: #111827;
    margin: 0 0 .2rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.jp-fav-item-company {
    font-size: .8rem;
    color: #9ca3af;
    margin: 0;
}

.jp-fav-item-actions {
    display: flex;
    align-items: center;
    gap: .4rem;
    flex-shrink: 0;
}

.jp-fav-item-view {
    font-size: .8rem;
    padding: .3rem .65rem;
    white-space: nowrap;
}

.jp-fav-item-remove {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    background: none;
    border: none;
    color: #d1d5db;
    cursor: pointer;
    border-radius: 6px;
    padding: 0;
    transition: background .15s, color .15s;
}

.jp-fav-item-remove:hover {
    background: #fef2f2;
    color: #ef4444;
}

/* Prevent body scroll when panel is open */
body.jp-fav-open {
    overflow: hidden;
}
