:root {
    --chat-primary-color: #008060;
    --chat-primary-dark: #005e46;
    --chat-header-gradient: linear-gradient(135deg, #008060 0%, #00b386 100%);
    --chat-bg-window: #ffffff;
    --chat-bg-messages: #f8f9fa;
    --chat-bot-msg-bg: #ffffff;
    --chat-user-msg-bg: #008060;
    --chat-user-msg-text: #ffffff;
    --chat-text-main: #333333;
    --chat-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
}

#dipner-chat-container {
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 1000;
    font-family: 'Inter', sans-serif;
}

/* Toggle Button */
#dipner-chat-toggle {
    width: 65px;
    height: 65px;
    border-radius: 50%;
    background: var(--chat-header-gradient);
    border: none;
    color: white;
    box-shadow: 0 5px 15px rgba(0, 128, 96, 0.4);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

#dipner-chat-toggle:hover {
    transform: scale(1.1);
}

/* Chat Window */
#dipner-chat-window {
    position: absolute;
    bottom: 80px;
    right: 0;
    width: 380px;
    height: 600px;
    max-height: 80vh;
    background: var(--chat-bg-window);
    border-radius: 20px;
    box-shadow: var(--chat-shadow);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transition: all 0.3s ease;
    transform-origin: bottom right;
}

#dipner-chat-window.hidden {
    opacity: 0;
    transform: scale(0.9);
    pointer-events: none;
}

/* Header Redesign */
#dipner-chat-header {
    padding: 15px 20px;
    background: var(--chat-header-gradient);
    color: white;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Use unique class names to avoid conflicts */
.chat-header-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.chat-avatar-container {
    position: relative;
    width: 45px;
    height: 45px;
}

.chat-avatar-img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.8);
    object-fit: cover;
    background: white;
}

.chat-online-dot {
    position: absolute;
    bottom: 2px;
    right: 2px;
    width: 12px;
    height: 12px;
    background: #4ade80;
    border: 2px solid var(--chat-primary-color);
    border-radius: 50%;
    box-shadow: 0 0 5px rgba(0, 0, 0, 0.2);
    animation: chat-pulse 2s infinite;
}

.chat-header-text strong {
    display: block;
    font-size: 1.05rem;
    line-height: 1.2;
}

.chat-header-text span {
    font-size: 0.8rem;
    opacity: 0.9;
}

#dipner-chat-close {
    background: none;
    border: none;
    color: white;
    font-size: 28px;
    cursor: pointer;
    opacity: 0.7;
    transition: opacity 0.2s;
    line-height: 1;
}

#dipner-chat-close:hover {
    opacity: 1;
}

/* Messages Area */
#dipner-chat-messages {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    background-color: var(--chat-bg-messages);
    display: flex;
    flex-direction: column;
    gap: 15px;
}

#dipner-chat-messages::-webkit-scrollbar {
    width: 5px;
}

#dipner-chat-messages::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 10px;
}

.message {
    max-width: 85%;
    padding: 12px 16px;
    border-radius: 18px;
    font-size: 0.95rem;
    line-height: 1.5;
    word-wrap: break-word;
    white-space: pre-wrap;
    animation: chat-fadeIn 0.3s ease;
}

@keyframes chat-fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.bot-message {
    align-self: flex-start;
    background: var(--chat-bot-msg-bg);
    color: var(--chat-text-main);
    border-bottom-left-radius: 4px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

.user-message {
    align-self: flex-end;
    background: var(--chat-user-msg-bg);
    color: var(--chat-user-msg-text);
    border-bottom-right-radius: 4px;
}

/* Input Area */
#dipner-chat-input-area {
    padding: 15px;
    border-top: 1px solid #eee;
    display: flex;
    gap: 10px;
    background: white;
}

#dipner-chat-input {
    flex: 1;
    padding: 12px 18px;
    border: 1px solid #ddd;
    border-radius: 25px;
    outline: none;
    font-family: inherit;
    font-size: 0.95rem;
    transition: border-color 0.2s;
}

#dipner-chat-input:focus {
    border-color: var(--chat-primary-color);
}

#dipner-chat-send {
    width: 45px;
    height: 45px;
    background: var(--chat-primary-color);
    color: white;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

#dipner-chat-send:hover {
    background: var(--chat-primary-dark);
}

/* Utils */
.hidden {
    display: none !important;
}

@keyframes chat-pulse {
    0% {
        transform: scale(1);
        opacity: 0.8;
    }

    50% {
        transform: scale(1.2);
        opacity: 1;
    }

    100% {
        transform: scale(1);
        opacity: 0.8;
    }
}

/* Mobile Responsive */
@media (max-width: 480px) {
    #dipner-chat-window {
        bottom: 0;
        right: 0;
        width: 100vw;
        height: 100vh;
        max-height: none;
        border-radius: 0;
    }

    #dipner-chat-container {
        bottom: 20px;
        right: 20px;
    }
}