/* ArcaQ WhatsApp Popup Widget — Sovereign Chat Experience */

/* ─── FAB Button (floating) ─── */
.arcaq-whatsapp-widget {
    position: fixed;
    bottom: 28px;
    right: 28px;
    z-index: 9998;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

.arcaq-wa-fab {
    width: 62px;
    height: 62px;
    border-radius: 50%;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #7c3aed 0%, #3b82f6 50%, #8b5cf6 100%);
    box-shadow: 0 4px 24px rgba(124, 58, 237, 0.45);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    animation: arcaq-wa-pulse 3s ease-in-out infinite;
    position: relative;
}

.arcaq-wa-fab:hover {
    transform: scale(1.1);
    box-shadow: 0 8px 36px rgba(124, 58, 237, 0.55), 0 0 0 8px rgba(124, 58, 237, 0.1);
    animation: none;
}

.arcaq-wa-fab:active { transform: scale(0.95); }

/* Icons inside FAB */
.arcaq-wa-fab svg { width: 30px; height: 30px; fill: #fff; filter: drop-shadow(0 1px 2px rgba(0,0,0,0.2)); transition: transform 0.3s, opacity 0.3s; }
.arcaq-wa-fab .wa-icon-close { display: none; width: 22px; height: 22px; }
.arcaq-wa-fab.is-open .wa-icon-wa   { display: none; }
.arcaq-wa-fab.is-open .wa-icon-close { display: block; }

/* Online dot on FAB */
.arcaq-wa-fab::after {
    content: '';
    position: absolute;
    top: 2px;
    right: 2px;
    width: 14px;
    height: 14px;
    background: #22c55e;
    border-radius: 50%;
    border: 2.5px solid #0f172a;
    animation: arcaq-wa-online 2s ease-in-out infinite;
    transition: opacity 0.3s;
}
.arcaq-wa-fab.is-open::after { opacity: 0; }

@keyframes arcaq-wa-pulse {
    0%, 100% { box-shadow: 0 4px 24px rgba(124,58,237,0.45), 0 0 0 0 rgba(124,58,237,0.3); }
    50%      { box-shadow: 0 4px 24px rgba(124,58,237,0.45), 0 0 0 14px rgba(124,58,237,0); }
}

@keyframes arcaq-wa-online {
    0%, 100% { opacity: 1; }
    50%      { opacity: 0.6; }
}

/* ─── Popup Card ─── */
.arcaq-wa-popup {
    position: fixed;
    bottom: 102px;
    right: 28px;
    width: 370px;
    z-index: 9999;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0,0,0,0.5), 0 0 0 1px rgba(139,92,246,0.2);
    transform: translateY(20px) scale(0.92);
    opacity: 0;
    visibility: hidden;
    transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: none;
}

.arcaq-wa-popup.is-visible {
    transform: translateY(0) scale(1);
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

/* ── Header ── */
.arcaq-wa-header {
    background: linear-gradient(135deg, #1e1b4b 0%, #0f172a 100%);
    padding: 24px 24px 20px;
    position: relative;
    overflow: hidden;
}

.arcaq-wa-header::before {
    content: '';
    position: absolute;
    top: -40px;
    right: -40px;
    width: 120px;
    height: 120px;
    background: radial-gradient(circle, rgba(139,92,246,0.15) 0%, transparent 70%);
    pointer-events: none;
}

.arcaq-wa-header-close {
    position: absolute;
    top: 12px;
    right: 12px;
    background: rgba(255,255,255,0.1);
    border: none;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #94a3b8;
    font-size: 18px;
    line-height: 1;
    transition: all 0.2s;
}
.arcaq-wa-header-close:hover { background: rgba(255,255,255,0.2); color: #fff; }

.arcaq-wa-avatar {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: linear-gradient(135deg, #7c3aed, #3b82f6);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 14px;
    border: 3px solid rgba(139,92,246,0.3);
}

.arcaq-wa-avatar svg { width: 28px; height: 28px; fill: #fff; }

.arcaq-wa-header-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: #fff;
    margin: 0 0 4px;
    line-height: 1.3;
}

.arcaq-wa-header-sub {
    font-size: 0.82rem;
    color: #94a3b8;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 6px;
}

.arcaq-wa-header-sub .online-dot {
    width: 8px;
    height: 8px;
    background: #22c55e;
    border-radius: 50%;
    display: inline-block;
    animation: arcaq-wa-online 2s ease-in-out infinite;
}

/* ── Body ── */
.arcaq-wa-body {
    background: #0f172a;
    padding: 20px 24px;
}

/* Chat bubble */
.arcaq-wa-bubble {
    background: rgba(30, 41, 59, 0.9);
    border: 1px solid rgba(139,92,246,0.15);
    border-radius: 0 16px 16px 16px;
    padding: 16px;
    margin-bottom: 16px;
    position: relative;
}

.arcaq-wa-bubble::before {
    content: '';
    position: absolute;
    top: 0;
    left: -8px;
    width: 0;
    height: 0;
    border-top: 8px solid rgba(30,41,59,0.9);
    border-left: 8px solid transparent;
}

.arcaq-wa-bubble-text {
    font-size: 0.9rem;
    color: #e2e8f0;
    line-height: 1.6;
    margin: 0;
}

.arcaq-wa-bubble-time {
    font-size: 0.7rem;
    color: #64748b;
    text-align: right;
    margin-top: 8px;
}

/* Phone row */
.arcaq-wa-phone {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    background: rgba(30, 41, 59, 0.6);
    border: 1px solid rgba(59,130,246,0.15);
    border-radius: 12px;
    margin-bottom: 16px;
}

.arcaq-wa-phone-icon {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(34,197,94,0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.arcaq-wa-phone-icon svg { width: 18px; height: 18px; fill: #22c55e; }

.arcaq-wa-phone-info { display: flex; flex-direction: column; }

.arcaq-wa-phone-number {
    font-size: 0.95rem;
    font-weight: 600;
    color: #e2e8f0;
    letter-spacing: 0.02em;
}

.arcaq-wa-phone-label {
    font-size: 0.72rem;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* CTA Button */
.arcaq-wa-cta {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    padding: 14px 24px;
    border: none;
    border-radius: 14px;
    cursor: pointer;
    font-family: inherit;
    font-size: 0.95rem;
    font-weight: 700;
    color: #fff;
    background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%);
    box-shadow: 0 4px 16px rgba(34,197,94,0.3);
    transition: all 0.3s;
    text-decoration: none;
}

.arcaq-wa-cta:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(34,197,94,0.4);
    color: #fff;
    text-decoration: none;
}

.arcaq-wa-cta:active { transform: translateY(0); }

.arcaq-wa-cta svg { width: 22px; height: 22px; fill: #fff; }

/* Footer */
.arcaq-wa-footer {
    background: rgba(15, 23, 42, 0.95);
    padding: 12px 24px;
    text-align: center;
    border-top: 1px solid rgba(255,255,255,0.05);
}

.arcaq-wa-footer-text {
    font-size: 0.7rem;
    color: #475569;
    margin: 0;
}

.arcaq-wa-footer-text a { color: #7c3aed; text-decoration: none; }

/* ─── Backdrop ─── */
.arcaq-wa-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.25);
    z-index: 9997;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s;
    -webkit-backdrop-filter: blur(2px);
    backdrop-filter: blur(2px);
}

.arcaq-wa-backdrop.is-visible {
    opacity: 1;
    visibility: visible;
}

/* ─── RTL ─── */
[dir="rtl"] .arcaq-whatsapp-widget { right: auto; left: 28px; }
[dir="rtl"] .arcaq-wa-popup         { right: auto; left: 28px; }
[dir="rtl"] .arcaq-wa-header-close   { right: auto; left: 12px; }
[dir="rtl"] .arcaq-wa-bubble         { border-radius: 16px 0 16px 16px; }
[dir="rtl"] .arcaq-wa-bubble::before { left: auto; right: -8px; border-left: none; border-top: 8px solid rgba(30,41,59,0.9); border-right: 8px solid transparent; }

/* ─── Mobile ─── */
@media (max-width: 768px) {
    .arcaq-whatsapp-widget { bottom: 16px; right: 16px; }
    .arcaq-wa-fab { width: 54px; height: 54px; }
    .arcaq-wa-fab svg { width: 26px; height: 26px; }

    .arcaq-wa-popup {
        right: 12px;
        left: 12px;
        bottom: 84px;
        width: auto;
        max-width: 100%;
        border-radius: 16px;
    }

    [dir="rtl"] .arcaq-whatsapp-widget { right: auto; left: 16px; }
    [dir="rtl"] .arcaq-wa-popup { right: 12px; left: 12px; }
}

/* No overlap — accessibility is bottom-left, WhatsApp is bottom-right */
