/* Chat Widget Styles */

.ccw-chat-button {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 50%;
    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: 9999;
    border: none;
}

.ccw-chat-button:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
}

.ccw-chat-button svg {
    width: 28px;
    height: 28px;
    fill: white;
}

.ccw-chat-button.active {
    background: #dc3545;
}

/* Notification Badge */
.ccw-notification-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background: #ff4444;
    color: white;
    border-radius: 50%;
    width: 22px;
    height: 22px;
    display: none;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: bold;
    animation: ccw-pulse 2s infinite;
}

@keyframes ccw-pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

/* Chat Window */
.ccw-chat-window {
    position: fixed;
    bottom: 90px;
    right: 20px;
    width: 380px;
    height: 550px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 5px 40px rgba(0, 0, 0, 0.16);
    display: none;
    flex-direction: column;
    z-index: 9998;
    animation: ccw-slideUp 0.3s ease;
}

@keyframes ccw-slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.ccw-chat-window.active {
    display: flex;
}

/* Chat Header */
.ccw-chat-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 20px;
    border-radius: 12px 12px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.ccw-chat-header-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.ccw-chat-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    color: #667eea;
    font-size: 14px;
}

.ccw-chat-header-text h3 {
    font-size: 16px;
    margin: 0 0 4px 0;
}

.ccw-chat-status {
    font-size: 12px;
    opacity: 0.9;
    display: flex;
    align-items: center;
    gap: 5px;
}

.ccw-status-dot {
    width: 8px;
    height: 8px;
    background: #4ade80;
    border-radius: 50%;
    animation: ccw-blink 2s infinite;
}

@keyframes ccw-blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

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

.ccw-chat-close:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* Chat Messages */
.ccw-chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    background: #f8f9fa;
}

.ccw-chat-messages::-webkit-scrollbar {
    width: 6px;
}

.ccw-chat-messages::-webkit-scrollbar-thumb {
    background: #cbd5e0;
    border-radius: 3px;
}

.ccw-message {
    margin-bottom: 16px;
    display: flex;
    gap: 10px;
    animation: ccw-fadeIn 0.3s ease;
}

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

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

.ccw-message-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #667eea;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: bold;
    flex-shrink: 0;
}

.ccw-message.user .ccw-message-avatar {
    background: #48bb78;
}

.ccw-message-content {
    max-width: 70%;
}

.ccw-message-bubble {
    background: white;
    padding: 12px 16px;
    border-radius: 18px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
    word-wrap: break-word;
}

.ccw-message.user .ccw-message-bubble {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.ccw-message-time {
    font-size: 11px;
    color: #a0aec0;
    margin-top: 4px;
    padding: 0 8px;
}

/* Typing Indicator */
.ccw-typing-indicator {
    display: none;
    gap: 10px;
    padding: 10px 20px;
}

.ccw-typing-indicator.active {
    display: flex;
}

.ccw-typing-dots {
    background: white;
    padding: 12px 16px;
    border-radius: 18px;
    display: flex;
    gap: 4px;
}

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

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

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

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

/* Chat Input */
.ccw-chat-input-container {
    padding: 20px;
    background: white;
    border-top: 1px solid #e2e8f0;
    border-radius: 0 0 12px 12px;
}

.ccw-chat-input-wrapper {
    display: flex;
    gap: 10px;
    align-items: center;
}

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

.ccw-chat-input:focus {
    border-color: #667eea;
}

.ccw-chat-send {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    border-radius: 50%;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s;
}

.ccw-chat-send:hover {
    transform: scale(1.1);
}

.ccw-chat-send:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.ccw-chat-send svg {
    width: 18px;
    height: 18px;
    fill: white;
}

/* Quick Replies */
.ccw-quick-replies {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 12px;
}

.ccw-quick-reply-btn {
    padding: 8px 16px;
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s;
}

.ccw-quick-reply-btn:hover {
    background: #667eea;
    color: white;
    border-color: #667eea;
}

/* Mobile Responsive */
@media (max-width: 480px) {
    .ccw-chat-window {
        width: calc(100vw - 40px);
        height: calc(100vh - 120px);
        bottom: 90px;
        right: 20px;
    }
}
