.chat-widget-container {
    --primary-color: #4f46e5;
    --primary-hover: #4338ca;
    --bg-color: #ffffff;
    --text-color: #1f2937;
    --border-color: #e5e7eb;
    --user-msg-bg: #4f46e5;
    --bot-msg-bg: #f3f4f6;
}

.chat-widget-container * {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

.chat-widget-button {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: var(--primary-color);
    color: white;
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    z-index: 9998;
}

.chat-widget-button svg {
    width: 28px;
    height: 28px;
}

.chat-widget-button:hover {
    background: var(--primary-hover);
    transform: scale(1.05);
}

.chat-widget-window {
    position: fixed;
    bottom: 90px;
    right: 20px;
    width: 380px;
    height: 550px;
    background: var(--bg-color);
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
    display: none;
    flex-direction: column;
    z-index: 9999;
    overflow: hidden;
    transition: all 0.3s ease;
}

.chat-widget-window.open {
    display: flex;
}

.chat-widget-header {
    background: var(--primary-color);
    color: white;
    padding: 16px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.chat-widget-header h3 {
    font-size: 18px;
    font-weight: 600;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.chat-widget-close {
    background: none;
    border: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: background 0.2s;
}

.chat-widget-close:hover {
    background: rgba(255, 255, 255, 0.1);
}

.chat-widget-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.chat-message {
    display: flex;
    gap: 8px;
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.chat-message.user {
    flex-direction: row-reverse;
}

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

.chat-message.user .chat-message-content {
    background: var(--user-msg-bg);
    color: white;
    border-bottom-right-radius: 4px;
}

.chat-message.bot .chat-message-content {
    background: var(--bot-msg-bg);
    color: var(--text-color);
    border-bottom-left-radius: 4px;
}

.chat-widget-input-area {
    padding: 16px 20px;
    border-top: 1px solid var(--border-color);
    display: flex;
    gap: 8px;
}

.chat-widget-input {
    flex: 1;
    padding: 10px 14px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 14px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    outline: none;
    transition: border-color 0.2s;
}

.chat-widget-input:focus {
    border-color: var(--primary-color);
}

.chat-widget-send {
    padding: 10px 20px;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: background 0.2s;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.chat-widget-send:hover:not(:disabled) {
    background: var(--primary-hover);
}

.chat-widget-send:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.typing-indicator {
    display: flex;
    gap: 4px;
    padding: 10px 14px;
}

.typing-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #9ca3af;
    animation: bounce 1.4s infinite;
}

.typing-dot:nth-child(2) {
    animation-delay: 0.2s;
}

.typing-dot:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes bounce {
    0%, 60%, 100% {
        transform: translateY(0);
    }
    30% {
        transform: translateY(-10px);
    }
}

/* Mobile Responsive */
@media (max-width: 480px) {
    .chat-widget-window {
        bottom: 0;
        right: 0;
        left: 0;
        width: 100%;
        height: 100vh;
        border-radius: 0;
    }

    .chat-widget-button {
        bottom: 16px;
        right: 16px;
        width: 56px;
        height: 56px;
    }

    .chat-message-content {
        max-width: 85%;
    }
}

@media (max-width: 420px) and (min-width: 481px) {
    .chat-widget-window {
        width: calc(100vw - 40px);
        right: 20px;
    }
}
