/* AI Customer Service Widget Styles */
.cs-widget {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 9999;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

.cs-toggle-btn {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.cs-toggle-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.6);
}

.cs-toggle-btn svg {
    width: 30px;
    height: 30px;
    fill: white;
}

.cs-toggle-btn .cs-close-icon {
    display: none;
}

.cs-widget.open .cs-toggle-btn .cs-close-icon {
    display: block;
}

.cs-widget.open .cs-toggle-btn .cs-chat-icon {
    display: none;
}

.cs-chat-box {
    position: absolute;
    bottom: 75px;
    right: 0;
    width: 350px;
    height: 500px;
    max-height: calc(100vh - 100px);
    background: white;
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    display: none;
    flex-direction: column;
    overflow: hidden;
    animation: csSlideIn 0.3s ease;
}

.cs-widget.open .cs-chat-box {
    display: flex;
}

@keyframes csSlideIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.cs-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 16px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
}

.cs-header-title {
    display: flex;
    align-items: center;
    gap: 10px;
}

.cs-header-title h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
}

.cs-header-title span {
    font-size: 12px;
    opacity: 0.9;
}

.cs-close-btn {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.2s;
}

.cs-close-btn:hover {
    background: rgba(255, 255, 255, 0.3);
}

.cs-close-btn svg {
    width: 14px;
    height: 14px;
    fill: white;
}

.cs-messages {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    background: #f8f9fa;
}

.cs-message {
    margin-bottom: 12px;
    display: flex;
    flex-direction: column;
}

.cs-message.cs-user {
    align-items: flex-end;
}

.cs-message.cs-bot {
    align-items: flex-start;
}

.cs-message-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    flex-shrink: 0;
    margin-bottom: 4px;
}

.cs-message.cs-bot .cs-message-avatar {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.cs-message.cs-user .cs-message-avatar {
    background: #e0e0e0;
    color: #666;
}

.cs-message-bubble {
    max-width: 80%;
    padding: 10px 14px;
    border-radius: 12px;
    font-size: 14px;
    line-height: 1.5;
    word-wrap: break-word;
}

.cs-message.cs-bot .cs-message-bubble {
    background: white;
    color: #333;
    border-bottom-left-radius: 4px;
}

.cs-message.cs-user .cs-message-bubble {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-bottom-right-radius: 4px;
}

.cs-message-time {
    font-size: 11px;
    color: #999;
    margin-top: 4px;
    padding: 0 4px;
}

.cs-typing {
    display: none;
    align-items: center;
    gap: 4px;
    padding: 10px 14px;
    background: white;
    border-radius: 12px;
    border-bottom-left-radius: 4px;
    width: fit-content;
    margin-bottom: 12px;
}

.cs-typing.cs-typing-active {
    display: flex;
}

.cs-typing-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #ccc;
    animation: csTyping 1.4s infinite;
}

.cs-typing-dot:nth-child(2) {
    animation-delay: 0.2s;
}

.cs-typing-dot:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes csTyping {
    0%, 60%, 100% {
        transform: translateY(0);
    }
    30% {
        transform: translateY(-10px);
    }
}

.cs-input-area {
    border-top: 1px solid #e0e0e0;
    padding: 12px 16px;
    background: white;
    display: flex;
    gap: 8px;
    align-items: flex-end;
    flex-shrink: 0;
}

.cs-input {
    flex: 1;
    border: 1px solid #e0e0e0;
    border-radius: 20px;
    padding: 10px 16px;
    font-size: 14px;
    outline: none;
    resize: none;
    max-height: 100px;
    min-height: 40px;
    line-height: 1.4;
    font-family: inherit;
}

.cs-input:focus {
    border-color: #667eea;
}

.cs-send-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: opacity 0.2s;
}

.cs-send-btn:hover {
    opacity: 0.9;
}

.cs-send-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.cs-send-btn svg {
    width: 18px;
    height: 18px;
    fill: white;
    transform: rotate(-45deg);
}

.cs-welcome {
    padding: 16px;
    background: #f8f9fa;
    text-align: center;
}

.cs-welcome h4 {
    margin: 0 0 8px 0;
    color: #333;
    font-size: 15px;
}

.cs-welcome p {
    margin: 0;
    color: #666;
    font-size: 13px;
}

.cs-quick-questions {
    padding: 8px 16px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.cs-quick-question {
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 16px;
    padding: 6px 12px;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s;
}

.cs-quick-question:hover {
    background: #667eea;
    color: white;
    border-color: #667eea;
}

/* Mobile responsive */
@media (max-width: 480px) {
    .cs-chat-box {
        width: calc(100vw - 40px);
        height: calc(100vh - 120px);
        bottom: 70px;
        right: -10px;
    }

    .cs-widget {
        right: 15px;
        bottom: 15px;
    }

    .cs-message-bubble {
        max-width: 85%;
    }
}
