/* SoftonHost WhatsApp Chat Widget Styles */
.sh-wa-container {
    position: fixed;
    z-index: 99999;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}

.sh-wa-container.left { left: 20px; right: auto; align-items: flex-start; }
.sh-wa-container.right { right: 20px; left: auto; }
.sh-wa-container.bottom { bottom: 20px; }

/* Pulse Animation */
@keyframes sh-pulse {
    0% { transform: scale(1); box-shadow: 0 0 0 0 rgba(37, 211, 102, 0.4); }
    70% { transform: scale(1.05); box-shadow: 0 0 0 15px rgba(37, 211, 102, 0); }
    100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(37, 211, 102, 0); }
}

.sh-wa-button {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    position: relative;
    border: none;
    outline: none;
}

.sh-wa-button.pulse {
    animation: sh-pulse 2s infinite;
}

.sh-wa-button:hover {
    transform: scale(1.1) rotate(5deg);
}

.sh-wa-badge {
    position: absolute;
    top: -45px;
    background: white;
    color: #333;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 600;
    white-space: nowrap;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    border: 1px solid #f0f0f0;
    opacity: 0;
    transform: translateY(10px);
    transition: all 0.3s ease;
    pointer-events: none;
}

.sh-wa-badge.show {
    opacity: 1;
    transform: translateY(0);
}

.sh-wa-container.right .sh-wa-badge { right: 0; }
.sh-wa-container.left .sh-wa-badge { left: 0; }

.sh-wa-badge::after {
    content: "";
    position: absolute;
    bottom: -6px;
    border-width: 6px 6px 0;
    border-style: solid;
    border-color: white transparent transparent;
}

.sh-wa-container.right .sh-wa-badge::after { right: 22px; }
.sh-wa-container.left .sh-wa-badge::after { left: 22px; }

/* Popup Transitions */
.sh-wa-popup {
    position: absolute;
    bottom: 80px;
    width: 340px;
    background: white;
    border-radius: 16px;
    box-shadow: 0 15px 50px rgba(0,0,0,0.15);
    overflow: hidden;
    display: none;
    opacity: 0;
    transform: translateY(20px) scale(0.95);
    transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
    z-index: 100000;
}

.sh-wa-container.right .sh-wa-popup { right: 0; transform-origin: bottom right; }
.sh-wa-container.left .sh-wa-popup { left: 0; transform-origin: bottom left; }

.sh-wa-popup.open {
    display: block;
    opacity: 1;
    transform: translateY(0) scale(1);
}

.sh-wa-header {
    padding: 25px 20px;
    color: white;
    position: relative;
}

.sh-wa-header h3 { margin: 0; font-size: 20px; font-weight: 700; }
.sh-wa-header p { margin: 5px 0 0; font-size: 14px; opacity: 0.9; }

.sh-wa-close {
    position: absolute;
    top: 15px;
    right: 15px;
    cursor: pointer;
    opacity: 0.7;
    transition: opacity 0.2s;
}
.sh-wa-close:hover { opacity: 1; }

.sh-wa-body {
    padding: 15px;
    max-height: 420px;
    overflow-y: auto;
    background: #f5f7f9;
}

/* Scrollbar */
.sh-wa-body::-webkit-scrollbar { width: 5px; }
.sh-wa-body::-webkit-scrollbar-track { background: #f1f1f1; }
.sh-wa-body::-webkit-scrollbar-thumb { background: #ccc; border-radius: 10px; }

.sh-wa-dept-item {
    background: white;
    padding: 15px;
    border-radius: 12px;
    margin-bottom: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 12px;
    border: 1px solid transparent;
}

.sh-wa-dept-item:hover {
    background: #fff;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
}

.sh-wa-dept-icon {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    background: #eee;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    flex-shrink: 0;
}

.sh-wa-dept-icon img { width: 100%; height: 100%; object-fit: cover; }

.sh-wa-dept-info { flex: 1; min-width: 0; }
.sh-wa-dept-name { font-weight: 700; color: #333; display: block; font-size: 15px; }
.sh-wa-dept-msg { font-size: 13px; color: #777; display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Form Styles */
.sh-wa-form-view {
    display: none;
    padding: 20px;
    background: white;
    animation: sh-slide-in 0.3s ease-out;
}

@keyframes sh-slide-in {
    from { transform: translateX(30px); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

.sh-wa-back {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    margin-bottom: 20px;
    cursor: pointer;
    font-size: 14px;
    color: #666;
    font-weight: 600;
}
.sh-wa-back:hover { color: #333; }

.sh-wa-input-group { margin-bottom: 15px; }
.sh-wa-label { display: block; font-size: 12px; font-weight: 700; color: #999; text-transform: uppercase; margin-bottom: 5px; letter-spacing: 0.5px; }
.sh-wa-input {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid #e1e4e8;
    border-radius: 8px;
    font-size: 14px;
    transition: border-color 0.2s;
    box-sizing: border-box;
}
.sh-wa-input:focus { border-color: #25D366; outline: none; }

.sh-wa-error { color: #ff4d4f; font-size: 12px; margin-top: 4px; display: none; }

.sh-wa-submit {
    color: white;
    border: none;
    padding: 14px;
    width: 100%;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 700;
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: opacity 0.2s;
}
.sh-wa-submit:hover { opacity: 0.9; }

/* Mobile Optimizations */
@media (max-width: 480px) {
    .sh-wa-popup {
        width: calc(100vw - 40px);
        bottom: 75px;
    }
}
