/* Quick Chat Widget Pro v3.1.8 - Theme Stocker */
.qcw-floating-wrapper {
    position: fixed;
    bottom: var(--qcw-bottom-offset, 80px);
    z-index: 999999;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    box-sizing: border-box;
    --qcw-primary: #059669;
}

.qcw-floating-wrapper *, 
.qcw-floating-wrapper *::before, 
.qcw-floating-wrapper *::after {
    box-sizing: border-box;
}

.qcw-pos-right {
    right: 20px;
}

.qcw-pos-left {
    left: 20px;
}

/* Minimize / Restore */
.qcw-minimize,
.qcw-restore {
    border: 0;
    cursor: pointer;
    align-items: center;
    justify-content: center;
    color: #fff;
    background: var(--qcw-primary);
    box-shadow: 0 5px 18px rgba(0,0,0,.20);
    font-family: inherit;
    line-height: 1;
}

.qcw-minimize {
    position: absolute;
    z-index: 1000001;
    top: 8px;
    right: 8px;
    width: 27px;
    height: 27px;
    border-radius: 50%;
    display: flex;
    font-size: 20px;
    font-weight: 400;
    opacity: .95;
}

.qcw-minimize:hover {
    opacity: .88;
    transform: scale(1.05);
}

/*
 * Clear restore CTA:
 * A fixed pill is used instead of "+" so ordinary visitors immediately
 * understand that the minimized widget can be opened.
 */
.qcw-restore {
    display: none;
    position: fixed;
    z-index: 1000001;
    bottom: var(--qcw-bottom-offset, 80px);
    width: auto;
    min-width: 108px;
    height: 42px;
    padding: 0 14px 0 12px;
    gap: 7px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: .45px;
    white-space: nowrap;
    margin: 0;
    animation: qcw-chat-pulse 2.8s ease-in-out infinite;
}

.qcw-pos-right .qcw-restore {
    right: 20px;
}

.qcw-pos-left .qcw-restore {
    left: 20px;
}

.qcw-chat-label {
    display: inline-block;
}

.qcw-chat-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 0 0 4px rgba(255,255,255,.16);
    flex: 0 0 auto;
}

.qcw-floating-wrapper.qcw-minimized .qcw-card {
    display: none;
}

.qcw-floating-wrapper.qcw-minimized .qcw-restore {
    display: flex;
}

.qcw-floating-wrapper.qcw-minimized {
    width: 1px;
    height: 1px;
    bottom: var(--qcw-bottom-offset, 80px);
}

@keyframes qcw-chat-pulse {
    0%, 100% {
        transform: translateY(0);
        box-shadow: 0 5px 18px rgba(0,0,0,.20);
    }
    50% {
        transform: translateY(-2px);
        box-shadow: 0 7px 22px rgba(0,0,0,.25);
    }
}

.qcw-scheme-blue { --qcw-primary: #2563eb; }
.qcw-scheme-purple { --qcw-primary: #7c3aed; }
.qcw-scheme-red { --qcw-primary: #dc2626; }
.qcw-scheme-orange { --qcw-primary: #ea580c; }
.qcw-scheme-dark { --qcw-primary: #334155; }

/* Card Styling */
.qcw-card {
    width: 215px;
    max-height: 90vh;
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.18);
    overflow-y: auto;
    border: 1px solid color-mix(in srgb, var(--qcw-primary) 22%, #e2e8f0);
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.qcw-card::-webkit-scrollbar {
    width: 4px;
}

.qcw-card::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
}

.qcw-card:hover {
    transform: translateY(-5px);
}

.qcw-image-container {
    position: relative;
    width: 100%;
    height: 160px;
    overflow: hidden;
    background: #f1f5f9;
}

.qcw-agent-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.qcw-badge-info {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.85), rgba(0,0,0,0));
    padding: 16px 10px 8px 10px;
    color: #ffffff;
}

.qcw-agent-name {
    display: block;
    font-size: 13px;
    font-weight: 700;
    line-height: 1.2;
}

.qcw-agent-status {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 10px;
    opacity: 0.9;
    margin-top: 2px;
}

.qcw-status-dot {
    width: 6px;
    height: 6px;
    background-color: #22c55e;
    border-radius: 50%;
    display: inline-block;
}

.qcw-content {
    padding: 10px;
    background: #ffffff;
}

.qcw-message {
    font-size: 11px;
    color: #475569;
    margin: 0 0 8px 0;
    text-align: center;
    font-weight: 500;
    line-height: 1.35;
}

/* Button Channel Styling & Colors */
.qcw-actions {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.qcw-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 7px 8px;
    border-radius: 8px;
    text-decoration: none !important;
    font-size: 10.5px;
    font-weight: 700;
    letter-spacing: 0.3px;
    color: #ffffff !important;
    transition: all 0.2s ease;
}

.qcw-btn:hover {
    opacity: 0.92;
    transform: scale(1.01);
}

.qcw-btn-whatsapp  { background-color: var(--qcw-color-whatsapp, #059669); }
.qcw-btn-call      { background-color: var(--qcw-color-call, #16a34a); }
.qcw-btn-telegram  { background-color: var(--qcw-color-telegram, #0088cc); }
.qcw-btn-messenger { background-color: var(--qcw-color-messenger, #0084ff); }
.qcw-btn-discord   { background-color: var(--qcw-color-discord, #5865f2); }
.qcw-btn-imo       { background-color: var(--qcw-color-imo, #00a8e8); }
.qcw-btn-wechat    { background-color: var(--qcw-color-wechat, #07c160); }
.qcw-btn-viber     { background-color: var(--qcw-color-viber, #7d51a0); }
.qcw-btn-custom    { background-color: var(--qcw-color-custom, #475569); }

.qcw-footer-branding {
    font-size: 8.5px;
    text-align: center;
    padding: 4px 0 5px 0;
    background: #f8fafc;
    color: #94a3b8;
    border-top: 1px solid #f1f5f9;
}

.qcw-footer-branding a {
    color: #64748b;
    text-decoration: none;
    font-weight: 600;
}

/* Mobile Responsiveness */
@media screen and (max-width: 576px) {
    .qcw-floating-wrapper {
        bottom: var(--qcw-bottom-offset, 80px);
        max-width: calc(100vw - 16px);
    }
    .qcw-pos-right { right: 8px; }
    .qcw-pos-left  { left: 8px; }
    .qcw-pos-right .qcw-restore { right: 8px; }
    .qcw-pos-left .qcw-restore { left: 8px; }
    .qcw-card {
        width: min(215px, calc(100vw - 16px));
        max-height: min(82vh, 620px);
        border-radius: 13px;
    }
    .qcw-image-container {
        height: 120px;
    }
    .qcw-content { padding: 9px; }
    .qcw-message {
        font-size: 10px;
        margin-bottom: 7px;
    }
    .qcw-actions { gap: 5px; }
    .qcw-btn {
        min-height: 34px;
        padding: 6px 7px;
        font-size: 9px;
        border-radius: 6px;
    }
    .qcw-btn svg {
        width: 13px;
        height: 13px;
        flex: 0 0 auto;
    }
    .qcw-minimize {
        top: 7px;
        right: 7px;
        width: 28px;
        height: 28px;
    }
    .qcw-restore {
        min-width: 104px;
        height: 40px;
        padding: 0 13px 0 11px;
        font-size: 10px;
        bottom: var(--qcw-bottom-offset, 80px);
    }
    .qcw-floating-wrapper.qcw-minimized {
        width: 1px;
        height: 1px;
    }
}

/* Very small phones */
@media screen and (max-width: 360px) {
    .qcw-card {
        width: min(200px, calc(100vw - 12px));
    }
    .qcw-image-container { height: 105px; }
    .qcw-btn { font-size: 8.5px; min-height: 32px; }
}
