/* Global WhatsApp Widget Styles */
.whatsapp-widget-global {
    position: fixed !important;
    bottom: 30px;
    right: 30px;
    z-index: 10000 !important; /* Увеличиваем z-index выше всех других элементов */
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
}

.whatsapp-button-global {
    width: 60px;
    height: 60px;
    background: #25d366;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(37, 211, 102, 0.4);
    transition: all 0.3s ease;
    position: relative;
    animation: pulseGlobal 2s infinite;
}

.whatsapp-button-global:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(37, 211, 102, 0.6);
}

.whatsapp-button-global .fab {
    color: white;
    font-size: 22px;
    text-align: center;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    position: absolute;
    top: 0;
    left: 0;
}

.online-indicator-global {
    position: absolute;
    top: 5px;
    right: 5px;
    width: 12px;
    height: 12px;
    background: #00ff00;
    border-radius: 50%;
    border: 2px solid white;
    animation: blinkGlobal 1.5s infinite;
}

.whatsapp-popup-global {
    position: absolute;
    bottom: 70px;
    right: 30px;
    width: 280px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
    transform: scale(0) translateY(20px);
    opacity: 0;
    transition: all 0.3s ease;
    transform-origin: bottom right;
}

.whatsapp-popup-global.show {
    transform: scale(1) translateY(0);
    opacity: 1;
}

.popup-content-global {
    padding: 15px;
}

.popup-header-global {
    display: flex;
    align-items: center;
    margin-bottom: 12px;
    flex-wrap: nowrap;
}

.lawyer-avatar-global {
    width: 40px !important;
    height: 40px !important;
    min-width: 40px !important;
    min-height: 40px !important;
    max-width: 40px !important;
    max-height: 40px !important;
    border-radius: 50% !important;
    margin-right: 10px !important;
    object-fit: cover !important;
    object-position: center center !important;
    flex-shrink: 0 !important;
    flex-grow: 0 !important;
    display: block !important;
    aspect-ratio: 1 / 1 !important;
}


.lawyer-info-global strong {
    display: block;
    font-size: 14px;
    color: #333;
}

.online-status-global {
    font-size: 12px;
    color: #25d366;
    display: flex;
    align-items: center;
    gap: 5px;
}

.status-dot-global {
    width: 8px;
    height: 8px;
    background: #25d366;
    border-radius: 50%;
    animation: blinkGlobal 1.5s infinite;
}

.popup-message-global {
    font-size: 14px;
    color: #333;
    margin-bottom: 12px;
    line-height: 1.4;
}

.popup-message-global .price-global {
    color: #25d366;
    font-weight: bold;
    font-size: 16px;
}

.guarantee-text-global {
    font-size: 11px;
    color: #666;
    margin-top: 8px;
    line-height: 1.3;
}

.consultation-btn-global {
    width: 100%;
    background: #25d366;
    color: white;
    border: none;
    padding: 10px;
    border-radius: 8px;
    font-weight: bold;
    cursor: pointer;
    transition: background 0.3s ease;
}

.consultation-btn-global:hover {
    background: #20b954;
    color: white;
}

@keyframes pulseGlobal {
    0% { box-shadow: 0 4px 12px rgba(37, 211, 102, 0.4); }
    50% { box-shadow: 0 4px 12px rgba(37, 211, 102, 0.8); }
    100% { box-shadow: 0 4px 12px rgba(37, 211, 102, 0.4); }
}

@keyframes blinkGlobal {
    0%, 50% { opacity: 1; }
    51%, 100% { opacity: 0.3; }
}

/* Desktop styles - ensure fixed positioning on larger screens */
@media (min-width: 768px) {
    .whatsapp-widget-global {
        position: fixed !important;
        bottom: 30px !important;
        right: 30px !important;
        z-index: 10000 !important;
        display: block !important;
        visibility: visible !important;
        opacity: 1 !important;
        width: auto !important;
        height: auto !important;
        transform: none !important;
    }
    
    .whatsapp-popup-global {
        position: absolute !important;
        bottom: 70px !important;
        right: 30px !important;
        width: 280px !important;
        transform-origin: bottom right !important;
    }
    
    .whatsapp-button-global {
        width: 60px !important;
        height: 60px !important;
        position: relative !important;
    }
}

@media (max-width: 767.98px) {
    .whatsapp-widget-global {
        bottom: 80px !important;
        right: 20px !important;
        z-index: 10000 !important;
        display: block !important;
        visibility: visible !important;
        opacity: 1 !important;
        pointer-events: auto !important;
        position: fixed !important;
    }
    
    .whatsapp-popup-global {
        width: 260px;
        right: 0px;
        bottom: 140px;
    }
    
    .whatsapp-button-global {
        width: 55px !important;
        height: 55px !important;
        display: flex !important;
        visibility: visible !important;
        opacity: 1 !important;
    }
    
    .whatsapp-button-global .fab {
        font-size: 20px;
    }
}

@media (max-width: 480px) {
    .whatsapp-widget-global {
        bottom: 80px !important;
        right: 15px !important;
        display: block !important;
        visibility: visible !important;
        opacity: 1 !important;
        z-index: 10000 !important;
        position: fixed !important;
    }
    
    .whatsapp-popup-global {
        width: 240px;
        right: 0px;
        bottom: 140px; /* 80px (позиция кнопки) + 60px (высота кнопки) */
    }
    
    .whatsapp-button-global {
        width: 50px !important;
        height: 50px !important;
        display: flex !important;
        visibility: visible !important;
        opacity: 1 !important;
    }
    
    .whatsapp-button-global .fab {
        font-size: 18px;
    }
    
    .online-indicator-global {
        width: 10px;
        height: 10px;
    }
}

/* Стили для модального окна быстрого входа на мобильных */
@media (max-width: 767.98px) {
    #quickLoginConsultationModal .modal-dialog {
        margin-top: 20px !important;
        margin-bottom: auto !important;
        transform: none !important;
        position: fixed !important;
        top: 20px !important;
        left: 50% !important;
        transform: translateX(-50%) !important;
        width: 90% !important;
        max-width: 400px !important;
    }
    
    #quickLoginConsultationModal .modal-dialog-centered {
        min-height: auto !important;
        display: block !important;
    }
}

@media (max-width: 480px) {
    #quickLoginConsultationModal .modal-dialog {
        top: 10px !important;
        width: 95% !important;
    }
}

/* CRITICAL FIX - Override any conflicting styles */
body .whatsapp-widget-global {
    position: fixed !important;
    bottom: 30px !important;
    right: 30px !important;
    z-index: 10000 !important;
    width: auto !important;
    height: auto !important;
    max-width: 280px !important;
    max-height: 400px !important;
    display: block !important;
    overflow: visible !important;
}

body .whatsapp-widget-global * {
    box-sizing: border-box !important;
}

body .whatsapp-widget-global img {
    max-width: 100% !important;
    height: auto !important;
}

/* Ensure the widget doesn't inherit flex properties */
body .whatsapp-widget-global,
body .whatsapp-widget-global > div {
    display: block !important;
    flex: none !important;
    flex-grow: 0 !important;
    flex-shrink: 0 !important;
    flex-basis: auto !important;
    align-self: auto !important;
}