@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600&display=swap');

#scw-root * { box-sizing: border-box; font-family: 'DM Sans', -apple-system, sans-serif; margin: 0; padding: 0; }

#scw-launcher {
    position: fixed;
    z-index: 99999;
    bottom: 28px;
    right: 28px;
}

#scw-launcher.pos-bottom-left { right: auto; left: 28px; }

/* ── Launcher button ── */
#scw-btn {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.3s cubic-bezier(0.34,1.56,0.64,1), box-shadow 0.2s;
    box-shadow: 0 4px 20px rgba(0,0,0,0.3);
    position: relative;
    background: var(--scw-brand, #1a1a2e);
}

#scw-btn:hover { transform: scale(1.09); box-shadow: 0 6px 28px rgba(0,0,0,0.38); }

#scw-btn svg { width: 26px; height: 26px; transition: transform 0.3s ease, opacity 0.2s ease; position: absolute; }
#scw-btn .scw-ico-chat  { opacity: 1; transform: rotate(0deg); }
#scw-btn .scw-ico-close { opacity: 0; transform: rotate(-90deg); }

#scw-btn.open .scw-ico-chat  { opacity: 0; transform: rotate(90deg); }
#scw-btn.open .scw-ico-close { opacity: 1; transform: rotate(0deg); }

/* ── Notification dot ── */
#scw-notif {
    position: absolute;
    top: -2px; right: -2px;
    width: 14px; height: 14px;
    border-radius: 50%;
    background: #ef4444;
    border: 2px solid #fff;
    opacity: 0;
    transform: scale(0);
    transition: opacity 0.3s, transform 0.4s cubic-bezier(0.34,1.6,0.64,1);
    padding: 10px 10px 10px 10px;
}

#scw-notif.show { opacity: 1; transform: scale(1); }

/* ── Greeting bubble ── */
#scw-bubble {
    position: absolute;
    bottom: 76px;
    right: 0;
    max-width: 230px;
    min-width: 180px;
    opacity: 0;
    pointer-events: none;
    transform: translateY(12px) scale(0.9);
    transform-origin: bottom right;
    transition: opacity 0.35s ease, transform 0.4s cubic-bezier(0.34,1.4,0.64,1);
    padding: 10px 10px 10px 10px;
}

#scw-launcher.pos-bottom-left #scw-bubble {
    right: auto; left: 0;
    transform-origin: bottom left;
}

#scw-bubble.show { opacity: 1; pointer-events: all; transform: translateY(0) scale(1); }

.scw-bubble-inner {
    background: var(--scw-brand, #1a1a2e);
    color: #fff;
    border-radius: 18px 18px 4px 18px;
    padding: 12px 15px;
    font-size: 13.5px;
    line-height: 1.45;
    position: relative;
    box-shadow: 0 4px 20px rgba(0,0,0,0.22);
}

#scw-launcher.pos-bottom-left .scw-bubble-inner {
    border-radius: 18px 18px 18px 4px;
}

.scw-bubble-inner::after {
    content: '';
    position: absolute;
    bottom: -8px; right: 14px;
    width: 0; height: 0;
    border-left: 8px solid transparent;
    border-top: 8px solid var(--scw-brand, #1a1a2e);
     padding: 10px 10px 10px 10px;
}

#scw-launcher.pos-bottom-left .scw-bubble-inner::after {
    right: auto; left: 14px;
    border-left: none;
    border-right: 8px solid transparent;
}

.scw-bubble-meta {
    display: flex; align-items: center; gap: 6px;
    margin-top: 7px; justify-content: flex-end;
}

.scw-bubble-dot { width: 6px; height: 6px; border-radius: 50%; background: #4ade80; }

.scw-bubble-name { font-size: 11px; color: rgba(255,255,255,0.55); }

.scw-bubble-close {
    position: absolute;
    top: -9px; right: -9px;
    width: 22px; height: 22px;
    border-radius: 50%;
    background: #fff;
    border: 1px solid #d1d5db;
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    font-size: 11px; color: #666; line-height: 1;
    box-shadow: 0 1px 4px rgba(0,0,0,0.1);
    transition: background 0.15s;
}

.scw-bubble-close:hover { background: #f3f4f6; }

/* ── Popup card ── */
#scw-popup {
    position: absolute;
    bottom: 76px; right: 0;
    width: 310px;
    background: #fff;
    border-radius: 20px;
    border: 1px solid rgba(0,0,0,0.08);
    overflow: hidden;
    transform: scale(0.85) translateY(20px);
    transform-origin: bottom right;
    opacity: 0;
    pointer-events: none;
    transition: transform 0.3s cubic-bezier(0.34,1.56,0.64,1), opacity 0.25s ease;
    box-shadow: 0 10px 44px rgba(0,0,0,0.14);
}

#scw-launcher.pos-bottom-left #scw-popup { right: auto; left: 0; transform-origin: bottom left; }

#scw-popup.show { transform: scale(1) translateY(0); opacity: 1; pointer-events: all; }

/* Popup header */
.scw-popup-head { padding: 20px 20px 22px; background: var(--scw-brand, #1a1a2e); }

.scw-popup-avatar-row { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }

.scw-avatar {
    width: 42px; height: 42px; border-radius: 50%;
    background: rgba(255,255,255,0.15);
    display: flex; align-items: center; justify-content: center;
    border: 2px solid rgba(255,255,255,0.2);
}

.scw-avatar svg { width: 20px; height: 20px; }

.scw-online {
    display: flex; align-items: center; gap: 5px;
    font-size: 12px; color: #a0f0c0;
}

.scw-online-dot {
    width: 7px; height: 7px; border-radius: 50%;
    background: #4ade80;
    animation: scwPulse 2s infinite;
}

@keyframes scwPulse { 0%,100%{opacity:1} 50%{opacity:0.35} }

.scw-popup-head h3 { font-size: 17px; font-weight: 600; color: #fff; margin: 0 0 5px; }
.scw-popup-head p  { font-size: 13px; color: rgba(255,255,255,0.6); line-height: 1.4; }

/* Channels */
.scw-channels { padding: 14px 14px 10px; display: flex; flex-direction: column; gap: 8px; }

.scw-channel {
    display: flex; align-items: center; gap: 12px;
    padding: 12px 14px;
    border-radius: 12px;
    border: 1px solid #f0f0f0;
    background: #fafafa;
    text-decoration: none;
    color: inherit;
    transition: background 0.15s, transform 0.15s, border-color 0.15s;
}

.scw-channel:hover { transform: translateX(4px); border-color: #e0e0e0; background: #f3f4f6; }
.scw-channel:active { transform: translateX(4px) scale(0.99); }

.scw-ch-ico {
    width: 38px; height: 38px; border-radius: 10px;
    display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}

.scw-ch-ico svg { width: 20px; height: 20px; }
.scw-ico-wa   { background: #e8faf1; }
.scw-ico-tw   { background: #e8f4ff; }
.scw-ico-fb   { background: #e8eeff; }
.scw-ico-call { background: #fff3e8; }

.scw-ch-text { flex: 1; }
.scw-ch-text span { display: block; font-size: 14px; font-weight: 500; color: #1a1a2e; }
.scw-ch-text small { font-size: 12px; color: #9ca3af; }

.scw-ch-arrow { font-size: 18px; color: #c0c0c0; }

/* Footer */
.scw-popup-foot { text-align: center; padding: 10px 14px 16px; font-size: 11.5px; color: #b0b0b0; }
