/** CSS for adding scroll bar to the top of each page */
#sapmfly-progress-bar-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: var(--sapmfly-pb-height, 5px);
    background: transparent;
    z-index: 9999;
}

#sapmfly-progress-bar {
    height: 100%;
    background: var(--sapmfly-pb-color, #4CAF50);
    width: 0%;
}

/* CSS for scroll to top button */
#sapmfly-back-to-top {
    opacity: 0;
    visibility: hidden;
    position: fixed;
    bottom: 25px;
    right: 25px;
    z-index: 9999;
    font-size: 20px;
    border: none;
    outline: none;
    background-color: var(--sapmfly-back-top-bg-color, #4CAF50);
    color: #fff;
    cursor: pointer;
    padding: 13px 20px;
    border-radius: 50%;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
    transition: opacity 0.4s ease, visibility 0.4s ease, transform 0.2s ease;
}

#sapmfly-back-to-top.show {
    opacity: 1;
    visibility: visible;
}

#sapmfly-back-to-top:hover {
    background-color: var(--sapmfly-back-top-hv-color, #4CAF50);
    transform: scale(1.1);
}

/* Front end dark mood related CSS goes here */
#sapmfly-dark-mode-toggle {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
    background: #2d2d2d;
    color: #ffffff;
    border: none;
    padding: 10px 16px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 14px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    transition: background 0.3s ease;
}

#sapmfly-dark-mode-toggle:hover {
    background: #444;
}

body.sapmfly-dark-mode {
    background-color: #121212 !important;
    color: #e0e0e0 !important;
}

body.sapmfly-dark-mode a {
    color: #9ecbff !important;
}

/* AI Summary page CSS goes here */
.sapmfly-ai-summary-block .ai-summary-container {
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 10px;
    background-color: #fff;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

.sapmfly-ai-summary-block .ai-summary-container-free {
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 10px;
    background-color: #fff;
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

.sapmfly-ai-summary-block .ai-summary-header p {
    font-weight: 600;
    margin: 0;
    color: #333;
    font-size: 16px;
}

.sapmfly-ai-summary-block .ai-summary-body {
    display: flex;
    gap: 8px;
}

.sapmfly-ai-summary-block .sapmfly-ai-summary-btn {
    display: flex;
    align-items: center;
    padding: 5px 10px;
    background-color: #000;
    border: 1px solid #000;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    color: #fff;
    gap: 5px;
    transition: all 0.3s ease;
}

.sapmfly-ai-summary-block .sapmfly-ai-summary-btn-icon {
    width: 20px;
    height: 20px;
}

.sapmfly-ai-summary-block .sapmfly-ai-summary-btn:hover {
    background-color: #2c2c2c;
    border-color: #2c2c2c;
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

/* Click to chat related css goes here */
.sapmfly-click-talk-block {
    position: fixed;
    bottom: 40px;
    right: 40px;
    z-index: 9999;
    font-family: Arial, sans-serif;
}

/* HEART PULSE ANIMATION (IMAGE ONLY) */
@keyframes sapmfly-heart-pulse {
    0% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.08);
    }

    100% {
        transform: scale(1);
    }
}

/* Initial state, the first image will pulse */
.sapmfly-click-talk-container:not(.active) .sapmfly-whatsapp-image {
    animation: sapmfly-heart-pulse 2.5s infinite;
}

/* When active → pulse fully stops */
.sapmfly-click-talk-container.active .sapmfly-whatsapp-image,
.sapmfly-click-talk-container.active .sapmfly-close-image {
    animation: none;
}

.sapmfly-click-talk-container {
    max-width: 300px;
}

/* === TOGGLE BUTTON === */
.sapmfly-click-talk-container .sapmfly-initial-panel {
    float: right;
    align-items: center;
    display: flex;
}

.sapmfly-click-talk-container .sapmfly-whatsapp-widget {
    background-color: #f5f7f9;
    border-radius: 4px;
    color: #43474e;
    font-size: 14px;
    margin: 0;
    margin-right: 7px;
    padding: 8px 12px;
    position: relative;
    right: auto;
    top: 8px;
    transform: none;
    transition: all .4s ease;
    width: 150px;
    box-shadow: 0 4px 4px rgba(0, 0, 0, .14);
}

/* Images */
.sapmfly-click-talk-container .sapmfly-initial-panel img {
    background: var(--sapmfly-click-talk-bg-color, #4CAF50);
    -moz-border-radius: 50%;
    -webkit-box-shadow: 0 6px 8px 2px rgba(0, 0, 0, .14);
    -moz-box-shadow: 0 6px 8px 2px rgba(0, 0, 0, .14);
    height: 35px;
    width: 35px;
    padding: 8px;
    border-radius: 4px;
}

/* Second image hidden initially */
.sapmfly-click-talk-container .sapmfly-close-image {
    display: none;
}

/* === PANEL === */
.sapmfly-click-talk-container .sapmfly-after-click-panel {
    background: #fff;
    border-radius: 8px;
    margin-bottom: 12px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
    overflow: hidden;

    /* SMOOTH ANIMATION SETUP */
    opacity: 0;
    transform: translateY(20px) scale(0.95);
    pointer-events: none;
    transition: all 0.35s ease;
}

.sapmfly-click-talk-container .sapmfly-after-click-content {
    display: flex;
    flex-direction: column;
}

.sapmfly-click-talk-container .sapmfly-after-click-header {
    background: var(--sapmfly-click-talk-bg-color, #4CAF50);
    color: #fff;
    padding: 12px 18px;
    display: flex;
    gap: 10px;
    align-items: center;
    justify-content: space-between;
}

.sapmfly-click-talk-container .sapmfly-after-click-header img {
    width: 50px;
    height: 50px;
    padding: 5px;
}

.sapmfly-click-talk-container .sapmfly-after-click-header-content h3 {
    font-size: 18px;
    margin: 0;
    color: #fff;
}

.sapmfly-click-talk-container .sapmfly-after-click-header-content p {
    font-size: 14px;
    margin: 0;
    color: #f5fcee;
}

.sapmfly-click-talk-container .sapmfly-after-click-promotion p {
    font-size: 14px;
    margin: 0;
    padding: 10px;
    color: #43474e;
    padding-left: 15px;
}

.sapmfly-click-talk-container .sapmfly-after-click-body,
.sapmfly-click-talk-container .sapmfly-after-click-body-call {
    padding: 12px 18px;
    display: flex;
    gap: 10px;
    align-items: center;
    position: relative;
}

.sapmfly-click-talk-container .sapmfly-after-click-body::after,
.sapmfly-click-talk-container .sapmfly-after-click-body-call::after {
    content: "";
    position: absolute;
    top: 10px;
    right: 0;
    width: 3px;
    height: 40px;
    background: var(--sapmfly-click-talk-bg-color, #4CAF50);
}

.sapmfly-click-talk-container .sapmfly-after-click-user {
    width: 40px;
    height: 40px;
    border-radius: 8px;
}

.sapmfly-click-talk-container .sapmfly-after-click-icon {
    width: 20px;
    height: 20px;
    margin-top: 8px;
}

.sapmfly-click-talk-container .sapmfly-after-click-body-content h3 {
    font-size: 16px;
    margin: 0;
}

.sapmfly-click-talk-container .sapmfly-after-click-body-content p {
    font-size: 13px;
    margin: 0;
}

.sapmfly-click-talk-container .sapmfly-after-click-body:hover,
.sapmfly-click-talk-container .sapmfly-after-click-body-call:hover {
    background: #f5fcee;
}

/* === ACTIVE STATE === */
.sapmfly-click-talk-container.active .sapmfly-after-click-panel {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: auto;
}

.sapmfly-click-talk-container.active .sapmfly-whatsapp-widget {
    display: none;
}

.sapmfly-click-talk-container.active .sapmfly-whatsapp-image {
    display: none;
}

.sapmfly-click-talk-container.active .sapmfly-close-image {
    display: block;
}

/* christmas snowfall related CSS goes here */
.sapmfly-snowfall {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 9999;
}

.sapmfly-snow {
    position: absolute;
    top: -10px;
    animation: sapmfly-snow-fall linear infinite;
    will-change: transform;
}

@keyframes sapmfly-snow-fall {
    from {
        transform: translateX(0) translateY(0);
    }

    to {
        transform: translateX(var(--drift, 0px)) translateY(100vh);
    }
}


/* Floating button related css goes here */
.sapmfly-floating-button-wrapper {
    position: fixed;
    left: var(--sapmfly-floating-btn-left, auto);
    right: var(--sapmfly-floating-btn-right, 30px);
    top: var(--sapmfly-floating-btn-top, 80%);
    bottom: var(--sapmfly-floating-btn-bottom, auto);
    z-index: 9999;
    display: inline-block;
}

/* Close icon CSS */
.sapmfly-floating-close {
    position: absolute;
    top: -20px;
    right: -8px;
    line-height: 20px;
    font-size: 30px;
    font-weight: 500;
    color: var(--sapmfly-floating-btn-bg, #fc8443);
    text-align: center;
    cursor: pointer;
}

/* Button style css */
.sapmfly-floating-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    position: relative;
    background: var(--sapmfly-floating-btn-bg, #fc8443);
    color: var(--sapmfly-floating-btn-color, #ffffff);
    font-size: 16px;
    text-decoration: none;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);

    animation: sapmfly-heart-pulse 2.5s ease-in-out infinite;
    transition: background 0.25s ease, box-shadow 0.25s ease;
}

.sapmfly-floating-button-rectangular {
    border-radius: 6px;
    padding: 10px 15px;
    max-width: 200px;
}

.sapmfly-floating-button-circular {
    border-radius: 50%;
    aspect-ratio: 1 / 1;
    flex-direction: column;
    max-width: 120px;
    padding: 10px;
}

.sapmfly-floating-button:hover {
    animation-play-state: paused;
    color: var(--sapmfly-floating-btn-color, #ffffff);
    background: var(--sapmfly-floating-btn-hover, #fe7c37);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.2);
}

.sapmfly-floating-button-icon {
    max-width: 30px;
    padding-right: var(--sapmfly-floating-btn-icon-padding-right, 0);
    padding-bottom: var(--sapmfly-floating-btn-icon-padding-bottom, 0);
}