/* ============================================================
   Gladiator WhatsApp Button — Frontend Styles
   Built by Gladiator Marketing | www.gdr.co.il
   ============================================================ */

:root {
    --gwb-green: #25D366;
    --gwb-dark-green: #075E54;
    --gwb-teal: #128C7E;
    --gwb-light-bg: #ECE5DD;
    --gwb-bubble-bg: #DCF8C6;
    --gwb-grey: #9E9E9E;
    --gwb-radius: 18px;
    --gwb-shadow: 0 8px 32px rgba(0, 0, 0, 0.18);
    --gwb-pos-x: 24px;
    --gwb-pos-y: 24px;
    --gwb-popup-pos-y: 100px;
    --gwb-popup-side-x: 100px;
    --gwb-popup-width: 320px;
}

/* ── FLOATING BUTTON ── */
#gwb-float-btn {
    position: fixed;
    z-index: 99999;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: transform 0.3s cubic-bezier(.34, 1.56, .64, 1), box-shadow 0.3s;
}

#gwb-float-btn:hover {
    transform: scale(1.1) !important;
}

/* POSITIONS */
#gwb-float-btn.pos-bottom-right {
    bottom: var(--gwb-pos-y, 24px);
    right: var(--gwb-pos-x, 24px);
}

#gwb-float-btn.pos-bottom-left {
    bottom: var(--gwb-pos-y, 24px);
    left: var(--gwb-pos-x, 24px);
}

#gwb-float-btn.pos-bottom-center {
    bottom: var(--gwb-pos-y, 24px);
    left: 50%;
    transform: translateX(-50%);
}

#gwb-float-btn.pos-middle-right {
    top: 50%;
    right: var(--gwb-pos-x, 24px);
    transform: translateY(-50%);
}

#gwb-float-btn.pos-middle-left {
    top: 50%;
    left: var(--gwb-pos-x, 24px);
    transform: translateY(-50%);
}

#gwb-float-btn.pos-middle-center {
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

/* ROUND shape */
#gwb-float-btn.shape-round .gwb-btn-inner {
    border-radius: 50%;
}

#gwb-float-btn.shape-round {
    flex-direction: column;
    align-items: center;
}

#gwb-float-btn.shape-round .gwb-btn-label {
    display: none;
}

/* RECTANGLE shape */
#gwb-float-btn.shape-rectangle .gwb-btn-inner {
    border-radius: 50px;
    padding: 0 22px 0 14px;
    min-width: 180px;
    justify-content: center;
    gap: 10px;
}

#gwb-float-btn.shape-rectangle .gwb-btn-label {
    display: inline;
    font-size: 15px;
    font-weight: 700;
    font-family: -apple-system, 'Segoe UI', sans-serif;
    white-space: nowrap;
}

/* BUTTON INNER */
.gwb-btn-inner {
    background: var(--gwb-green);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--gwb-shadow);
    transition: background 0.3s;
    position: relative;
}

/* SIZES */
#gwb-float-btn.size-small .gwb-btn-inner {
    width: 52px;
    height: 52px;
}

#gwb-float-btn.size-normal .gwb-btn-inner {
    width: 64px;
    height: 64px;
}

#gwb-float-btn.size-large .gwb-btn-inner {
    width: 76px;
    height: 76px;
}

#gwb-float-btn.size-small.shape-rectangle .gwb-btn-inner {
    height: 44px;
    width: auto;
}

#gwb-float-btn.size-normal.shape-rectangle .gwb-btn-inner {
    height: 54px;
    width: auto;
}

#gwb-float-btn.size-large.shape-rectangle .gwb-btn-inner {
    height: 64px;
    width: auto;
}

#gwb-float-btn.size-small svg {
    width: 28px;
    height: 28px;
}

#gwb-float-btn.size-normal svg {
    width: 36px;
    height: 36px;
}

#gwb-float-btn.size-large svg {
    width: 44px;
    height: 44px;
}

/* Custom icon image — matches SVG sizes per button size */
#gwb-float-btn.size-small .gwb-btn-icon img  { width: 28px; height: 28px; object-fit: contain; display: block; }
#gwb-float-btn.size-normal .gwb-btn-icon img { width: 36px; height: 36px; object-fit: contain; display: block; }
#gwb-float-btn.size-large .gwb-btn-icon img  { width: 44px; height: 44px; object-fit: contain; display: block; }

/* INACTIVE state */
#gwb-float-btn.gwb-inactive .gwb-btn-inner {
    background: var(--gwb-grey) !important;
}

#gwb-float-btn.gwb-inactive .gwb-pulse-ring {
    display: none !important;
}

/* STATUS BADGE */
.gwb-status-tag {
    font-size: 11px;
    font-weight: 700;
    font-family: -apple-system, 'Segoe UI', Arial, sans-serif;
    padding: 3px 10px;
    border-radius: 20px;
    white-space: nowrap;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    direction: rtl;
    letter-spacing: 0.3px;
}

.gwb-status-tag.open {
    background: #25D366 !important;
    color: #fff !important;
}

.gwb-status-tag.closed {
    background: #9E9E9E !important;
    color: #fff !important;
}

/* PULSE RING */
.gwb-pulse-ring {
    position: absolute;
    border-radius: 50%;
    border: 3px solid var(--gwb-green);
    animation: gwb-pulse 1.8s ease-out infinite;
    pointer-events: none;
}

#gwb-float-btn.size-small .gwb-pulse-ring  { inset: -4px; }
#gwb-float-btn.size-normal .gwb-pulse-ring { inset: -5px; }
#gwb-float-btn.size-large .gwb-pulse-ring  { inset: -7px; }

@keyframes gwb-pulse {
    0% {
        opacity: 0.7;
        transform: scale(1);
    }

    80% {
        opacity: 0;
        transform: scale(1.6);
    }

    100% {
        opacity: 0;
        transform: scale(1.6);
    }
}

/* ── BUTTON ANIMATIONS ── */

/* GLOW */
#gwb-float-btn.anim-glow .gwb-btn-inner {
    animation: gwb-glow 2s ease-in-out infinite;
}

@keyframes gwb-glow {
    0%, 100% { box-shadow: var(--gwb-shadow); }
    50%       { box-shadow: 0 0 0 12px rgba(37, 211, 102, .25), 0 8px 32px rgba(0, 0, 0, .18); }
}

/* BOUNCE */
#gwb-float-btn.anim-bounce .gwb-btn-inner {
    animation: gwb-btn-bounce 1.4s ease infinite;
}

@keyframes gwb-btn-bounce {
    0%, 60%, 100% { transform: translateY(0); }
    30%            { transform: translateY(-8px); }
}

/* SHAKE */
#gwb-float-btn.anim-shake .gwb-btn-inner {
    animation: gwb-btn-shake 1.6s ease infinite;
}

@keyframes gwb-btn-shake {
    0%, 100%      { transform: rotate(0deg); }
    10%, 30%, 50% { transform: rotate(-8deg); }
    20%, 40%      { transform: rotate(8deg); }
    60%           { transform: rotate(0deg); }
}

/* Disable animations when inactive */
#gwb-float-btn.gwb-inactive .gwb-btn-inner {
    animation: none !important;
}

/* ── POPUP ── */
#gwb-popup {
    position: fixed;
    z-index: 99998;
    width: var(--gwb-popup-width, 320px);
    max-width: calc(100vw - 40px);
    background: #fff;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 16px 48px rgba(0, 0, 0, .22);
    direction: rtl;
    font-family: -apple-system, 'Segoe UI', Arial, sans-serif;
    animation: gwb-pop-in 0.35s cubic-bezier(.34, 1.56, .64, 1);
    display: none;
}

#gwb-popup.gwb-popup-open {
    display: block;
}

@keyframes gwb-pop-in {
    from {
        opacity: 0;
        transform: scale(0.85) translateY(20px);
    }

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

/* Popup Position helpers */
#gwb-popup.pos-bottom-right {
    bottom: var(--gwb-popup-pos-y, 100px);
    right: var(--gwb-popup-side-x, 24px);
}

#gwb-popup.pos-bottom-left {
    bottom: var(--gwb-popup-pos-y, 100px);
    left: var(--gwb-popup-side-x, 24px);
}

#gwb-popup.pos-bottom-center {
    bottom: var(--gwb-popup-pos-y, 100px);
    left: 50%;
    transform: translateX(-50%);
}

#gwb-popup.pos-middle-right {
    top: 50%;
    right: var(--gwb-popup-side-x, 100px);
    transform: translateY(-50%);
}

#gwb-popup.pos-middle-left {
    top: 50%;
    left: var(--gwb-popup-side-x, 100px);
    transform: translateY(-50%);
}

#gwb-popup.pos-middle-center {
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

/* Popup Header */
.gwb-popup-header {
    background: var(--gwb-dark-green);
    padding: 14px 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    position: relative;
}

.gwb-popup-avatar {
    width: 46px;
    height: 46px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid rgba(255, 255, 255, 0.3);
    flex-shrink: 0;
}

.gwb-popup-info {
    flex: 1;
}

.gwb-popup-name {
    color: #fff;
    font-size: 15px;
    font-weight: 700;
    line-height: 1.2;
}

.gwb-popup-status {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.75);
    display: flex;
    align-items: center;
    gap: 5px;
}

.gwb-status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
}

.gwb-status-dot.open {
    background: #4ADB6A;
    box-shadow: 0 0 6px #4ADB6A;
}

.gwb-status-dot.closed {
    background: #bbb;
}

.gwb-popup-close {
    position: absolute;
    top: 8px;
    left: 8px;
    background: rgba(255, 255, 255, 0.12);
    border: none;
    color: rgba(255, 255, 255, 0.85);
    font-size: 18px;
    cursor: pointer;
    line-height: 1;
    padding: 0;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s, transform 0.15s, color 0.2s;
}

.gwb-popup-close:hover {
    background: rgba(255, 255, 255, 0.25);
    color: #fff;
    transform: scale(1.12);
}

/* Popup Body */
.gwb-popup-body {
    background: var(--gwb-light-bg);
    padding: 16px;
    background-image: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23000000' fill-opacity='0.03'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}

/* Chat bubble */
.gwb-chat-bubble-wrap {
    display: flex;
    gap: 10px;
    margin-bottom: 16px;
}

.gwb-bubble-avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
    align-self: flex-end;
}

.gwb-chat-bubble {
    background: #fff;
    border-radius: 0 12px 12px 12px;
    padding: 10px 14px;
    font-size: 14px;
    line-height: 1.55;
    color: #111;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
    max-width: 230px;
    position: relative;
}

.gwb-chat-bubble::before {
    content: '';
    position: absolute;
    top: 0;
    right: 100%;
    border: 8px solid transparent;
    border-top-color: #fff;
    border-right-color: #fff;
}

/* Typing dots animation */
.gwb-typing {
    display: flex;
    gap: 5px;
    align-items: center;
    padding: 4px 0;
}

.gwb-typing span {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #aaa;
    animation: gwb-bounce 1.2s infinite;
}

.gwb-typing span:nth-child(2) {
    animation-delay: 0.2s;
}

.gwb-typing span:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes gwb-bounce {

    0%,
    60%,
    100% {
        transform: translateY(0);
    }

    30% {
        transform: translateY(-6px);
    }
}

/* Time stamp */
.gwb-bubble-time {
    text-align: left;
    font-size: 11px;
    color: #999;
    margin-top: 4px;
}

/* Hours toggle button */
.gwb-hours-wrap {
    margin-bottom: 12px;
}

.gwb-hours-toggle-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: rgba(0, 0, 0, 0.06);
    border: 1px solid rgba(0, 0, 0, 0.12);
    border-radius: 20px;
    padding: 5px 12px;
    font-size: 12px;
    font-weight: 600;
    color: #555;
    cursor: pointer;
    font-family: inherit;
    direction: rtl;
    transition: background 0.2s, color 0.2s;
    width: 100%;
    justify-content: center;
    margin-bottom: 6px;
}

.gwb-hours-toggle-btn:hover,
.gwb-hours-toggle-btn.active {
    background: rgba(37, 211, 102, 0.12);
    color: #128C7E;
    border-color: rgba(37, 211, 102, 0.3);
}

.gwb-hours-details {
    font-size: 11px;
    color: #666;
    text-align: center;
    background: rgba(0, 0, 0, 0.04);
    border-radius: 8px;
    padding: 8px 10px;
    line-height: 1.8;
    animation: gwb-fade-in 0.2s ease;
    direction: rtl;
}

@keyframes gwb-fade-in {
    from {
        opacity: 0;
        transform: translateY(-4px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}


/* Agent CTA Buttons */
.gwb-agent-btn {
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--gwb-green) !important;
    color: #fff !important;
    border: none !important;
    border-radius: 12px;
    padding: 12px 16px;
    width: 100%;
    cursor: pointer;
    margin-bottom: 8px;
    font-size: 14px;
    font-weight: 600;
    font-family: inherit;
    text-decoration: none !important;
    transition: background 0.2s, transform 0.15s;
    direction: rtl;
    text-align: right;
    box-shadow: 0 2px 8px rgba(37, 211, 102, .28) !important;
}

.gwb-agent-btn:hover {
    background: var(--gwb-teal) !important;
    transform: translateY(-1px);
    color: #fff !important;
    text-decoration: none !important;
}

.gwb-agent-btn.inactive {
    background: var(--gwb-grey) !important;
    box-shadow: none !important;
}

.gwb-agent-btn-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
    border: 2px solid rgba(255, 255, 255, 0.4);
}

.gwb-agent-btn-text {
    flex: 1;
}

.gwb-agent-btn-name {
    font-size: 14px;
    font-weight: 700;
}

.gwb-agent-btn-role {
    font-size: 11px;
    opacity: 0.85;
}

/* WA icon inside button */
.gwb-agent-btn-icon {
    flex-shrink: 0;
    opacity: 0.8;
}

/* Footer credit */
.gwb-popup-credit {
    background: #f7f7f7;
    border-top: 1px solid #eee;
    text-align: center;
    padding: 8px;
    font-size: 10px;
    color: #aaa;
    font-family: -apple-system, 'Segoe UI', sans-serif;
    letter-spacing: 0.3px;
}

.gwb-popup-credit a {
    color: #888 !important;
    text-decoration: none !important;
}

.gwb-popup-credit a:hover {
    color: #25D366 !important;
}

/* ── RESPONSIVE ── */
@media (max-width: 480px) {
    #gwb-float-btn.pos-bottom-right {
        bottom: var(--gwb-pos-y, 16px);
        right: var(--gwb-pos-x, 16px);
    }

    #gwb-float-btn.pos-bottom-left {
        bottom: var(--gwb-pos-y, 16px);
        left: var(--gwb-pos-x, 16px);
    }

    #gwb-float-btn.size-normal .gwb-btn-inner {
        width: 56px;
        height: 56px;
    }

    #gwb-float-btn.size-large .gwb-btn-inner {
        width: 64px;
        height: 64px;
    }

    #gwb-popup.pos-bottom-right,
    #gwb-popup.pos-bottom-left {
        bottom: var(--gwb-popup-pos-y, 90px);
        right: var(--gwb-popup-side-x, 16px);
        left: auto;
    }

    #gwb-popup.pos-middle-right,
    #gwb-popup.pos-middle-left,
    #gwb-popup.pos-middle-center {
        top: auto;
        bottom: var(--gwb-popup-pos-y, 90px);
        left: var(--gwb-popup-side-x, 16px);
        right: var(--gwb-popup-side-x, 16px);
        transform: none;
    }

    #gwb-popup.pos-bottom-center {
        left: var(--gwb-popup-side-x, 16px);
        right: var(--gwb-popup-side-x, 16px);
        transform: none;
    }
}

/* ── THEME ISOLATION ────────────────────────────────────────────────────────
   Prevents Elementor / theme CSS from bleeding into the plugin.
   Common culprits: a{color}, a:hover{color}, a:active{color}, :focus outlines,
   button{background}, .active{color/background}.
   ────────────────────────────────────────────────────────────────────────── */

/* Cover ALL link states for the agent button (it's an <a> tag) */
a.gwb-agent-btn,
a.gwb-agent-btn:link,
a.gwb-agent-btn:visited {
    color: #fff !important;
    background: var(--gwb-green) !important;
    text-decoration: none !important;
}

a.gwb-agent-btn:hover,
a.gwb-agent-btn:focus,
a.gwb-agent-btn:active {
    color: #fff !important;
    background: var(--gwb-teal) !important;
    text-decoration: none !important;
}

a.gwb-agent-btn.inactive,
a.gwb-agent-btn.inactive:hover,
a.gwb-agent-btn.inactive:focus,
a.gwb-agent-btn.inactive:active {
    background: var(--gwb-grey) !important;
    color: #fff !important;
    box-shadow: none !important;
}

/* Credit link states */
.gwb-popup-credit a:link,
.gwb-popup-credit a:visited,
.gwb-popup-credit a:active {
    color: #888 !important;
    text-decoration: none !important;
}

/* Prevent theme :focus outlines on internal UI elements */
.gwb-popup-close:focus,
.gwb-hours-toggle-btn:focus,
.gwb-agent-btn:focus-visible {
    outline: none !important;
    box-shadow: none !important;
}

/* Prevent theme .active class (e.g. Elementor menu) from tinting text */
#gwb-mount .active,
#gwb-popup .active,
#gwb-float-btn.active {
    color: inherit !important;
}

/* Protect the float button from theme button/a resets */
#gwb-float-btn {
    background: transparent !important;
    border: none !important;
    padding: 0 !important;
    margin: 0 !important;
    text-decoration: none !important;
    outline: none !important;
}

/* Ensure popup SVG icons are never recolored by theme */
#gwb-popup svg,
#gwb-float-btn svg {
    fill: currentColor !important;
    color: inherit !important;
}