/* ==========================================================================
   DR Waterlock - 4 Powerful Visitor Contact & Lead Capture Widgets
   1. Smart Exit-Intent & Timed Callback Modal
   2. Floating Quick Action Buttons (WhatsApp & Call)
   3. Live Interactive Floating Support Chat ("Waterproofing Assistant")
   4. Back-To-Top Button Stacking & Alignment
   ========================================================================== */

/* ── Method 1: Smart Modal ── */
.dw-lead-modal-content {
    background: #ffffff;
    border-radius: 20px !important;
}

.dw-lead-modal-header {
    background: linear-gradient(135deg, #0284c7 0%, #0369a1 100%);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.dw-modal-badge {
    background: rgba(255, 255, 255, 0.15);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    backdrop-filter: blur(4px);
}

.dw-lead-modal-close {
    position: absolute;
    top: 15px;
    right: 15px;
    background-color: #ffffff !important;
    border-radius: 50%;
    opacity: 0.85;
    z-index: 10;
    padding: 6px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}

.dw-service-chips .dw-chip-label {
    cursor: pointer;
    margin: 0;
}

.dw-service-chips input[type="radio"] {
    display: none;
}

.dw-service-chips span {
    display: inline-block;
    padding: 5px 12px;
    font-size: 0.78rem;
    font-weight: 600;
    border: 1.5px solid #e2e8f0;
    border-radius: 50px;
    color: #475569;
    background: #f8fafc;
    transition: all 0.2s ease;
}

.dw-service-chips input[type="radio"]:checked + span {
    background: #0284c7;
    color: #ffffff;
    border-color: #0284c7;
    box-shadow: 0 3px 8px rgba(2, 132, 199, 0.25);
}

.dw-phone-input-group .form-control {
    font-size: 1.1rem;
    font-weight: 600;
    color: #0f172a;
    letter-spacing: 0.05em;
}

.dw-btn-lead-submit {
    background: linear-gradient(135deg, #0284c7 0%, #0369a1 100%) !important;
    border: none !important;
    letter-spacing: 0.02em;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.dw-btn-lead-submit:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(2, 132, 199, 0.35) !important;
}

.dw-success-icon-circle {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: #10b981;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 6px 16px rgba(16, 185, 129, 0.3);
}

/* ── Method 2: Floating Left Action Widget (Web / Desktop Only) ── */
.dw-floating-action-left {
    display: none !important;
}

@media (min-width: 992px) {
    .dw-floating-action-left {
        position: fixed;
        bottom: 25px;
        left: 25px;
        z-index: 9990;
        display: flex !important;
        flex-direction: column;
        gap: 12px;
    }
}

.dw-float-btn {
    display: inline-flex;
    align-items: center;
    padding: 4px;
    height: 50px;
    width: 50px;
    max-width: 50px;
    border-radius: 50px;
    text-decoration: none !important;
    color: #ffffff !important;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
    transition: all 0.35s cubic-bezier(0.16, 1, 0.3, 1);
    overflow: hidden;
    white-space: nowrap;
}

.dw-float-btn:hover,
.dw-float-btn:focus-visible {
    width: auto;
    max-width: 220px;
    padding: 4px 16px 4px 4px;
    transform: translateY(-2px) scale(1.02);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.22);
}

.dw-float-whatsapp {
    background: linear-gradient(135deg, #25D366 0%, #128C7E 100%);
    animation: dwPulseGlowGreen 2.4s infinite;
}

.dw-float-call {
    background: linear-gradient(135deg, #0284c7 0%, #0369a1 100%);
    animation: dwPulseGlowBlue 2.4s infinite;
    animation-delay: 1.2s;
}

.dw-float-call .fa-phone-volume {
    display: inline-block;
    animation: phoneWiggle 3.5s infinite ease-in-out;
}

.dw-float-icon-box {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.35rem;
    position: relative;
    flex-shrink: 0;
}

.dw-live-status-dot {
    position: absolute;
    top: 2px;
    right: 2px;
    width: 11px;
    height: 11px;
    background: #22c55e;
    border: 2px solid #ffffff;
    border-radius: 50%;
    animation: dwDotBlink 1.4s infinite ease-in-out;
}

.dw-float-text {
    display: flex;
    flex-direction: column;
    justify-content: center;
    max-width: 0;
    opacity: 0;
    margin-left: 0;
    overflow: hidden;
    white-space: nowrap;
    pointer-events: none;
    transition: max-width 0.35s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.25s ease, margin 0.35s ease;
}

.dw-float-btn:hover .dw-float-text,
.dw-float-btn:focus-visible .dw-float-text {
    max-width: 160px;
    opacity: 1;
    margin-left: 10px;
    pointer-events: auto;
}

.dw-float-title {
    font-size: 0.82rem;
    font-weight: 700;
    line-height: 1.15;
    color: #ffffff;
    letter-spacing: 0.01em;
}

.dw-float-sub {
    font-size: 0.68rem;
    opacity: 0.92;
    color: #ffffff;
    line-height: 1.2;
}

/* ── Method 3: Floating Live Chat on Right ── */
.dw-floating-chat-right {
    position: fixed;
    bottom: 25px;
    right: 25px;
    z-index: 9995;
}

.dw-chat-launcher-btn {
    width: 58px;
    height: 58px;
    border-radius: 50%;
    background: linear-gradient(135deg, #0284c7 0%, #0369a1 100%);
    border: none;
    color: #ffffff;
    font-size: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 8px 24px rgba(2, 132, 199, 0.4);
    transition: transform 0.25s ease;
    position: relative;
}

.dw-chat-launcher-btn:hover {
    transform: scale(1.08);
}

.dw-live-badge-count {
    position: absolute;
    top: -2px;
    right: -2px;
    width: 20px;
    height: 20px;
    background: #ef4444;
    color: #ffffff;
    border-radius: 50%;
    font-size: 0.68rem;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid #ffffff;
}

/* ── Back To Top Button Alignment (Stacked cleanly above Chat Launcher) ── */
.btn-back-to-top {
    bottom: 95px !important;
    right: 30px !important;
    z-index: 9990 !important;
    transition: all 0.35s cubic-bezier(0.16, 1, 0.3, 1), bottom 0.2s ease !important;
}

.dw-chat-teaser-balloon {
    position: absolute;
    bottom: 6px;
    right: 70px;
    width: 270px;
    max-width: calc(100vw - 120px);
    background: #ffffff;
    border-radius: 16px;
    padding: 12px 14px;
    border: 1px solid rgba(0, 0, 0, 0.08);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.12) !important;
    animation: fadeInRight 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    white-space: normal;
}

.dw-chat-teaser-balloon::after {
    content: '';
    position: absolute;
    right: -7px;
    bottom: 18px;
    width: 0;
    height: 0;
    border-top: 7px solid transparent;
    border-bottom: 7px solid transparent;
    border-left: 8px solid #ffffff;
}

@keyframes fadeInRight {
    from { opacity: 0; transform: translateX(15px); }
    to { opacity: 1; transform: translateX(0); }
}

.dw-teaser-close {
    position: absolute;
    top: 4px;
    right: 8px;
    border: none;
    background: none;
    font-size: 1.1rem;
    color: #94a3b8;
    cursor: pointer;
}

.dw-avatar-circle {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #e0f2fe;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.dw-chat-drawer-box {
    position: absolute;
    bottom: 72px;
    right: 0;
    width: 330px;
    max-width: 90vw;
    background: #ffffff;
    border-radius: 18px;
    overflow: hidden;
    border: 1px solid rgba(0, 0, 0, 0.08);
    display: flex;
    flex-direction: column;
    animation: fadeInUp 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.dw-chat-header {
    background: linear-gradient(135deg, #0284c7 0%, #0369a1 100%);
}

.dw-agent-avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
}

.dw-agent-online-dot {
    position: absolute;
    bottom: 0;
    right: 0;
    width: 8px;
    height: 8px;
    background: #22c55e;
    border: 1.5px solid #ffffff;
    border-radius: 50%;
}

.dw-chat-messages-area {
    min-height: 180px;
    max-height: 250px;
    overflow-y: auto;
    background: #f8fafc;
}

.dw-msg-bubble {
    background: #ffffff;
    border-radius: 14px 14px 14px 2px;
    padding: 10px 12px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.04);
    margin-bottom: 8px;
}

.dw-msg-time {
    font-size: 0.62rem;
    color: #94a3b8;
    display: block;
    text-align: right;
    margin-top: 4px;
}

.dw-chat-send-btn {
    width: 34px;
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

@keyframes dwPulseGlowGreen {
    0% {
        box-shadow: 0 0 0 0 rgba(37, 211, 102, 0.75), 0 6px 20px rgba(0, 0, 0, 0.15);
    }
    60% {
        box-shadow: 0 0 0 14px rgba(37, 211, 102, 0), 0 6px 20px rgba(0, 0, 0, 0.15);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(37, 211, 102, 0), 0 6px 20px rgba(0, 0, 0, 0.15);
    }
}

@keyframes dwPulseGlowBlue {
    0% {
        box-shadow: 0 0 0 0 rgba(2, 132, 199, 0.75), 0 6px 20px rgba(0, 0, 0, 0.15);
    }
    60% {
        box-shadow: 0 0 0 14px rgba(2, 132, 199, 0), 0 6px 20px rgba(0, 0, 0, 0.15);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(2, 132, 199, 0), 0 6px 20px rgba(0, 0, 0, 0.15);
    }
}

@keyframes dwDotBlink {
    0%, 100% {
        transform: scale(1);
        opacity: 1;
        box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.95);
    }
    50% {
        transform: scale(1.3);
        opacity: 0.8;
        box-shadow: 0 0 0 6px rgba(34, 197, 94, 0);
    }
}

@keyframes phoneWiggle {
    0%, 75%, 100% {
        transform: rotate(0deg);
    }
    80% {
        transform: rotate(-16deg);
    }
    85% {
        transform: rotate(16deg);
    }
    90% {
        transform: rotate(-12deg);
    }
    95% {
        transform: rotate(10deg);
    }
}

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

@media (max-width: 991.98px) {
    .dw-floating-action-left {
        display: none !important;
    }
}

@media (max-width: 576px) {
    .dw-floating-action-left {
        display: none !important;
    }
    .dw-floating-chat-right {
        bottom: 80px;
        right: 15px;
    }
    .btn-back-to-top {
        bottom: 145px !important;
        right: 18px !important;
    }
    .dw-chat-teaser-balloon {
        right: 64px;
        bottom: 4px;
        width: 220px;
        padding: 10px 12px;
    }
}
