/**
 * XeroStream Animated Chatbot Styles
 * Beautiful speech bubble design with smooth animations
 */

/* Main Chatbot Container */
.xerostream-chatbot {
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 10000;
    font-family: 'Inter', sans-serif;
    transform: translateX(100px);
    opacity: 0;
    transition: all 0.6s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.xerostream-chatbot.chatbot-visible {
    transform: translateX(0);
    opacity: 1;
}

.xerostream-chatbot.chatbot-animated {
    animation: chatbotBounce 0.8s ease-out;
}

@keyframes chatbotBounce {
    0% { transform: translateX(0) scale(1); }
    50% { transform: translateX(-10px) scale(1.05); }
    100% { transform: translateX(0) scale(1); }
}

/* Chatbot Toggle Button */
.chatbot-toggle {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, #0ea5e9, #1e40af);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 6px 20px rgba(14, 165, 233, 0.4);
    transition: all 0.3s ease;
    position: relative;
    border: 2px solid rgba(255, 255, 255, 0.3);
    overflow: visible;
}

.chatbot-toggle::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at 30% 30%, rgba(255, 255, 255, 0.3), transparent 50%);
    pointer-events: none;
}

.chatbot-toggle:hover {
    transform: scale(1.1) translateY(-3px);
    box-shadow: 0 12px 35px rgba(14, 165, 233, 0.6);
    background: linear-gradient(135deg, #1e40af, #1e3a8a);
}

.chatbot-avatar {
    font-size: 24px;
    color: white;
    z-index: 2;
    position: relative;
}

/* Notification Badge */
.chatbot-notification {
    position: absolute;
    top: -8px;
    right: -8px;
    background: linear-gradient(135deg, #ef4444, #dc2626);
    color: white;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: bold;
    border: 2px solid white;
    animation: notificationPulse 2s infinite;
    box-shadow: 0 2px 8px rgba(239, 68, 68, 0.4);
    z-index: 10001;
}

@keyframes notificationPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.2); }
}

/* Chat Window */
.chat-window {
    position: absolute;
    bottom: 85px;
    right: 0;
    width: 380px;
    height: 600px;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(20px);
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
    border: 2px solid rgba(14, 165, 233, 0.2);
    transform: scale(0) translateY(20px);
    opacity: 0;
    transition: all 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.chat-window.chat-open {
    transform: scale(1) translateY(0);
    opacity: 1;
}

/* Speech Bubble Arrow */
.chat-window::after {
    content: '';
    position: absolute;
    bottom: -15px;
    right: 25px;
    width: 0;
    height: 0;
    border-left: 15px solid transparent;
    border-right: 15px solid transparent;
    border-top: 15px solid rgba(255, 255, 255, 0.98);
    filter: drop-shadow(0 3px 6px rgba(0, 0, 0, 0.1));
}

/* Chat Header */
.chat-header {
    background: linear-gradient(135deg, #0ea5e9, #1e40af);
    color: white;
    padding: 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;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at 20% 20%, rgba(255, 255, 255, 0.2), transparent 50%);
    pointer-events: none;
}

.chat-header-info {
    display: flex;
    align-items: center;
    z-index: 2;
    position: relative;
}

.chat-avatar {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 15px;
    border: 2px solid rgba(255, 255, 255, 0.3);
}

.chat-logo {
    width: 30px;
    height: 30px;
    filter: brightness(0) invert(1);
}

.chat-title h4 {
    margin: 0;
    font-size: 16px;
    font-weight: 700;
}

.chat-status {
    font-size: 12px;
    opacity: 0.9;
    display: flex;
    align-items: center;
}

.chat-status::before {
    content: '';
    width: 8px;
    height: 8px;
    background: #10b981;
    border-radius: 50%;
    margin-right: 6px;
    animation: statusBlink 2s infinite;
}

@keyframes statusBlink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.chat-controls {
    display: flex;
    gap: 10px;
    z-index: 2;
    position: relative;
}

.chat-minimize,
.chat-close {
    width: 35px;
    height: 35px;
    border: none;
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.chat-minimize:hover,
.chat-close:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.1);
}

/* Chat Messages */
.chat-messages {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 15px;
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
}

.chat-messages::-webkit-scrollbar {
    width: 6px;
}

.chat-messages::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.05);
    border-radius: 3px;
}

.chat-messages::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, #0ea5e9, #1e40af);
    border-radius: 3px;
}

/* Message Styles */
.message {
    display: flex;
    align-items: flex-end;
    gap: 10px;
    animation: messageSlideIn 0.4s ease-out;
}

@keyframes messageSlideIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.user-message {
    flex-direction: row-reverse;
}

.message-avatar {
    width: 35px;
    height: 35px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.user-message .message-avatar {
    background: linear-gradient(135deg, #6b7280, #4b5563);
    color: white;
    font-size: 14px;
}

.bot-message .message-avatar {
    background: rgba(14, 165, 233, 0.1);
    border: 2px solid rgba(14, 165, 233, 0.2);
}

.bot-avatar {
    width: 20px;
    height: 20px;
    filter: brightness(0) saturate(100%) invert(42%) sepia(93%) saturate(1352%) hue-rotate(187deg) brightness(119%) contrast(119%);
}

.message-content {
    max-width: 250px;
    background: white;
    padding: 12px 16px;
    border-radius: 18px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    position: relative;
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.user-message .message-content {
    background: linear-gradient(135deg, #0ea5e9, #1e40af);
    color: white;
    border-radius: 18px 18px 4px 18px;
}

.bot-message .message-content {
    border-radius: 18px 18px 18px 4px;
}

.message-content p {
    margin: 0;
    font-size: 14px;
    line-height: 1.4;
}

.message-time {
    font-size: 11px;
    opacity: 0.7;
    margin-top: 5px;
    display: block;
}

/* Chat Input */
.chat-input-container {
    padding: 20px;
    background: white;
    border-top: 1px solid rgba(0, 0, 0, 0.1);
}

.chat-input-wrapper {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
}

.chat-input {
    flex: 1;
    padding: 12px 16px;
    border: 2px solid rgba(14, 165, 233, 0.2);
    border-radius: 25px;
    outline: none;
    font-size: 14px;
    transition: all 0.3s ease;
    background: rgba(248, 250, 252, 0.8);
}

.chat-input:focus {
    border-color: #0ea5e9;
    box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.1);
    background: white;
}

.chat-send {
    width: 45px;
    height: 45px;
    background: linear-gradient(135deg, #0ea5e9, #1e40af);
    border: none;
    border-radius: 50%;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(14, 165, 233, 0.3);
}

.chat-send:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(14, 165, 233, 0.4);
}

/* Suggestion Buttons */
.chat-suggestions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.suggestion-btn {
    padding: 8px 12px;
    background: rgba(14, 165, 233, 0.1);
    border: 1px solid rgba(14, 165, 233, 0.2);
    border-radius: 15px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    color: #0ea5e9;
    font-weight: 500;
}

.suggestion-btn:hover {
    background: linear-gradient(135deg, #0ea5e9, #1e40af);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(14, 165, 233, 0.3);
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
    .xerostream-chatbot {
        bottom: 20px;
        right: 20px;
    }
    
    .chatbot-toggle {
        width: 55px;
        height: 55px;
    }
    
    .chatbot-avatar {
        font-size: 22px;
    }
    
    .chat-window {
        width: 320px;
        height: 550px;
        bottom: 75px;
    }
    
    .chat-header {
        padding: 15px;
    }
    
    .chat-messages {
        padding: 15px;
    }
    
    .chat-input-container {
        padding: 15px;
    }
}

@media (max-width: 480px) {
    .chat-window {
        width: 280px;
        height: 500px;
        right: -10px;
        bottom: 75px;
    }
    
    .message-content {
        max-width: 200px;
    }
}

/* Animation for typing indicator */
.typing-indicator {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 12px 16px;
}

.typing-dot {
    width: 8px;
    height: 8px;
    background: #0ea5e9;
    border-radius: 50%;
    animation: typingAnimation 1.4s infinite ease-in-out;
}

.typing-dot:nth-child(2) {
    animation-delay: 0.2s;
}

.typing-dot:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes typingAnimation {
    0%, 60%, 100% {
        transform: translateY(0);
        opacity: 0.5;
    }
    30% {
        transform: translateY(-10px);
        opacity: 1;
    }
} 