/* =====================================================
   SEO247 WhatsApp Channel Widget — style.css  v3.1.0
   Author: SEO247 | http://seo247.in/
   ALL classes prefixed seo247wcw- to prevent conflicts
   ===================================================== */

*, *::before, *::after { box-sizing: border-box; }

/* ─────────────────────────────────────────────────────
   WRAPPER
───────────────────────────────────────────────────── */
.seo247wcw-wrap {
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding: 32px 16px 40px;
    font-family: -apple-system, 'Segoe UI', Roboto, Helvetica, sans-serif;
    -webkit-font-smoothing: antialiased;
}

/* ─────────────────────────────────────────────────────
   PHONE SHELL (desktop)
───────────────────────────────────────────────────── */
.seo247wcw-phone {
    width: 300px;
    height: 620px;
    background: #1a1a1a;
    border-radius: 42px;
    box-shadow:
        0 0 0 1px #333,
        0 0 0 3px #111,
        0 0 0 4.5px #2a2a2a,
        0 28px 80px rgba(0,0,0,.65),
        inset 0 1px 0 rgba(255,255,255,.05);
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: hidden;
}
.seo247wcw-phone::before {
    content: '';
    position: absolute; left: -3.5px; top: 110px;
    width: 3.5px; height: 28px;
    background: #282828; border-radius: 2px 0 0 2px;
    box-shadow: 0 38px 0 #282828, 0 72px 0 #282828;
}
.seo247wcw-phone::after {
    content: '';
    position: absolute; right: -3.5px; top: 140px;
    width: 3.5px; height: 50px;
    background: #282828; border-radius: 0 2px 2px 0;
}
.seo247wcw-notch {
    position: absolute; top: 9px; left: 50%; transform: translateX(-50%);
    width: 82px; height: 24px;
    background: #000; border-radius: 18px; z-index: 20;
    display: flex; align-items: center; justify-content: flex-end;
    padding-right: 9px; gap: 4px;
}
.seo247wcw-cam {
    width: 8px; height: 8px;
    background: #1c1c1c; border-radius: 50%;
    border: 1px solid #222;
    box-shadow: inset 0 0 3px rgba(80,180,255,.1);
}
.seo247wcw-screen {
    flex: 1; margin: 7px 2.5px 0;
    border-radius: 36px; overflow: hidden;
    background: #0b141a;
}
.seo247wcw-chin {
    height: 22px;
    display: flex; align-items: center; justify-content: center;
}
.seo247wcw-bar { width: 90px; height: 4px; background: #363636; border-radius: 2px; }
.seo247wcw-flat { display: none; }

/* ─────────────────────────────────────────────────────
   CHANNEL UI — shared inner shell
───────────────────────────────────────────────────── */
.seo247wcw-ui {
    display: flex;
    flex-direction: column;
    height: 100%;
    background: #0b141a;
    overflow: hidden;
    position: relative;
}

/* Status bar */
.seo247wcw-status {
    display: flex; justify-content: space-between; align-items: center;
    padding: 13px 16px 3px;
    flex-shrink: 0; color: #fff;
    font-size: 11px; font-weight: 700; letter-spacing: .2px;
}
.seo247wcw-status-right { display: flex; align-items: center; gap: 5px; }
.seo247wcw-batt {
    width: 21px; height: 10px;
    border: 1.5px solid rgba(255,255,255,.8);
    border-radius: 2px; padding: 1.5px;
    display: flex; align-items: center; position: relative;
}
.seo247wcw-batt::after {
    content: '';
    position: absolute; right: -4px; top: 50%; transform: translateY(-50%);
    width: 2px; height: 5px;
    background: rgba(255,255,255,.55); border-radius: 0 1px 1px 0;
}
.seo247wcw-batt-fill { width: 74%; height: 100%; background: #fff; border-radius: 1px; }

/* Nav bar */
.seo247wcw-nav {
    display: flex; align-items: center; justify-content: space-between;
    padding: 5px 9px 5px 7px;
    background: #202c33; flex-shrink: 0; min-height: 48px;
    position: relative; z-index: 30;
}
.seo247wcw-nav-l { display: flex; align-items: center; gap: 6px; min-width: 0; flex: 1; }
.seo247wcw-av {
    width: 36px; height: 36px; border-radius: 50%;
    background: linear-gradient(135deg, #25d366, #128c7e);
    display: flex; align-items: center; justify-content: center;
    color: #fff; font-size: 13px; font-weight: 700;
    overflow: hidden; flex-shrink: 0;
}
.seo247wcw-av img { width: 100%; height: 100%; object-fit: cover; }
.seo247wcw-nav-txt { min-width: 0; }
.seo247wcw-nav-name {
    color: #e9edef; font-size: 14px; font-weight: 600;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
    max-width: 140px; line-height: 1.2;
}
.seo247wcw-nav-sub { color: #8696a0; font-size: 11px; margin-top: 1px; }
.seo247wcw-nav-r { display: flex; align-items: center; gap: 13px; flex-shrink: 0; }

/* ─────────────────────────────────────────────────────
   INFO CARD — smooth scroll-aware collapse
   Uses max-height so height animates without jank.
   overflow:hidden clips children during collapse.
───────────────────────────────────────────────────── */
.seo247wcw-card {
    background: #1f2c34;
    margin: 4px 6px 5px;
    border-radius: 10px;
    padding: 10px 10px 9px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    flex-shrink: 0;
    gap: 2px;
    overflow: hidden;
    /* Animate the space the card occupies */
    max-height: 220px;
    opacity: 1;
    will-change: max-height, opacity, margin, padding;
    transition:
        max-height  .40s cubic-bezier(.4, 0, .2, 1),
        opacity     .25s cubic-bezier(.4, 0, .2, 1)  .05s,
        margin-top  .40s cubic-bezier(.4, 0, .2, 1),
        margin-bottom .40s cubic-bezier(.4, 0, .2, 1),
        padding-top .40s cubic-bezier(.4, 0, .2, 1),
        padding-bottom .40s cubic-bezier(.4, 0, .2, 1);
}
.seo247wcw-card.seo247wcw-card--collapsed {
    max-height: 0;
    opacity: 0;
    margin-top: 0;
    margin-bottom: 0;
    padding-top: 0;
    padding-bottom: 0;
    pointer-events: none;
}

.seo247wcw-card-av {
    width: 42px; height: 42px; border-radius: 50%;
    background: linear-gradient(135deg, #25d366, #128c7e);
    display: flex; align-items: center; justify-content: center;
    color: #fff; font-size: 15px; font-weight: 700;
    overflow: hidden; margin-bottom: 5px;
    border: 2px solid #2a3942; flex-shrink: 0;
}
.seo247wcw-card-av img { width: 100%; height: 100%; object-fit: cover; }
.seo247wcw-card-name { color: #e9edef; font-size: 12.5px; font-weight: 700; line-height: 1.2; }
.seo247wcw-card-desc { color: #8696a0; font-size: 10.5px; line-height: 1.35; }
.seo247wcw-card-subs {
    display: flex; align-items: center; gap: 3px;
    color: #8696a0; font-size: 10.5px; margin-top: 1px;
}

/* ─────────────────────────────────────────────────────
   FOLLOW BUTTON — in-card pill (always rendered)
───────────────────────────────────────────────────── */
.seo247wcw-follow-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    border: 1.5px solid #25d366;
    color: #25d366;
    font-size: 11px;
    font-weight: 700;
    padding: 4px 16px;
    border-radius: 20px;
    text-decoration: none;
    margin-top: 5px;
    transition: background .2s, color .2s, box-shadow .2s;
    white-space: nowrap;
}
.seo247wcw-follow-btn:hover {
    background: #25d366;
    color: #fff;
    text-decoration: none;
    box-shadow: 0 0 0 3px rgba(37,211,102,.2);
}

/* ─────────────────────────────────────────────────────
   FLOATING FOLLOW PILL
   A separate element injected by JS — floats above feed.
   Animates independently; no position jump.
───────────────────────────────────────────────────── */
.seo247wcw-follow-pill {
    position: absolute;
    top: 54px;          /* just below nav bar */
    right: 10px;
    z-index: 40;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #25d366;
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    padding: 7px 14px;
    border-radius: 24px;
    text-decoration: none;
    white-space: nowrap;
    box-shadow: 0 4px 18px rgba(37,211,102,.5), 0 2px 6px rgba(0,0,0,.35);
    /* Start hidden; JS toggles seo247wcw-pill--visible */
    opacity: 0;
    transform: translateY(-6px) scale(.9);
    pointer-events: none;
    will-change: opacity, transform;
    transition:
        opacity   .32s cubic-bezier(.34, 1.4, .64, 1),
        transform .32s cubic-bezier(.34, 1.4, .64, 1);
}
.seo247wcw-follow-pill.seo247wcw-pill--visible {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: auto;
}
.seo247wcw-follow-pill:hover {
    background: #1ebe5d;
    color: #fff;
    text-decoration: none;
    box-shadow: 0 6px 22px rgba(37,211,102,.6);
    transform: translateY(-1px) scale(1.03);
}
.seo247wcw-follow-pill svg { flex-shrink: 0; }

/* ─────────────────────────────────────────────────────
   FEED
───────────────────────────────────────────────────── */
.seo247wcw-feed {
    flex: 1;
    overflow-y: auto; overflow-x: hidden;
    padding: 4px 6px 4px;
    display: flex; flex-direction: column; gap: 4px;
    scrollbar-width: thin; scrollbar-color: #374045 transparent;
    background: #0b141a;
}
.seo247wcw-feed::-webkit-scrollbar { width: 3px; }
.seo247wcw-feed::-webkit-scrollbar-thumb { background: #374045; border-radius: 2px; }
.seo247wcw-empty {
    text-align: center; color: #8696a0;
    font-size: 11px; padding: 24px 12px; line-height: 1.7;
}

/* Bubble wrapper */
.seo247wcw-bubble-wrap {
    display: flex; gap: 4px; align-items: flex-start;
    animation: seo247wcw-pop .28s ease both;
}
@keyframes seo247wcw-pop {
    from { opacity: 0; transform: translateY(5px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* Avatar in feed */
.seo247wcw-bav {
    width: 24px; height: 24px; border-radius: 50%;
    background: linear-gradient(135deg, #25d366, #128c7e);
    display: flex; align-items: center; justify-content: center;
    color: #fff; font-size: 9px; font-weight: 700;
    overflow: hidden; flex-shrink: 0; margin-top: 1px;
}
.seo247wcw-bav img { width: 100%; height: 100%; object-fit: cover; }

/* Bubble */
.seo247wcw-bubble {
    background: #1f2c34;
    border-radius: 0 7px 7px 7px;
    overflow: hidden;
    width: calc(100% - 30px);
    flex-shrink: 0;
    position: relative;
}
.seo247wcw-bubble::before {
    content: '';
    position: absolute; top: 0; left: -6px;
    border-right: 6px solid #1f2c34;
    border-bottom: 6px solid transparent;
}

/* NEW badge on first/newest image */
.seo247wcw-bubble--new {
    border: 1px solid rgba(37,211,102,.35);
}
.seo247wcw-new-badge {
    position: absolute; top: 6px; right: 6px;
    background: #25d366; color: #fff;
    font-size: 8px; font-weight: 900; letter-spacing: .8px;
    padding: 2px 6px; border-radius: 20px; z-index: 5;
    box-shadow: 0 1px 4px rgba(0,0,0,.4);
}

.seo247wcw-bubble-sender {
    color: #25d366; font-size: 10.5px; font-weight: 700;
    padding: 5px 7px 2px; line-height: 1;
}

/* Image box — fixed aspect */
.seo247wcw-img-wrap {
    width: 100%;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    background: #111d24;
    display: flex; align-items: center; justify-content: center;
}
.seo247wcw-img-wrap img {
    width: 100%; height: 100%; display: block;
    object-fit: cover; background: #111d24;
}
.seo247wcw-img-err {
    width: 100%; height: 100%;
    display: flex; flex-direction: column;
    align-items: center; justify-content: center;
    background: #162028; color: #8696a0;
    font-size: 10px; text-align: center; padding: 10px; line-height: 1.6;
}

.seo247wcw-caption {
    color: #e9edef; font-size: 11px; padding: 4px 7px 2px; line-height: 1.5;
}
.seo247wcw-meta {
    display: flex; align-items: center; justify-content: flex-end;
    gap: 3px; padding: 2px 5px 4px;
}
.seo247wcw-time-lbl { color: #8696a0; font-size: 9.5px; }

/* ─────────────────────────────────────────────────────
   BOTTOM JOIN BAR
───────────────────────────────────────────────────── */
.seo247wcw-bottom {
    background: #202c33;
    padding: 7px 8px 9px;
    flex-shrink: 0;
}
.seo247wcw-join {
    display: flex; align-items: center; justify-content: center; gap: 7px;
    background: #25d366; color: #fff;
    font-size: 13px; font-weight: 700;
    padding: 10px; border-radius: 8px;
    text-decoration: none;
    transition: background .15s, transform .1s, box-shadow .15s;
}
.seo247wcw-join:hover {
    background: #1ebe5d; color: #fff;
    text-decoration: none;
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(37,211,102,.4);
}

/* ─────────────────────────────────────────────────────
   MOBILE ≤ 680px
───────────────────────────────────────────────────── */
@media (max-width: 680px) {
    .seo247wcw-wrap  { padding: 0; }
    .seo247wcw-phone { display: none; }
    .seo247wcw-flat  { display: block; width: 100%; }

    .seo247wcw-flat .seo247wcw-ui { height: 100svh; border-radius: 0; }
    .seo247wcw-flat .seo247wcw-status { display: none; }

    .seo247wcw-flat .seo247wcw-nav { padding: 8px 14px 8px 12px; min-height: 56px; }
    .seo247wcw-flat .seo247wcw-nav-name { max-width: 55vw; font-size: 15px; }
    .seo247wcw-flat .seo247wcw-av { width: 40px; height: 40px; font-size: 14px; }
    .seo247wcw-flat .seo247wcw-nav-sub { font-size: 12px; }

    .seo247wcw-flat .seo247wcw-card { margin: 6px 10px; padding: 10px 12px; gap: 3px; }
    .seo247wcw-flat .seo247wcw-card-av { width: 44px; height: 44px; font-size: 15px; }
    .seo247wcw-flat .seo247wcw-card-name { font-size: 13px; }
    .seo247wcw-flat .seo247wcw-card-desc { font-size: 11px; }
    .seo247wcw-flat .seo247wcw-card-subs { font-size: 11px; }
    .seo247wcw-flat .seo247wcw-follow-btn { font-size: 11.5px; padding: 5px 18px; }

    .seo247wcw-flat .seo247wcw-feed { padding: 6px 10px; gap: 6px; }
    .seo247wcw-flat .seo247wcw-bubble { width: calc(100% - 34px); }
    .seo247wcw-flat .seo247wcw-bav { width: 26px; height: 26px; font-size: 10px; }
    .seo247wcw-flat .seo247wcw-bubble-sender { font-size: 11px; padding: 6px 8px 2px; }

    .seo247wcw-flat .seo247wcw-bottom { padding: 10px 12px 18px; }
    .seo247wcw-flat .seo247wcw-join { font-size: 14.5px; padding: 13px; border-radius: 10px; }

    /* Floating pill on mobile — a bit lower for the taller nav */
    .seo247wcw-flat .seo247wcw-follow-pill {
        top: 64px;
        right: 14px;
        font-size: 12px;
        padding: 8px 16px;
    }
}
