/* WhatsApp Widget Styles */
.whatsapp-widget {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 9999;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
}

/* Floating Button */
.whatsapp-button {
    width: 56px;
    height: 56px;
    border-radius: 50% !important;
    background: linear-gradient(135deg, #25D366 0%, #128C7E 100%);
    border: none !important;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    color: white;
    position: relative;
    z-index: 100;
    padding: 15px !important;
}

.whatsapp-button svg {
    width: 40px;
    height: 40px;
}

.whatsapp-button:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(37, 211, 102, 0.2);
}

.whatsapp-button:active {
    transform: scale(0.95);
}

/* Panel */
.whatsapp-panel {
    position: fixed;
    bottom: 90px;
    right: 20px;
    width: 360px;
    max-width: calc(100vw - 40px);
    background: white;
    border-radius: 16px;
    box-shadow: 0 12px 48px rgba(0, 0, 0, 0.15);
    opacity: 0;
    transform: translateY(20px) scale(0.9);
    pointer-events: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    max-height: 600px;
    display: flex;
    flex-direction: column;
}

.whatsapp-panel.active {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: all;
}

/* Header */
.whatsapp-header {
    background: rgb(45, 183, 66);
    color: white;
    padding: 20px;
    border-radius: 16px 16px 0 0;
    display: flex;
    align-items: center;
    gap: 16px;
}

.whatsapp-header h3 {
    font-size: clamp(1rem, 0.965rem + 0.2vw, 1.125rem) !important;
    font-weight: 600;
    line-height: 1.2em;

}

.whatsapp-icon {
    width: 56px;
    height: 56px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.whatsapp-icon svg {
    width: 32px;
    height: 32px;
}

.whatsapp-header-text {
    flex: 1;
    min-width: 0;
}

.whatsapp-header h3 {
    margin: 0 0 4px 0;
    font-size: 18px;
    font-weight: 600;
    line-height: 1.2;
}

.whatsapp-header p {
    margin: 0;
    font-size: 13px;
    opacity: 0.95;
    line-height: 1.4;
}

/* Body */
.whatsapp-body {
    padding: 20px;
    overflow-y: auto;
    max-height: 500px;
}

/* Contacts List */
.whatsapp-contacts {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* Contact Card */
.whatsapp-contact {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    border-radius: 0 4px 4px 0;
    background-color: #f5f7f9;
    border-left: 2px solid #2db742;
    text-decoration: none;
    transition: all 0.25s linear;
}

.whatsapp-contact.available:hover {
    background-color: #fff;
    box-shadow: 0 7px 15px 1px rgba(55, 62, 70, .07);
}

.whatsapp-contact.available {
    cursor: pointer;
}

.whatsapp-contact.unavailable {
    opacity: 0.6;
    cursor: not-allowed;
    border-color: #f0ad4e;
}

/* Contact Avatar */
.contact-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    overflow: hidden;
    flex-shrink: 0;
    background: #ddd;
    display: flex;
    align-items: center;
    justify-content: center;
}

.contact-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.contact-avatar-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #d1dbe0 0%, #0c70b6 100%);
    color: white;
}

.contact-avatar-placeholder svg {
    width: 28px;
    height: 28px;
}

/* Contact Info */
.contact-info {
    flex: 1;
    min-width: 0;
}

.contact-name {
    font-weight: 600;
    font-size: 15px;
    color: #333;
    margin-bottom: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.contact-role {
    font-size: 13px;
    color: #666;
    margin-bottom: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.contact-status {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    font-weight: 500;
}

.whatsapp-contact.available .contact-status {
    color: #25D366;
}

.whatsapp-contact.unavailable .contact-status {
    color: #999;
}

/* Status Dot */
.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
}

.status-dot.available {
    background: #25D366;
    box-shadow: 0 0 0 2px rgba(37, 211, 102, 0.2);
    animation: pulse-green 2s infinite;
}

.status-dot.unavailable {
    background: #999;
}

@keyframes pulse-green {

    0%,
    100% {
        box-shadow: 0 0 0 2px rgba(37, 211, 102, 0.2);
    }

    50% {
        box-shadow: 0 0 0 4px rgba(37, 211, 102, 0.4);
    }
}

/* Responsive */
@media (max-width: 480px) {
    .whatsapp-panel {
        bottom: 90px;
        right: 10px;
        width: calc(100vw - 20px);
    }

    .whatsapp-button {
        width: 56px;
        height: 56px;
    }

    .whatsapp-button svg {
        width: 28px;
        height: 28px;
    }
}

/* Scrollbar Styles */
.whatsapp-body::-webkit-scrollbar {
    width: 6px;
}

.whatsapp-body::-webkit-scrollbar-track {
    background: transparent;
}

.whatsapp-body::-webkit-scrollbar-thumb {
    background: #ddd;
    border-radius: 3px;
}

.whatsapp-body::-webkit-scrollbar-thumb:hover {
    background: #ccc;
}