/* =========================
   WhatsApp Widget Styles
========================= */

:root {
    --color-primary: #118c7e;
    --color-secondary: #0b5a51;
    --color-active: #26c281;
    --color-inactive: #f1a528;
    --color-offline: #a4a4a4;
    --color-message: #f1f0f0;
    --color-light: #fff;
    --shadow: 0 7px 15px 1px rgb(55 62 70 / 7%);
}

/* Canvas for confetti */
canvas {
    position: fixed !important;
    z-index: 99999 !important;
    pointer-events: none !important;
}

/* WhatsApp Widget Container */
.wHelp {
    position: fixed;
    bottom: 30px;
    left: 30px;
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.5s ease, visibility 0.5s ease;
}

.wHelp.visible {
    opacity: 1;
    visibility: visible;
}

/* Button Container */
.button-container {
    position: relative;
    display: inline-block;
}

/* Tooltip Styles */
.tooltip-text {
    position: absolute;
    left: 70px;
    top: 50%;
    transform: translateY(-50%);
    background-color: rgba(30, 30, 30, 0.9);
    color: white;
    padding: 10px 20px;
    border-radius: 30px;
    font-size: 14px;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(5px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    pointer-events: none;
}

.tooltip-text::before {
    content: '';
    position: absolute;
    left: -8px;
    top: 50%;
    transform: translateY(-50%);
    width: 0;
    height: 0;
    border-top: 8px solid transparent;
    border-bottom: 8px solid transparent;
    border-right: 8px solid rgba(30, 30, 30, 0.9);
}

.button-container:hover .tooltip-text:not(.hidden) {
    opacity: 1;
    visibility: visible;
    left: 65px;
}

.tooltip-text.hidden {
    opacity: 0 !important;
    visibility: hidden !important;
}

/* WhatsApp Bubble */
.wHelp-bubble.circle-bubble {
    position: relative;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background-color: var(--color-primary);
    transition: all 0.3s ease;
    cursor: pointer;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: breathe 1.2s ease-out infinite;
}

@keyframes breathe {
    0% {
        box-shadow: 0 0 0 0 rgba(17, 140, 126, 0.8), 0 0 0 0 rgba(17, 140, 126, 0.5);
    }
    50% {
        box-shadow: 0 0 0 8px rgba(17, 140, 126, 0.5), 0 0 0 16px rgba(17, 140, 126, 0.2);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(17, 140, 126, 0), 0 0 0 0 rgba(17, 140, 126, 0);
    }
}

.wHelp-bubble.circle-bubble:hover {
    background-color: var(--color-secondary);
    transform: scale(1.1);
    animation: none;
}

.wHelp-bubble .open-icon {
    color: white;
    font-size: 28px;
}

.wHelp-bubble .close-icon {
    display: none;
}

.wHelp.wHelp-show .wHelp-bubble .open-icon {
    display: none;
}

.wHelp.wHelp-show .wHelp-bubble .close-icon {
    display: block;
    color: white;
    font-size: 28px;
}

/* WhatsApp Popup */
.wHelp__popup {
    position: absolute;
    width: 350px;
    bottom: 80px;
    left: 0;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s;
    box-shadow: var(--shadow);
    border-radius: 12px;
    background: white;
    transform: translateY(10px);
}

.wHelp.wHelp-show .wHelp__popup {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* Popup Header */
.wHelp__popup--header {
    display: flex;
    gap: 15px;
    align-items: center;
    padding: 20px;
    background-color: var(--color-primary);
    border-radius: 12px 12px 0 0;
    /*min-height: 95px;
    box-sizing: border-box;*/
}

.wHelp__popup--header .image {
    position: relative;
    width: 60px;
    height: 60px;
    flex-shrink: 0;
}

.wHelp__popup--header .image img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid rgba(255, 255, 255, 0.3);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
    pointer-events: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    -webkit-user-drag: none;
}

.wHelp__popup--header .info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.wHelp__popup--header .info__name {
    font-size: 20px;
    font-weight: 600;
    color: white;
    line-height: 1.3;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 4px;
}

.wHelp__popup--header .info__title {
    color: #ffffff;
    font-size: 14px;
    opacity: 0.9;
    line-height: 1.4;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin: 0;
}

/* Online Status Dots */
.online-dot {
    position: absolute;
    bottom: 2px;
    right: 2px;
    width: 14px;
    height: 14px;
    background-color: #4CAF50;
    border: 2px solid var(--color-primary);
    border-radius: 50%;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
    z-index: 2;
}

.online-dot-small {
    position: absolute;
    bottom: 2px;
    right: 4px;
    width: 8px;
    height: 8px;
    background-color: #4CAF50;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    z-index: 10;
}

/* Popup Content */
.wHelp__popup--content {
    padding: 20px;
}

.current-datetime {
    text-align: center;
    font-size: 13px;
    color: #64748b;
    margin-bottom: 15px;
    padding: 8px 16px;
    background: #f8fafc;
    border-radius: 20px;
}

/* Message Styles */
.sms {
    display: grid;
    gap: 12px;
    grid-template-columns: 35px 1fr;
    margin-bottom: 8px;
}

.sms__user {
    position: relative;
    width: 35px;
    height: 35px;
}

.sms__user img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid rgba(255, 255, 255, 0.3);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    pointer-events: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    -webkit-user-drag: none;
}

.sms__text {
    padding: 12px 15px;
    background-color: var(--color-message);
    border-radius: 0 12px 12px 12px;
    position: relative;
}

.sms__text::before {
    content: '';
    position: absolute;
    top: 0;
    left: -10px;
    width: 0;
    height: 0;
    border-style: solid;
    border-width: 0 10px 10px 0;
    border-color: transparent var(--color-message) transparent transparent;
}

/* Send Message Button */
.wHelp__send-message {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    padding: 10px 20px;
    background-color: var(--color-primary);
    color: white;
    border: none;
    border-radius: 30px;
    font-size: 15px;
    cursor: pointer;
    margin-top: 0;
    transition: background-color 0.3s ease;
}

.wHelp__send-message:hover {
    background-color: var(--color-secondary);
}

/* Protected Avatar */
.protected-avatar {
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    -khtml-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

/* =========================
   Back to Top Button Styles
========================= */

#backToTop {
    position: fixed;
    right: 30px;
    bottom: 30px;
    width: 50px;
    height: 50px;
    background-color: #007BFF;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 9999;
    opacity: 0;
    transition: opacity 0.5s, background-color 0.3s, transform 0.3s;
    box-shadow: 0 4px 10px rgba(0,0,0,0.2);
}

#backToTop svg {
    width: 28px;
    height: 28px;
    fill: white;
}

#backToTop:hover {
    background-color: #0056b3;
    transform: scale(1.1);
}

/* =========================
   QR Container Styles
========================= */

#qrContainer {
    position: fixed;
    padding: 16px;
    background: #fff;
    border-radius: 10px;
    width: auto;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    display: none;
    z-index: 9998;
    text-align: center;
    box-shadow: 0 8px 20px rgba(0,0,0,0.25);
}

#qrContainer img {
    width: auto;
    height: 200px;
    display: block;
    margin: 0 auto;
}

#qrText {
    color: #666;
    font-size: 14px;
    margin-top: 6px;
}

/* Confetti Canvas */
#qrConfettiCanvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 9997;
}

/* =========================
   Mobile Responsive Styles
========================= */

@media (max-width: 768px) {
    .wHelp {
        bottom: 30px;
        left: 20px;
    }
    
    .wHelp__popup {
        width: 350px;
    }
    
    .wHelp__popup--header {
        padding: 15px;
        min-height: 85px;
    }
    
    .wHelp__popup--header .image {
        width: 50px;
        height: 50px;
    }
    
    .wHelp__popup--header .info__name {
        font-size: 18px;
    }
    
    .wHelp__popup--header .info__title {
        font-size: 12px;
    }
    
    .tooltip-text {
        display: none;
    }
    
    #backToTop {
        bottom: 30px;
        right: 20px;
        width: 50px;
        height: 50px;
    }
    
    #backToTop svg {
        width: 24px;
        height: 24px;
    }
    
    #qrContainer {
        width: 250px;
    }
    
    #qrContainer img {
        width: 250px;
        height: auto;
    }
}

@media (max-width: 480px) {
    .wHelp {
        bottom: 20px;
        left: 15px;
    }
    
    .wHelp__popup {
        width: 350px;
    }
    
    #backToTop {
        bottom: 20px;
        right: 15px;
        width: 50px;
        height: 50px;
    }
    
    #backToTop svg {
        width: 22px;
        height: 22px;
    }
}