.smartdlr-chat-widget {
    --brand: #0055A5;
    --white: #ffffff;
    --gray-50: #f9fafb;
    --gray-200: #e5e7eb;
    --gray-700: #374151;
    --gray-800: #1f2937;
    --gray-900: #111827;
}

@keyframes bounce-gentle {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-5px);
    }
}

@keyframes fade-in {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate-bounce-gentle {
    animation: bounce-gentle 2s infinite;
}

.animate-fade-in {
    animation: fade-in 0.3s ease-out forwards;
}

@media (prefers-reduced-motion: reduce) {
    .animate-bounce-gentle {
        animation: none;
    }
}

.smartdlr-chat-widget {
    position: fixed;
    bottom: 1rem;
    right: 1rem;
    z-index: 9999;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

.smartdlr-chat-bubble-container {
    position: fixed;
    bottom: 1rem;
    right: 1rem;
    display: flex;
    align-items: flex-end;
}

.smartdlr-chat-bubble-message {
    position: relative;
    margin-bottom: 0.5rem;
    margin-right: 1rem;
    max-width: 20rem;
    background: var(--white);
    border-radius: 0.5rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    padding: 1rem;
}

#smartdlr-chat-bubble-close {
    position: absolute;
    top: -0.5rem;
    right: -0.5rem;
    background: var(--gray-50);
    border-radius: 9999px;
    padding: 0.25rem;
    cursor: pointer;
    transition: background-color 0.2s;
}

#smartdlr-chat-bubble-close:hover {
    background: var(--gray-200);
}

.smartdlr-chat-bubble-message::after {
    content: '';
    position: absolute;
    bottom: -0.5rem;
    right: 1rem;
    width: 1rem;
    height: 1rem;
    background: var(--white);
    transform: rotate(45deg);
}

.smartdlr-chat-toggle {
    background: var(--brand);
    color: var(--white);
    border: none;
    border-radius: 9999px;
    padding: 1rem;
    cursor: pointer;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    transition: all 0.3s;
    position: relative;
}

.smartdlr-chat-toggle:hover {
    transform: scale(1.1);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

.smartdlr-chat-online-indicator {
    position: absolute;
    top: -0.25rem;
    right: -0.25rem;
    width: 0.75rem;
    height: 0.75rem;
    background: #22c55e;
    border-radius: 9999px;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% {
        transform: scale(0.95);
        box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.7);
    }
    70% {
        transform: scale(1);
        box-shadow: 0 0 0 10px rgba(34, 197, 94, 0);
    }
    100% {
        transform: scale(0.95);
        box-shadow: 0 0 0 0 rgba(34, 197, 94, 0);
    }
}

.smartdlr-chat-container {
    position: absolute;
    bottom: 0;
    right: 0;
    width: 400px;
    height: 600px;
    background: var(--white);
    border-radius: 0.5rem;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
}

.dark-mode .smartdlr-chat-container {
    background: var(--gray-900);
}

.smartdlr-chat-header {
    background: var(--brand);
    color: var(--white);
    padding: 1rem 1.5rem;
    border-top-left-radius: 0.5rem;
    border-top-right-radius: 0.5rem;
}

.smartdlr-chat-header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.smartdlr-chat-header img {
    height: 2rem;
    width: auto;
}

.smartdlr-chat-controls {
    display: flex;
    gap: 0.5rem;
}

.smartdlr-chat-theme-toggle,
.smartdlr-chat-close {
    background: transparent;
    border: none;
    color: var(--white);
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 9999px;
}

.smartdlr-chat-theme-toggle:hover,
.smartdlr-chat-close:hover {
    background: rgba(255, 255, 255, 0.1);
}

.smartdlr-chat-subtitle {
    color: var(--white);
    font-size: 0.875rem;
    text-decoration: none;
}

.smartdlr-chat-subtitle:hover {
    text-decoration: underline;
}

.smartdlr-chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 1.5rem;
    background: var(--gray-50);
}

.dark-mode .smartdlr-chat-messages {
    background: var(--gray-800);
}

.smartdlr-chat-message {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
}

.smartdlr-chat-message.user {
    flex-direction: row-reverse;
}

.smartdlr-chat-avatar {
    width: 2rem;
    height: 2rem;
    border-radius: 9999px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.user .smartdlr-chat-avatar {
    background: var(--brand);
    color: var(--white);
}

.assistant .smartdlr-chat-avatar {
    background: var(--white);
    border: 2px solid var(--brand);
    color: var(--brand);
}

.dark-mode .assistant .smartdlr-chat-avatar {
    background: var(--gray-700);
}

.smartdlr-chat-bubble {
    max-width: 80%;
    padding: 1rem;
    border-radius: 0.5rem;
}

.user .smartdlr-chat-bubble {
    background: var(--brand);
    color: var(--white);
}

.assistant .smartdlr-chat-bubble {
    background: var(--white);
    border: 1px solid var(--gray-200);
    color: var(--gray-900);
}

.dark-mode .assistant .smartdlr-chat-bubble {
    background: var(--gray-700);
    border-color: var(--gray-600);
    color: var(--white);
}

.smartdlr-chat-footer {
    background: var(--white);
    border-top: 1px solid var(--gray-200);
    padding: 1rem;
}

.dark-mode .smartdlr-chat-footer {
    background: var(--gray-900);
    border-color: var(--gray-700);
}

.smartdlr-chat-error {
    margin-bottom: 1rem;
    padding: 0.5rem 1rem;
    background: #fee2e2;
    color: #991b1b;
    border-radius: 0.375rem;
    font-size: 0.875rem;
}

.smartdlr-chat-form {
    display: flex;
    gap: 1rem;
}

.smartdlr-chat-form input {
    flex: 1;
    padding: 0.5rem 1rem;
    border: 1px solid var(--gray-200);
    border-radius: 0.375rem;
    outline: none;
}

.dark-mode .smartdlr-chat-form input {
    background: var(--gray-800);
    border-color: var(--gray-700);
    color: var(--white);
}

.smartdlr-chat-form input:focus {
    border-color: var(--brand);
    box-shadow: 0 0 0 2px rgba(0, 85, 165, 0.1);
}

.smartdlr-chat-form button {
    background: var(--brand);
    color: var(--white);
    border: none;
    border-radius: 0.375rem;
    padding: 0.5rem 1.5rem;
    cursor: pointer;
    transition: opacity 0.2s;
}

.smartdlr-chat-form button:hover {
    opacity: 0.9;
}

.smartdlr-chat-form button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Typing indicator dots */
.smartdlr-chat-typing-dots {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 0.75rem 1rem;
}

.smartdlr-chat-typing-dots span {
    width: 8px;
    height: 8px;
    border-radius: 9999px;
    background: var(--gray-700);
    animation: typing-pulse 1.2s infinite;
}

.smartdlr-chat-typing-dots span:nth-child(2) { animation-delay: 0.2s; }
.smartdlr-chat-typing-dots span:nth-child(3) { animation-delay: 0.4s; }

@keyframes typing-pulse {
    0%, 80%, 100% { opacity: 0.3; transform: scale(0.85); }
    40%           { opacity: 1;   transform: scale(1); }
}
