/**
 * Waply Custom Button Fix
 * This CSS file fixes the custom button shape and positioning issues
 */

/* Fix the custom button shape to ensure it's a perfect circle */
#waply-custom-pos-preview-btn {
    width: 60px !important;
    height: 60px !important;
    min-width: 60px !important;
    min-height: 60px !important;
    max-width: 60px !important;
    max-height: 60px !important;
    border-radius: 50% !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    overflow: visible !important;
    position: absolute !important;
    transform: translate(-50%, -50%) !important;
    z-index: 9999 !important;
    visibility: visible !important;
    opacity: 1 !important;
}

/* Fix the WhatsApp icon inside the custom button */
#waply-custom-pos-preview-btn img,
#waply-custom-pos-preview-btn svg {
    width: 30px !important;
    height: 30px !important;
    position: absolute !important;
    top: 50% !important;
    left: 50% !important;
    transform: translate(-50%, -50%) !important;
    margin: 0 !important;
    padding: 0 !important;
}

/* Fix positioning at extreme values */
/* Right edge (100% horizontal) */
.waply-preview-screen #waply-custom-pos-preview-btn[style*="left:100%"] {
    margin-left: -30px !important;
    left: calc(100% - 30px) !important;
}

/* Bottom edge (100% vertical) */
.waply-preview-screen #waply-custom-pos-preview-btn[style*="top:100%"] {
    margin-top: -30px !important;
    top: calc(100% - 30px) !important;
}

/* Left edge (0% horizontal) */
.waply-preview-screen #waply-custom-pos-preview-btn[style*="left:0%"] {
    margin-left: 30px !important;
    left: 30px !important;
}

/* Top edge (0% vertical) */
.waply-preview-screen #waply-custom-pos-preview-btn[style*="top:0%"] {
    margin-top: 30px !important;
    top: 30px !important;
}

/* Corner cases */
/* Bottom right corner */
.waply-preview-screen #waply-custom-pos-preview-btn[style*="left:100%"][style*="top:100%"] {
    margin-left: -30px !important;
    margin-top: -30px !important;
    left: calc(100% - 30px) !important;
    top: calc(100% - 30px) !important;
}

/* Top left corner */
.waply-preview-screen #waply-custom-pos-preview-btn[style*="left:0%"][style*="top:0%"] {
    margin-left: 30px !important;
    margin-top: 30px !important;
    left: 30px !important;
    top: 30px !important;
}

/* Top right corner */
.waply-preview-screen #waply-custom-pos-preview-btn[style*="left:100%"][style*="top:0%"] {
    margin-left: -30px !important;
    margin-top: 30px !important;
    left: calc(100% - 30px) !important;
    top: 30px !important;
}

/* Bottom left corner */
.waply-preview-screen #waply-custom-pos-preview-btn[style*="left:0%"][style*="top:100%"] {
    margin-left: 30px !important;
    margin-top: -30px !important;
    left: 30px !important;
    top: calc(100% - 30px) !important;
}

/* Ensure the preview container has enough space */
.waply-preview-screen {
    min-height: 500px !important;
    overflow: visible !important;
    padding: 60px !important;
    box-sizing: border-box !important;
    position: relative !important;
}
