/* ============================================
   AI CHAT WIDGET - FIXED POSITION
   ============================================ */

.ai-chat-widget {
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 9999;
    font-family: 'Poppins', sans-serif;
}

/* Chat Toggle Button */
.chat-toggle {
    width: 65px;
    height: 65px;
    border-radius: 50%;
    background: linear-gradient(135deg, #00f5ff 0%, #ff00ff 100%);
    border: none;
    font-size: 32px;
    cursor: pointer;
    box-shadow: 0 10px 40px rgba(0, 245, 255, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    animation: pulse 2s infinite;
}

.chat-toggle:hover {
    transform: scale(1.1);
    box-shadow: 0 15px 50px rgba(0, 245, 255, 0.6);
}

@keyframes pulse {
    0%, 100% {
        box-shadow: 0 10px 40px rgba(0, 245, 255, 0.4);
    }
    50% {
        box-shadow: 0 10px 40px rgba(0, 245, 255, 0.8), 0 0 0 10px rgba(0, 245, 255, 0.1);
    }
}

/* Chat Window */
.chat-window {
    position: absolute;
    bottom: 80px;
    right: 0;
    width: 380px;
    height: 550px;
    background: rgba(10, 14, 39, 0.98);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(0, 245, 255, 0.2);
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    display: none;
    flex-direction: column;
    overflow: hidden;
    animation: slideUp 0.3s ease;
}

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

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

/* Chat Header */
.chat-header {
    background: linear-gradient(135deg, rgba(0, 245, 255, 0.1) 0%, rgba(255, 0, 255, 0.1) 100%);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 15px;
}

.chat-avatar {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    background: linear-gradient(135deg, #00f5ff 0%, #ff00ff 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    flex-shrink: 0;
}

.chat-info {
    flex: 1;
}

.chat-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 3px;
}

.chat-status {
    font-size: 13px;
    color: var(--text-muted);
}

.chat-close {
    width: 35px;
    height: 35px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
    font-size: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.chat-close:hover {
    background: rgba(255, 0, 0, 0.1);
    border-color: rgba(255, 0, 0, 0.3);
    color: #ff0000;
}

/* Chat Messages */
.chat-messages {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

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

.chat-messages::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
}

.chat-messages::-webkit-scrollbar-thumb {
    background: rgba(0, 245, 255, 0.3);
    border-radius: 10px;
}

.chat-messages::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 245, 255, 0.5);
}

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

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

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

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

.message-avatar {
    width: 35px;
    height: 35px;
    border-radius: 50%;
    background: linear-gradient(135deg, #00f5ff 0%, #ff00ff 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    flex-shrink: 0;
}

.chat-message.user .message-avatar {
    background: rgba(255, 255, 255, 0.1);
}

.message-content {
    max-width: 70%;
    padding: 12px 16px;
    border-radius: 15px;
    font-size: 14px;
    line-height: 1.6;
    color: var(--text-primary);
}

.chat-message.bot .message-content {
    background: rgba(0, 245, 255, 0.1);
    border: 1px solid rgba(0, 245, 255, 0.2);
    border-bottom-left-radius: 5px;
}

.chat-message.user .message-content {
    background: rgba(255, 0, 255, 0.1);
    border: 1px solid rgba(255, 0, 255, 0.2);
    border-bottom-right-radius: 5px;
}

/* Chat Input */
.chat-input {
    padding: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    gap: 10px;
}

.chat-input input {
    flex: 1;
    padding: 12px 16px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 25px;
    color: var(--text-primary);
    font-size: 14px;
    transition: all 0.3s ease;
}

.chat-input input:focus {
    outline: none;
    border-color: var(--accent-cyan);
    background: rgba(255, 255, 255, 0.08);
}

.chat-input input::placeholder {
    color: var(--text-muted);
}

.chat-input button {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    background: linear-gradient(135deg, #00f5ff 0%, #ff00ff 100%);
    border: none;
    color: #fff;
    font-size: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.chat-input button:hover {
    transform: scale(1.1);
    box-shadow: 0 5px 20px rgba(0, 245, 255, 0.4);
}

/* Welcome Message */
.welcome-message {
    text-align: center;
    padding: 30px 20px;
    color: var(--text-muted);
}

.welcome-message .icon {
    font-size: 48px;
    margin-bottom: 15px;
}

.welcome-message h4 {
    font-size: 18px;
    color: var(--text-primary);
    margin-bottom: 10px;
}

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

/* Responsive */
@media (max-width: 768px) {
    .ai-chat-widget {
        bottom: 20px;
        right: 20px;
    }
    
    .chat-toggle {
        width: 55px;
        height: 55px;
        font-size: 28px;
    }
    
    .chat-window {
        width: calc(100vw - 40px);
        height: calc(100vh - 120px);
        bottom: 75px;
        right: -10px;
    }
    
    .message-content {
        max-width: 80%;
    }
}

@media (max-width: 480px) {
    .chat-window {
        width: calc(100vw - 20px);
        height: calc(100vh - 100px);
        bottom: 70px;
        right: -5px;
    }
}
