/* Home Chatbot Widget Styles */

.chatbot-widget {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 9999;
    font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

/* Floating Toggle Button */
.chatbot-toggle {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, #1E3A8A 0%, #F43F5E 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(244, 63, 94, 0.4);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    color: white;
    font-size: 24px;
}

.chatbot-toggle:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(244, 63, 94, 0.6);
}

.chatbot-toggle.active {
    background: linear-gradient(135deg, #F43F5E 0%, #E11D48 100%);
}

.chatbot-notification {
    position: absolute;
    top: -5px;
    right: -5px;
    background: #F43F5E;
    color: white;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    font-size: 12px;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: pulse 2s infinite;
}

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

/* Chat Window */
.chatbot-window {
    position: absolute;
    bottom: 80px;
    right: 0;
    width: 380px;
    height: 500px;
    background: white;
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

@media (max-width: 480px) {
    .chatbot-window {
        width: calc(100vw - 40px);
        right: -10px;
    }
}

/* Header */
.chatbot-header {
    background: linear-gradient(135deg, #1E3A8A 0%, #F43F5E 100%);
    color: white;
    padding: 16px;
    border-radius: 16px 16px 0 0;
}

.chatbot-avatar {
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 12px;
    font-size: 18px;
}

.online-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    background-color: #10b981;
    border-radius: 50%;
    margin-right: 6px;
    animation: pulse-green 2s infinite;
}

@keyframes pulse-green {
    0% {
        box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
    }
    70% {
        box-shadow: 0 0 0 6px rgba(16, 185, 129, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(16, 185, 129, 0);
    }
}

.chatbot-controls button {
    background: none;
    border: none;
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    margin-left: 4px;
    transition: background-color 0.2s;
}

.chatbot-controls button:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* Messages Area */
.chatbot-messages {
    flex: 1;
    padding: 16px;
    overflow-y: auto;
    background: #f8f9fa;
}

.chatbot-message {
    display: flex;
    margin-bottom: 16px;
    animation: slideIn 0.3s ease-out;
}

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

.chatbot-message.user-message {
    justify-content: flex-end;
}

.message-avatar {
    width: 32px;
    height: 32px;
    background: linear-gradient(135deg, #1E3A8A 0%, #F43F5E 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 14px;
    margin-right: 8px;
    flex-shrink: 0;
}

.message-content {
    max-width: 80%;
}

.user-message .message-content {
    text-align: right;
}

.message-bubble {
    background: white;
    padding: 12px 16px;
    border-radius: 18px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    font-size: 14px;
    line-height: 1.4;
    word-wrap: break-word;
}

.user-message .message-bubble {
    background: linear-gradient(135deg, #F43F5E 0%, #E11D48 100%);
    color: white;
    border-bottom-right-radius: 6px;
}

.bot-message .message-bubble {
    border-bottom-left-radius: 6px;
}

.message-time {
    font-size: 11px;
    color: #6c757d;
    margin-top: 4px;
}

.user-message .message-time {
    color: rgba(255, 255, 255, 0.8);
}

/* Typing Indicator */
.typing-indicator .message-bubble {
    padding: 16px;
}

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

.typing-dots span {
    width: 8px;
    height: 8px;
    background: #6c757d;
    border-radius: 50%;
    animation: typing 1.4s infinite ease-in-out;
}

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

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

/* Input Area */
.chatbot-input {
    padding: 16px;
    background: white;
    border-top: 1px solid #e9ecef;
}

.chatbot-input .form-control {
    border: 1px solid #e9ecef;
    border-radius: 20px;
    padding: 10px 16px;
    font-size: 14px;
}

.chatbot-input .form-control:focus {
    border-color: #F43F5E;
    box-shadow: 0 0 0 0.2rem rgba(244, 63, 94, 0.25);
}

.chatbot-input .btn {
    border-radius: 20px;
    padding: 10px 16px;
    background: linear-gradient(135deg, #F43F5E 0%, #E11D48 100%);
    border: none;
}

.chatbot-input .btn:hover {
    background: linear-gradient(135deg, #E11D48 0%, #DC2626 100%);
    transform: translateY(-1px);
}

/* Suggestions */
.chatbot-suggestions {
    margin-top: 12px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.suggestion-btn {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 16px;
    padding: 6px 12px;
    font-size: 12px;
    color: #495057;
    cursor: pointer;
    transition: all 0.2s;
}

.suggestion-btn:hover {
    background: linear-gradient(135deg, #F43F5E 0%, #E11D48 100%);
    color: white;
    border-color: transparent;
    transform: translateY(-1px);
}

/* Scrollbar Styling */
.chatbot-messages::-webkit-scrollbar {
    width: 4px;
}

.chatbot-messages::-webkit-scrollbar-track {
    background: transparent;
}

.chatbot-messages::-webkit-scrollbar-thumb {
    background: #dee2e6;
    border-radius: 2px;
}

.chatbot-messages::-webkit-scrollbar-thumb:hover {
    background: #adb5bd;
}

/* Animation for window opening */
.chatbot-window {
    transform-origin: bottom right;
    animation: chatWindowOpen 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

/* Responsive adjustments */
@media (max-width: 768px) {
    .chatbot-widget {
        bottom: 10px;
        right: 10px;
    }
    
    .chatbot-toggle {
        width: 50px;
        height: 50px;
        font-size: 20px;
    }
    
    .chatbot-window {
        width: calc(100vw - 20px);
        height: 400px;
        right: -5px;
        bottom: 70px;
    }
}
