    /* --- COMPLETELY MODERN REDESIGN --- */
:root {
    --primary-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --secondary-gradient: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    --success-gradient: linear-gradient(135deg, #13B497 0%, #59D4A4 100%);
    --glass-bg: rgba(255, 255, 255, 0.1);
    --glass-border: rgba(255, 255, 255, 0.2);
    --dark-bg: #1a1a2e;
    --light-bg: #f8f9fa;
    --text-primary: #2d3748;
    --text-secondary: #718096;
    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.15);
    --shadow-xl: 0 20px 40px rgba(0, 0, 0, 0.2);
    --border-radius: 20px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

.webchat-widget {
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 9999;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

/* Chat Toggle Button - New Design */
.webchat-toggle {
    width: auto;
    min-width: 160px;
    height: 60px;
    background: var(--primary-gradient);
    border: none;
    border-radius: 50px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-lg);
    transition: var(--transition);
    position: relative;
    overflow: hidden;
    padding: 0 20px;
    gap: 10px;
}

.webchat-toggle::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: left 0.5s;
}

.webchat-toggle:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-xl);
}

.webchat-toggle:hover::before {
    left: 100%;
}

.webchat-toggle:active {
    transform: translateY(-1px);
}

.webchat-toggle i {
    font-size: 20px;
    color: white;
    z-index: 1;
    transition: var(--transition);
}

.webchat-toggle:hover i {
    transform: scale(1.1);
}

.webchat-toggle-text {
    color: white;
    font-weight: 600;
    font-size: 18px;
    z-index: 1;
    white-space: nowrap;
}


.webchat-close-text {
    color: white;
    font-weight: 600;
    font-size: 18px;
    z-index: 1;
    white-space: nowrap;
}

/* Notification Badge - Adjusted for new design */
.webchat-notification-badge {
    position: absolute;
    top: -8px;
    right: -8px;
    background: var(--secondary-gradient);
    color: white;
    font-size: 11px;
    font-weight: bold;
    min-width: 22px;
    height: 22px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 5px;
    box-shadow: var(--shadow-md);
    animation: pulse 2s infinite;
    z-index: 2;
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); }
}

/* Chat Box */
.webchat-box {
    position: absolute;
    bottom: 90px;
    right: 30px;
    width: 400px;
    height: 600px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: var(--border-radius);
    display: none;
    flex-direction: column;
    box-shadow: var(--shadow-xl);
    overflow: hidden;
    animation: slideInUp 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    border: 1px solid var(--glass-border);
}

@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(50px) scale(0.9);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.webchat-box.webchat-open {
    display: flex;
}

/* Control Buttons */
.webchat-controls {
    position: absolute;
    top: 15px;
    left: 15px;
    right: 15px;
    display: flex;
    justify-content: space-between;
    z-index: 10;
}

.webchat-control-btn {
    visibility: hidden;
    width: 35px;
    height: 35px;
    border-radius: 50%;
    border: none;
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    color: white;
}

.webchat-control-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.1);
}

/* Pre-Chat Form */
#webchat-pre-chat-form {
    display: flex;
    flex-direction: column;
    height: 100%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    position: relative;
    overflow: hidden;
}

#webchat-pre-chat-form::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.1) 0%, transparent 70%);
    animation: rotate 30s linear infinite;
}

@keyframes rotate {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.webchat-welcome-section {
    text-align: center;
    padding: 30px 30px 30px;
    position: relative;
    z-index: 1;
}

.webchat-welcome-icon {
    width: 80px;
    height: 80px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 0px;
    font-size: 36px;
    color: white;
    animation: float 3s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

.webchat-welcome-title {
    color: white;
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 1px;
}

.webchat-welcome-subtitle {
    color: rgba(255, 255, 255, 0.8);
    font-size: 16px;
    font-weight: 400;
}

.webchat-form-container {
    background: white;
    border-radius: var(--border-radius) var(--border-radius) 0 0;
    padding: 30px;
    margin-top: auto;
    position: relative;
    z-index: 1;
}

.webchat-input-group {
    position: relative;
    margin-bottom: 15px;
}

.webchat-input-group input {
    width: 100%;
    padding: 16px 20px 16px 50px;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    font-size: 15px;
    background: #f8f9fa;
    transition: var(--transition);
    font-weight: 500;
}

.webchat-input-group input::placeholder {
    color: #a0aec0;
    font-weight: 400;
}

.webchat-input-group input:focus {
    border-color: #667eea;
    background: white;
    box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.1);
    outline: none;
}

.webchat-input-group i {
    position: absolute;
    left: 18px;
    top: 50%;
    transform: translateY(-50%);
    color: #667eea;
    font-size: 18px;
    transition: var(--transition);
    z-index: 1;
}

.webchat-input-group input:focus + i {
    color: #667eea;
    transform: translateY(-50%) scale(1.1);
}

.webchat-submit-btn {
    width: 100%;
    padding: 16px;
    background: var(--primary-gradient);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
    margin-top: 10px;
}

.webchat-submit-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: left 0.5s;
}

.webchat-submit-btn:hover::before {
    left: 100%;
}

.webchat-submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.webchat-submit-btn:active {
    transform: translateY(0);
}

/* Waiting Form */
#webchat-waiting-form {
    display: flex;
    flex-direction: column;
    height: 100%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    position: relative;
    overflow: hidden;
}

#webchat-waiting-form::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.1) 0%, transparent 70%);
    animation: rotate 30s linear infinite;
}

.webchat-waiting-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px;
    position: relative;
    z-index: 1;
}

.webchat-waiting-icon {
    width: 80px;
    height: 80px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 30px;
    font-size: 36px;
    color: white;
    animation: pulse 2s infinite;
}

.webchat-waiting-text {
    color: white;
    font-size: 18px;
    font-weight: 500;
    text-align: center;
    margin-bottom: 20px;
}

.webchat-waiting-dots {
    display: flex;
    gap: 8px;
    margin-bottom: 20px;
}

.webchat-waiting-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: white;
    animation: bounce 1.4s infinite ease-in-out both;
}

.webchat-waiting-dot:nth-child(1) { animation-delay: -0.32s; }
.webchat-waiting-dot:nth-child(2) { animation-delay: -0.16s; }
.webchat-waiting-dot:nth-child(3) { animation-delay: 0; }

@keyframes bounce {
    0%, 80%, 100% { transform: scale(0); opacity: 0; }
    40% { transform: scale(1); opacity: 1; }
}

.webchat-cancel-btn {
    padding: 12px 30px;
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    backdrop-filter: blur(10px);
}

.webchat-cancel-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
}

/* Chat Ended Form */
#webchat-ended-form {
    display: flex;
    flex-direction: column;
    height: 100%;
    background: linear-gradient(135deg, #13B497 0%, #59D4A4 100%);
    position: relative;
    overflow: hidden;
}

#webchat-ended-form::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.1) 0%, transparent 70%);
    animation: rotate 30s linear infinite;
}

.webchat-ended-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px;
    position: relative;
    z-index: 1;
}

.webchat-ended-icon {
    width: 80px;
    height: 80px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 30px;
    font-size: 36px;
    color: white;
}

.webchat-ended-text {
    color: white;
    font-size: 18px;
    font-weight: 500;
    text-align: center;
    margin-bottom: 30px;
}

.webchat-new-chat-btn {
    padding: 16px 40px;
    background: white;
    color: #13B497;
    border: none;
    border-radius: 50px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: var(--shadow-md);
}

.webchat-new-chat-btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

/* Chat Interface */
.webchat-chat-interface-container {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.webchat-chat-header {
    background: var(--primary-gradient);
    color: white;
    padding: 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: var(--shadow-md);
    position: relative;
}

.webchat-agent-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.webchat-agent-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
}

.webchat-agent-details {
    display: flex;
    flex-direction: column;
}

.webchat-agent-name {
    font-size: 16px;
    font-weight: 600;
}

.webchat-agent-status {
    font-size: 12px;
    opacity: 0.9;
    display: flex;
    align-items: center;
    gap: 6px;
    position: relative;
}

.webchat-status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #10b981;
    animation: pulse 2s infinite;
    position: relative;
    z-index: 2;
}

/* Add the bubble effect */
.webchat-status-dot::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: #10b981;
    opacity: 0.5;
    z-index: 1;
    animation: bubblePulse 2s infinite;
}

@keyframes bubblePulse {
    0% {
        transform: scale(1);
        opacity: 0.5;
    }
    50% {
        transform: scale(2.5);
        opacity: 0;
    }
    100% {
        transform: scale(1);
        opacity: 0.5;
    }
}

/* For the toggle button, if you want to add a bubble when agent is online */
.webchat-toggle.agent-online::after {
    content: '';
    position: absolute;
    top: -5px;
    right: -5px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #10b981;
    z-index: 3;
    animation: bubblePulse 2s infinite;
}

/* Add a class to the toggle button when agent is online */
.webchat-toggle.agent-online {
    position: relative;
}

.webchat-chat-close {
    width: 35px;
    height: 35px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    font-size: 18px;
    position: relative;
    z-index: 20;
}

.webchat-chat-close:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: rotate(90deg);
}

.webchat-chat-messages {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    background: #f8f9fa;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.webchat-chat-messages::-webkit-scrollbar {
    width: 6px;
}

.webchat-chat-messages::-webkit-scrollbar-track {
    background: transparent;
}

.webchat-chat-messages::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 3px;
}

.webchat-message {
    display: flex;
    gap: 8px;
    max-width: 80%;
}

.webchat-message.visitor {
    align-self: flex-end;
    flex-direction: row-reverse;
}

.webchat-message.admin {
    align-self: flex-start;
}

.webchat-message-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--primary-gradient);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 14px;
    flex-shrink: 0;
}

.webchat-message-content {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.webchat-message-bubble {
    padding: 12px 16px;
    border-radius: 18px;
    font-size: 14px;
    line-height: 1.4;
    word-wrap: break-word;
    box-shadow: var(--shadow-sm);
}

.webchat-message.visitor .webchat-message-bubble {
    background: var(--primary-gradient);
    color: white;
    border-bottom-right-radius: 6px;
}

.webchat-message.admin .webchat-message-bubble {
    background: white;
    color: var(--text-primary);
    border-bottom-left-radius: 6px;
}

.webchat-message-time {
    font-size: 11px;
    color: var(--text-secondary);
    padding: 0 8px;
}

.webchat-message.visitor .webchat-message-time {
    text-align: right;
}

.webchat-chat-form {
    padding: 20px;
    background: white;
    border-top: 1px solid #e2e8f0;
    display: flex;
    gap: 12px;
    align-items: center;
}

.webchat-input-wrapper {
    flex: 1;
    position: relative;
}

.webchat-chat-input {
    width: 100%;
    padding: 12px 45px 12px 16px;
    border: 2px solid #e2e8f0;
    border-radius: 25px;
    font-size: 14px;
    background: #f8f9fa;
    transition: var(--transition);
    outline: none;
}

.webchat-chat-input:focus {
    border-color: #667eea;
    background: white;
    box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.1);
}

.webchat-send-btn {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    background: var(--primary-gradient);
    border: none;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    box-shadow: var(--shadow-md);
}

.webchat-send-btn:hover {
    transform: scale(1.1);
    box-shadow: var(--shadow-lg);
}

.webchat-send-btn:active {
    transform: scale(0.95);
}

/* Rating Section */
.webchat-chat-rating {
    padding: 20px;
    background: white;
    border-top: 1px solid #e2e8f0;
    display: none;
    align-items: center;
    justify-content: center;
    gap: 12px;
}

.webchat-rating-text {
    font-size: 14px;
    color: var(--text-primary);
    font-weight: 500;
}

.webchat-rating-stars {
    display: flex;
    gap: 8px;
}

.webchat-rating-star {
    font-size: 24px;
    color: #e2e8f0;
    cursor: pointer;
    transition: var(--transition);
}

.webchat-rating-star:hover,
.webchat-rating-star.active {
    color: #fbbf24;
    transform: scale(1.1);
}

/* Confirmation Dialog */
.webchat-confirm-dialog {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
}

.webchat-confirm-dialog.show {
    display: flex;
}

.webchat-confirm-content {
    background: white;
    border-radius: var(--border-radius);
    padding: 30px;
    max-width: 350px;
    width: 90%;
    box-shadow: var(--shadow-xl);
    text-align: center;
    animation: slideInUp 0.3s ease-out;
}

.webchat-confirm-title {
    font-size: 20px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 15px;
}

.webchat-confirm-message {
    font-size: 16px;
    color: var(--text-secondary);
    margin-bottom: 25px;
}

.webchat-confirm-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
}

.webchat-confirm-btn {
    padding: 12px 25px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    border: none;
}

.webchat-confirm-btn.yes {
    background: var(--primary-gradient);
    color: white;
}

.webchat-confirm-btn.no {
    background: #e2e8f0;
    color: var(--text-primary);
}

.webchat-confirm-btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.webchat-notification {
    visibility: hidden;
    position: absolute;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    padding: 10px 20px;
    border-radius: 4px;
    color: white;
    font-weight: 500;
    z-index: 1000;
    width: 100%;
    max-width: 300px;
    animation: slideDown 0.3s ease;
}

.webchat-success {
    background-color: #28a745;
}

.webchat-error {
    background-color: #dc3545;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

.webchat-header-buttons {
    display: flex;
    align-items: center;
}

/* Error message styling */
.webchat-message-bubble.error-message {
    background-color: #f8d7da;
    color: #721c24;
    border-left: 3px solid #dc3545;
    padding-left: 12px;
}

.webchat-message.system .webchat-message-avatar i {
    color: #ffffff;
}

/* Fade out animation for error messages */
.webchat-message {
    transition: opacity 0.3s ease;
}

/* Modal footer with left and right button alignment */
.modal-footer-left-right {
    display: flex;
    justify-content: space-between;
    width: 100%;
}

.modal-footer-left-right button:first-child {
    order: 1;
}

.modal-footer-left-right button:last-child {
    order: 2;
}

/* Offline message styling - Enhanced Version */
.webchat-offline-message {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 40px 30px;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-lg);
    position: absolute;
    top: 20px;
    left: 20px;
    right: 20px;
    bottom: 20px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.8);
    margin: 0;
    z-index: 1;
}

/* Additional decorative element */
.webchat-offline-message::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 5px;
    background: linear-gradient(90deg, #667eea, #764ba2, #f093fb, #f5576c);
    background-size: 300% 100%;
    animation: gradientShift 4s ease infinite;
}

@keyframes gradientShift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

.webchat-offline-icon {
    font-size: 64px;
    background: linear-gradient(135deg, #6c757d 0%, #495057 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    margin-bottom: 25px;
    animation: float 3s ease-in-out infinite;
    position: relative;
    z-index: 1;
    filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.1));
    transition: var(--transition);
}

.webchat-offline-icon:hover {
    transform: scale(1.05);
}

.webchat-offline-title {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 15px;
    color: #343a40;
    position: relative;
    z-index: 1;
    width: 100%;
    letter-spacing: -0.5px;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.webchat-offline-text {
    font-size: 16px;
    color: #6c757d;
    margin-bottom: 25px;
    line-height: 1.6;
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 300px;
}

.webchat-offline-time {
    font-size: 16px;
    font-weight: 600;
    color: #495057;
    margin-top: 20px;
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.webchat-back-time {
    background: linear-gradient(135deg, #e9ecef 0%, #dee2e6 100%);
    padding: 18px 25px;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-md);
    transition: var(--transition);
    border: 1px solid rgba(0, 0, 0, 0.05);
    position: relative;
    overflow: hidden;
    margin-top: 10px;
}

/* Shimmer effect on hover */
.webchat-back-time::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
    transition: left 0.6s;
}

.webchat-back-time:hover::before {
    left: 100%;
}

.webchat-back-time:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
}

.webchat-back-time i {
    margin-right: 10px;
    color: #6c757d;
    font-size: 18px;
    animation: pulse 2s infinite;
}

/* Add a subtle pulse to the time display */
@keyframes pulse {
    0% { opacity: 1; }
    50% { opacity: 0.7; }
    100% { opacity: 1; }
}

/* Add a subtle pattern overlay */
.webchat-offline-message-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        radial-gradient(circle at 10% 20%, rgba(255, 255, 255, 0.1) 0%, transparent 8%),
        radial-gradient(circle at 80% 40%, rgba(255, 255, 255, 0.1) 0%, transparent 8%),
        radial-gradient(circle at 40% 80%, rgba(255, 255, 255, 0.1) 0%, transparent 8%);
    background-size: 20px 20px;
    opacity: 0.3;
    z-index: 0;
}

/* Enhanced floating animation */
@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

/* Add a subtle bounce to the entire message container */
.webchat-offline-message {
    animation: gentleBounce 4s ease-in-out infinite;
}

@keyframes gentleBounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-5px); }
}

/* Hide the text and chat icon when the toggle is in 'open' state */
.webchat-toggle.is-open .webchat-toggle-text {
    display: none;
}
    
.webchat-toggle.is-open .fa-comments {
    display: none;
}
    
/* Show the close icon when the toggle is in 'open' state */
.webchat-toggle.is-open .fa-times {
    display: inline-block;
}
    
/* Hide the close text by default */
.webchat-toggle .webchat-close-text {
    display: none;
}

/* Show the close text when the toggle is in 'open' state */
.webchat-toggle.is-open .webchat-close-text {
    display: inline-block;
    margin-left: 5px; /* Adds a little space between icon and text */
}
    
/* Ensure the close icon is hidden by default */
.webchat-toggle .fa-times {
    display: none;
}

/* Responsive Design */
@media (max-width: 480px) {
    .webchat-widget {
        bottom: 20px;
        right: 20px;
    }
    
    .webchat-box {
        width: calc(100vw - 40px);
        height: calc(100vh - 100px);
        right: -10px;
        border-radius: var(--border-radius) var(--border-radius);
    }
    
    .webchat-message {
        max-width: 90%;
    }
    
    .webchat-toggle {
        min-width: 140px;
        height: 45px;
        padding: 0 15px;
    }
    
    .webchat-toggle-text {
        font-size: 14px;
    }
    
    .webchat-toggle i {
        font-size: 18px;
    }
}
