/* Chat Button - Floating */
.chat-button {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, #8b5cf6 0%, #6d28d9 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 5px 25px rgba(139, 92, 246, 0.5);
    transition: all 0.3s;
    z-index: 999;
    animation: pulse-chat 2s infinite;
}

.chat-button:hover {
    transform: scale(1.1);
    box-shadow: 0 8px 35px rgba(139, 92, 246, 0.7);
}

@keyframes pulse-chat {
    0%, 100% {
        box-shadow: 0 5px 25px rgba(139, 92, 246, 0.5);
    }
    50% {
        box-shadow: 0 5px 35px rgba(139, 92, 246, 0.8);
    }
}

.chat-button-icon {
    font-size: 28px;
    color: white;
    transition: transform 0.3s;
}

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

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

@keyframes bounce-badge {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.2); }
}

/* Chat Window */
.chat-window {
    position: fixed;
    bottom: 100px;
    right: 30px;
    width: 400px;
    height: 600px;
    background: rgba(26, 31, 58, 0.98);
    backdrop-filter: blur(20px);
    border-radius: 20px;
    border: 2px solid #8b5cf6;
    box-shadow: 0 10px 50px rgba(0, 0, 0, 0.5);
    display: none;
    flex-direction: column;
    overflow: hidden;
    z-index: 998;
    animation: slideUp 0.4s ease-out;
}

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

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

/* Chat Header */
.chat-header {
    background: linear-gradient(135deg, #8b5cf6 0%, #6d28d9 100%);
    padding: 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 2px solid rgba(139, 92, 246, 0.5);
}

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

.chat-avatar {
    width: 45px;
    height: 45px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    border: 2px solid rgba(255, 255, 255, 0.3);
}

.chat-header-text h3 {
    color: white;
    font-size: 18px;
    margin: 0;
    font-weight: 600;
}

.chat-status {
    color: rgba(255, 255, 255, 0.8);
    font-size: 12px;
    display: flex;
    align-items: center;
    gap: 5px;
}

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

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

.chat-close {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    color: white;
    font-size: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
}

.chat-close:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: rotate(90deg);
}

/* Chat Messages Area */
.chat-messages {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 15px;
    background: linear-gradient(135deg, rgba(26, 31, 58, 0.5) 0%, rgba(45, 27, 78, 0.5) 100%);
}

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

.chat-messages::-webkit-scrollbar-track {
    background: rgba(139, 92, 246, 0.1);
    border-radius: 10px;
}

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

/* Message Bubbles */
.message {
    display: flex;
    gap: 10px;
    animation: messageSlide 0.3s ease-out;
}

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

.message.bot {
    align-self: flex-start;
}

.message.user {
    align-self: flex-end;
    flex-direction: row-reverse;
}

.message-avatar {
    width: 35px;
    height: 35px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    flex-shrink: 0;
}

.message.bot .message-avatar {
    background: linear-gradient(135deg, #8b5cf6 0%, #6d28d9 100%);
}

.message.user .message-avatar {
    background: linear-gradient(135deg, #a78bfa 0%, #8b5cf6 100%);
}

.message-bubble {
    max-width: 70%;
    padding: 12px 16px;
    border-radius: 15px;
    color: white;
    line-height: 1.5;
    word-wrap: break-word;
}

.message.bot .message-bubble {
    background: rgba(139, 92, 246, 0.3);
    border: 1px solid rgba(139, 92, 246, 0.5);
    border-bottom-left-radius: 5px;
}

.message.user .message-bubble {
    background: linear-gradient(135deg, #8b5cf6 0%, #6d28d9 100%);
    border-bottom-right-radius: 5px;
}

.message-time {
    font-size: 10px;
    color: rgba(255, 255, 255, 0.5);
    margin-top: 5px;
}

/* Typing Indicator */
.typing-indicator {
    display: flex;
    gap: 10px;
    padding: 15px;
    animation: messageSlide 0.3s ease-out;
}

.typing-indicator .message-avatar {
    width: 35px;
    height: 35px;
    border-radius: 50%;
    background: linear-gradient(135deg, #8b5cf6 0%, #6d28d9 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
}

.typing-dots {
    background: rgba(139, 92, 246, 0.3);
    border: 1px solid rgba(139, 92, 246, 0.5);
    padding: 12px 16px;
    border-radius: 15px;
    border-bottom-left-radius: 5px;
    display: flex;
    gap: 5px;
    align-items: center;
}

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

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

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

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

/* Chat Input Area */
.chat-input-area {
    padding: 20px;
    background: rgba(26, 31, 58, 0.8);
    border-top: 1px solid rgba(139, 92, 246, 0.3);
}

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

.chat-input {
    flex: 1;
    padding: 12px 16px;
    background: rgba(139, 92, 246, 0.1);
    border: 2px solid rgba(139, 92, 246, 0.3);
    border-radius: 25px;
    color: white;
    font-size: 14px;
    font-family: inherit;
    outline: none;
    transition: all 0.3s;
}

.chat-input:focus {
    border-color: #8b5cf6;
    background: rgba(139, 92, 246, 0.15);
}

.chat-input::placeholder {
    color: rgba(167, 139, 250, 0.5);
}

.chat-send-btn {
    width: 45px;
    height: 45px;
    background: linear-gradient(135deg, #8b5cf6 0%, #6d28d9 100%);
    border: none;
    border-radius: 50%;
    color: white;
    font-size: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
}

.chat-send-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 5px 20px rgba(139, 92, 246, 0.5);
}

.chat-send-btn:active {
    transform: scale(0.95);
}

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

/* Welcome Message */
.welcome-message {
    text-align: center;
    padding: 40px 20px;
    color: #a78bfa;
}

.welcome-message h4 {
    color: white;
    font-size: 20px;
    margin-bottom: 10px;
}

.welcome-message p {
    font-size: 14px;
    line-height: 1.6;
    margin-bottom: 20px;
}

.quick-questions {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 20px;
}

.quick-question-btn {
    background: rgba(139, 92, 246, 0.2);
    border: 1px solid rgba(139, 92, 246, 0.4);
    color: #a78bfa;
    padding: 10px 15px;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s;
    font-size: 13px;
    text-align: left;
}

.quick-question-btn:hover {
    background: rgba(139, 92, 246, 0.3);
    border-color: #8b5cf6;
    color: white;
    transform: translateX(5px);
}

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