/* Novera Smart Chat Frontend Styles
 *
 * Every rule is scoped to #novera-smart-chat-button so theme and page builder
 * styles for a, span, svg, div (colors, underlines, borders, svg sizing,
 * box-sizing, text-transform...) cannot reshape the button. Properties themes
 * commonly override are marked !important on purpose.
 */

#novera-smart-chat-button {
    --novera-smart-chat-shadow: rgba(0, 0, 0, 0.18);
    --novera-smart-chat-shadow-hover: rgba(0, 0, 0, 0.24);
    position: fixed !important;
    z-index: 999999 !important;
    display: block !important;
    width: auto !important;
    height: auto !important;
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    background: none !important;
    box-sizing: border-box !important;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif !important;
    line-height: 1.2 !important;
    letter-spacing: normal !important;
    text-transform: none !important;
    text-align: left !important;
    float: none !important;
    transform: none;
}

#novera-smart-chat-button *,
#novera-smart-chat-button *::before,
#novera-smart-chat-button *::after {
    box-sizing: border-box !important;
}

/* Position classes */
#novera-smart-chat-button.novera-smart-chat-bottom-right {
    top: auto !important;
    left: auto !important;
    bottom: 20px !important;
    right: 20px !important;
}

#novera-smart-chat-button.novera-smart-chat-bottom-left {
    top: auto !important;
    right: auto !important;
    bottom: 20px !important;
    left: 20px !important;
}

#novera-smart-chat-button.novera-smart-chat-top-right {
    bottom: auto !important;
    left: auto !important;
    top: 20px !important;
    right: 20px !important;
}

#novera-smart-chat-button.novera-smart-chat-top-left {
    bottom: auto !important;
    right: auto !important;
    top: 20px !important;
    left: 20px !important;
}

/* Main button */
#novera-smart-chat-button .novera-smart-chat-button,
#novera-smart-chat-button .novera-smart-chat-button:link,
#novera-smart-chat-button .novera-smart-chat-button:visited {
    position: relative !important;
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 10px !important;
    width: auto !important;
    min-width: 0 !important;
    max-width: 250px !important;
    height: auto !important;
    min-height: 0 !important;
    margin: 0 !important;
    padding: 12px 20px !important;
    border: 0 !important;
    border-radius: 999px !important;
    background: var(--novera-smart-chat-color, #25D366) !important;
    background-image: none !important;
    box-shadow: 0 4px 12px var(--novera-smart-chat-shadow);
    color: #ffffff !important;
    font-family: inherit !important;
    font-size: 14px !important;
    font-weight: 500 !important;
    font-style: normal !important;
    line-height: 1.2 !important;
    letter-spacing: normal !important;
    text-decoration: none !important;
    text-transform: none !important;
    text-shadow: none !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    opacity: 1 !important;
    outline: none;
    cursor: pointer !important;
    transform: translateY(0);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    -webkit-tap-highlight-color: transparent;
}

/* Themes often add underline, border or overlay pseudo elements to links */
#novera-smart-chat-button .novera-smart-chat-button::before,
#novera-smart-chat-button .novera-smart-chat-button::after {
    content: none !important;
    display: none !important;
}

#novera-smart-chat-button .novera-smart-chat-button:hover,
#novera-smart-chat-button .novera-smart-chat-button:focus,
#novera-smart-chat-button .novera-smart-chat-button:active,
#novera-smart-chat-button .novera-smart-chat-button.novera-smart-chat-hovered {
    background: var(--novera-smart-chat-color, #25D366) !important;
    background-image: none !important;
    color: #ffffff !important;
    text-decoration: none !important;
    opacity: 1 !important;
}

#novera-smart-chat-button .novera-smart-chat-button:hover,
#novera-smart-chat-button .novera-smart-chat-button.novera-smart-chat-hovered {
    transform: translateY(-2px);
    box-shadow: 0 6px 18px var(--novera-smart-chat-shadow-hover);
}

#novera-smart-chat-button .novera-smart-chat-button:active {
    transform: translateY(0);
}

#novera-smart-chat-button .novera-smart-chat-button:focus-visible,
#novera-smart-chat-button .novera-smart-chat-button.novera-smart-chat-keyboard-focus {
    outline: 2px solid var(--novera-smart-chat-color, #25D366) !important;
    outline-offset: 3px !important;
}

/* Icon */
#novera-smart-chat-button .novera-smart-chat-icon {
    display: block !important;
    flex: 0 0 auto !important;
    width: 20px !important;
    height: 20px !important;
    min-width: 0 !important;
    max-width: none !important;
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    fill: #ffffff !important;
    vertical-align: middle !important;
    overflow: visible !important;
}

#novera-smart-chat-button .novera-smart-chat-icon path {
    fill: #ffffff !important;
}

/* Text */
#novera-smart-chat-button .novera-smart-chat-text {
    display: block !important;
    flex: 0 1 auto !important;
    min-width: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    background: none !important;
    color: #ffffff !important;
    font-family: inherit !important;
    font-size: inherit !important;
    font-weight: inherit !important;
    line-height: 1.2 !important;
    letter-spacing: normal !important;
    text-transform: none !important;
    text-decoration: none !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
}

/* Size variants */
#novera-smart-chat-button.novera-smart-chat-small .novera-smart-chat-button {
    gap: 8px !important;
    padding: 8px 15px !important;
    font-size: 12px !important;
}

#novera-smart-chat-button.novera-smart-chat-small .novera-smart-chat-icon {
    width: 16px !important;
    height: 16px !important;
}

#novera-smart-chat-button.novera-smart-chat-large .novera-smart-chat-button {
    gap: 12px !important;
    padding: 16px 25px !important;
    font-size: 16px !important;
}

#novera-smart-chat-button.novera-smart-chat-large .novera-smart-chat-icon {
    width: 24px !important;
    height: 24px !important;
}

/* Tooltip */
#novera-smart-chat-button .novera-smart-chat-tooltip {
    position: absolute !important;
    z-index: 1 !important;
    display: block !important;
    width: max-content !important;
    max-width: 220px !important;
    margin: 0 !important;
    padding: 8px 12px !important;
    border: 0 !important;
    border-radius: 6px !important;
    background: rgba(0, 0, 0, 0.85) !important;
    color: #ffffff !important;
    font-family: inherit !important;
    font-size: 12px !important;
    font-weight: 400 !important;
    line-height: 1.35 !important;
    letter-spacing: normal !important;
    text-transform: none !important;
    text-align: left !important;
    white-space: normal !important;
    overflow-wrap: break-word !important;
    pointer-events: none !important;
    opacity: 0;
    visibility: hidden;
    transform: translateY(6px);
    transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s;
}

#novera-smart-chat-button.novera-smart-chat-bottom-right .novera-smart-chat-tooltip,
#novera-smart-chat-button.novera-smart-chat-bottom-left .novera-smart-chat-tooltip {
    top: auto !important;
    bottom: 100% !important;
    margin-bottom: 10px !important;
}

#novera-smart-chat-button.novera-smart-chat-top-right .novera-smart-chat-tooltip,
#novera-smart-chat-button.novera-smart-chat-top-left .novera-smart-chat-tooltip {
    bottom: auto !important;
    top: 100% !important;
    margin-top: 10px !important;
}

#novera-smart-chat-button.novera-smart-chat-bottom-right .novera-smart-chat-tooltip,
#novera-smart-chat-button.novera-smart-chat-top-right .novera-smart-chat-tooltip {
    left: auto !important;
    right: 0 !important;
}

#novera-smart-chat-button.novera-smart-chat-bottom-left .novera-smart-chat-tooltip,
#novera-smart-chat-button.novera-smart-chat-top-left .novera-smart-chat-tooltip {
    right: auto !important;
    left: 0 !important;
}

/* Tooltip arrow */
#novera-smart-chat-button .novera-smart-chat-tooltip::after {
    content: '' !important;
    position: absolute !important;
    width: 0 !important;
    height: 0 !important;
    border: 5px solid transparent !important;
}

#novera-smart-chat-button.novera-smart-chat-bottom-right .novera-smart-chat-tooltip::after,
#novera-smart-chat-button.novera-smart-chat-bottom-left .novera-smart-chat-tooltip::after {
    top: 100% !important;
    border-top-color: rgba(0, 0, 0, 0.85) !important;
}

#novera-smart-chat-button.novera-smart-chat-top-right .novera-smart-chat-tooltip::after,
#novera-smart-chat-button.novera-smart-chat-top-left .novera-smart-chat-tooltip::after {
    bottom: 100% !important;
    border-bottom-color: rgba(0, 0, 0, 0.85) !important;
}

#novera-smart-chat-button.novera-smart-chat-bottom-right .novera-smart-chat-tooltip::after,
#novera-smart-chat-button.novera-smart-chat-top-right .novera-smart-chat-tooltip::after {
    right: 20px !important;
}

#novera-smart-chat-button.novera-smart-chat-bottom-left .novera-smart-chat-tooltip::after,
#novera-smart-chat-button.novera-smart-chat-top-left .novera-smart-chat-tooltip::after {
    left: 20px !important;
}

/* Show tooltip */
#novera-smart-chat-button:hover .novera-smart-chat-tooltip,
#novera-smart-chat-button:focus-within .novera-smart-chat-tooltip {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* Pulse animation */
@keyframes novera-smart-chat-pulse {
    0% {
        box-shadow: 0 4px 12px var(--novera-smart-chat-shadow), 0 0 0 0 rgba(37, 211, 102, 0.35);
    }
    70% {
        box-shadow: 0 4px 12px var(--novera-smart-chat-shadow), 0 0 0 10px rgba(37, 211, 102, 0);
    }
    100% {
        box-shadow: 0 4px 12px var(--novera-smart-chat-shadow), 0 0 0 0 rgba(37, 211, 102, 0);
    }
}

#novera-smart-chat-button .novera-smart-chat-button.novera-smart-chat-pulse {
    animation: novera-smart-chat-pulse 2s infinite;
}

/* Entry animation */
@keyframes novera-smart-chat-slideIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

#novera-smart-chat-button.novera-smart-chat-loaded {
    animation: novera-smart-chat-slideIn 0.4s ease-out;
}

/* Button states */
#novera-smart-chat-button.novera-smart-chat-page-hidden {
    visibility: hidden !important;
}

#novera-smart-chat-button.novera-smart-chat-test-mode .novera-smart-chat-button {
    outline: 2px dashed #ff6b6b !important;
    outline-offset: 3px !important;
}

#novera-smart-chat-button .novera-smart-chat-button.novera-smart-chat-loading {
    pointer-events: none !important;
    opacity: 0.75 !important;
}

/* "Show only on mobile" setting, done in CSS so cached pages behave the same for every visitor */
@media (min-width: 769px) {
    #novera-smart-chat-button.novera-smart-chat-mobile-only {
        display: none !important;
    }
}

/* Tablet and mobile */
@media (max-width: 768px) {
    #novera-smart-chat-button.novera-smart-chat-bottom-right {
        bottom: calc(15px + env(safe-area-inset-bottom, 0px)) !important;
        right: 15px !important;
    }

    #novera-smart-chat-button.novera-smart-chat-bottom-left {
        bottom: calc(15px + env(safe-area-inset-bottom, 0px)) !important;
        left: 15px !important;
    }

    #novera-smart-chat-button.novera-smart-chat-top-right {
        top: calc(15px + env(safe-area-inset-top, 0px)) !important;
        right: 15px !important;
    }

    #novera-smart-chat-button.novera-smart-chat-top-left {
        top: calc(15px + env(safe-area-inset-top, 0px)) !important;
        left: 15px !important;
    }

    #novera-smart-chat-button .novera-smart-chat-button {
        padding: 10px 16px !important;
        font-size: 13px !important;
        max-width: calc(100vw - 30px) !important;
    }

    /* There is no hover on touch screens, keep the tooltip out of the way */
    #novera-smart-chat-button .novera-smart-chat-tooltip {
        display: none !important;
    }
}

/* Phones: round icon-only button */
@media (max-width: 480px) {
    #novera-smart-chat-button .novera-smart-chat-text {
        display: none !important;
    }

    #novera-smart-chat-button .novera-smart-chat-button,
    #novera-smart-chat-button.novera-smart-chat-medium .novera-smart-chat-button {
        width: 54px !important;
        height: 54px !important;
        min-width: 54px !important;
        max-width: 54px !important;
        padding: 0 !important;
        gap: 0 !important;
        border-radius: 50% !important;
    }

    #novera-smart-chat-button .novera-smart-chat-icon,
    #novera-smart-chat-button.novera-smart-chat-medium .novera-smart-chat-icon {
        width: 28px !important;
        height: 28px !important;
    }

    #novera-smart-chat-button.novera-smart-chat-small .novera-smart-chat-button {
        width: 44px !important;
        height: 44px !important;
        min-width: 44px !important;
        max-width: 44px !important;
        padding: 0 !important;
    }

    #novera-smart-chat-button.novera-smart-chat-small .novera-smart-chat-icon {
        width: 22px !important;
        height: 22px !important;
    }

    #novera-smart-chat-button.novera-smart-chat-large .novera-smart-chat-button {
        width: 62px !important;
        height: 62px !important;
        min-width: 62px !important;
        max-width: 62px !important;
        padding: 0 !important;
    }

    #novera-smart-chat-button.novera-smart-chat-large .novera-smart-chat-icon {
        width: 32px !important;
        height: 32px !important;
    }
}

/* High contrast mode */
@media (prefers-contrast: more) {
    #novera-smart-chat-button .novera-smart-chat-button {
        border: 2px solid #ffffff !important;
    }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    #novera-smart-chat-button,
    #novera-smart-chat-button .novera-smart-chat-button,
    #novera-smart-chat-button .novera-smart-chat-tooltip {
        transition: none !important;
        animation: none !important;
    }
}

/* RTL: mirror the chosen corner */
[dir="rtl"] #novera-smart-chat-button.novera-smart-chat-bottom-right,
[dir="rtl"] #novera-smart-chat-button.novera-smart-chat-top-right {
    right: auto !important;
    left: 20px !important;
}

[dir="rtl"] #novera-smart-chat-button.novera-smart-chat-bottom-left,
[dir="rtl"] #novera-smart-chat-button.novera-smart-chat-top-left {
    left: auto !important;
    right: 20px !important;
}

/* Print hiding */
@media print {
    #novera-smart-chat-button {
        display: none !important;
    }
}
