:root {
    --nixie-purple: #8a4fff;
    --nixie-light-purple: #a471ff;
    --chat-bg: rgba(30, 31, 36, 0.7);
    --chat-header-bg: rgba(25, 26, 30, 0.8);
    --user-message-bg: #5865F2;
    --bot-message-bg: #40444B;
}

#nixie-chat-widget {
    position: fixed;
    bottom: 25px;
    right: 25px;
    z-index: 9999;
}

.chat-bubble {
    width: 60px;
    height: 60px;
    background: var(--nixie-purple);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.3);
    transition: transform 0.3s ease, background-color 0.3s ease;
}

.chat-bubble:hover {
    transform: scale(1.1);
    background-color: var(--nixie-light-purple);
}

.chat-bubble svg {
    width: 32px;
    height: 32px;
    color: white;
}

.chat-window {
    position: absolute;
    bottom: 80px;
    right: 0;
    width: 350px;
    max-width: 90vw;
    height: 500px;
    background-color: var(--chat-bg);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transform: translateY(10px) scale(0.95);
    opacity: 0;
    visibility: hidden;
    transform-origin: bottom right;
    transition: transform 0.3s cubic-bezier(0.25, 1, 0.5, 1), opacity 0.3s ease, visibility 0.3s;
}

.chat-window.active {
    transform: translateY(0) scale(1);
    opacity: 1;
    visibility: visible;
}

.chat-header {
    padding: 15px 20px;
    background-color: var(--chat-header-bg);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
}

.chat-header-title {
    font-family: 'Poppins', sans-serif;
    font-weight: 600;
    font-size: 1.1rem;
}

.chat-close-btn {
    background: none;
    border: none;
    color: #fff;
    opacity: 0.7;
    font-size: 1.5rem;
    cursor: pointer;
    transition: transform 0.2s ease, opacity 0.2s ease;
}
.chat-close-btn:hover {
    transform: scale(1.2) rotate(90deg);
    opacity: 1;
}

.chat-messages {
    flex-grow: 1;
    padding: 20px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.message {
    max-width: 80%;
    padding: 10px 15px;
    border-radius: 18px;
    line-height: 1.5;
    opacity: 0;
    transform: translateY(10px);
    animation: message-in 0.4s ease forwards;
}

@keyframes message-in {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.user-message {
    background-color: var(--user-message-bg);
    color: white;
    align-self: flex-end;
    border-bottom-right-radius: 4px;
}

.bot-message {
    background-color: var(--bot-message-bg);
    color: #dcddde;
    align-self: flex-start;
    border-bottom-left-radius: 4px;
}

.typing-indicator {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 10px 15px;
}

.typing-indicator span {
    width: 8px;
    height: 8px;
    background-color: #8e9297;
    border-radius: 50%;
    animation: typing 1.2s infinite ease-in-out;
}
.typing-indicator span:nth-child(2) { animation-delay: 0.2s; }
.typing-indicator span:nth-child(3) { animation-delay: 0.4s; }

@keyframes typing {
    0%, 80%, 100% { transform: scale(0); }
    40% { transform: scale(1.0); }
}

.chat-input-form {
    display: flex;
    padding: 15px;
    background-color: var(--chat-header-bg);
    flex-shrink: 0;
}

#chat-input {
    flex-grow: 1;
    padding: 10px 15px;
    border: none;
    background-color: var(--bot-message-bg);
    border-radius: 20px;
    color: #dcddde;
    font-family: 'Montserrat', sans-serif;
    margin-right: 10px;
}
#chat-input:focus {
    outline: none;
}
#chat-input:disabled {
    cursor: not-allowed;
}

#chat-send-btn {
    width: 40px;
    height: 40px;
    border: none;
    background-color: var(--nixie-purple);
    border-radius: 50%;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s ease, transform 0.2s ease;
}
#chat-send-btn:hover:not(:disabled) {
    background-color: var(--nixie-light-purple);
    transform: scale(1.1);
}
#chat-send-btn:disabled {
    background-color: #5c5c5c;
    cursor: not-allowed;
}
#chat-send-btn svg {
    width: 20px;
    height: 20px;
}
