/* Frontend Widget Styles - Clean & Modern Design */

.wa-floating-chat {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 9999;
}

/* Floating Wrapper - Contains text label and button */
.wa-floating-wrapper {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-direction: row;
}

/* Button Text Label - Separate from button */
.wa-button-text-label {
    background: #fff;
    color: #4a4a4a;
    padding: 12px 18px;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 500;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    white-space: nowrap;
    display: inline-block;
    cursor: pointer;
    /* Make it look clickable */
    transition: all 0.3s ease;
    opacity: 1;
    visibility: visible;
    transform: translateX(0);
}

/* Hide label when wrapper is open */
.wa-floating-wrapper.is-open .wa-button-text-label {
    opacity: 0;
    visibility: hidden;
    transform: translateX(10px);
}

/* Floating Button - Icon only, circular */
.wa-floating-button {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 60px;
    height: 60px;
    background: var(--wa-color);
    color: #fff;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.3s ease;
    text-decoration: none;
}

.wa-floating-button:hover {
    /* No hover effect requested */
    color: #fff;
    background: var(--wa-color);
}

.wa-floating-button:focus {
    outline: 2px solid var(--wa-color);
    outline-offset: 2px;
}

.wa-button-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    transition: transform 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.wa-button-icon svg {
    width: 30px;
    height: 30px;
}

/* Icon toggle when popup is open */
.wa-floating-button.is-open .wa-button-icon {
    transform: rotate(180deg);
}

.wa-button-icon svg {
    transition: opacity 0.3s ease;
    opacity: 1;
}

.wa-floating-button.is-open .wa-button-icon svg {
    opacity: 0;
}

.wa-button-icon::after {
    content: '✕';
    font-size: 24px;
    font-weight: 400;
    line-height: 1;
    color: #fff;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) rotate(-180deg);
    opacity: 0;
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.wa-floating-button.is-open .wa-button-icon::after {
    opacity: 1;
    transform: translate(-50%, -50%) rotate(0deg);
}

/* Popup */
.wa-chat-popup {
    position: fixed;
    bottom: 90px;
    right: 20px;
    width: 360px;
    max-width: calc(100vw - 40px);
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px) scale(0.95);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
}

.wa-chat-popup.is-open {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

.wa-popup-content {
    display: flex;
    flex-direction: column;
    max-height: 520px;
}

/* Popup Header - Cleaner design with rounded top */
.wa-popup-header {
    background: var(--wa-color);
    color: #fff;
    padding: 20px 18px;
    display: flex;
    align-items: flex-start;
    gap: 10px;
    position: relative;
    border-radius: 12px 12px 0 0;
}

.wa-header-icon {
    width: 52px;
    height: 52px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.wa-header-icon svg {
    width: 32px;
    height: 32px;
}

.wa-header-text {
    flex: 1;
    min-width: 0;
}

.wa-header-text h3 {
    margin: 0 0 5px 0;
    font-size: 18px;
    font-weight: 600;
    line-height: 1.3;
    color: #fff;
}

.wa-header-text p {
    margin: 0;
    font-size: 13px;
    line-height: 1.4;
    opacity: 0.92;
}

.wa-popup-close {
    display: none;
}

/* Reply Time Text - Below header */
.wa-reply-time {
    padding: 14px 20px 0 20px;
    color: #6c757d;
    font-size: 12px;
}

/* Agents List - Cleaner spacing */
.wa-agents-list {
    overflow-y: auto;
    max-height: 360px;
    padding: 12px;
    background: #fff;
    /* Changed from #f5f7f9 to white since items are now colored */
}

.wa-agent-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    text-decoration: none;
    color: #333;
    background: #F5F7F9;
    /* Requested background color */
    border-radius: 8px;
    margin-bottom: 8px;
    border: 1px solid transparent;
    transition: all 0.2s ease;
    position: relative;
    border-left: 4px solid transparent;
}

.wa-agent-item:hover,
.wa-agent-item:focus {
    background: #edf2f7;
}

.wa-agent-item:last-child {
    border-bottom: none;
}

/* Agent Info - Better typography */
.wa-agent-info {
    flex: 1;
    min-width: 0;
}

.wa-agent-info h4 {
    margin: 0 0 2px 0;
    font-size: 14px;
    /* Requested 14px */
    font-weight: 600;
    color: #1a1a1a;
    line-height: 1.3;
}

.wa-agent-info p {
    margin: 0;
    font-size: 13px;
    color: #6c757d;
    line-height: 1.3;
}

/* Agent WhatsApp Icon - Simple green icon */
.wa-agent-icon {
    width: 24px;
    height: 24px;
    background: transparent;
    /* No background */
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--wa-color);
    /* Green icon */
    flex-shrink: 0;
}

.wa-agent-icon svg {
    width: 24px;
    height: 24px;
}

/* Scrollbar Styling */
.wa-agents-list::-webkit-scrollbar {
    width: 6px;
}

.wa-agents-list::-webkit-scrollbar-track {
    background: #f8f9fa;
}

.wa-agents-list::-webkit-scrollbar-thumb {
    background: #cbd5e0;
    border-radius: 3px;
}

.wa-agents-list::-webkit-scrollbar-thumb:hover {
    background: #a0aec0;
}

/* Mobile Responsive */
@media screen and (max-width: 480px) {
    .wa-floating-chat {
        bottom: 15px;
        right: 15px;
    }

    .wa-floating-wrapper {
        gap: 10px;
    }

    .wa-button-text-label {
        padding: 10px 14px;
        font-size: 14px;
    }

    .wa-floating-button {
        width: 56px;
        height: 56px;
    }

    .wa-button-icon svg {
        width: 28px;
        height: 28px;
    }

    .wa-chat-popup {
        bottom: 80px;
        right: 15px;
        width: calc(100vw - 30px);
        border-radius: 12px;
    }

    .wa-popup-header {
        padding: 20px 16px;
        border-radius: 12px 12px 0 0;
    }

    .wa-header-icon {
        width: 48px;
        height: 48px;
    }

    .wa-header-icon svg {
        width: 28px;
        height: 28px;
    }

    .wa-header-text h3 {
        font-size: 18px;
    }

    .wa-header-text p {
        font-size: 13px;
    }

    .wa-agent-item {
        padding: 14px 16px;
    }
}

/* Accessibility - Reduce motion */
@media (prefers-reduced-motion: reduce) {

    .wa-floating-button,
    .wa-chat-popup,
    .wa-agent-item,
    .wa-popup-close {
        transition: none;
    }
}