/* =============================================================================
 * JR ATS Core — Following Shortcode Stylesheet
 *
 * Surface: [jr_employee_following] (3-tab layout)
 *   Tab 1 — Companies the candidate follows
 *   Tab 2 — Other candidates the candidate follows
 *   Tab 3 — Candidates following the current candidate
 *
 * Brand color: #5277ba (primary)
 * Light tint:  #eef2fb (info background)
 * Border tint: #c7d4ec (info border)
 * Hover tint:  #3d5a92 (deeper brand)
 *
 * RTL: works automatically via logical-position properties where possible.
 * No external dependencies. Scoped under .jrats-following-wrap to avoid
 * leakage into theme styles.
 * ============================================================================= */

.jrats-following-wrap {
    box-sizing: border-box;
    width: 100%;
    max-width: 100%;
    margin: 0;
    padding: 0;
    font-family: inherit;
    color: #1f2937;
}

.jrats-following-wrap *,
.jrats-following-wrap *::before,
.jrats-following-wrap *::after {
    box-sizing: border-box;
}

/* -----------------------------------------------------------------------------
 * Header card (title + counter)
 * --------------------------------------------------------------------------- */

.jrats-following-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
    padding: 16px 20px;
    margin: 0 0 16px 0;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
}

.jrats-following-header__title {
    margin: 0 0 4px 0;
    font-size: 18px;
    font-weight: 600;
    color: #111827;
}

.jrats-following-header__subtitle {
    margin: 0;
    font-size: 13px;
    color: #6b7280;
}

.jrats-following-header__counter {
    text-align: center;
    min-width: 96px;
    padding: 10px 16px;
    background: #eef2fb;
    border: 1px solid #c7d4ec;
    border-radius: 8px;
}

.jrats-following-header__counter-number {
    font-size: 24px;
    font-weight: 700;
    color: #5277ba;
    line-height: 1;
}

.jrats-following-header__counter-label {
    font-size: 11px;
    color: #3d5a92;
    margin-top: 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* -----------------------------------------------------------------------------
 * Tab navigation
 * --------------------------------------------------------------------------- */

.jrats-following-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 0;
    margin: 0 0 0 0;
    padding: 0;
    list-style: none;
    border-bottom: 2px solid #e5e7eb;
}

.jrats-following-tab {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    margin: 0;
    text-decoration: none;
    color: #6b7280;
    font-size: 14px;
    font-weight: 500;
    background: transparent;
    border: none;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    cursor: pointer;
    transition: color 0.15s ease, border-color 0.15s ease;
}

.jrats-following-tab:hover,
.jrats-following-tab:focus {
    color: #5277ba;
    outline: none;
}

.jrats-following-tab.is-active {
    color: #5277ba;
    border-bottom-color: #5277ba;
    font-weight: 600;
}

.jrats-following-tab__badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 22px;
    height: 22px;
    padding: 0 7px;
    font-size: 11px;
    font-weight: 600;
    color: #5277ba;
    background: #eef2fb;
    border-radius: 11px;
    line-height: 1;
}

.jrats-following-tab.is-active .jrats-following-tab__badge {
    color: #ffffff;
    background: #5277ba;
}

/* -----------------------------------------------------------------------------
 * Tab panels
 * --------------------------------------------------------------------------- */

.jrats-following-panel {
    display: none;
    padding: 20px 0 0 0;
}

.jrats-following-panel.is-active {
    display: block;
}

/* -----------------------------------------------------------------------------
 * Status messages (followed/unfollowed/error/etc.)
 * --------------------------------------------------------------------------- */

.jrats-following-status {
    padding: 12px 16px;
    margin: 0 0 16px 0;
    border-radius: 6px;
    font-size: 14px;
    line-height: 1.5;
}

.jrats-following-status--success {
    color: #15803d;
    background: #f0fdf4;
    border: 1px solid #86efac;
}

.jrats-following-status--neutral {
    color: #374151;
    background: #f9fafb;
    border: 1px solid #e5e7eb;
}

.jrats-following-status--error {
    color: #b91c1c;
    background: #fef2f2;
    border: 1px solid #fca5a5;
}

/* -----------------------------------------------------------------------------
 * List rows (simplified: avatar + name + headline + unfollow)
 * --------------------------------------------------------------------------- */

.jrats-following-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 0;
    margin: 0;
    list-style: none;
}

.jrats-following-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.jrats-following-row:hover {
    border-color: #c7d4ec;
    box-shadow: 0 1px 3px rgba(82, 119, 186, 0.08);
}

.jrats-following-row__avatar {
    flex: 0 0 auto;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    overflow: hidden;
    background: #eef2fb;
    border: 1px solid #e5e7eb;
}

.jrats-following-row__avatar img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.jrats-following-row__avatar-fallback {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    font-size: 16px;
    font-weight: 600;
    color: #5277ba;
    background: #eef2fb;
}

.jrats-following-row__main {
    flex: 1 1 auto;
    min-width: 0; /* allow text truncation */
}

.jrats-following-row__name {
    margin: 0;
    font-size: 14px;
    font-weight: 600;
    color: #111827;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.jrats-following-row__name a {
    color: inherit;
    text-decoration: none;
}

.jrats-following-row__name a:hover {
    color: #5277ba;
    text-decoration: underline;
}

.jrats-following-row__headline {
    margin: 2px 0 0 0;
    font-size: 12px;
    color: #6b7280;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.jrats-following-row__actions {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* -----------------------------------------------------------------------------
 * Unfollow button (the ❌)
 * --------------------------------------------------------------------------- */

.jrats-following-unfollow {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    padding: 0;
    margin: 0;
    background: transparent;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    color: #6b7280;
    font-size: 16px;
    line-height: 1;
    cursor: pointer;
    transition: color 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}

.jrats-following-unfollow:hover,
.jrats-following-unfollow:focus {
    color: #b91c1c;
    border-color: #fca5a5;
    background: #fef2f2;
    outline: none;
}

.jrats-following-unfollow__icon {
    pointer-events: none;
    user-select: none;
}

.jrats-following-unfollow-form {
    margin: 0;
    padding: 0;
}

/* -----------------------------------------------------------------------------
 * Empty state
 * --------------------------------------------------------------------------- */

.jrats-following-empty {
    padding: 32px 20px;
    text-align: center;
    background: #f9fafb;
    border: 1px dashed #d1d5db;
    border-radius: 8px;
    color: #6b7280;
    font-size: 14px;
}

/* -----------------------------------------------------------------------------
 * Pagination
 * --------------------------------------------------------------------------- */

.jrats-following-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    flex-wrap: wrap;
    margin: 20px 0 0 0;
    padding: 0;
    list-style: none;
}

.jrats-following-pagination__link,
.jrats-following-pagination__current,
.jrats-following-pagination__ellipsis {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
    padding: 0 10px;
    font-size: 13px;
    font-weight: 500;
    text-decoration: none;
    border-radius: 6px;
    line-height: 1;
}

.jrats-following-pagination__link {
    color: #5277ba;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    transition: background 0.15s ease, border-color 0.15s ease;
}

.jrats-following-pagination__link:hover,
.jrats-following-pagination__link:focus {
    background: #eef2fb;
    border-color: #c7d4ec;
    outline: none;
}

.jrats-following-pagination__current {
    color: #ffffff;
    background: #5277ba;
    border: 1px solid #5277ba;
    cursor: default;
}

.jrats-following-pagination__ellipsis {
    color: #9ca3af;
    cursor: default;
}

/* -----------------------------------------------------------------------------
 * Responsive — narrower viewports
 * --------------------------------------------------------------------------- */

@media (max-width: 640px) {
    .jrats-following-header {
        padding: 14px 16px;
    }

    .jrats-following-header__counter {
        min-width: 80px;
        padding: 8px 12px;
    }

    .jrats-following-header__counter-number {
        font-size: 20px;
    }

    .jrats-following-tab {
        padding: 10px 14px;
        font-size: 13px;
    }

    .jrats-following-row {
        padding: 10px 12px;
        gap: 10px;
    }

    .jrats-following-row__avatar {
        width: 40px;
        height: 40px;
    }

    .jrats-following-row__name {
        font-size: 13px;
    }

    .jrats-following-row__headline {
        font-size: 11px;
    }
}

/* -----------------------------------------------------------------------------
 * RTL adjustments — handled mostly automatically; a few explicit overrides.
 * --------------------------------------------------------------------------- */

[dir="rtl"] .jrats-following-pagination,
[dir="rtl"] .jrats-following-tabs {
    direction: rtl;
}

[dir="rtl"] .jrats-following-header__counter-label {
    letter-spacing: 0;
}
