<?php if(optional($settings)->contact_email || optional($settings)->contact_whatsapp || optional($settings)->contact_telegram): ?>
<div class="contact-widget" id="contactWidget">
    <button class="contact-widget-toggle" id="contactWidgetToggle" aria-label="Contact us">
        <span class="contact-widget-icon-open">
            <svg width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><path d="M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z"/></svg>
        </span>
        <span class="contact-widget-icon-close">
            <svg width="22" height="22" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5"><line x1="18" y1="6" x2="6" y2="18"/><line x1="6" y1="6" x2="18" y2="18"/></svg>
        </span>
    </button>

    <div class="contact-widget-menu" id="contactWidgetMenu">
        <p class="contact-widget-label">Need help? Chat with us</p>

        <?php if(optional($settings)->contact_whatsapp): ?>
        <a href="https://wa.me/<?php echo e(preg_replace('/[^0-9]/', '', $settings->contact_whatsapp)); ?>" target="_blank" class="contact-widget-item contact-widget-whatsapp">
            <span class="contact-widget-item-icon">
                <svg viewBox="0 0 24 24" fill="currentColor" width="22" height="22"><path d="M17.472 14.382c-.297-.149-1.758-.867-2.03-.967-.273-.099-.471-.148-.67.15-.197.297-.767.966-.94 1.164-.173.199-.347.223-.644.075-.297-.15-1.255-.463-2.39-1.475-.883-.788-1.48-1.761-1.653-2.059-.173-.297-.018-.458.13-.606.134-.133.298-.347.446-.52.149-.174.198-.298.298-.497.099-.198.05-.371-.025-.52-.075-.149-.669-1.612-.916-2.207-.242-.579-.487-.5-.669-.51-.173-.008-.371-.01-.57-.01-.198 0-.52.074-.792.372-.272.297-1.04 1.016-1.04 2.479 0 1.462 1.065 2.875 1.213 3.074.149.198 2.096 3.2 5.077 4.487.709.306 1.262.489 1.694.625.712.227 1.36.195 1.871.118.571-.085 1.758-.719 2.006-1.413.248-.694.248-1.289.173-1.413-.074-.124-.272-.198-.57-.347m-5.421 7.403h-.004a9.87 9.87 0 01-5.031-1.378l-.361-.214-3.741.982.998-3.648-.235-.374a9.86 9.86 0 01-1.51-5.26c.001-5.45 4.436-9.884 9.888-9.884 2.64 0 5.122 1.03 6.988 2.898a9.825 9.825 0 012.893 6.994c-.003 5.45-4.437 9.884-9.885 9.884m8.413-18.297A11.815 11.815 0 0012.05 0C5.495 0 .16 5.335.157 11.892c0 2.096.547 4.142 1.588 5.945L.057 24l6.305-1.654a11.882 11.882 0 005.683 1.448h.005c6.554 0 11.89-5.335 11.893-11.893a11.821 11.821 0 00-3.48-8.413z"/></svg>
            </span>
            <div class="contact-widget-item-text">
                <span class="contact-widget-item-name">WhatsApp</span>
                <span class="contact-widget-item-sub">Chat with us</span>
            </div>
        </a>
        <?php endif; ?>

        <?php if(optional($settings)->contact_telegram): ?>
        <a href="https://t.me/<?php echo e(ltrim($settings->contact_telegram, '@')); ?>" target="_blank" class="contact-widget-item contact-widget-telegram">
            <span class="contact-widget-item-icon">
                <svg viewBox="0 0 24 24" fill="currentColor" width="22" height="22"><path d="M11.944 0A12 12 0 0 0 0 12a12 12 0 0 0 12 12 12 12 0 0 0 12-12A12 12 0 0 0 12 0a12 12 0 0 0-.056 0zm4.962 7.224c.1-.002.321.023.465.14a.506.506 0 0 1 .171.325c.016.093.036.306.02.472-.18 1.898-.962 6.502-1.36 8.627-.168.9-.499 1.201-.82 1.23-.696.065-1.225-.46-1.9-.902-1.056-.693-1.653-1.124-2.678-1.8-1.185-.78-.417-1.21.258-1.91.177-.184 3.247-2.977 3.307-3.23.007-.032.014-.15-.056-.212s-.174-.041-.249-.024c-.106.024-1.793 1.14-5.061 3.345-.48.33-.913.49-1.302.48-.428-.008-1.252-.241-1.865-.44-.752-.245-1.349-.374-1.297-.789.027-.216.325-.437.893-.663 3.498-1.524 5.83-2.529 6.998-3.014 3.332-1.386 4.025-1.627 4.476-1.635z"/></svg>
            </span>
            <div class="contact-widget-item-text">
                <span class="contact-widget-item-name">Telegram</span>
                <span class="contact-widget-item-sub">Message us</span>
            </div>
        </a>
        <?php endif; ?>

        <?php if(optional($settings)->contact_email): ?>
        <a href="mailto:<?php echo e($settings->contact_email); ?>" class="contact-widget-item contact-widget-email">
            <span class="contact-widget-item-icon">
                <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" width="22" height="22"><path d="M4 4h16c1.1 0 2 .9 2 2v12c0 1.1-.9 2-2 2H4c-1.1 0-2-.9-2-2V6c0-1.1.9-2 2-2z"/><polyline points="22,6 12,13 2,6"/></svg>
            </span>
            <div class="contact-widget-item-text">
                <span class="contact-widget-item-name">Email</span>
                <span class="contact-widget-item-sub"><?php echo e($settings->contact_email); ?></span>
            </div>
        </a>
        <?php endif; ?>
    </div>
</div>

<style>
.contact-widget{position:fixed;bottom:24px;right:24px;z-index:99999;display:flex;flex-direction:column;align-items:flex-end;gap:12px;pointer-events:none;}
.contact-widget-toggle{pointer-events:auto;}

.contact-widget-toggle{
    width:56px;height:56px;border-radius:50%;
    background:var(--primary-color,#ff8432);
    color:#fff;border:none;cursor:pointer;
    display:flex;align-items:center;justify-content:center;
    box-shadow:0 4px 24px rgba(0,0,0,.22);
    transition:transform .25s,box-shadow .25s;
    position:relative;
}
.contact-widget-toggle:hover{transform:scale(1.1);box-shadow:0 6px 28px rgba(0,0,0,.3);}
.contact-widget-toggle::before{
    content:'';
    position:absolute;inset:-4px;
    border-radius:50%;
    background:var(--primary-color,#ff8432);
    opacity:.2;
    animation:widgetPulse 2s ease-in-out infinite;
}
@keyframes widgetPulse{0%,100%{transform:scale(1);opacity:.2;}50%{transform:scale(1.3);opacity:0;}}

.contact-widget-icon-close{display:none;}
.contact-widget.open .contact-widget-icon-open{display:none;}
.contact-widget.open .contact-widget-icon-close{display:flex;}
.contact-widget.open .contact-widget-toggle::before{animation:none;opacity:0;}

.contact-widget-menu{
    display:flex;flex-direction:column;gap:8px;
    opacity:0;pointer-events:none;
    transform:translateY(12px) scale(.97);
    transition:opacity .25s,transform .25s;
    min-width:220px;
}
.contact-widget.open .contact-widget-menu{opacity:1;pointer-events:auto;transform:translateY(0) scale(1);}

.contact-widget-label{
    font-size:11px;font-weight:700;text-transform:uppercase;
    letter-spacing:.6px;color:rgba(255,255,255,.7);
    background:rgba(0,0,0,.35);backdrop-filter:blur(8px);
    padding:6px 14px;border-radius:20px;
    text-align:center;margin-bottom:2px;
}

.contact-widget-item{
    display:flex;align-items:center;gap:12px;
    padding:12px 16px;border-radius:16px;
    color:#fff;text-decoration:none;
    box-shadow:0 4px 16px rgba(0,0,0,.18);
    transition:transform .2s,box-shadow .2s;
    backdrop-filter:blur(4px);
}
.contact-widget-item:hover{transform:translateX(-5px);box-shadow:0 6px 20px rgba(0,0,0,.25);}

.contact-widget-item-icon{
    width:40px;height:40px;border-radius:12px;
    background:rgba(255,255,255,.2);
    display:flex;align-items:center;justify-content:center;
    flex-shrink:0;
}

.contact-widget-item-text{display:flex;flex-direction:column;gap:1px;}
.contact-widget-item-name{font-size:14px;font-weight:700;line-height:1.2;}
.contact-widget-item-sub{font-size:11px;opacity:.8;}

.contact-widget-whatsapp{background:linear-gradient(135deg,#25d366,#128c7e);}
.contact-widget-telegram{background:linear-gradient(135deg,#229ed9,#1a7ab5);}
.contact-widget-email{background:linear-gradient(135deg,#6366f1,#4f46e5);}
</style>

<script>
document.addEventListener('DOMContentLoaded',function(){
    var widget=document.getElementById('contactWidget');
    var btn=document.getElementById('contactWidgetToggle');
    if(!widget||!btn)return;
    btn.addEventListener('click',function(e){
        e.stopPropagation();
        widget.classList.toggle('open');
    });
    document.addEventListener('click',function(e){
        if(widget.classList.contains('open')&&!widget.contains(e.target)){
            widget.classList.remove('open');
        }
    });
});
</script>
<?php endif; ?>
<?php /**PATH C:\xampp\htdocs\jjd\socialnum\sstack\mine\core\resources\views/frontend/partial/contact-widget.blade.php ENDPATH**/ ?>