#chat-widget {
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 9999;
    font-family: 'Inter', sans-serif;
}

#chat-toggle-btn {
    background: #007aff;
    color: white;
    border: none;
    border-radius: 50%;
    width: 60px;
    height: 60px;
    font-size: 28px;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(0, 122, 255, 0.4);
    transition: transform 0.2s, background 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

#chat-toggle-btn:hover {
    transform: scale(1.05);
    background: #0056b3;
}

#chat-window {
    position: absolute;
    bottom: 80px;
    right: 0;
    width: 380px;
    height: 500px;
    background: white;
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transition: opacity 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275), transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    transform-origin: bottom right;
}

#chat-window.hidden {
    opacity: 0;
    transform: scale(0.6);
    pointer-events: none;
}

#chat-header {
    background: #fff;
    color: #1d1d1f;
    padding: 16px 20px;
    font-weight: 600;
    font-size: 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #f0f0f0;
}

#chat-header span {
    display: flex;
    align-items: center;
    gap: 8px;
}

#chat-header span::before {
    content: "●";
    color: #34c759;
    font-size: 18px;
}

#chat-close-btn {
    background: none;
    border: none;
    color: #86868b;
    font-size: 24px;
    cursor: pointer;
    transition: color 0.2s;
}

#chat-close-btn:hover {
    color: #1d1d1f;
}

#chat-body {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    background: #fbfbfd;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.chat-message {
    max-width: 85%;
    padding: 12px 16px;
    border-radius: 18px;
    font-size: 14px;
    line-height: 1.5;
    word-wrap: break-word;
}

.ai-message {
    background: #f0f0f5;
    color: #1d1d1f;
    align-self: flex-start;
    border-bottom-left-radius: 4px;
}

.user-message {
    background: #007aff;
    color: white;
    align-self: flex-end;
    border-bottom-right-radius: 4px;
}

.loading {
    font-style: italic;
    color: #86868b;
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0% {
        opacity: 0.5;
    }

    50% {
        opacity: 1;
    }

    100% {
        opacity: 0.5;
    }
}

#chat-input-container {
    padding: 16px;
    background: white;
    border-top: 1px solid #f0f0f0;
    display: flex;
    gap: 10px;
}

#chat-input {
    flex: 1;
    padding: 12px 16px;
    border: 1px solid #d2d2d7;
    border-radius: 24px;
    outline: none;
    font-size: 14px;
    transition: border-color 0.2s;
}

#chat-input:focus {
    border-color: #007aff;
}

#chat-send-btn {
    background: #007aff;
    color: white;
    border: none;
    border-radius: 50%;
    width: 44px;
    height: 44px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    transition: background 0.2s;
}

#chat-send-btn:hover {
    background: #0056b3;
}

#chat-send-btn:disabled {
    background: #d2d2d7;
    cursor: not-allowed;
}