:root {
    --wa-green: var(--wa-main-color, #20c06c);
    --wa-green-dark: #128C7E;
    --wa-bg-glass: rgba(255, 255, 255, 0.85);
    --wa-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.15);
}

#float-wa-container {
    position: fixed;
    right: var(--wa-right);
    bottom: var(--wa-bottom);
    z-index: 999999;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
}

#float-wa-button {
    width: var(--wa-size);
    height: var(--wa-size);
    background: var(--wa-green);
    border-radius: var(--wa-radius);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
    border: 3px solid rgba(255, 255, 255, 0.4); /* Transparent white border */
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    animation: wa-pulse 2s infinite;
    position: relative;
}

/* Tooltip styles */
#float-wa-button::after {
    content: attr(data-tooltip);
    position: absolute;
    right: calc(100% + 15px);
    top: 50%;
    transform: translateY(-50%) scale(0.8);
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 8px 15px;
    border-radius: 8px;
    font-size: 14px;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    pointer-events: none;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
}

#float-wa-button:hover::after {
    opacity: 1;
    visibility: visible;
    transform: translateY(-50%) scale(1);
}

#float-wa-button svg {
    width: 60%;
    height: 60%;
}

@keyframes wa-pulse {
    0% { box-shadow: 0 0 0 0 rgba(37, 211, 102, 0.7); }
    70% { box-shadow: 0 0 0 15px rgba(37, 211, 102, 0); }
    100% { box-shadow: 0 0 0 0 rgba(37, 211, 102, 0); }
}

#float-wa-button:hover {
    transform: scale(1.1);
    filter: brightness(0.9);
}

#float-wa-popup {
    position: absolute;
    bottom: calc(var(--wa-size) + 20px);
    right: 0;
    width: 320px;
    background: var(--wa-bg-glass);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.18);
    box-shadow: var(--wa-shadow);
    overflow: hidden;
    transition: all 0.3s ease;
    transform-origin: bottom right;
}

#float-wa-popup.float-wa-hidden {
    opacity: 0;
    visibility: hidden;
    transform: scale(0.8) translate(10px, 20px);
    pointer-events: none;
}

.float-wa-header {
    background: linear-gradient(135deg, var(--wa-green) 0%, var(--wa-green-dark) 100%);
    color: white;
    padding: 25px 20px;
    position: relative;
}

.float-wa-header-top {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 5px;
}

.float-wa-header-icon {
    width: 24px;
    height: 24px;
    flex-shrink: 0;
}

.float-wa-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 700;
}

.float-wa-header span {
    display: block;
    font-size: 13px;
    opacity: 0.9;
    margin-top: 5px;
}

.float-wa-header p {
    margin: 10px 0 0;
    font-size: 13px;
    line-height: 1.4;
    opacity: 0.85;
}

#float-wa-close {
    position: absolute;
    top: 10px;
    right: 15px;
    background: none;
    border: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
    opacity: 0.7;
}

.float-wa-body {
    padding: 15px;
    max-height: 400px;
    overflow-y: auto;
}

.float-wa-user-item {
    display: flex;
    align-items: center;
    padding: 12px;
    background: rgba(255,255,255,0.5);
    border-radius: 12px;
    margin-bottom: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.float-wa-user-item:hover {
    background: rgba(255,255,255,0.8);
    transform: translateX(5px);
}

.float-wa-user-photo {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    overflow: hidden;
    margin-right: 12px;
    flex-shrink: 0;
}

.float-wa-user-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.float-wa-user-info strong {
    display: block;
    font-size: 14px;
    color: #333;
}

.float-wa-user-info span {
    font-size: 12px;
    color: #666;
}

.float-wa-input-container {
    display: flex;
    gap: 8px;
    margin-bottom: 15px;
    padding: 0 5px;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

.float-wa-message-input {
    flex: 1;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 8px 12px;
    font-size: 13px;
    outline: none;
}

.float-wa-send-btn {
    background: var(--wa-green);
    color: white;
    border: none;
    border-radius: 8px;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.float-wa-input-container.float-wa-hidden {
    display: none !important;
}

#float-wa-popup.float-wa-hidden {
    display: block !important; /* Override the general .float-wa-hidden display: none to allow animation */
    opacity: 0;
    visibility: hidden;
}

@media (max-width: 480px) {
    #float-wa-popup {
        width: calc(100vw - 40px);
        right: 0;
    }
}
