/* =====================================================================
   WhatsApp Channel Popup — Premium Frontend Styles v2.0
   Colors are driven by CSS variables set inline from admin settings:
   --wacp-c1, --wacp-c2, --wacp-text, --wacp-btn-bg, --wacp-btn-text, --wacp-radius
   ===================================================================== */

.wacp-overlay {
    position: fixed;
    inset: 0;
    z-index: 999999;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(7px);
    -webkit-backdrop-filter: blur(7px);
    opacity: 0;
    transition: opacity 0.35s ease;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

.wacp-overlay.wacp-show {
    display: flex;
    opacity: 1;
    animation: wacpFadeIn 0.35s ease forwards;
}

@keyframes wacpFadeIn { from { opacity: 0; } to { opacity: 1; } }

/* ---- The big dialog box ---- */
.wacp-box {
    /* fallbacks if inline vars are missing */
    --wacp-c1: #128C7E;
    --wacp-c2: #25D366;
    --wacp-text: #ffffff;
    --wacp-btn-bg: #ffffff;
    --wacp-btn-text: #0d7a5f;
    --wacp-radius: 28px;

    position: relative;
    overflow: hidden;
    width: 100%;
    max-width: 500px;                 /* BIG size */
    box-sizing: border-box;
    padding: 46px 44px 40px;
    text-align: center;
    border-radius: var(--wacp-radius);
    color: var(--wacp-text);
    background:
        radial-gradient(120% 90% at 20% 0%, rgba(255,255,255,0.18) 0%, rgba(255,255,255,0) 45%),
        linear-gradient(155deg, var(--wacp-c1) 0%, var(--wacp-c2) 100%);
    border: 1px solid rgba(255, 255, 255, 0.22);
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(255, 255, 255, 0.06) inset;
    transform: translateY(40px) scale(0.9);
    opacity: 0;
    animation: wacpPopIn 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes wacpPopIn { to { transform: translateY(0) scale(1); opacity: 1; } }

/* ---- Decorative floating shapes ---- */
.wacp-shape {
    position: absolute;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.12);
    pointer-events: none;
}
.wacp-shape-1 { width: 150px; height: 150px; top: -50px;  right: -40px; animation: wacpFloat 7s ease-in-out infinite; }
.wacp-shape-2 { width: 90px;  height: 90px;  bottom: -30px; left: -30px; animation: wacpFloat 9s ease-in-out infinite reverse; }
.wacp-shape-3 { width: 40px;  height: 40px;  top: 50%;      right: 20px;  background: rgba(255,255,255,0.16); animation: wacpFloat 6s ease-in-out infinite; }

@keyframes wacpFloat {
    0%, 100% { transform: translateY(0) translateX(0); }
    50%      { transform: translateY(-18px) translateX(8px); }
}

/* ---- Close icon ---- */
.wacp-close {
    position: absolute;
    top: 16px;
    right: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    padding: 0;
    color: var(--wacp-text);
    background: rgba(255, 255, 255, 0.16);
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-radius: 50%;
    cursor: pointer;
    z-index: 5;
    transition: transform 0.25s ease, background 0.25s ease;
}
.wacp-close:hover { background: rgba(255, 255, 255, 0.32); transform: rotate(90deg) scale(1.12); }

/* ---- Live badge ---- */
.wacp-badge {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    margin: 0 0 22px;
    padding: 6px 15px;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 1.2px;
    border-radius: 50px;
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.28);
}
.wacp-dot {
    width: 8px; height: 8px;
    border-radius: 50%;
    background: #ff5252;
    animation: wacpBlink 1.4s infinite;
}
@keyframes wacpBlink {
    0%   { box-shadow: 0 0 0 0 rgba(255, 82, 82, 0.7); }
    70%  { box-shadow: 0 0 0 9px rgba(255, 82, 82, 0); }
    100% { box-shadow: 0 0 0 0 rgba(255, 82, 82, 0); }
}

/* ---- Icon / Logo ---- */
.wacp-icon-wrap { position: relative; display: inline-block; margin: 0 auto 22px; }
.wacp-icon {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 112px;
    height: 112px;
    border-radius: 50%;
    background: #ffffff;
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.25);
    z-index: 2;
    overflow: hidden;
    animation: wacpBob 3s ease-in-out infinite;
}
.wacp-logo-img { width: 100%; height: 100%; object-fit: cover; }
.wacp-icon-wrap::before,
.wacp-icon-wrap::after {
    content: "";
    position: absolute;
    top: 50%; left: 50%;
    width: 112px; height: 112px;
    border-radius: 50%;
    transform: translate(-50%, -50%);
    border: 2px solid rgba(255, 255, 255, 0.55);
    animation: wacpRipple 2.4s ease-out infinite;
}
.wacp-icon-wrap::after { animation-delay: 1.2s; }
@keyframes wacpRipple {
    0%   { transform: translate(-50%, -50%) scale(1);   opacity: 0.7; }
    100% { transform: translate(-50%, -50%) scale(1.7); opacity: 0; }
}
@keyframes wacpBob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-7px); } }

/* ---- Text ---- */
.wacp-title {
    margin: 0 0 12px;
    font-size: 31px;
    font-weight: 800;
    line-height: 1.22;
    color: var(--wacp-text);
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}
.wacp-subtitle {
    margin: 0 0 22px;
    font-size: 16.5px;
    line-height: 1.6;
    color: var(--wacp-text);
    opacity: 0.94;
}

/* ---- Social proof ---- */
.wacp-proof {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin: 0 0 26px;
    flex-wrap: wrap;
}
.wacp-avatars { display: flex; }
.wacp-av {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    margin-left: -10px;
    font-size: 13px;
    font-weight: 700;
    color: #fff;
    border-radius: 50%;
    border: 2px solid rgba(255,255,255,0.85);
    box-shadow: 0 2px 6px rgba(0,0,0,0.2);
}
.wacp-av:first-child { margin-left: 0; }
.wacp-av-more { background: #ffffff; color: var(--wacp-c1); font-size: 11px; }
.wacp-proof-text { font-size: 14px; font-weight: 600; color: var(--wacp-text); opacity: 0.95; }

/* ---- Join button ---- */
.wacp-btn {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    max-width: 320px;
    box-sizing: border-box;
    padding: 17px 34px;
    font-size: 19px;
    font-weight: 800;
    text-decoration: none;
    color: var(--wacp-btn-text);
    background: var(--wacp-btn-bg);
    border-radius: 50px;
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.28);
    overflow: hidden;
    transition: transform 0.22s ease, box-shadow 0.22s ease;
}
.wacp-btn::before {
    content: "";
    position: absolute;
    top: 0; left: -120%;
    width: 60%; height: 100%;
    background: linear-gradient(120deg, transparent, rgba(255, 255, 255, 0.55), transparent);
    transform: skewX(-20deg);
    animation: wacpShine 3s infinite;
}
@keyframes wacpShine {
    0%   { left: -120%; }
    55%  { left: 130%; }
    100% { left: 130%; }
}
.wacp-btn:hover { transform: translateY(-3px) scale(1.03); box-shadow: 0 18px 38px rgba(0, 0, 0, 0.38); }
.wacp-btn .wacp-arrow { color: var(--wacp-btn-text); transition: transform 0.22s ease; }
.wacp-btn:hover .wacp-arrow { transform: translateX(5px); }

/* ---- Skip text ---- */
.wacp-skip {
    margin: 20px 0 0;
    font-size: 14px;
    font-weight: 500;
    color: var(--wacp-text);
    opacity: 0.82;
    cursor: pointer;
    transition: opacity 0.2s ease;
}
.wacp-skip:hover { opacity: 1; text-decoration: underline; }

/* ---- Responsive (mobile) ---- */
@media (max-width: 480px) {
    .wacp-box      { padding: 40px 22px 32px; }
    .wacp-title    { font-size: 25px; }
    .wacp-subtitle { font-size: 15px; }
    .wacp-icon,
    .wacp-icon-wrap::before,
    .wacp-icon-wrap::after { width: 96px; height: 96px; }
    .wacp-icon svg { width: 50px; height: 50px; }
    .wacp-btn      { padding: 15px 26px; font-size: 17px; }
    .wacp-shape-1  { width: 110px; height: 110px; }
}

/* =====================================================================
   ADMIN-ONLY styles (stats dashboard + live preview layout)
   ===================================================================== */
.wacp-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    max-width: 760px;
    margin: 10px 0 6px;
}
.wacp-stat {
    background: #fff;
    border: 1px solid #dcdcde;
    border-radius: 12px;
    padding: 18px 16px;
    text-align: center;
    box-shadow: 0 2px 6px rgba(0,0,0,0.05);
}
.wacp-stat-num { display: block; font-size: 30px; font-weight: 800; color: #128C7E; line-height: 1.1; }
.wacp-stat-label { display: block; margin-top: 6px; font-size: 12.5px; color: #50575e; }
.wacp-stat-rate .wacp-stat-num { color: #d63384; }

@media (max-width: 782px) { .wacp-stats { grid-template-columns: repeat(2, 1fr); } }

/* Two-column layout: form + preview */
.wacp-layout { display: flex; gap: 30px; align-items: flex-start; flex-wrap: wrap; }
.wacp-form { flex: 1 1 520px; min-width: 340px; }
.wacp-preview-col { flex: 0 0 360px; position: sticky; top: 40px; }

.wacp-preview-stage {
    background: repeating-linear-gradient(45deg, #eef1f4, #eef1f4 12px, #e7ebef 12px, #e7ebef 24px);
    border-radius: 16px;
    padding: 26px 20px;
    display: flex;
    justify-content: center;
}
/* Preview box = same look as frontend but static & smaller */
.wacp-box.wacp-preview {
    animation: none !important;
    opacity: 1 !important;
    transform: none !important;
    max-width: 320px;
    padding: 34px 26px 28px;
    box-shadow: 0 18px 45px rgba(0,0,0,0.28);
}
.wacp-box.wacp-preview .wacp-icon { width: 88px; height: 88px; animation: none; }
.wacp-box.wacp-preview .wacp-icon-wrap::before,
.wacp-box.wacp-preview .wacp-icon-wrap::after { width: 88px; height: 88px; }
.wacp-box.wacp-preview .wacp-title { font-size: 22px; }
.wacp-box.wacp-preview .wacp-subtitle { font-size: 14px; margin-bottom: 16px; }
.wacp-box.wacp-preview .wacp-btn { font-size: 16px; padding: 13px 24px; }

@media (max-width: 960px) { .wacp-preview-col { position: static; flex: 1 1 100%; } }
