/* Smart Popup - All rules use high-specificity selectors to prevent theme interference */

#smart-popup-overlay {
    display: none;
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    background: rgba(0, 0, 0, 0.5) !important;
    z-index: 2147483647 !important; /* maximum possible z-index */
    padding: 20px !important;
    box-sizing: border-box !important;
    /* centering */
    justify-content: center !important;
    align-items: center !important;
}

#smart-popup-overlay.active {
    display: flex !important;
}

#smart-popup-modal {
    background: white !important;
    border-radius: 16px !important;
    padding: 40px !important;
    max-width: 500px !important;
    width: 100% !important;
    position: relative !important;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2) !important;
    text-align: center !important;
    box-sizing: border-box !important;
    /* reset any theme interference */
    margin: 0 !important;
    left: auto !important;
    right: auto !important;
    top: auto !important;
    bottom: auto !important;
    transform: none !important;
    float: none !important;
    animation: smartPopupSlideUp 0.3s ease !important;
}

#smart-popup-overlay #smart-popup-close-btn {
    position: absolute !important;
    top: 15px !important;
    right: 15px !important;
    background: none !important;
    border: none !important;
    font-size: 42px !important;
    cursor: pointer !important;
    width: 48px !important;
    height: 48px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    transition: opacity 0.3s !important;
    line-height: 1 !important;
    padding: 0 !important;
    font-weight: 300 !important;
    box-shadow: none !important;
    text-shadow: none !important;
}

#smart-popup-overlay #smart-popup-close-btn:hover {
    opacity: 0.7 !important;
}

/* Custom Image Styles */
#smart-popup-modal .smart-popup-custom-image {
    width: 200px !important;
    height: 200px !important;
    margin: 0 auto 20px !important;
    overflow: hidden !important;
    border-radius: 50% !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}

#smart-popup-modal .smart-popup-custom-image img {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
}

/* Law-themed Illustration */
#smart-popup-modal .smart-popup-law-illustration {
    width: 200px !important;
    height: 200px !important;
    margin: 0 auto 20px !important;
    padding: 10px !important;
}

#smart-popup-modal .smart-popup-law-illustration svg {
    width: 100% !important;
    height: 100% !important;
}

#smart-popup-modal h2 {
    font-size: 28px !important;
    margin: 0 0 10px 0 !important;
    font-weight: 600 !important;
}

#smart-popup-modal h3 {
    font-size: 24px !important;
    margin: 0 0 20px 0 !important;
    font-weight: 600 !important;
}

#smart-popup-modal p {
    font-size: 16px !important;
    line-height: 1.6 !important;
    margin: 0 0 30px 0 !important;
}

#smart-popup-modal #smart-popup-cta-btn {
    border: none !important;
    padding: 0 40px !important;
    font-size: 16px !important;
    border-radius: 8px !important;
    cursor: pointer !important;
    transition: all 0.3s !important;
    font-weight: 500 !important;
    line-height: normal !important;
    display: inline-block !important;
    text-decoration: none !important;
}

#smart-popup-modal #smart-popup-cta-btn:hover {
    transform: translateY(-2px) !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15) !important;
}

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

/* Mobile responsive */
@media (max-width: 600px) {
    #smart-popup-overlay {
        padding: 15px !important;
    }

    #smart-popup-modal {
        padding: 30px 20px !important;
        width: calc(100% - 30px) !important;
        max-width: 100% !important;
    }

    #smart-popup-overlay #smart-popup-close-btn {
        width: 42px !important;
        height: 42px !important;
        font-size: 36px !important;
        top: 10px !important;
        right: 10px !important;
    }

    #smart-popup-modal .smart-popup-custom-image,
    #smart-popup-modal .smart-popup-law-illustration {
        width: 150px !important;
        height: 150px !important;
    }

    #smart-popup-modal h2 {
        font-size: 24px !important;
    }

    #smart-popup-modal h3 {
        font-size: 20px !important;
    }

    #smart-popup-modal p {
        font-size: 14px !important;
    }

    #smart-popup-modal #smart-popup-cta-btn {
        width: 100% !important;
        font-size: 14px !important;
    }
}

/* Extra small screens */
@media (max-width: 400px) {
    #smart-popup-overlay {
        padding: 10px !important;
    }

    #smart-popup-modal {
        padding: 25px 15px !important;
    }
}
