/* Enhanced Floating AI Assistant Styles */
.ai-chat-widget {
    position: fixed;
    bottom: 80px;
    left: 20px;
    z-index: 1000;
    font-family: 'Inter', 'Open Sans', sans-serif;
}

.chat-toggle {
    width: 65px;
    height: 65px;
    background: linear-gradient(135deg, #355EFC 0%, #667eea 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 6px 20px rgba(53, 94, 252, 0.4);
    transition: all 0.3s ease;
    position: relative;
    border: 3px solid rgba(255, 255, 255, 0.2);
}

.pulse-effect {
    animation: pulse-ai 2s infinite;
}

@keyframes pulse-ai {
    0% {
        box-shadow: 0 6px 20px rgba(53, 94, 252, 0.4), 0 0 0 0 rgba(53, 94, 252, 0.7);
    }
    70% {
        box-shadow: 0 6px 20px rgba(53, 94, 252, 0.4), 0 0 0 10px rgba(53, 94, 252, 0);
    }
    100% {
        box-shadow: 0 6px 20px rgba(53, 94, 252, 0.4), 0 0 0 0 rgba(53, 94, 252, 0);
    }
}

.chat-notification {
    position: absolute;
    top: -5px;
    right: -5px;
    background: #ffc107;
    border-radius: 50%;
    width: 25px;
    height: 25px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    animation: bounce 1s infinite;
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateY(0);
    }
    40% {
        transform: translateY(-5px);
    }
    60% {
        transform: translateY(-3px);
    }
}

.chat-toggle i {
    font-size: 28px;
    animation: ai-float 2s ease-in-out infinite;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.3));
}

.chat-toggle::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: linear-gradient(135deg, #FF4757 0%, #3742FA 50%, #2ED573 100%);
    border-radius: 50%;
    z-index: -1;
    opacity: 0.3;
    animation: enhanced-pulse 2.5s infinite;
}

.chat-badge {
    position: absolute;
    top: -8px;
    right: -8px;
    background: #28a745;
    color: white;
    border-radius: 10px;
    padding: 2px 6px;
    font-size: 10px;
    font-weight: bold;
}

@keyframes enhanced-pulse {
    0% { 
        box-shadow: 0 0 0 0 rgba(55, 66, 250, 0.8), 0 8px 25px rgba(55, 66, 250, 0.4); 
        transform: scale(1);
    }
    50% { 
        box-shadow: 0 0 0 15px rgba(55, 66, 250, 0.1), 0 12px 30px rgba(55, 66, 250, 0.6); 
        transform: scale(1.05);
    }
    100% { 
        box-shadow: 0 0 0 0 rgba(55, 66, 250, 0), 0 8px 25px rgba(55, 66, 250, 0.4); 
        transform: scale(1);
    }
}

@keyframes ai-float {
    0%, 100% { transform: translateY(0px) rotate(0deg); }
    25% { transform: translateY(-3px) rotate(-1deg); }
    50% { transform: translateY(-6px) rotate(0deg); }
    75% { transform: translateY(-3px) rotate(1deg); }
}

.chat-container {
    display: none;
    flex-direction: column;
    width: 380px;
    height: 550px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border-radius: 20px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.3);
    position: absolute;
    left: 80px;
    bottom: 150px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.2);
    animation: slideInUp 0.4s ease-out;
}

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

.chat-header {
    background: linear-gradient(135deg, #FF4757 0%, #3742FA 50%, #2ED573 100%);
    color: white;
    padding: 18px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-radius: 20px 20px 0 0;
    position: relative;
    overflow: hidden;
}

.chat-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 20" fill="rgba(255,255,255,0.05)"><polygon points="0,20 100,0 100,20"/></svg>');
    pointer-events: none;
}

.chat-header h5 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
}

.chat-close {
    background: none;
    border: none;
    color: white;
    font-size: 20px;
    cursor: pointer;
    padding: 0;
    width: 25px;
    height: 25px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background-color 0.2s;
}

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

.chat-messages {
    flex: 1;
    padding: 15px;
    overflow-y: auto;
    background: #f8f9fa;
}

.chat-message {
    display: flex;
    margin-bottom: 15px;
    align-items: flex-start;
}

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

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

.chat-message.bot .message-avatar {
    background: linear-gradient(135deg, #007bff, #0056b3);
    color: white;
}

.chat-message.user .message-avatar {
    background: #28a745;
    color: white;
}

.message-content {
    max-width: 70%;
    padding: 12px 15px;
    border-radius: 15px;
    font-size: 14px;
    line-height: 1.4;
}

.chat-message.bot .message-content {
    background: white;
    border: 1px solid #e9ecef;
    border-top-left-radius: 5px;
}

.chat-message.user .message-content {
    background: #007bff;
    color: white;
    border-top-right-radius: 5px;
}

.chat-input-container {
    display: flex;
    padding: 15px;
    background: white;
    border-top: 1px solid #e9ecef;
}

#chat-input {
    flex: 1;
    border: 1px solid #e9ecef;
    border-radius: 25px;
    padding: 12px 15px;
    outline: none;
    font-size: 14px;
    margin-right: 10px;
}

#chat-input:focus {
    border-color: #007bff;
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.1);
}

#chat-send {
    width: 45px;
    height: 45px;
    background: #007bff;
    border: none;
    border-radius: 50%;
    color: white;
    cursor: pointer;
    transition: background-color 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

#chat-send:hover {
    background: #0056b3;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .ai-chat-widget {
        bottom: 70px;
        left: 20px;
        right: auto;
    }

    .chat-container {
        width: calc(100vw - 30px);
        max-width: 350px;
        height: 70vh;
        max-height: 500px;
        bottom: 140px;
        right: 0;
        left: 15px;
        transform: none;
    }

    .chat-toggle {
        width: 55px;
        height: 55px;
        box-shadow: 0 6px 20px rgba(0, 123, 255, 0.4);
    }

    .chat-toggle i {
        font-size: 22px;
    }

    .chat-messages {
        padding: 10px;
    }

    .chat-input-container {
        padding: 10px;
    }

    #chat-input {
        font-size: 16px;
        padding: 10px 12px;
    }

    .message-content {
        font-size: 13px;
        max-width: 80%;
    }
}

@media (max-width: 480px) {
    .chat-container {
        width: calc(100vw - 20px);
        height: 75vh;
        bottom: 65px;
    }

    .chat-toggle {
        width: 50px;
        height: 50px;
    }

    .chat-toggle i {
        font-size: 18px;
    }

    .chat-header h5 {
        font-size: 14px;
    }

    .message-content {
        font-size: 12px;
        padding: 8px 12px;
    }

    .message-avatar {
        width: 30px;
        height: 30px;
        font-size: 12px;
    }
}

/* Scrollbar styling */
.chat-messages::-webkit-scrollbar {
    width: 6px;
}

.chat-messages::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

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

.chat-messages::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}
