/**
 * Sky SEO Boost - WhatsApp Business Frontend Styles
 * 
 * @package Sky_SEO_Boost
 * @subpackage WhatsApp_Business
 * @version 1.0.1
 */

/* Reset WhatsApp widget styles */
.sky-whatsapp-widget,
.sky-whatsapp-widget * {
    margin: 0;
    padding: 0;
    box-sizing: border-box !important;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Roboto", "Oxygen", "Ubuntu", "Cantarell", "Fira Sans", "Droid Sans", "Helvetica Neue", sans-serif !important;
    line-height: 1.4;
}

/* WhatsApp Floating Widget Container */
.sky-whatsapp-widget {
    position: fixed;
    z-index: 999999;
}

.sky-whatsapp-widget.sky-whatsapp-bottom-right {
    bottom: 20px;
    right: 20px;
}

.sky-whatsapp-widget.sky-whatsapp-bottom-left {
    bottom: 20px;
    left: 20px;
}

/* WhatsApp Floating Button */
.sky-whatsapp-button {
    width: 60px;
    height: 60px;
    background: #25D366 !important;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2);
    position: relative;
    transition: none !important;
    border: none;
    pointer-events: auto !important;
}

/* Remove hover effect */
.sky-whatsapp-button:hover {
    transform: none !important;
    box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2) !important;
}

.sky-whatsapp-button svg {
    width: 28px;
    height: 28px;
    fill: #ffffff;
    transition: none !important;
    transform: none !important;
}

/* Red notification dot */
.sky-whatsapp-button::before {
    content: '';
    position: absolute;
    top: 0px;
    right: 0px;
    width: 16px;
    height: 16px;
    background: #ff0000;
    border-radius: 50%;
}

/* Clicked state animation */
.sky-whatsapp-button.clicked {
    animation: whatsappButtonClick 0.4s ease-out;
}

@keyframes whatsappButtonClick {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(0.95);
    }
    100% {
        transform: scale(1);
    }
}

/* WhatsApp Popup with enhanced animations */
.sky-whatsapp-popup {
    position: absolute;
    bottom: 75px;
    right: 0;
    width: 370px;
    background: transparent;
    filter: drop-shadow(0 1px 10px rgba(0, 0, 0, 0.2));
    display: none;
    transform-origin: bottom right;
    opacity: 0;
    transform: scale(0.95);
    transition: opacity 0.2s ease, transform 0.2s ease;
    z-index: 999998;
    pointer-events: none;
}

.sky-whatsapp-widget.sky-whatsapp-bottom-left .sky-whatsapp-popup {
    right: auto;
    left: 0;
    transform-origin: bottom left;
}

.sky-whatsapp-popup.show {
    display: block;
    opacity: 1;
    transform: scale(1);
    pointer-events: auto;
}

.sky-whatsapp-popup.closing {
    opacity: 0;
    transform: scale(0.95);
}

@keyframes whatsappPopupBounce {
    0% {
        opacity: 0;
        transform: scale(0.3) translateY(20px);
    }
    50% {
        transform: scale(1.05) translateY(-5px);
    }
    100% {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

@keyframes whatsappPopupClose {
    0% {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
    100% {
        opacity: 0;
        transform: scale(0.8) translateY(10px);
    }
}

/* Popup Container with rounded corners */
.sky-whatsapp-popup-inner {
    background: #ffffff;
    border-radius: 10px;
    overflow: hidden;
    transform: translateZ(0); /* Hardware acceleration */
}

/* Popup Header */
.sky-whatsapp-popup-header {
    background: #008069 !important;
    color: #ffffff !important;
    padding: 20px 20px 18px 20px !important;
    position: relative !important;
    display: flex !important;
    align-items: center !important;
}

/* Close button with better hover effect */
.sky-whatsapp-close {
    position: absolute !important;
    top: 11px !important;
    right: 11px !important;
    width: 34px !important;
    height: 34px !important;
    background: transparent !important;
    border: none !important;
    color: #ffffff !important;
    font-size: 30px !important;
    line-height: 1 !important;
    cursor: pointer !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 0 !important;
    opacity: 0.8 !important;
    font-weight: 300 !important;
    transition: all 0.2s ease !important;
    border-radius: 50% !important;
}

.sky-whatsapp-close:hover {
    opacity: 1 !important;
    background: rgba(255, 255, 255, 0.1) !important;
    transform: rotate(90deg) !important;
}

/* Avatar */
.sky-whatsapp-avatar,
.sky-whatsapp-avatar-placeholder {
    width: 50px !important;
    height: 50px !important;
    border-radius: 50% !important;
    margin-right: 15px !important;
    flex-shrink: 0 !important;
}

.sky-whatsapp-avatar {
    object-fit: cover;
}

.sky-whatsapp-avatar-placeholder {
    background: #ffffff !important;
    display: flex;
    align-items: center;
    justify-content: center;
}

.sky-whatsapp-avatar-placeholder svg {
    width: 30px;
    height: 30px;
    fill: #93999f;
}

/* Info */
.sky-whatsapp-info {
    flex: 1;
    padding-right: 40px;
}

.sky-whatsapp-info h4 {
    font-size: 16px !important;
    font-weight: 500 !important;
    margin: 0 0 2px 0 !important;
    color: #ffffff !important;
    display: flex !important;
    align-items: center !important;
    gap: 5px !important;
}

/* Verified badge in header */
.sky-whatsapp-verified {
    width: 18px !important;
    height: 18px !important;
    display: inline-block !important;
    vertical-align: middle !important;
    margin-left: 2px !important;
}

.sky-whatsapp-status {
    font-size: 13px !important;
    color: rgba(255, 255, 255, 0.9) !important;
    display: block !important;
}

/* Chat Body */
.sky-whatsapp-popup-body {
    background: #e5ddd5 !important;
    padding: 23px 20px 30px 20px !important;
    min-height: 100px !important;
    background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAFAAAABQCAYAAACOEfKtAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAABx0RVh0U29mdHdhcmUAQWRvYmUgRmlyZXdvcmtzIENTNui8sowAAAAWdEVYdENyZWF0aW9uIFRpbWUAMDEvMDEvMTY32XGNYgAABE9JREFUeNrtm9uO2yAQhs+Wk25VVb2s+gJ9gz5F36IV3/RtyqPQl+gL5HKrqoq9SXYPzoE5DDDYxJYz0mir7CaO/fn3jBkbFEVRbLwsy2FVVQfrQRAEU1VVU2sN8/k8Pp1OT0EQfPRo3K5t21qaC5eVJMnp+fl5OZvNfns0bHfG7boC4JU4QMd0XBDjBYCOiXElDtCxzDkOEPN42A5F8ZzjOo7reM5xHa/qOY7jOI7jOH7McdFRnud1HMdxHMdxHDc4x3Ecx3Ecx3E7M44cx3Fcl7gu3A+WZbm2VhDHcbQsyz+e49q3bdtaCYBJkuw9x7VvHGBfxgGOxDjAkRgHOBLjAEdiPQP0CgPjOkC3XJblUvEHK1uWZULnmabpqfuYrAJh8/n8M7btl/b19fW7pmnyrtdqtbr12UmVABiTITvXGZgky8JJVb2oa7Va3W232zuX5p/luuXzeb8AazUAYuMW4zgGQLqnrKHxGOOXl5e3cRzPXMHLdM9H0QPEei2Oo8vlcu8C3vF4/I7SBPH7rAJA7POeeuO7H0EYhndjIJaVn9EARBHGPR8Oh28uwXEc185zK4qiKOQASDbjOJ7UOJDUhFEUhY4xEINBN5Pao8+a8vmu9ykFgBkJDW5drjUAbCoCWy5HN3s0i6JYWvJcJYnI2cQBbnUOGNNJm5mFQfieBRCzCZfA1m5fHtj0HCyKYqUD7nQ6/cAFsK1bVdWiB/BjHMf1YIAkJN9ut181bnPT1o2y7Bs2DdbVx5YDrFar29ls9qvrOdI0/RqG4X0cx7fIGNdoNboJQNJrkualrZuYWZblpmu5q48tA3g6nd6dn59/6wJEE3+5XL7gAs9Tq9XqBn2HYfhZB8jOAbWA5BDn0wPcieFUDNBmATnAdQvAdDr9iX0HQlcPSAqcFkAyHvJ4SIAG4LapmzZAXd34cNg0TY9oHCD5/kOapo+qY2UbIM7KTQu9m/V+xwPIBmjqRqcgqNaRAOQ2kx4gKQpkc72pCxN5QNUBcsEEF+BjV13YArBDfaAKQHJOqAcob+a2czJJkt3hcPjMAchl3bRtr4YABFUHSCLMAvgjnU88QJo2AVUAmg6CdFyTvRoD6Ksm1lgAVQFqBcP4vi/AKwJQJSKqm2lAXT+TAOI5oQm8iwF8hNiUH/AAxRU5OYBNnVfXz2SAAhfABa1vANAkNJ0DpPvRAchNIQiAtrOmfgbgtQ7QJhLNOUBs2wGQXFXQATQJN0mSHUoiVF0MtmZhANKfAbz8rwKgQqYNUGQ6gLYLuJwDNIlHBjASdaHOuJkTHZiP1QLu5gCbRGIDYNMKnXQVwHvdA0SjWyhyOpNJBm2A9G6ArNkAhL/nHiCqFrKNIdm1YRV4cQBNKnDMXE1EWQD8y05NnH8CEA3e5jJpgMA8z+sAyXjDMIzcA/TGjRs3Dhxu3Lhx48aNm6Hbf8T9WJG1A/ToAAAAAElFTkSuQmCC") !important;
}

/* Message container */
.sky-whatsapp-message-container {
    display: flex;
    align-items: flex-start;
    margin-bottom: 10px;
}

/* Message bubble */
.sky-whatsapp-message {
    background: #ffffff !important;
    padding: 6px 9px 8px 9px !important;
    border-radius: 7.5px !important;
    box-shadow: 0 1px 0.5px rgba(0, 0, 0, 0.13) !important;
    position: relative !important;
    max-width: 330px !important;
    margin-left: 8px !important;
}

/* Message tail */
.sky-whatsapp-message::before {
	position: absolute;
	background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAmCAMAAADp2asXAAAABGdBTUEAALGPC/xhBQAAAAFzUkdCAK7OHOkAAACQUExURUxpccPDw9ra2m9vbwAAAAAAADExMf///wAAABoaGk9PT7q6uqurqwsLCycnJz4+PtDQ0JycnIyMjPf3915eXvz8/E9PT/39/RMTE4CAgAAAAJqamv////////r6+u/v7yUlJeXl5f///5ycnOXl5XNzc/Hx8f///xUVFf///+zs7P///+bm5gAAAM7Ozv///2fVensAAAAvdFJOUwCow1cBCCnqAhNAnY0WIDW2f2/hSeo99g1lBYT87vDXG8/6d8oL4sgM5szrkgl660OiZwAAAHRJREFUKM/ty7cSggAABNFVUQFzwizmjPz/39k4YuFWtm55bw7eHR6ny63+alnswT3/rIDzUSC7CrAziPYCJCsB+gbVkgDtVIDh+DsE9OTBpCtAbSBAZSEQNgWIygJ0RgJMDWYNAdYbAeKtAHODlkHIv997AkLqIVOXVU84AAAAAElFTkSuQmCC");
	background-position: 50% 50%;
	background-repeat: no-repeat;
	background-size: contain;
	content: "";
	top: 0px;
	left: -12px;
	width: 12px;
	height: 19px;
}

/* Message header with name and verified badge */
.sky-whatsapp-message {
	background: #ffffff !important;
	padding: 10px 15px 18px 13px !important;
	border-radius: 0px 5px 5px 5px !important;
	box-shadow: 0 1px 0.5px rgba(0, 0, 0, 0.13) !important;
	position: relative !important;
	max-width: 330px !important;
	margin-left: 8px !important;
}

.sky-whatsapp-message-name {
	font-size: 12.8px !important;
	color: #000 !important;
	font-weight: 600 !important;
}

/* Verified badge in message */
.sky-whatsapp-message-verified {
    display: inline-block !important;
    width: 14px !important;
    height: 14px !important;
    vertical-align: middle !important;
    margin-left: 2px !important;
}

.sky-whatsapp-message-verified img {
    width: 14px !important;
    height: 14px !important;
    display: block !important;
}

/* Message text */
.sky-whatsapp-message p {
    margin: 0 !important;
    font-size: 14.2px !important;
    line-height: 19px !important;
    color: #303030 !important;
    word-wrap: break-word !important;
}

/* Time stamp */
.message-time {
    font-size: 11px !important;
    color: rgba(0, 0, 0, 0.45) !important;
    float: right !important;
    margin: 0 0 -5px 10px !important;
    position: relative !important;
    bottom: -2px !important;
}

/* Footer section */
.sky-whatsapp-popup-footer {
    padding: 16px 20px 20px 20px !important;
    background: #ffffff !important;
}

/* Start Chat Button - NO HOVER EFFECTS */
.sky-whatsapp-start-chat {
    width: 100% !important;
    padding: 12px 32px !important;
    background: #25d366 !important;
    color: #ffffff !important;
    border: none !important;
    border-radius: 50px !important;
font-size: 15px !important;
  font-weight: 700 !important;
    cursor: pointer !important;
    transition: none !important;
    font-family: inherit !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 8px !important;
    text-decoration: none !important;
    position: relative !important;
    overflow: hidden !important;
  text-transform: capitalize !important;
}

/* Remove all hover effects */
.sky-whatsapp-start-chat:hover {
    background: #25d366 !important;
    transform: none !important;
    box-shadow: none !important;
}

/* Remove the ripple effect */
.sky-whatsapp-start-chat::after {
    display: none !important;
}

/* Simple active state */
.sky-whatsapp-start-chat:active {
    transform: none !important;
    box-shadow: none !important;
    background: #20c05c !important;
}

/* WhatsApp icon in button */
.sky-whatsapp-start-chat::before {
    content: "";
    width: 18px;
    height: 18px;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='white'%3E%3Cpath d='M17.472 14.382c-.297-.149-1.758-.867-2.03-.967-.273-.099-.471-.148-.67.15-.197.297-.767.966-.94 1.164-.173.199-.347.223-.644.075-.297-.15-1.255-.463-2.39-1.475-.883-.788-1.48-1.761-1.653-2.059-.173-.297-.018-.458.13-.606.134-.133.298-.347.446-.52.149-.174.198-.298.298-.497.099-.198.05-.371-.025-.52-.075-.149-.669-1.612-.916-2.207-.242-.579-.487-.5-.669-.51-.173-.008-.371-.01-.57-.01-.198 0-.52.074-.792.372-.272.297-1.04 1.016-1.04 2.479 0 1.462 1.065 2.875 1.213 3.074.149.198 2.096 3.2 5.077 4.487.709.306 1.262.489 1.694.625.712.227 1.36.195 1.871.118.571-.085 1.758-.719 2.006-1.413.248-.694.248-1.289.173-1.413-.074-.124-.272-.198-.57-.347m-5.421 7.403h-.004a9.87 9.87 0 01-5.031-1.378l-.361-.214-3.741.982.998-3.648-.235-.374a9.86 9.86 0 01-1.51-5.26c.001-5.45 4.436-9.884 9.888-9.884 2.64 0 5.122 1.03 6.988 2.898a9.825 9.825 0 012.893 6.994c-.003 5.45-4.437 9.884-9.885 9.884m8.413-18.297A11.815 11.815 0 0012.05 0C5.495 0 .16 5.335.157 11.892c0 2.096.547 4.142 1.588 5.945L.057 24l6.305-1.654a11.882 11.882 0 005.683 1.448h.005c6.554 0 11.89-5.335 11.893-11.893a11.821 11.821 0 00-3.48-8.413Z'/%3E%3C/svg%3E");
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
}

/* ==========================================================================
   MOBILE RESPONSIVENESS - CRITICAL FIXES
   ========================================================================== */

/* Tablets and smaller */
@media (max-width: 768px) {
    .sky-whatsapp-popup {
        width: 340px;
        max-width: calc(100vw - 40px);
    }
}

/* Mobile devices */
@media (max-width: 480px) {
    /* Adjust widget position for mobile */
    .sky-whatsapp-widget.sky-whatsapp-bottom-right {
        bottom: 20px;
        right: 20px;
    }
    
    .sky-whatsapp-widget.sky-whatsapp-bottom-left {
        bottom: 20px;
        left: 20px;
    }
    
    /* Keep button same size on mobile */
    .sky-whatsapp-button {
        width: 60px;
        height: 60px;
    }
    
    .sky-whatsapp-button svg {
        width: 28px;
        height: 28px;
    }
    
    /* Popup as card on mobile - WhatsApp style */
    .sky-whatsapp-popup {
        position: fixed;
        bottom: 90px;
        left: 15px;
        right: 15px;
        width: auto;
        max-width: 450px;
        margin: 0 auto;
        transform-origin: bottom center;
    }
    
    /* Center popup if widget is on the right */
    .sky-whatsapp-widget.sky-whatsapp-bottom-right .sky-whatsapp-popup {
        left: auto;
        right: 15px;
        margin: 0;
    }
    
    /* Center popup if widget is on the left */
    .sky-whatsapp-widget.sky-whatsapp-bottom-left .sky-whatsapp-popup {
        right: auto;
        left: 15px;
        margin: 0;
    }
    
    /* Popup inner with rounded corners */
    .sky-whatsapp-popup-inner {
        border-radius: 16px;
        overflow: hidden;
        box-shadow: 0 5px 25px rgba(0,0,0,0.2);
    }
    
    /* WhatsApp style header */
    .sky-whatsapp-popup-header {
        background: #008069 !important;
        padding: 16px 20px !important;
    }
    
    /* Avatar and info layout */
    .sky-whatsapp-avatar,
    .sky-whatsapp-avatar-placeholder {
        width: 44px !important;
        height: 44px !important;
        margin-right: 14px !important;
    }
    
    .sky-whatsapp-avatar-placeholder {
        background: rgba(255,255,255,0.9) !important;
    }
    
    /* Header text */
    .sky-whatsapp-info h4 {
        font-size: 17px !important;
        font-weight: 600 !important;
    }
    
    .sky-whatsapp-status {
        font-size: 13px !important;
        color: rgba(255, 255, 255, 0.8) !important;
    }
    
    /* WhatsApp style close button */
    .sky-whatsapp-close {
        width: 28px !important;
        height: 28px !important;
        font-size: 24px !important;
        top: 50% !important;
        right: 20px !important;
        transform: translateY(-50%) !important;
        opacity: 1 !important;
        background: transparent !important;
        color: rgba(255,255,255,0.8) !important;
    }
    
    .sky-whatsapp-close:hover {
        transform: translateY(-50%) !important;
        background: transparent !important;
        color: #ffffff !important;
    }
    
    /* Chat body */
.sky-whatsapp-popup-body {
	background: #e5ddd5 !important;
	padding: 30px 20px 30px 20px !important;
	min-height: 100px !important;
}

    
    /* Message bubble adjustments */
    .sky-whatsapp-message-container {
        margin-bottom: 16px;
    }
    
    .sky-whatsapp-message {
        max-width: 90% !important;
        padding: 10px 14px !important;
        font-size: 15px !important;
    }
    
    .sky-whatsapp-message p {
        font-size: 15px !important;
        line-height: 22px !important;
    }
    
    /* Footer with WhatsApp style */
    .sky-whatsapp-popup-footer {
        padding: 16px 20px 20px 20px !important;
        background: #fff !important;
    }
    
    /* WhatsApp style button */
    .sky-whatsapp-start-chat {
        padding: 14px 36px !important;
        font-size: 16px !important;
        border-radius: 28px !important;
        font-weight: 500 !important;
    }
}

/* Very small mobile devices */
@media (max-width: 360px) {
    .sky-whatsapp-button {
        width: 45px;
        height: 45px;
    }
    
    .sky-whatsapp-button svg {
        width: 22px;
        height: 22px;
    }
    
    .sky-whatsapp-info h4 {
        font-size: 14px !important;
    }
    
    .sky-whatsapp-message {
        font-size: 12px !important;
    }
}

/* Hide on print */
@media print {
    .sky-whatsapp-widget {
        display: none !important;
    }
}

/* Loading state */
.sky-whatsapp-widget.sky-whatsapp-loading .sky-whatsapp-button {
    pointer-events: none;
    opacity: 0.7;
}

.sky-whatsapp-widget.sky-whatsapp-loading .sky-whatsapp-button::after {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: sky-whatsapp-spin 0.8s linear infinite;
}

@keyframes sky-whatsapp-spin {
    to { transform: rotate(360deg); }
}

/* Ensure proper z-index stacking */
.sky-whatsapp-widget {
    z-index: 999999 !important;
}

.sky-whatsapp-popup {
    z-index: 999998 !important;
}

/* Fix for iOS Safari */
@supports (-webkit-touch-callout: none) {
    .sky-whatsapp-popup {
        -webkit-transform: translateZ(0);
        transform: translateZ(0);
    }
    
    .sky-whatsapp-popup-inner {
        -webkit-overflow-scrolling: touch;
    }
}

/* ========================================
   DELAYED PULSE & NOTIFICATION CSS
   ======================================== */

/* Initially hide the pulse effect */
.sky-whatsapp-button {
    /* Keep all your existing button styles and add: */
    animation: none !important;
}

/* Add pulse effect when show-pulse class is added */
.sky-whatsapp-button.show-pulse {
    animation: whatsappPulse 2s ease-in-out infinite !important;
}

/* Pulse animation keyframes */
@keyframes whatsappPulse {
    0% {
        box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2), 0 0 0 0 rgba(37, 211, 102, 0.7);
    }
    50% {
        box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2), 0 0 0 15px rgba(37, 211, 102, 0);
    }
    100% {
        box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2), 0 0 0 0 rgba(37, 211, 102, 0);
    }
}

/* Initially hide the notification badge */
.sky-whatsapp-button::before {
    content: '1';
    position: absolute;
    top: -2px;
    right: -2px;
    width: 18px;
    height: 18px;
    background: #ff0000;
    border-radius: 50%;
    color: #ffffff;
    font-size: 11px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Roboto", sans-serif;
    text-align: center;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    /* Initially hidden with smooth transition */
    opacity: 0;
    transform: scale(0);
    transition: all 0.3s ease-in-out;
}

/* Show notification badge when show-notification class is added */
.sky-whatsapp-button.show-notification::before {
    opacity: 1;
    transform: scale(1);
}

/* Optional: Bounce animation when notification appears */
@keyframes notificationBounce {
    0% {
        transform: scale(0);
        opacity: 0;
    }
    50% {
        transform: scale(1.2);
        opacity: 1;
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

/* Apply bounce animation to notification */
.sky-whatsapp-button.show-notification::before {
    animation: notificationBounce 0.5s ease-out forwards;
}

/* Remove notification when popup is open */
.sky-whatsapp-widget.popup-open .sky-whatsapp-button::before {
    display: none;
}

/* Stop pulse when popup is open */
.sky-whatsapp-widget.popup-open .sky-whatsapp-button {
    animation: none !important;
}

/* Mobile responsiveness for delayed effects */
@media (max-width: 360px) {
    .sky-whatsapp-button::before {
        width: 16px;
        height: 16px;
        font-size: 10px;
        top: -2px;
        right: -2px;
        border-width: 1.5px;
    }
}

.sky-whatsapp-button {
	color: white;
}

/**
 * Sky SEO Boost - WhatsApp Business Frontend Styles with RTL Support
 * 
 * Add this to the end of your existing whatsapp-frontend.css file
 * 
 * @package Sky_SEO_Boost
 * @subpackage WhatsApp_Business
 * @version 1.0.2
 */

/* ==========================================================================
   RTL SUPPORT FOR ARABIC AND OTHER RTL LANGUAGES
   ========================================================================== */

/* RTL Detection - Applied when HTML has dir="rtl" or lang="ar" */
html[dir="rtl"] .sky-whatsapp-widget,
html[lang="ar"] .sky-whatsapp-widget,
.rtl .sky-whatsapp-widget {
    direction: rtl;
}

/* Floating Widget Position Adjustments for RTL */
html[dir="rtl"] .sky-whatsapp-widget.sky-whatsapp-bottom-right,
html[lang="ar"] .sky-whatsapp-widget.sky-whatsapp-bottom-right,
.rtl .sky-whatsapp-widget.sky-whatsapp-bottom-right {
    right: auto;
    left: 20px;
}

html[dir="rtl"] .sky-whatsapp-widget.sky-whatsapp-bottom-left,
html[lang="ar"] .sky-whatsapp-widget.sky-whatsapp-bottom-left,
.rtl .sky-whatsapp-widget.sky-whatsapp-bottom-left {
    left: auto;
    right: 20px;
}

/* Popup Position Adjustments for RTL */
html[dir="rtl"] .sky-whatsapp-popup,
html[lang="ar"] .sky-whatsapp-popup,
.rtl .sky-whatsapp-popup {
    right: auto;
    left: 0;
    transform-origin: bottom left;
    text-align: right;
}

html[dir="rtl"] .sky-whatsapp-widget.sky-whatsapp-bottom-left .sky-whatsapp-popup,
html[lang="ar"] .sky-whatsapp-widget.sky-whatsapp-bottom-left .sky-whatsapp-popup,
.rtl .sky-whatsapp-widget.sky-whatsapp-bottom-left .sky-whatsapp-popup {
    left: auto;
    right: 0;
    transform-origin: bottom right;
}

/* Header Adjustments for RTL */
html[dir="rtl"] .sky-whatsapp-popup-header,
html[lang="ar"] .sky-whatsapp-popup-header,
.rtl .sky-whatsapp-popup-header {
    flex-direction: row-reverse;
}

html[dir="rtl"] .sky-whatsapp-avatar,
html[dir="rtl"] .sky-whatsapp-avatar-placeholder,
html[lang="ar"] .sky-whatsapp-avatar,
html[lang="ar"] .sky-whatsapp-avatar-placeholder,
.rtl .sky-whatsapp-avatar,
.rtl .sky-whatsapp-avatar-placeholder {
    margin-right: 0;
    margin-left: 15px;
}

html[dir="rtl"] .sky-whatsapp-info,
html[lang="ar"] .sky-whatsapp-info,
.rtl .sky-whatsapp-info {
    padding-right: 0;
    padding-left: 40px;
    text-align: right;
}

/* Close Button Position for RTL */
html[dir="rtl"] .sky-whatsapp-close,
html[lang="ar"] .sky-whatsapp-close,
.rtl .sky-whatsapp-close {
    right: auto !important;
    left: 11px !important;
}

/* Message Bubble Adjustments for RTL */
html[dir="rtl"] .sky-whatsapp-message-container,
html[lang="ar"] .sky-whatsapp-message-container,
.rtl .sky-whatsapp-message-container {
    flex-direction: row-reverse;
}

html[dir="rtl"] .sky-whatsapp-message,
html[lang="ar"] .sky-whatsapp-message,
.rtl .sky-whatsapp-message {
    margin-left: 0;
    margin-right: 8px;
    text-align: right;
}

/* Message Tail for RTL */
html[dir="rtl"] .sky-whatsapp-message::before,
html[lang="ar"] .sky-whatsapp-message::before,
.rtl .sky-whatsapp-message::before {
    left: auto;
    right: -12px;
    transform: scaleX(-1);
}

/* Message Time Stamp for RTL */
html[dir="rtl"] .message-time,
html[lang="ar"] .message-time,
.rtl .message-time {
    float: left !important;
    margin: 0 10px -5px 0 !important;
}

/* Start Chat Button for RTL */
html[dir="rtl"] .sky-whatsapp-start-chat,
html[lang="ar"] .sky-whatsapp-start-chat,
.rtl .sky-whatsapp-start-chat {
    flex-direction: row-reverse;
}

html[dir="rtl"] .sky-whatsapp-start-chat::before,
html[lang="ar"] .sky-whatsapp-start-chat::before,
.rtl .sky-whatsapp-start-chat::before {
    margin-right: 0;
    margin-left: 8px;
}

/* Verified Badge Position for RTL */
html[dir="rtl"] .sky-whatsapp-verified,
html[dir="rtl"] .sky-whatsapp-message-verified,
html[lang="ar"] .sky-whatsapp-verified,
html[lang="ar"] .sky-whatsapp-message-verified,
.rtl .sky-whatsapp-verified,
.rtl .sky-whatsapp-message-verified {
    margin-left: 0 !important;
    margin-right: 2px !important;
}

/* Notification Badge for RTL */
html[dir="rtl"] .sky-whatsapp-button::before,
html[lang="ar"] .sky-whatsapp-button::before,
.rtl .sky-whatsapp-button::before {
    right: auto;
    left: -2px;
}

/* Arabic Font Improvements */
html[lang="ar"] .sky-whatsapp-widget,
html[lang="ar"] .sky-whatsapp-widget * {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Roboto", "Oxygen", "Ubuntu", "Cantarell", "Fira Sans", "Droid Sans", "Helvetica Neue", "Arial", sans-serif !important;
    letter-spacing: 0 !important;
}

/* Improved Arabic Text Rendering */
html[lang="ar"] .sky-whatsapp-message p,
html[lang="ar"] .sky-whatsapp-info h4,
html[lang="ar"] .sky-whatsapp-status,
html[lang="ar"] .sky-whatsapp-start-chat {
    line-height: 1.6;
    word-spacing: 0.1em;
}

/* Mobile RTL Adjustments */
@media (max-width: 480px) {
    /* Popup positioning for mobile RTL */
    html[dir="rtl"] .sky-whatsapp-popup,
    html[lang="ar"] .sky-whatsapp-popup,
    .rtl .sky-whatsapp-popup {
        left: 15px;
        right: 15px;
    }
    
    html[dir="rtl"] .sky-whatsapp-widget.sky-whatsapp-bottom-right .sky-whatsapp-popup,
    html[lang="ar"] .sky-whatsapp-widget.sky-whatsapp-bottom-right .sky-whatsapp-popup,
    .rtl .sky-whatsapp-widget.sky-whatsapp-bottom-right .sky-whatsapp-popup {
        right: auto;
        left: 15px;
    }
    
    html[dir="rtl"] .sky-whatsapp-widget.sky-whatsapp-bottom-left .sky-whatsapp-popup,
    html[lang="ar"] .sky-whatsapp-widget.sky-whatsapp-bottom-left .sky-whatsapp-popup,
    .rtl .sky-whatsapp-widget.sky-whatsapp-bottom-left .sky-whatsapp-popup {
        left: auto;
        right: 15px;
    }
    
    /* Close button position fix for mobile RTL */
    html[dir="rtl"] .sky-whatsapp-close,
    html[lang="ar"] .sky-whatsapp-close,
    .rtl .sky-whatsapp-close {
        right: auto !important;
        left: 20px !important;
        transform: translateY(-50%) !important;
    }
}

/* Animations for RTL */
@keyframes whatsappPopupBounceRTL {
    0% {
        opacity: 0;
        transform: scale(0.3) translateY(20px);
    }
    50% {
        transform: scale(1.05) translateY(-5px);
    }
    100% {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

@keyframes whatsappPopupCloseRTL {
    0% {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
    100% {
        opacity: 0;
        transform: scale(0.8) translateY(10px);
    }
}

/* Apply RTL animations */
html[dir="rtl"] .sky-whatsapp-popup.show,
html[lang="ar"] .sky-whatsapp-popup.show,
.rtl .sky-whatsapp-popup.show {
    animation-name: whatsappPopupBounceRTL;
}

html[dir="rtl"] .sky-whatsapp-popup.closing,
html[lang="ar"] .sky-whatsapp-popup.closing,
.rtl .sky-whatsapp-popup.closing {
    animation-name: whatsappPopupCloseRTL;
}

/* Fix for mixed content (LTR numbers in RTL text) */
html[dir="rtl"] .sky-whatsapp-widget .message-time,
html[lang="ar"] .sky-whatsapp-widget .message-time,
.rtl .sky-whatsapp-widget .message-time {
    direction: ltr;
    unicode-bidi: embed;
}

/* Smooth transitions for direction changes */
.sky-whatsapp-widget,
.sky-whatsapp-popup,
.sky-whatsapp-message,
.sky-whatsapp-popup-header {
    transition: all 0.3s ease;
}