/* Luna Launch Professional Live Chat */
.luna-chat-widget {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 10000;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* Chat Button */
.luna-chat-button {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, #6b5ff6 0%, #8b5cf6 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 8px 32px rgba(107, 95, 246, 0.3);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.luna-chat-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 40px rgba(107, 95, 246, 0.4);
}

.luna-chat-button::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, transparent 30%, rgba(255,255,255,0.1) 50%, transparent 70%);
    transform: translateX(-100%);
    transition: transform 0.6s;
}

.luna-chat-button:hover::before {
    transform: translateX(100%);
}

.luna-chat-icon {
    width: 24px;
    height: 24px;
    fill: white;
    transition: transform 0.3s ease;
}

.luna-chat-button.active .luna-chat-icon {
    transform: rotate(180deg);
}

/* Notification Badge */
.luna-chat-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background: #ff4757;
    color: white;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 600;
    animation: pulse 2s infinite;
}

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

/* Chat Window */
.luna-chat-window {
    position: absolute;
    bottom: 80px;
    right: 0;
    width: 380px;
    height: 500px;
    background: #ffffff;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
    display: none;
    flex-direction: column;
    overflow: hidden;
    transform: translateY(20px) scale(0.95);
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.luna-chat-window.active {
    display: flex;
    transform: translateY(0) scale(1);
    opacity: 1;
}

/* Chat Header */
.luna-chat-header {
    background: linear-gradient(135deg, #6b5ff6 0%, #8b5cf6 100%);
    padding: 20px;
    color: white;
    display: flex;
    align-items: center;
    gap: 12px;
}

.luna-chat-avatar {
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 16px;
}

.luna-chat-info h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
}

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

.luna-status-dot {
    width: 8px;
    height: 8px;
    background: #2ed573;
    border-radius: 50%;
    animation: breathe 2s infinite;
}

@keyframes breathe {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

.luna-chat-close {
    margin-left: auto;
    background: none;
    border: none;
    color: white;
    cursor: pointer;
    padding: 8px;
    border-radius: 8px;
    transition: background 0.3s;
}

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

/* Chat Messages Area */
.luna-chat-messages {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    background: #f8fafc;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

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

.luna-chat-messages::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.luna-chat-messages::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 10px;
}

/* Message Bubbles */
.luna-message {
    display: flex;
    flex-direction: column;
    max-width: 80%;
    animation: messageSlide 0.3s ease-out;
}

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

.luna-message.user {
    align-self: flex-end;
    align-items: flex-end;
}

.luna-message.support {
    align-self: flex-start;
    align-items: flex-start;
}

.luna-message-bubble {
    padding: 12px 16px;
    border-radius: 18px;
    font-size: 14px;
    line-height: 1.4;
    word-wrap: break-word;
}

.luna-message.user .luna-message-bubble {
    background: linear-gradient(135deg, #6b5ff6 0%, #8b5cf6 100%);
    color: white;
}

.luna-message.support .luna-message-bubble {
    background: white;
    color: #333;
    border: 1px solid #e2e8f0;
}

.luna-message-time {
    font-size: 11px;
    color: #94a3b8;
    margin-top: 4px;
}

/* Typing Indicator */
.luna-typing {
    display: none;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
    margin: 8px 16px;
    background: white;
    border-radius: 18px;
    border: 1px solid #e2e8f0;
    max-width: fit-content;
    opacity: 0;
    transform: translateY(10px);
    transition: all 0.3s ease;
}

.luna-typing.active {
    display: flex;
    opacity: 1;
    transform: translateY(0);
}

.luna-typing-dots {
    display: flex;
    gap: 4px;
}

.luna-typing-dot {
    width: 6px;
    height: 6px;
    background: #94a3b8;
    border-radius: 50%;
    animation: typingBounce 1.4s infinite ease-in-out;
}

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

@keyframes typingBounce {
    0%, 80%, 100% {
        transform: scale(0.8);
        opacity: 0.5;
    }
    40% {
        transform: scale(1);
        opacity: 1;
    }
}

/* Quick Actions */
.luna-quick-actions {
    padding: 16px 20px;
    background: white;
    border-top: 1px solid #e2e8f0;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.luna-quick-action {
    padding: 8px 12px;
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    font-size: 12px;
    color: #475569;
    cursor: pointer;
    transition: all 0.3s;
}

.luna-quick-action:hover {
    background: #6b5ff6;
    color: white;
    border-color: #6b5ff6;
}

/* Input Area */
.luna-chat-input-area {
    padding: 20px;
    background: white;
    border-top: 1px solid #e2e8f0;
}

.luna-chat-input-container {
    display: flex;
    align-items: flex-end;
    gap: 12px;
    background: #f8fafc;
    border: 2px solid #e2e8f0;
    border-radius: 16px;
    padding: 8px 16px;
    transition: border-color 0.3s;
}

.luna-chat-input-container:focus-within {
    border-color: #6b5ff6;
}

.luna-chat-input {
    flex: 1;
    border: none;
    outline: none;
    background: none;
    font-size: 14px;
    color: #333;
    resize: none;
    max-height: 80px;
    min-height: 20px;
    line-height: 1.4;
    font-family: inherit;
}

.luna-chat-input::placeholder {
    color: #94a3b8;
}

.luna-chat-send {
    background: #6b5ff6;
    border: none;
    border-radius: 12px;
    padding: 8px;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.luna-chat-send:hover {
    background: #5a4ee6;
    transform: scale(1.05);
}

.luna-chat-send:disabled {
    background: #94a3b8;
    cursor: not-allowed;
    transform: none;
}

.luna-send-icon {
    width: 16px;
    height: 16px;
    fill: white;
}

/* Welcome Message */
.luna-welcome {
    text-align: center;
    padding: 20px;
    color: #64748b;
}

.luna-welcome h4 {
    margin: 0 0 8px;
    color: #1e293b;
    font-size: 16px;
}

.luna-welcome p {
    margin: 0;
    font-size: 14px;
    line-height: 1.5;
}

/* Responsive Design */
@media (max-width: 480px) {
    .luna-chat-window {
        width: calc(100vw - 40px);
        height: calc(100vh - 100px);
        right: 20px;
        bottom: 80px;
    }
    
    .luna-chat-widget {
        right: 15px;
        bottom: 15px;
    }
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    .luna-chat-window {
        background: #1e293b;
    }
    
    .luna-chat-messages {
        background: #0f172a;
    }
    
    .luna-message.support .luna-message-bubble {
        background: #334155;
        color: #e2e8f0;
        border-color: #475569;
    }
    
    .luna-chat-input-area {
        background: #1e293b;
        border-color: #475569;
    }
    
    .luna-chat-input-container {
        background: #334155;
        border-color: #475569;
    }
    
    .luna-chat-input {
        color: #e2e8f0;
    }
    
    .luna-quick-actions {
        background: #1e293b;
        border-color: #475569;
    }
    
    .luna-quick-action {
        background: #334155;
        color: #e2e8f0;
        border-color: #475569;
    }
}