:root {
    --wplc-primary: #ff206e;
    --wplc-secondary: #6c757d;
    --wplc-text: #333333;
    --wplc-light-bg: #f8f9fa;
    --wplc-border: #dee2e6;
}
/* Contact Widget Container */
.wplc-contact-widget {
    position: fixed;
    z-index: 999999;
}

.wplc-contact-widget.wplc-left {
    left: 20px;
}

.wplc-contact-widget.wplc-right {
    right: 20px;
}

/* Main Bubble */
.wplc-main-bubble {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background-color: #ff206e;
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    transition: all 0.3s ease;
}

.wplc-main-bubble:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 16px rgba(0,0,0,0.2);
}

.wplc-main-bubble i,
.wplc-main-bubble svg {
    width: 30px;
    height: 30px;
    fill: currentColor;
}



.wplc-left .wplc-contact-menu {
    left: 0;
    right: auto;
}

.wplc-contact-menu.wplc-open {
    display: flex;
}




.wplc-menu-text {
    font-size: 14px;
    font-weight: 500;
}

/* Animations */
.wplc-animation-fade.wplc-open {
    animation: wplcFadeIn 0.3s ease;
}

.wplc-animation-fade-up.wplc-open {
    animation: wplcFadeUp 0.3s ease;
}

.wplc-animation-fade-down.wplc-open {
    animation: wplcFadeDown 0.3s ease;
}

.wplc-animation-scale.wplc-open {
    animation: wplcScale 0.3s ease;
}

@keyframes wplcFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes wplcFadeUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes wplcFadeDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes wplcScale {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}



.wplc-menu-item-wrapper {
    display: none;
    position: absolute;
    bottom: 80px;
    right: 0;
    border-radius: 12px;
    min-width: 70px;
    gap: 10px;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.wplc-main-bubble:hover .wplc-menu-item-wrapper {
    display:flex;
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.wplc-item {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    transition: all 0.3s ease;
}


.wplc-item:hover {
    transform: scale(1.1);
}

.wplc-menu-item i,
.wplc-menu-item svg {
    width: 24px;
    height: 24px;
    color: white;
    fill: currentColor;
    margin:0px;
}

.wplc-main-bubble[data-title],
.wplc-menu-item[data-title],
.wplc-item[data-title] {
    position: relative;
}

.wplc-main-bubble[data-title]::after,
.wplc-menu-item[data-title]::after,
.wplc-item[data-title]::after {
    background: rgba(15, 23, 42, 0.95);
    border-radius: 12px;
    box-shadow: 0 12px 28px rgba(15, 23, 42, 0.24);
    color: #ffffff;
    content: attr(data-title);
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.01em;
    max-width: 220px;
    opacity: 0;
    padding: 10px 14px;
    pointer-events: none;
    position: absolute;
    right: calc(100% + 14px);
    top: 50%;
    transform: translateY(-50%) translateX(8px);
    transition: opacity 0.22s ease, transform 0.22s ease;
    visibility: hidden;
    white-space: nowrap;
    z-index: 1000001;
}

.wplc-main-bubble[data-title]::before,
.wplc-menu-item[data-title]::before,
.wplc-item[data-title]::before {
    border: 7px solid transparent;
    border-left-color: rgba(15, 23, 42, 0.95);
    content: '';
    opacity: 0;
    pointer-events: none;
    position: absolute;
    right: calc(100% + 1px);
    top: 50%;
    transform: translateY(-50%) translateX(8px);
    transition: opacity 0.22s ease, transform 0.22s ease;
    visibility: hidden;
    z-index: 1000001;
}

.wplc-main-bubble[data-title]:hover::after,
.wplc-main-bubble[data-title]:hover::before,
.wplc-menu-item[data-title]:hover::after,
.wplc-menu-item[data-title]:hover::before,
.wplc-item[data-title]:hover::after,
.wplc-item[data-title]:hover::before {
    opacity: 1;
    transform: translateY(-50%) translateX(0);
    visibility: visible;
}

.wplc-contact-widget.wplc-left .wplc-main-bubble[data-title]::after,
.wplc-contact-widget.wplc-left .wplc-menu-item[data-title]::after,
.wplc-contact-widget.wplc-left .wplc-item[data-title]::after {
    left: calc(100% + 14px);
    right: auto;
    transform: translateY(-50%) translateX(-8px);
}

.wplc-contact-widget.wplc-left .wplc-main-bubble[data-title]::before,
.wplc-contact-widget.wplc-left .wplc-menu-item[data-title]::before,
.wplc-contact-widget.wplc-left .wplc-item[data-title]::before {
    border-left-color: transparent;
    border-right-color: rgba(15, 23, 42, 0.95);
    left: calc(100% + 1px);
    right: auto;
    transform: translateY(-50%) translateX(-8px);
}

.wplc-contact-widget.wplc-left .wplc-main-bubble[data-title]:hover::after,
.wplc-contact-widget.wplc-left .wplc-main-bubble[data-title]:hover::before,
.wplc-contact-widget.wplc-left .wplc-menu-item[data-title]:hover::after,
.wplc-contact-widget.wplc-left .wplc-menu-item[data-title]:hover::before,
.wplc-contact-widget.wplc-left .wplc-item[data-title]:hover::after,
.wplc-contact-widget.wplc-left .wplc-item[data-title]:hover::before {
    transform: translateY(-50%) translateX(0);
}

/* Chat Interface - Keep your existing chat interface styles */
.wplc-chat-interface {
    position: fixed;
    bottom: 100px;
    right: 20px;
    width: 350px;
    height: 500px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 5px 40px rgba(0,0,0,0.16);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    z-index: 999998;
}

.wplc-left .wplc-chat-interface {
    left: 20px;
    right: auto;
}

/* Guest form */
.wplc-guest-form {
    padding: 20px;
    height: 100%;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
}

.wplc-guest-form h3 {
    margin: 0 0 10px 0;
    color: var(--wplc-text);
    font-size: 18px;
    font-weight: 600;
}

.wplc-guest-form p {
    color: #666;
    margin-bottom: 20px;
    font-size: 14px;
    line-height: 1.5;
}

.wplc-availability-banner {
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    margin-bottom: 12px;
    padding: 6px 10px;
    text-align: center;
}

.wplc-availability-banner.online {
    background: #d4edda;
    color: #155724;
}

.wplc-availability-banner.offline {
    background: #fff3cd;
    color: #856404;
}

.wplc-form-group {
    margin-bottom: 15px;
}

.wplc-form-group input {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--wplc-border);
    border-radius: 8px;
    font-size: 14px;
    transition: border-color 0.3s;
    box-sizing: border-box;
}

.wplc-form-group .iti {
    display: block;
    width: 100%;
}

.wplc-form-group .iti input {
    width: 100%;
    padding: 12px 12px 12px 52px;
}

.wplc-form-group .iti--separate-dial-code input {
    padding-left: 110px;
}

.wplc-form-group .iti input.wplc-input-error,
.wplc-form-group input.wplc-input-error {
    border-color: #e63946 !important;
    box-shadow: 0 0 0 3px rgba(230, 57, 70, 0.12);
}

.wplc-form-group .iti__selected-country {
    border-radius: 8px 0 0 8px;
}

.wplc-form-group .iti__country-container {
    z-index: 3;
}

.wplc-form-group .iti input:focus {
    outline: none;
    border-color: var(--wplc-primary);
    box-shadow: 0 0 0 3px rgba(0,123,255,0.1);
}

.wplc-form-group textarea,
#wplc-feedback-text {
    border: 1px solid var(--wplc-border);
    border-radius: 8px;
    box-sizing: border-box;
    font-family: inherit;
    font-size: 14px;
    padding: 12px;
    resize: vertical;
    width: 100%;
}

select.wplc-department-select {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--wplc-border);
    border-radius: 8px;
    font-size: 14px;
    transition: border-color 0.3s;
    box-sizing: border-box;
    outline: none;
    background-color: #fff;
}

/* Optional: focus effect */
select.wplc-department-select:focus {
    border-color: #ff206e; /* change to your theme color */
}

.wplc-form-group input:focus {
    outline: none;
    border-color: var(--wplc-primary);
    box-shadow: 0 0 0 3px rgba(0,123,255,0.1);
}

.wplc-start-chat {
    background-color: var(--wplc-primary);
    color: white;
    border: none;
    padding: 12px;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.3s;
    margin-top: 10px;
}

.wplc-start-chat:hover {
    background-color: var(--wplc-primary);
    opacity: 0.9;
}

.wplc-start-chat:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Chat interface */
.wplc-chat-interface {
    display: flex;
    flex-direction: column;
}

/* Chat header */
.wplc-chat-header {
    background-color: var(--wplc-primary);
    color: white;
    padding: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
}

.wplc-chat-header h4 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
}

.wplc-close-chat {
    background: none;
    border: none;
    color: white;
    cursor: pointer;
    font-size: 24px;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background-color 0.3s;
}

.wplc-close-chat:hover {
    background-color: rgba(255,255,255,0.2);
}

/* Messages container - FIXED scrolling */
.wplc-messages-container {
    flex: 1;
    overflow-y: auto !important;
    padding: 20px;
    background: var(--wplc-light-bg);
    height: calc(100% - 120px);
    max-height: 400px;
    scroll-behavior: smooth;
}

/* Message wrapper */
.wplc-message {
    margin-bottom: 15px;
    display: flex;
    flex-direction: column;
    width: 100%;
    clear: both;
}

/* Guest messages (right side) */
.wplc-message.wplc-guest {
    align-items: flex-end;
}

/* Agent messages (left side) */
.wplc-message.wplc-agent {
    align-items: flex-start;
}

/* System messages (center) */
.wplc-message.wplc-system {
    align-items: center;
}

.wplc-message.wplc-system .wplc-message-content {
    background: #e9ecef;
    color: #6c757d;
    font-style: italic;
    font-size: 12px;
    max-width: 90%;
    text-align: center;
}

.wplc-agent-join-message {
    align-items: center;
}

.wplc-agent-join-card {
    align-items: center;
    background: #ffffff;
    border: 1px solid rgba(219, 228, 240, 0.9);
    border-radius: 18px;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.08);
    display: flex;
    gap: 12px;
    max-width: 92%;
    padding: 12px 14px;
}

.wplc-agent-join-avatar {
    border-radius: 50%;
    flex: 0 0 42px;
    height: 42px;
    object-fit: cover;
    width: 42px;
}

.wplc-agent-join-avatar-fallback {
    align-items: center;
    background: var(--wplc-primary);
    color: #fff;
    display: inline-flex;
    font-size: 16px;
    font-weight: 700;
    justify-content: center;
}

.wplc-agent-join-body {
    align-items: flex-start;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.wplc-agent-join-name {
    color: #0f172a;
    font-size: 14px;
    font-weight: 700;
}

.wplc-agent-join-text {
    color: #475569;
    font-size: 13px;
    line-height: 1.4;
}

/* Message content */
.wplc-message-content {
    max-width: 80%;
    padding: 10px 15px;
    border-radius: 18px;
    background: white;
    box-shadow: 0 1px 2px rgba(0,0,0,0.1);
    word-wrap: break-word;
    line-height: 1.4;
    font-size: 14px;
}

/* Guest message bubble */
.wplc-guest .wplc-message-content {
    background-color: var(--wplc-primary);
    color: white;
    border-bottom-right-radius: 4px;
}

/* Agent message bubble */
.wplc-agent .wplc-message-content {
    background-color: var(--wplc-secondary);
    color: white;
    border-bottom-left-radius: 4px;
}

/* Message time */
.wplc-message-time {
    font-size: 11px;
    color: #999;
    margin-top: 5px;
    margin-bottom: 5px;
}

/* Message input area */
.wplc-message-input-area {
    padding: 15px;
    background: white;
    border-top: 1px solid var(--wplc-border);
    display: flex;
    gap: 10px;
    flex-shrink: 0;
}

.wplc-toast-notification {
    align-items: center;
    background: rgba(15, 23, 42, 0.94);
    border-radius: 14px;
    bottom: 18px;
    box-shadow: 0 16px 34px rgba(15, 23, 42, 0.28);
    color: #ffffff;
    display: inline-flex;
    gap: 10px;
    left: 50%;
    max-width: calc(100% - 32px);
    opacity: 0;
    padding: 12px 16px;
    position: absolute;
    transform: translate(-50%, 16px);
    transition: opacity 0.22s ease, transform 0.22s ease;
    z-index: 30;
}

.wplc-toast-notification.active {
    opacity: 1;
    transform: translate(-50%, 0);
}

.wplc-toast-icon {
    flex-shrink: 0;
    font-size: 18px;
    height: 18px;
    width: 18px;
}

.wplc-toast-text {
    display: block;
    font-size: 13px;
    font-weight: 500;
    line-height: 1.4;
}

.wplc-toast-notification.wplc-is-success {
    background: linear-gradient(135deg, #047857, #10b981);
}

.wplc-toast-notification.wplc-is-error {
    background: linear-gradient(135deg, #b91c1c, #ef4444);
}

.wplc-toast-notification.wplc-is-info {
    background: linear-gradient(135deg, #1d4ed8, #3b82f6);
}

.wplc-message-input-wrapper {
    align-items: flex-end;
    display: flex;
    gap: 10px;
    width: 100%;
}

.wplc-message-input-area textarea {
    flex: 1;
    padding: 10px;
    border: 1px solid var(--wplc-border);
    border-radius: 8px;
    resize: none;
    font-family: inherit;
    font-size: 14px;
    max-height: 42px;
    min-height: 30px;
    box-sizing: border-box;
}

.wplc-message-input-area textarea:focus {
    outline: none;
    border-color: var(--wplc-primary);
    box-shadow: 0 0 0 3px rgba(0,123,255,0.1);
}

.wplc-send-message {
    background-color: var(--wplc-primary);
    color: white;
    border: none;
    padding: 13px 20px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    transition: background-color 0.3s;
    align-self: flex-end;
}

.wplc-send-message:hover {
    opacity: 0.9;
}

.wplc-send-message:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Updated Typing Indicator for frontend */
.wplc-typing-indicator {
    padding: 10px 15px;
    color: #666;
    font-size: 12px;
    font-style: italic;
    animation: wplc-fade-in 0.3s ease;
    background: transparent;
    margin-bottom: 5px;
    display: flex;
    align-items: center;
    gap: 2px;
    position: absolute;
    bottom: 14%;
    right: 20px;
}

.wplc-typing-indicator span {
    width: 4px;
    height: 4px;
    background: #666;
    border-radius: 50%;
    display: inline-block;
    margin-left: 2px;
    animation: wplc-typing-dots 1.4s infinite ease-in-out both;
}

.wplc-typing-indicator span:nth-child(1) { animation-delay: -0.32s; }
.wplc-typing-indicator span:nth-child(2) { animation-delay: -0.16s; }
.wplc-typing-indicator span:nth-child(3) { animation-delay: 0; }

@keyframes wplc-typing-dots {
    0%, 60%, 100% { transform: translateY(0); opacity: 0.6; }
    30% { transform: translateY(-4px); opacity: 1; }
}
/* Animations */
@keyframes wplc-fade-in {
    from { 
        opacity: 0; 
        transform: translateY(10px); 
    }
    to { 
        opacity: 1; 
        transform: translateY(0); 
    }
}

@keyframes wplc-slide-up {
    from { 
        opacity: 0; 
        transform: translateY(20px); 
    }
    to { 
        opacity: 1; 
        transform: translateY(0); 
    }
}

/* Loading states */
.wplc-loading {
    text-align: center;
    padding: 20px;
    color: #999;
}

.wplc-loading::after {
    content: '';
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid var(--wplc-primary);
    border-radius: 50%;
    animation: wplc-spin 1s linear infinite;
    margin-left: 10px;
}

@keyframes wplc-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Error messages */
.wplc-error {
    color: #dc3545;
    text-align: center;
    padding: 10px;
    font-size: 13px;
    background: #f8d7da;
    border-radius: 4px;
    margin: 10px;
}

/* System messages */
.wplc-system-message {
    text-align: left;
    color: #6c757d;
    font-size: 12px;
    padding: 5px;
    font-style: italic;
}

/* Date separator */
.wplc-date-separator {
    text-align: center;
    margin: 15px 0;
    position: relative;
    clear: both;
}

.wplc-date-separator span {
    background: var(--wplc-light-bg);
    padding: 5px 15px;
    color: #999;
    font-size: 11px;
    border-radius: 15px;
    display: inline-block;
}

/* Read receipt */
.wplc-message-read {
    font-size: 10px;
    color: #4caf50;
    margin-left: 5px;
}

/* Unread badge */
.wplc-unread-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background: #dc3545;
    color: white;
    font-size: 10px;
    padding: 2px 5px;
    border-radius: 10px;
    min-width: 15px;
    text-align: center;
}

/* Responsive Design */
@media (max-width: 480px) {
    .wplc-chat-interface {
        width: 100%;
        height: 100%;
        bottom: 0;
        right: 0;
        border-radius: 0;
        position: fixed;
        top: 0;
        left: 0;
    }
    
    .wplc-main-bubble {
        bottom: 20px;
        right: 20px;
        position: fixed;
    }
    
    .wplc-contact-widget.wplc-left .wplc-main-bubble {
        left: 20px;
    }
    
    .wplc-message-content {
        max-width: 90%;
    }
    
    .wplc-messages-container {
        max-height: none;
        height: calc(100% - 110px);
    }
}

/* Dark mode support (optional) */
@media (prefers-color-scheme: dark) {
    .wplc-chat-interface {
        background: #1e1e1e;
        color: #e0e0e0;
    }
    
    .wplc-messages-container {
        background: #2d2d2d;
    }
    
    .wplc-message-content {
        background: #3d3d3d;
        color: #e0e0e0;
    }
    
    .wplc-guest-form h3 {
        color: #e0e0e0;
    }
    
    .wplc-guest-form p {
        color: #b0b0b0;
    }
    
    .wplc-form-group input {
        background: #3d3d3d;
        border-color: #4d4d4d;
        color: #e0e0e0;
    }
    
    .wplc-message-input-area {
        background: #1e1e1e;
        border-color: #3d3d3d;
    }
    
    .wplc-message-input-area textarea {
        background: #3d3d3d;
        border-color: #4d4d4d;
        color: #e0e0e0;
    }
}

/* Print styles */
@media print {
    .wplc-contact-widget,
    .wplc-chat-interface {
        display: none !important;
    }
}

/* Accessibility */
.wplc-main-bubble:focus-visible,
.wplc-start-chat:focus-visible,
.wplc-send-message:focus-visible,
.wplc-close-chat:focus-visible {
    outline: 3px solid #ff206e;
    outline-offset: 2px;
}

/* Smooth transitions */
.wplc-chat-interface,
.wplc-main-bubble,
.wplc-message-content {
    transition: all 0.2s ease-in-out;
}


/* Waiting message styling */
.wplc-system-message.wplc-waiting-message {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.08), rgba(254, 240, 138, 0.28));
    border: 1px solid rgba(245, 158, 11, 0.2);
    color: #92400e;
    animation: wplc-pulse-waiting 2.4s ease-in-out infinite;
}

.wplc-system-message.wplc-waiting-message .wplc-system-icon {
    background: linear-gradient(135deg, #f59e0b, #fbbf24);
    color: #ffffff;
}

.wplc-system-message.wplc-waiting-message .wplc-system-text {
    color: #92400e;
    font-weight: 700;
    letter-spacing: 0.01em;
}

.wplc-system-message.wplc-waiting-message .wplc-message-time {
    color: rgba(146, 64, 14, 0.62);
}

@keyframes wplc-pulse-waiting {
    0% {
        box-shadow: 0 10px 22px rgba(245, 158, 11, 0.08);
    }
    50% {
        box-shadow: 0 14px 28px rgba(245, 158, 11, 0.14);
    }
    100% {
        box-shadow: 0 10px 22px rgba(245, 158, 11, 0.08);
    }
}

/* Regular system messages */
.wplc-system-message {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin: 10px 0;
    padding: 8px 15px;
    background: #e9ecef;
    border-radius: 20px;
    font-size: 14px;
    color: #6c757d;
    max-width: 90%;
    margin-left: auto;
    margin-right: auto;
}

.wplc-system-icon {
    font-size: 14px;
}

.wplc-system-text {
    font-style: italic;
}

.wplc-system-message:has(.wplc-system-text) {
    position: relative;
}

.wplc-system-message .wplc-system-text {
    line-height: 1.45;
}

.wplc-system-content {
    display: flex;
    flex: 1;
    flex-direction: column;
    gap: 6px;
    min-width: 0;
}

.wplc-system-message.wplc-system-card {
    align-items: flex-start;
    border: 1px solid rgba(15, 23, 42, 0.08);
    border-radius: 18px;
    box-shadow: 0 14px 30px rgba(15, 23, 42, 0.08);
    gap: 12px;
    justify-content: flex-start;
    max-width: calc(100% - 24px);
    padding: 14px 16px;
}

.wplc-system-message.wplc-system-card .wplc-system-icon {
    align-items: center;
    border-radius: 50%;
    display: inline-flex;
    font-size: 14px;
    font-style: normal;
    font-weight: 700;
    height: 28px;
    justify-content: center;
    min-width: 28px;
    width: 28px;
}

.wplc-system-message.wplc-system-card .wplc-system-text {
    font-size: 13px;
    font-style: normal;
    font-weight: 600;
    letter-spacing: 0.01em;
    margin: 0;
}

.wplc-system-message.wplc-system-card .wplc-message-time {
    color: rgba(15, 23, 42, 0.48);
    font-size: 11px;
    margin: 0;
}

.wplc-system-message.wplc-system-info {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.08), rgba(191, 219, 254, 0.22));
    border-color: rgba(59, 130, 246, 0.18);
    color: #1d4ed8;
}

.wplc-system-message.wplc-system-info .wplc-system-icon {
    background: linear-gradient(135deg, #3b82f6, #60a5fa);
    color: #ffffff;
}

.wplc-system-message.wplc-system-success {
    background: linear-gradient(135deg, rgba(34, 197, 94, 0.08), rgba(187, 247, 208, 0.24));
    border-color: rgba(34, 197, 94, 0.2);
    color: #166534;
}

.wplc-system-message.wplc-system-success .wplc-system-icon {
    background: linear-gradient(135deg, #16a34a, #22c55e);
    color: #ffffff;
}

.wplc-system-message.wplc-system-error {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.08), rgba(254, 202, 202, 0.26));
    border-color: rgba(239, 68, 68, 0.18);
    color: #b91c1c;
}

.wplc-system-message.wplc-system-error .wplc-system-icon {
    background: linear-gradient(135deg, #ef4444, #f87171);
    color: #ffffff;
}

.wplc-system-message.wplc-system-join {
    background: linear-gradient(135deg, rgba(14, 165, 233, 0.08), rgba(186, 230, 253, 0.26));
    border-color: rgba(14, 165, 233, 0.2);
    color: #075985;
}

.wplc-system-message.wplc-system-join .wplc-system-icon {
    background: linear-gradient(135deg, #0ea5e9, #38bdf8);
    color: #ffffff;
}

.wplc-system-message.wplc-chat-ended {
    align-items: flex-start;
    background: linear-gradient(135deg, rgba(255, 32, 110, 0.08), rgba(255, 173, 204, 0.22));
    border: 1px solid rgba(255, 32, 110, 0.2);
    border-radius: 18px;
    box-shadow: 0 14px 30px rgba(255, 32, 110, 0.08);
    color: #7a1d45;
    gap: 12px;
    justify-content: flex-start;
    max-width: calc(100% - 24px);
    padding: 14px 16px;
}

.wplc-system-message.wplc-chat-ended .wplc-system-icon {
    align-items: center;
    background: linear-gradient(135deg, #ff206e, #ff6b9f);
    border-radius: 50%;
    color: #ffffff;
    display: inline-flex;
    font-size: 14px;
    font-style: normal;
    font-weight: 700;
    height: 28px;
    justify-content: center;
    min-width: 28px;
    width: 28px;
}

.wplc-system-message.wplc-chat-ended .wplc-system-text {
    color: #7a1d45;
    font-size: 15px;
    font-style: normal;
    font-weight: 700;
    letter-spacing: 0.01em;
}

.wplc-system-message.wplc-chat-ended::after {
    color: rgba(122, 29, 69, 0.72);
    content: 'Conversation ended';
    display: block;
    font-size: 11px;
    font-style: normal;
    font-weight: 700;
    letter-spacing: 0.08em;
    position: absolute;
    right: 16px;
    text-transform: uppercase;
    top: 10px;
}

.wplc-system-message.wplc-chat-ended .wplc-message-time {
    color: rgba(122, 29, 69, 0.62);
}

/* Transfer message styling */
.wplc-transfer-message {
    background: linear-gradient(135deg, rgba(14, 165, 233, 0.08), rgba(186, 230, 253, 0.24));
    border: 1px solid rgba(14, 165, 233, 0.18);
    padding: 14px 16px;
    margin: 10px 20px;
    border-radius: 18px;
    box-shadow: 0 14px 30px rgba(14, 165, 233, 0.08);
    display: flex;
    align-items: flex-start;
    gap: 12px;
    max-width: 90%;
    margin-left: auto;
    margin-right: auto;
}

.wplc-transfer-icon {
    align-items: center;
    background: linear-gradient(135deg, #0ea5e9, #38bdf8);
    border-radius: 50%;
    color: #ffffff;
    display: inline-flex;
    font-size: 14px;
    font-style: normal;
    font-weight: 700;
    height: 28px;
    justify-content: center;
    line-height: 1;
    min-width: 28px;
    width: 28px;
}

.wplc-transfer-content {
    flex: 1;
}

.wplc-transfer-text {
    display: block;
    font-size: 13px;
    color: #075985;
    font-weight: 600;
}

/* Add to chat-widget.css */
 
.wplc-connection-status {
    font-size: 11px;
    margin-left: 10px;
    padding: 2px 8px;
    border-radius: 12px;
    background: rgba(255,255,255,0.2);
}
 
.wplc-connected {
    color: #4caf50;
}
 
.wplc-disconnected {
    color: #ff9800;
    animation: wplc-pulse 1.5s infinite;
}
 
.wplc-reconnecting-message {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.08), rgba(254, 240, 138, 0.26));
    border-color: rgba(245, 158, 11, 0.2);
    color: #92400e;
}

.wplc-reconnecting-message .wplc-system-icon {
    background: linear-gradient(135deg, #f59e0b, #fbbf24);
    color: #ffffff;
}

.wplc-feedback-panel {
    background: #ffffff;
    border-top: 1px solid var(--wplc-border);
    padding: 15px;
}

.wplc-chat-actions {
    background: #ffffff;
    border-top: 1px solid var(--wplc-border);
    padding: 15px;
}

.wplc-feedback-panel h4 {
    color: var(--wplc-text);
    font-size: 15px;
    margin: 0 0 12px 0;
}

.wplc-feedback-stars {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
}

.wplc-feedback-star {
    background: #f1f3f5;
    border: 1px solid var(--wplc-border);
    border-radius: 8px;
    cursor: pointer;
    font-weight: 700;
    min-width: 42px;
    padding: 10px 0;
    transition: all 0.2s ease;
}

.wplc-feedback-star.active,
.wplc-feedback-star:hover {
    background: var(--wplc-primary);
    border-color: var(--wplc-primary);
    color: #fff;
}


/* ============================================
   ATTACHMENT STYLES - Frontend
   ============================================ */

/* Attachment Area Container */
.wplc-attachment-area {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    background: var(--wplc-light-bg, #f8f9fa);
    border-radius: 8px;
    margin-bottom: 10px;
    flex-wrap: wrap;
    position: relative;
}

/* Attachment Buttons */
.wplc-attachment-buttons {
    flex-shrink: 0;
}

/* Attachment Preview Container */
.wplc-attachment-preview {
    flex: 1;
    max-height: 120px;
}

/* Attachment Info */
.wplc-attachment-info {
    max-width: 150px;
}

/* Attachment Remove Button */
.wplc-attachment-count {
    font-weight: 500;
}

.wplc-attachment-space {
    margin-left: 8px;
}

.wplc-attachment-panel {
    background: #ffffff;
    border-top: 1px solid var(--wplc-border, #dee2e6);
    box-shadow: 0 -8px 25px rgba(0,0,0,0.1);
    width: 100%;
}

/* Attachments in Messages */
.wplc-message-content .wplc-attachments {
    margin-top: 10px;
    padding-top: 8px;
    border-top: 1px solid rgba(0, 0, 0, 0.1);
}

.wplc-message.guest .wplc-attachments {
    border-top-color: rgba(255, 255, 255, 0.2);
}

.wplc-message.agent .wplc-attachments {
    border-top-color: rgba(255, 255, 255, 0.2);
}

.wplc-message-content .wplc-attachment-item {
    background: rgba(255, 255, 255, 0.15);
    border: none;
    margin-top: 5px;
    padding: 6px 10px;
}

.wplc-message.guest .wplc-attachment-item {
    background: rgba(0, 0, 0, 0.05);
}

.wplc-message.agent .wplc-attachment-item {
    background: rgba(255, 255, 255, 0.2);
}

.wplc-message-content .wplc-attachment-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: inherit;
    text-decoration: none;
    font-size: 12px;
}

.wplc-message-content .wplc-attachment-link:hover {
    text-decoration: underline;
}

.wplc-message-content .wplc-attachment-name {
    max-width: 180px;
    color: inherit;
}

/* Error State for Attachments */
.wplc-attachment-error {
    --wplc-attachment-error-bg: rgba(220, 53, 69, 0.05);
    --wplc-attachment-error-color: #dc3545;
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    .wplc-attachment-item {
        background: #2d2d2d;
        border-color: #4d4d4d;
    }
    
    .wplc-attachment-name {
        color: #e0e0e0;
    }
    
    .wplc-attachment-thumb {
        background: #3d3d3d;
    }
    
    .wplc-message-content .wplc-attachment-item {
        background: rgba(0, 0, 0, 0.3);
    }
}

/* Mobile Responsive */
@media (max-width: 480px) {
    .wplc-attachment-area {
        flex-direction: column;
        align-items: stretch;
    }
    
    .wplc-attachment-preview {
        max-height: 160px;
    }
    
    .wplc-attachment-item {
        width: calc(100% - 20px);
    }
    
    .wplc-attachment-info {
        flex: 1;
    }
    
    .wplc-attachment-name {
        max-width: 200px;
    }
    
    .wplc-attachment-limits {
        text-align: center;
    }
}
