/* Smart Contact Widget - Frontend Styles */

:root {
    --scw-wa-color:   #25D366;
    --scw-call-color: #0078D4;
    --scw-size:       56px;
    --scw-shadow:     0 4px 20px rgba(0,0,0,.18);
    --scw-radius:     16px;
    --scw-z:          99999;
}

.scw-widget {
    position: fixed;
    z-index: var(--scw-z);
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 10px;
}

/* Positions */
.scw-pos-bottom-right { bottom: 24px; right: 24px; }
.scw-pos-bottom-left  { bottom: 24px; left: 24px; align-items: flex-start; }

/* Visibility */
@media (min-width: 769px) { .scw-hide-desktop { display: none !important; } }
@media (max-width: 768px) { .scw-hide-mobile  { display: none !important; } }

/* ---- Greeting ---- */
.scw-greeting {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 12px 12px 4px 12px;
    padding: 10px 16px;
    font-size: 14px;
    color: #333;
    box-shadow: var(--scw-shadow);
    max-width: 220px;
    animation: scwFadeIn .4s ease;
}
.scw-pos-bottom-left .scw-greeting { border-radius: 12px 12px 12px 4px; }

/* ---- Buttons Stack ---- */
.scw-buttons { display: flex; flex-direction: column; gap: 10px; align-items: flex-end; }
.scw-pos-bottom-left .scw-buttons { align-items: flex-start; }

/* ---- FAB ---- */
.scw-fab {
    width:  var(--scw-size);
    height: var(--scw-size);
    border-radius: 50%;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--scw-shadow);
    transition: transform .2s, box-shadow .2s;
    position: relative;
    flex-shrink: 0;
}
.scw-fab:hover  { transform: scale(1.08); box-shadow: 0 6px 24px rgba(0,0,0,.22); }
.scw-fab:active { transform: scale(.97); }

.scw-fab svg { width: 52%; height: 52%; }

.scw-fab-wa   { background: var(--scw-wa-color);   color: #fff; }
.scw-fab-call { background: var(--scw-call-color); color: #fff; }

/* Pulse ring */
.scw-fab::after {
    content: '';
    position: absolute;
    inset: -4px;
    border-radius: 50%;
    border: 2px solid currentColor;
    opacity: 0;
    animation: scwPulse 2.5s ease-out infinite;
}
.scw-fab-wa::after   { border-color: var(--scw-wa-color); }
.scw-fab-call::after { border-color: var(--scw-call-color); }

@keyframes scwPulse {
    0%   { inset: -4px; opacity: .6; }
    100% { inset: -18px; opacity: 0; }
}

/* ---- Popup ---- */
.scw-popup {
    position: fixed;
    bottom: calc(24px + var(--scw-size) + 16px);
    right: 24px;
    width: 300px;
    background: #fff;
    border-radius: var(--scw-radius);
    box-shadow: 0 8px 40px rgba(0,0,0,.22);
    z-index: calc(var(--scw-z) + 1);
    overflow: hidden;
    display: none;
    animation: scwSlideUp .25s ease;
}
.scw-pos-bottom-left .scw-popup { right: auto; left: 24px; }

.scw-popup.scw-open { display: block; }

@keyframes scwSlideUp {
    from { opacity: 0; transform: translateY(16px); }
    to   { opacity: 1; transform: translateY(0); }
}

.scw-popup-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 16px;
    color: #fff;
    font-weight: 600;
    font-size: 15px;
}
.scw-popup-header-wa   { background: var(--scw-wa-color); }
.scw-popup-header-call { background: var(--scw-call-color); }

.scw-popup-icon { width: 22px; height: 22px; flex-shrink: 0; }

.scw-popup-close {
    margin-left: auto;
    background: rgba(255,255,255,.25);
    border: none;
    color: #fff;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background .15s;
    flex-shrink: 0;
}
.scw-popup-close:hover { background: rgba(255,255,255,.4); }

.scw-popup-body { padding: 8px 0; }

.scw-contact-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    text-decoration: none;
    color: #333;
    transition: background .15s;
}
.scw-contact-item:hover { background: #f7f7f7; color: #333; }

.scw-contact-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    flex-shrink: 0;
}
.scw-avatar-wa   { background: #e8f8ef; }
.scw-avatar-call { background: #e8f0fb; }

.scw-contact-info { display: flex; flex-direction: column; gap: 2px; flex: 1; }
.scw-contact-info strong { font-size: 14px; font-weight: 600; color: #1d2327; }
.scw-contact-info small  { font-size: 12px; color: #646970; }

.scw-contact-arrow { font-size: 20px; color: #c3c4c7; }

/* ---- Overlay ---- */
.scw-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.3);
    z-index: var(--scw-z);
    display: none;
}
.scw-overlay.scw-open { display: block; }

/* ---- Animations ---- */
@keyframes scwFadeIn {
    from { opacity: 0; transform: translateY(6px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* Mobile adjustments */
@media (max-width: 480px) {
    .scw-popup { width: calc(100vw - 48px); }
    .scw-pos-bottom-right { right: 16px; bottom: 16px; }
    .scw-pos-bottom-left  { left: 16px;  bottom: 16px; }
    .scw-popup { right: 16px; }
    .scw-pos-bottom-left .scw-popup { right: auto; left: 16px; }
}
