.chat-widget-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 9999;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

.chat-widget-button {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background-color: var(--primary-deep, #064e3b);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    cursor: pointer;
    transition: transform 0.2s, background-color 0.2s;
}

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

.chat-widget-window {
    position: absolute;
    bottom: 76px;
    right: 0;
    width: 350px;
    height: 500px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
    display: none;
    flex-direction: column;
    overflow: hidden;
    transform-origin: bottom right;
    animation: chat-fade-in 0.3s ease-out forwards;
}

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

@keyframes chat-fade-in {
    from { opacity: 0; transform: scale(0.9); }
    to { opacity: 1; transform: scale(1); }
}

.chat-widget-header {
    background: var(--primary-deep, #064e3b);
    color: white;
    padding: 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 600;
}

.chat-widget-close {
    cursor: pointer;
    background: none;
    border: none;
    color: white;
    opacity: 0.8;
}

.chat-widget-close:hover {
    opacity: 1;
}

.chat-widget-messages {
    flex: 1;
    padding: 16px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 12px;
    background: #f9fafb;
}

.chat-widget-bubble {
    max-width: 85%;
    padding: 10px 14px;
    border-radius: 12px;
    font-size: 14px;
    line-height: 1.4;
    white-space: pre-wrap;
}

.chat-widget-bubble.user {
    align-self: flex-end;
    background: #e5e7eb;
    color: #1f2937;
    border-bottom-right-radius: 4px;
}

.chat-widget-bubble.ai {
    align-self: flex-start;
    background: white;
    color: #374151;
    border: 1px solid #e5e7eb;
    border-bottom-left-radius: 4px;
}

.chat-widget-input-area {
    padding: 12px;
    background: white;
    border-top: 1px solid #e5e7eb;
    display: flex;
    gap: 8px;
}

.chat-widget-input {
    flex: 1;
    border: 1px solid #d1d5db;
    border-radius: 20px;
    padding: 8px 12px;
    font-size: 14px;
    font-family: inherit;
    outline: none;
}

.chat-widget-input:focus {
    border-color: var(--primary-deep, #064e3b);
}

.chat-widget-send {
    background: var(--primary-deep, #064e3b);
    color: white;
    border: none;
    border-radius: 50%;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.chat-widget-send:disabled {
    background: #9ca3af;
    cursor: not-allowed;
}

.chat-widget-typing {
    display: flex;
    gap: 4px;
    padding: 8px;
}

.chat-widget-dot {
    width: 6px;
    height: 6px;
    background: #9ca3af;
    border-radius: 50%;
    animation: chat-typing 1.4s infinite ease-in-out both;
}

.chat-widget-dot:nth-child(1) { animation-delay: -0.32s; }
.chat-widget-dot:nth-child(2) { animation-delay: -0.16s; }

@keyframes chat-typing {
    0%, 80%, 100% { transform: scale(0); }
    40% { transform: scale(1); }
}

@media (max-width: 480px) {
    .chat-widget-window {
        width: calc(100vw - 32px);
        height: calc(100vh - 120px);
        right: -8px;
    }
}
