/* =========================================================
   MyFit — All Experts / Compact Editorial
   Uses the project's theme variables when available.
   ========================================================= */

.ep-all-page {
    --ep-bg: var(--bg-color, var(--background, #f5f7f3));
    --ep-surface: var(--card-bg, var(--surface, #ffffff));
    --ep-surface-2: var(--surface-2, #f9faf8);
    --ep-text: var(--text-color, var(--text, #182019));
    --ep-muted: var(--muted-color, var(--muted, #778078));
    --ep-border: var(--border-color, var(--border, rgba(24,32,25,.10)));
    --ep-border-soft: var(--border-soft, rgba(24,32,25,.07));
    --ep-accent: var(--primary-color, var(--accent-color, #9bcb55));
    --ep-shadow: 0 18px 45px rgba(25, 35, 27, .10);

    direction: rtl;
    min-height: 70vh;
    padding: 18px 0 58px;
    background: var(--ep-bg);
    color: var(--ep-text);
}

.ep-all-list-section {
    width: min(1380px, calc(100% - 42px));
    margin-inline: auto;
}

/* ---------- Header ---------- */
.ep-all-list-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 28px;
    margin-bottom: 20px;
    padding-bottom: 18px;
    border-bottom: 1px solid var(--ep-border);
}

.ep-all-list-heading {
    min-width: 0;
}

.ep-all-kicker {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    margin-bottom: 5px;
    color: var(--ep-accent);
    font-size: 10px;
    font-weight: 900;
    letter-spacing: .08em;
}

.ep-all-title-row {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 9px;
}

.ep-all-list-head h1 {
    margin: 0;
    font-size: clamp(24px, 2.5vw, 32px);
    line-height: 1.3;
    font-weight: 950;
    letter-spacing: -.02em;
}

.ep-all-total {
    display: inline-flex;
    align-items: center;
    min-height: 25px;
    padding: 0 9px;
    border: 1px solid color-mix(in srgb, var(--ep-accent) 35%, transparent);
    border-radius: 999px;
    background: color-mix(in srgb, var(--ep-accent) 13%, transparent);
    color: var(--ep-accent);
    font-size: 10px;
    font-weight: 900;
}

.ep-all-list-head p {
    margin: 6px 0 0;
    color: var(--ep-muted);
    font-size: 11px;
    line-height: 1.8;
}

.ep-all-list-actions {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 8px;
    width: min(400px, 100%);
}

.ep-all-back-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--ep-muted);
    font-size: 10px;
    font-weight: 800;
    text-decoration: none;
    transition: color .18s ease, transform .18s ease;
}

.ep-all-back-link:hover {
    color: var(--ep-accent);
    transform: translateX(2px);
}

.ep-all-search {
    width: 100%;
    height: 43px;
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 4px 5px;
    border: 1px solid var(--ep-border);
    border-radius: 12px;
    background: var(--ep-surface);
    box-shadow: 0 7px 22px rgba(0,0,0,.035);
}

.ep-all-search > i {
    padding: 0 8px;
    color: var(--ep-accent);
    font-size: 12px;
}

.ep-all-search input {
    flex: 1;
    min-width: 0;
    height: 100%;
    border: 0;
    outline: 0;
    background: transparent;
    color: var(--ep-text);
    font-family: inherit;
    font-size: 11px;
}

.ep-all-search input::placeholder {
    color: var(--ep-muted);
}

.ep-all-search button {
    height: 33px;
    padding: 0 14px;
    border: 0;
    border-radius: 9px;
    background: var(--ep-accent);
    color: #14200f;
    font-family: inherit;
    font-size: 10px;
    font-weight: 900;
    cursor: pointer;
    transition: transform .18s ease, filter .18s ease;
}

.ep-all-search button:hover {
    transform: translateY(-1px);
    filter: brightness(1.04);
}

/* ---------- Cards ---------- */
.ep-all-cards-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 13px;
}

.ep-all-profile-card {
    position: relative;
    min-width: 0;
    overflow: hidden;
    padding: 14px;
    border: 1px solid var(--ep-border);
    border-radius: 15px;
    background: linear-gradient(180deg, var(--ep-surface), var(--ep-surface-2));
    box-shadow: 0 5px 18px rgba(0,0,0,.025);
    transition: transform .2s ease, border-color .2s ease, box-shadow .2s ease;
}

.ep-all-profile-card:hover {
    transform: translateY(-3px);
    border-color: color-mix(in srgb, var(--ep-accent) 48%, var(--ep-border));
    box-shadow: var(--ep-shadow);
}

.ep-all-card-accent {
    position: absolute;
    inset: 0 0 auto;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--ep-accent), transparent);
    opacity: .75;
}

.ep-all-profile-top {
    display: grid;
    grid-template-columns: 58px minmax(0, 1fr);
    align-items: center;
    gap: 10px;
}

.ep-all-avatar {
    width: 58px;
    height: 58px;
    display: grid;
    place-items: center;
    overflow: hidden;
    border: 1px solid var(--ep-border);
    border-radius: 14px;
    background: color-mix(in srgb, var(--ep-accent) 9%, var(--ep-surface));
    color: var(--ep-accent);
    font-size: 18px;
}

.ep-all-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.ep-all-profile-title {
    min-width: 0;
}

.ep-all-profile-name-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 7px;
}

.ep-all-profile-title h3 {
    min-width: 0;
    margin: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: var(--ep-text);
    font-size: 14px;
    line-height: 1.45;
    font-weight: 950;
}

.ep-all-rating {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    flex: 0 0 auto;
    color: var(--ep-text);
    font-size: 9px;
    font-weight: 900;
}

.ep-all-rating i {
    color: #f2c94c !important;
}

.ep-all-specialty {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    max-width: 100%;
    margin-top: 3px;
    overflow: hidden;
    color: var(--ep-accent);
    font-size: 9px;
    font-weight: 850;
    white-space: nowrap;
    text-overflow: ellipsis;
}

/* Compact stats — no boxes, no wasted height */
.ep-all-profile-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    margin: 12px 0 10px;
    padding: 9px 0;
    border-top: 1px solid var(--ep-border-soft);
    border-bottom: 1px solid var(--ep-border-soft);
}

.ep-all-profile-stats span {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-width: 0;
    gap: 1px;
    border-inline-start: 1px solid var(--ep-border-soft);
}

.ep-all-profile-stats span:first-child {
    border-inline-start: 0;
}

.ep-all-profile-stats strong {
    color: var(--ep-text);
    font-size: 12px;
    line-height: 1.2;
}

.ep-all-profile-stats small {
    color: var(--ep-muted);
    font-size: 8px;
    line-height: 1.5;
}

/* Short bio instead of a fixed-height section */
.ep-all-bio {
    display: -webkit-box;
    min-height: 38px;
    margin: 0 0 11px;
    overflow: hidden;
    color: var(--ep-muted);
    font-size: 9.5px;
    line-height: 1.95;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

.ep-all-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding-top: 10px;
    border-top: 1px solid var(--ep-border-soft);
}

.ep-all-profile-status {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    min-width: 0;
    color: var(--ep-muted);
    font-size: 8.5px;
    font-weight: 700;
    white-space: nowrap;
}

.ep-all-profile-status i {
    color: var(--ep-accent);
}

.ep-all-profile-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-height: 32px;
    padding: 0 11px;
    flex: 0 0 auto;
    border: 1px solid var(--ep-accent);
    border-radius: 8px;
    background: var(--ep-accent);
    color: #14200f !important;
    font-family: inherit;
    font-size: 9px;
    font-weight: 900;
    text-decoration: none;
    transition: transform .18s ease, box-shadow .18s ease, filter .18s ease;
}

.ep-all-profile-btn i {
    color: #14200f !important;
}

.ep-all-profile-btn:hover {
    transform: translateY(-1px);
    filter: brightness(1.04);
    box-shadow: 0 7px 15px color-mix(in srgb, var(--ep-accent) 22%, transparent);
}

.ep-all-empty {
    grid-column: 1 / -1;
    min-height: 230px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 7px;
    border: 1px dashed var(--ep-border);
    border-radius: 15px;
    color: var(--ep-muted);
    text-align: center;
}

.ep-all-empty i {
    margin-bottom: 3px;
    color: var(--ep-accent);
    font-size: 24px;
}

.ep-all-empty strong {
    color: var(--ep-text);
    font-size: 13px;
}

.ep-all-empty span {
    font-size: 10px;
}

/* ---------- Dark theme fallback ---------- */
.dark-mode .ep-all-page,
[data-theme="dark"] .ep-all-page,
html.dark .ep-all-page,
body.dark .ep-all-page {
    --ep-bg: var(--bg-color, #0f1411);
    --ep-surface: var(--card-bg, #151b17);
    --ep-surface-2: var(--surface-2, #121814);
    --ep-text: var(--text-color, #f1f4ef);
    --ep-muted: var(--muted-color, #8d968f);
    --ep-border: var(--border-color, rgba(255,255,255,.08));
    --ep-border-soft: rgba(255,255,255,.055);
    --ep-shadow: 0 20px 50px rgba(0,0,0,.28);
}

/* ---------- Responsive ---------- */
@media (max-width: 1180px) {
    .ep-all-cards-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 900px) {
    .ep-all-list-head {
        align-items: stretch;
        flex-direction: column;
        gap: 15px;
    }

    .ep-all-list-actions {
        width: 100%;
    }

    .ep-all-cards-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 600px) {
    .ep-all-page {
        padding: 10px 0 40px;
    }

    .ep-all-list-section {
        width: calc(100% - 20px);
    }

    .ep-all-list-head {
        margin-bottom: 14px;
        padding-bottom: 14px;
    }

    .ep-all-list-head h1 {
        font-size: 23px;
    }

    .ep-all-list-head p {
        font-size: 10px;
    }

    .ep-all-cards-grid {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .ep-all-profile-card {
        padding: 13px;
        border-radius: 14px;
    }

    .ep-all-profile-top {
        grid-template-columns: 54px minmax(0, 1fr);
        gap: 9px;
    }

    .ep-all-avatar {
        width: 54px;
        height: 54px;
        border-radius: 13px;
    }

    .ep-all-profile-title h3 {
        font-size: 13px;
    }

    .ep-all-profile-stats {
        margin: 10px 0 9px;
        padding: 8px 0;
    }

    .ep-all-profile-stats strong {
        font-size: 11px;
    }

    .ep-all-profile-stats small {
        font-size: 7.5px;
    }

    .ep-all-bio {
        min-height: 34px;
        margin-bottom: 9px;
        font-size: 9px;
    }

    .ep-all-card-footer {
        padding-top: 8px;
    }

    .ep-all-profile-status {
        font-size: 8px;
    }

    .ep-all-profile-btn {
        min-height: 30px;
        padding: 0 10px;
        font-size: 8.5px;
    }
}
