:root {
    --primary-color: #28a745;
    --primary-dark: #1e7e34;
    --bg-light: #ffffff;
    --bg-chat: #f8f9fa;
    --text-main: #333333;
    --text-muted: #666666;
    --header-gradient: linear-gradient(135deg, #28a745 0%, #a5d6a7 100%);
    --bot-msg-bg: #e8f5e9;
    --user-msg-bg: #28a745;
    --user-msg-text: #ffffff;
    --shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Montserrat', sans-serif;
    background-color: #f0f2f5;
}

.demo-bg {
    padding: 50px;
    text-align: center;
    color: #444;
}

/* Chat Container */
#dipner-chat-container {
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 1000;
}

/* Toggle Button */
#dipner-chat-toggle {
    width: 65px;
    height: 65px;
    border-radius: 50%;
    background: var(--header-gradient);
    border: none;
    color: white;
    box-shadow: 0 5px 15px rgba(0, 123, 255, 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: white;
    border-radius: 20px;
    box-shadow: var(--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 */
#dipner-chat-header {
    padding: 20px;
    background: var(--header-gradient);
    color: white;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.online-dot {
    width: 10px;
    height: 10px;
    background: #4ade80;
    border-radius: 50%;
    box-shadow: 0 0 10px rgba(74, 222, 128, 0.5);
    animation: pulse 2s infinite;
}

.header-info strong {
    display: block;
    font-size: 1.1rem;
}

.header-info span {
    font-size: 0.8rem;
    opacity: 0.8;
}

#dipner-chat-close {
    background: none;
    border: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
    opacity: 0.7;
    transition: opacity 0.2s;
}

#dipner-chat-close:hover {
    opacity: 1;
}

/* Messages Area */
#dipner-chat-messages {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    background-color: var(--bg-chat);
    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: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.bot-message {
    align-self: flex-start;
    background: var(--bot-msg-bg);
    color: var(--text-main);
    border-bottom-left-radius: 4px;
}

.user-message {
    align-self: flex-end;
    background: var(--user-msg-bg);
    color: var(--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;
}

#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(--primary-color);
}

#dipner-chat-send {
    width: 45px;
    height: 45px;
    background: var(--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(--primary-dark);
}

/* Utils */
.hidden {
    display: none !important;
}

@keyframes 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;
    }
}