#clio-ccw-widget {
    position: fixed;
    bottom: 20px;
    z-index: 99999;
    font-family: Arial, sans-serif;
    box-shadow: 0 0 #0000, 0 0 #0000, 0 10px 40px -10px #5048e54d;
}

#clio-ccw-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    white-space: nowrap;
    font-size: 14px;
    font-weight: 500;
    outline: none;
    border: none;
    cursor: pointer;
    width: 56px;
    height: 56px;
    border-radius: 9999px;
    background: linear-gradient(135deg,  var(--clio-ccw-color, #0073aa) 0%, #fff 150%);
    color: #ffffff;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
    transition: all 0.3s ease;
    animation: bounceIn 0.6s ease;
    z-index: 99999;
    position: fixed;
    bottom: 20px;
    padding: 0;
}

#clio-ccw-toggle:hover {
    transform: scale(1.1);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2);
}

#clio-ccw-toggle:focus-visible {
    outline: 2px solid #0073aa;
    outline-offset: 2px;
}

#clio-ccw-toggle:disabled {
    pointer-events: none;
    opacity: 0.5;
}

#clio-ccw-toggle svg {
    pointer-events: none;
    width: 24px;
    height: 24px;
    flex-shrink: 0;
}

/* Bounce In Animation */
@keyframes bounceIn {
    0% {
        transform: scale(0.3);
        opacity: 0;
    }
    50% {
        transform: scale(1.05);
        opacity: 1;
    }
    70% {
        transform: scale(0.9);
    }
    100% {
        transform: scale(1);
    }
}

#clio-ccw-chat {
    width: 320px;
    height: 400px;
    background-color: #fff;
    border-radius: 16px;
    box-shadow: 0 0 15px rgba(0,0,0,0.3);
    position: fixed;
    bottom: 80px;
    display: none;
    flex-direction: column;
    z-index: 999999;
    font-size: 14px;
    font-family: ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", Segoe UI Symbol, "Noto Color Emoji";
}

#clio-ccw-chat-title-wrapper {
    background: linear-gradient(135deg,  var(--clio-ccw-color, #0073aa) 0%, #fff 150%);
    color: #fff;
    padding: 16px;
    border-top-left-radius: 16px;
    border-top-right-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-weight: 600;
    font-size: 16px;
}

#clio-ccw-close-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    white-space: nowrap;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    transition: background-color 0.2s ease, color 0.2s ease;
    outline: none;
    height: 32px;
    width: 32px;
    background-color: transparent;
    color: #fff;
    border: none;
    cursor: pointer;
    padding: 0;
}

#clio-ccw-close-button:focus-visible {
    outline: 2px solid #3b82f6;
    outline-offset: 2px;
}

#clio-ccw-close-button:hover {
    background-color: rgba(255, 255, 255, 0.2);
    color: #000;
}

#clio-ccw-close-button:disabled {
    opacity: 0.5;
    pointer-events: none;
}

#clio-ccw-close-button svg {
    pointer-events: none;
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

#clio-ccw-chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    background: #f9fafb;
}

#clio-ccw-chat-form {
    display: flex;
    gap: 8px;
    padding: 16px;
    border-top: 1px solid #e5e7eb;
}

#clio-ccw-chat-input {
    flex: 1;
    padding: 5px;
    display: flex;
    height: 40px;
    width: 100%;
    border-radius: 6px;
    border: 1px solid #d1d5db;
    background-color: #fff;
    font-size: 16px;
    box-sizing: border-box;
    color: #000;
}

#clio-ccw-chat-input::placeholder {
    color: #9ca3af;
}

#clio-ccw-chat-input:focus-visible {
    outline: none;
    box-shadow:
            0 0 0 2px #3b82f6,
            0 0 0 4px #fff;
}

#clio-ccw-chat-input:disabled {
    cursor: not-allowed;
    opacity: 0.5;
}

@media (min-width: 768px) {
    #clio-ccw-chat-input {
        font-size: 14px;
    }
}

#clio-ccw-chat-send {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    white-space: nowrap;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    height: 40px;
    width: 40px;
    flex-shrink: 0;
    background: linear-gradient(135deg,  var(--clio-ccw-color, #0073aa) 0%, #fff 150%);
    color: #f9fafb;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    outline: none;
    padding: 0;
}

#clio-ccw-chat-send:disabled {
    pointer-events: none;
    opacity: 0.5;
    cursor: default;
}

#clio-ccw-chat-send:hover:not(:disabled) {
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    transform: scale(1.05);
}

.clio-ccw-message {
    margin: 5px;
}

.clio-ccw-user-message-wrapper, .clio-ccw-bot-message-wrapper {
    display: flex;
    width: 100%;
    margin-bottom: 16px;
    animation: fade-in 0.3s ease-in-out;
}

.clio-ccw-user-message-wrapper {
    justify-content: flex-end;
}

.clio-ccw-user-message-bubble, .clio-ccw-bot-message-bubble {
    max-width: 80%;
    padding-left: 16px;
    padding-right: 16px;
    padding-top: 12px;
    padding-bottom: 12px;
    border-radius: 16px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.clio-ccw-bot-message-bubble {
    background: #f1f2f4;
    border-bottom-left-radius: 6px;
    color: #000;
}

.clio-ccw-bot-message-bubble a {
    color: var(--clio-ccw-color, #0073aa);
    text-decoration: underline;
}

.clio-ccw-user-message-bubble {
    background: linear-gradient(135deg,  var(--clio-ccw-color, #0073aa) 0%, #fff 150%);
    border-bottom-right-radius: 6px;
    color: #fff;
}

.clio-ccw-user-message-bubble p, .clio-ccw-bot-message-bubble p {
    font-size: 14px;
    line-height: 1.625;
    margin: 0;
    font-weight: 400;
}

.clio-ccw-bot-message-bubble p {
    color: #000;
}

@keyframes fade-in {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fade-in {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.clio-ccw-message.bot {
    margin: 5px;
}

.clio-ccw-message.error {
    color: red;
}

.clio-ccw-message.loading {
    font-style: italic;
}
