/* ============================================================================
 * ECA v4 — Suggested People (carousel + card)
 * Aplica al widget "Suggested People" / "Suggested Friends" en feed y wizard.
 * Sin tocar PHP — usa solo los campos que get_new_people() retorna.
 * ========================================================================== */

/* ---------- widget container -------------------------------------------- */
.eca-sp-widget {
    background: #fff;
    border-radius: 12px;
    padding: 8px 0 12px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
    border: 1px solid #e6e8ec;
}
body.night-mode .eca-sp-widget {
    background: #1e1e1e;
    border-color: #2a2a2a;
}

.eca-sp-widget-title {
    display: flex !important;
    align-items: center;
    justify-content: space-between;
    padding: 16px 16px 14px;
    margin: 0 !important;
    gap: 12px;
    flex-wrap: nowrap;
}
.eca-sp-widget-title b {
    font-size: 16px;
    font-weight: 700;
    color: #1d2129;
    letter-spacing: -0.01em;
}
body.night-mode .eca-sp-widget-title b { color: #e4e6eb; }

.eca-sp-widget-link {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    font-size: 13px;
    font-weight: 600;
    color: #2e6b4d;
    text-decoration: none !important;
}
.eca-sp-widget-link:hover { color: #1f4f37; }
body.night-mode .eca-sp-widget-link { color: #6fae89; }

/* ---------- carousel wrapper + arrows ----------------------------------- */
.eca-sp-carousel-wrap {
    position: relative;
}

.eca-sp-carousel {
    display: flex;
    gap: 12px;
    list-style: none;
    margin: 0;
    padding: 4px 16px 8px;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}
.eca-sp-carousel::-webkit-scrollbar { display: none; }

.eca-sp-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 32px;
    height: 32px;
    display: none;
    align-items: center;
    justify-content: center;
    border: 1px solid #e6e8ec;
    border-radius: 50%;
    background: #fff;
    color: #1d2129;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.12);
    cursor: pointer;
    z-index: 5;
    padding: 0;
    transition: background 0.15s ease, color 0.15s ease, opacity 0.15s ease;
}
.eca-sp-arrow:hover { background: #2e6b4d; color: #fff; border-color: #2e6b4d; }
.eca-sp-arrow:disabled { opacity: 0.35; cursor: default; }
.eca-sp-arrow:disabled:hover { background: #fff; color: #1d2129; border-color: #e6e8ec; }
.eca-sp-arrow-prev { left: 4px; }
.eca-sp-arrow-next { right: 4px; }

body.night-mode .eca-sp-arrow {
    background: #2a2a2a;
    border-color: #3a3a3a;
    color: #e4e6eb;
}
body.night-mode .eca-sp-arrow:hover { background: #2e6b4d; color: #fff; border-color: #2e6b4d; }

/* Mostrar flechas solo cuando hay JS (se activa con clase) */
.eca-sp-carousel-wrap.has-controls .eca-sp-arrow { display: flex; }

/* ---------- card -------------------------------------------------------- */
.eca-sp-card-item {
    flex: 0 0 220px;
    max-width: 220px;
    scroll-snap-align: start;
    list-style: none;
}

.eca-sp-card {
    position: relative;
    background: #fff;
    border: 1px solid #e6e8ec;
    border-radius: 14px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 0 12px 14px;
    transition: box-shadow 0.18s ease, transform 0.18s ease;
}
.eca-sp-card:hover {
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.08);
    transform: translateY(-2px);
}
body.night-mode .eca-sp-card {
    background: #262626;
    border-color: #3a3a3a;
}

/* Cover (gradient — sin imagen real) */
.eca-sp-card-cover {
    position: relative;
    left: -12px;
    right: -12px;
    width: calc(100% + 24px);
    height: 80px;
    background:
        radial-gradient(circle at 20% 30%, rgba(255, 255, 255, 0.12) 0, transparent 50%),
        radial-gradient(circle at 80% 70%, rgba(255, 255, 255, 0.10) 0, transparent 55%),
        linear-gradient(135deg, #2e6b4d 0%, #4a8b6a 55%, #6fae89 100%);
    margin-bottom: -36px;
}

/* Avatar */
.eca-sp-card-avatar-link {
    position: relative;
    display: inline-block;
    z-index: 2;
    text-decoration: none;
}
.eca-sp-card-avatar {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    border: 4px solid #fff;
    object-fit: cover;
    background: #f0f2f5;
    display: block;
}
body.night-mode .eca-sp-card-avatar { border-color: #262626; }

.eca-sp-card-dot {
    position: absolute;
    right: 4px;
    bottom: 6px;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: #31a24c;
    border: 2px solid #fff;
    box-sizing: border-box;
}
body.night-mode .eca-sp-card-dot { border-color: #262626; }

/* Name */
.eca-sp-card-name {
    margin-top: 10px;
    text-align: center;
    font-size: 14px;
    font-weight: 700;
    color: #1d2129;
    line-height: 1.3;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
}
.eca-sp-card-name a {
    color: inherit !important;
    text-decoration: none !important;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.eca-sp-card-name a:hover { text-decoration: underline !important; }
body.night-mode .eca-sp-card-name { color: #e4e6eb; }
.eca-sp-card-name .verified-color svg { flex-shrink: 0; }

/* Mutual pill */
.eca-sp-card-mutual {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 10px;
    padding: 6px 10px;
    border-radius: 999px;
    background: #f0f2f5;
    color: #4b5563;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    max-width: 100%;
    line-height: 1;
}
.eca-sp-card-mutual:hover { background: #e4e6eb; color: #1d2129; }
.eca-sp-card-mutual-icon { flex-shrink: 0; color: #2e6b4d; }
.eca-sp-card-mutual span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
body.night-mode .eca-sp-card-mutual { background: #3a3a3a; color: #c0c0c0; }
body.night-mode .eca-sp-card-mutual:hover { background: #4a4a4a; color: #e4e6eb; }
body.night-mode .eca-sp-card-mutual-icon { color: #6fae89; }

/* Action button */
.eca-sp-card-action {
    margin-top: 12px;
    width: 100%;
}
.eca-sp-card-btn {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    gap: 6px;
    width: 100%;
    height: 36px;
    padding: 0 12px !important;
    border: 1.5px solid #2e6b4d !important;
    border-radius: 999px !important;
    background: #fff !important;
    color: #2e6b4d !important;
    font-size: 13px !important;
    font-weight: 700 !important;
    line-height: 1 !important;
    box-shadow: none !important;
    transition: background 0.15s ease, color 0.15s ease;
    cursor: pointer;
}
.eca-sp-card-btn:hover,
.eca-sp-card-btn:focus {
    background: #2e6b4d !important;
    color: #fff !important;
}
.eca-sp-card-btn svg { flex-shrink: 0; }
body.night-mode .eca-sp-card-btn {
    background: transparent !important;
    color: #6fae89 !important;
    border-color: #6fae89 !important;
}
body.night-mode .eca-sp-card-btn:hover,
body.night-mode .eca-sp-card-btn:focus {
    background: #2e6b4d !important;
    color: #fff !important;
}

/* ---------- responsive -------------------------------------------------- */
@media (max-width: 767.98px) {
    .eca-sp-widget { padding: 6px 0 10px; }
    .eca-sp-widget-title { padding: 14px 14px 12px; }
    .eca-sp-widget-title b { font-size: 15px; }
    .eca-sp-widget-link { font-size: 12px; }
    .eca-sp-carousel { padding: 4px 14px 8px; gap: 10px; }
}

@media (max-width: 575.98px) {
    .eca-sp-widget-title { padding: 12px 12px 10px; }
    .eca-sp-carousel { padding: 4px 12px 8px; }
    .eca-sp-card-item { flex: 0 0 200px; max-width: 200px; }
    .eca-sp-card-cover { height: 72px; margin-bottom: -32px; }
    .eca-sp-card-avatar { width: 64px; height: 64px; }
}
