/* Spinnie Chat Button - Compact Floating Button */

/* Chat Button Container */
.chat-button-container {
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 1000;
    font-family: 'Futura', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

/* Floating Chat Button */
.chat-button {
    width: 60px;
    height: 60px;
    background: #3b82f6;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.4);
    transition: all 0.3s ease;
    border: none;
    outline: none;
    position: relative;
    overflow: hidden;
}

.chat-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(59, 130, 246, 0.5);
    background: #2563eb;
}

.chat-button:active {
    transform: translateY(0);
}

/* Spinnie Avatar in Button */
.chat-button-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid white;
}

/* Online Indicator */
.chat-button::after {
    content: "";
    position: absolute;
    bottom: 4px;
    right: 4px;
    width: 14px;
    height: 14px;
    background: #10b981;
    border-radius: 50%;
    border: 3px solid white;
}

/* Chat Popup Window */
.chat-popup {
    position: fixed;
    bottom: 100px;
    right: 30px;
    width: 350px;
    height: 500px;
    background: white;
    border-radius: 16px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    display: none;
    flex-direction: column;
    overflow: hidden;
    z-index: 999;
    border: 1px solid #e5e7eb;
}

.chat-popup.active {
    display: flex;
    animation: popupSlideIn 0.3s ease;
}

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

/* Popup Header */
.chat-popup-header {
    background: #f8fafc;
    padding: 16px 20px;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.chat-popup-info {
    display: flex;
    align-items: center;
}

.chat-popup-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    margin-right: 12px;
    border: 2px solid #e2e8f0;
    object-fit: cover;
}

.chat-popup-details h4 {
    font-size: 1rem;
    font-weight: 600;
    color: #1a1a1a;
    margin: 0;
    font-family: 'Bauhaus', 'Futura', sans-serif;
}

.chat-popup-details p {
    font-size: 0.8rem;
    color: #10b981;
    margin: 0;
    display: flex;
    align-items: center;
}

.chat-popup-details p::before {
    content: "●";
    margin-right: 4px;
}

.chat-close-btn {
    background: none;
    border: none;
    font-size: 18px;
    color: #6b7280;
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.chat-close-btn:hover {
    background: #f3f4f6;
    color: #374151;
}

/* Messages Area */
.chat-popup-messages {
    flex: 1;
    padding: 16px;
    overflow-y: auto;
    background: white;
}

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

.chat-popup-messages::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.02);
}

.chat-popup-messages::-webkit-scrollbar-thumb {
    background: #d1d5db;
    border-radius: 2px;
}

/* Welcome Message */
.chat-welcome {
    text-align: center;
    padding: 20px 16px;
    background: #f8fafc;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    margin-bottom: 16px;
}

.chat-welcome h5 {
    font-size: 1rem;
    font-weight: 600;
    color: #1a1a1a;
    margin: 0 0 8px 0;
    font-family: 'Bauhaus', 'Futura', sans-serif;
}

.chat-welcome p {
    font-size: 0.85rem;
    color: #6b7280;
    margin: 0;
    line-height: 1.4;
}

/* Message Bubbles in Popup */
.popup-message {
    margin-bottom: 12px;
    display: flex;
    align-items: flex-start;
    animation: messageSlide 0.3s ease;
}

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

.popup-message-bubble {
    max-width: 75%;
    padding: 8px 12px;
    font-size: 0.85rem;
    line-height: 1.4;
    border-radius: 12px;
    word-wrap: break-word;
}

.popup-message.bot .popup-message-bubble {
    background: #f8fafc;
    color: #1a1a1a;
    border: 1px solid #e2e8f0;
    border-radius: 12px 12px 12px 4px;
}

.popup-message.user .popup-message-bubble {
    background: #3b82f6;
    color: white;
    border-radius: 12px 12px 4px 12px;
}

.popup-bot-avatar {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    margin-right: 8px;
    margin-top: 2px;
    border: 1px solid #e2e8f0;
    object-fit: cover;
    flex-shrink: 0;
}

/* Typing Indicator in Popup */
.popup-typing {
    display: flex;
    align-items: center;
    margin-bottom: 12px;
}

.popup-typing-dots {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 8px 12px;
    display: flex;
    align-items: center;
    margin-left: 32px;
}

.popup-typing-dots span {
    width: 6px;
    height: 6px;
    background: #6b7280;
    border-radius: 50%;
    margin: 0 2px;
    animation: typing 1.6s infinite ease-in-out;
}

.popup-typing-dots span:nth-child(2) { animation-delay: 0.3s; }
.popup-typing-dots span:nth-child(3) { animation-delay: 0.6s; }

/* Input Area */
.chat-popup-input {
    padding: 12px 16px;
    border-top: 1px solid #e2e8f0;
    background: white;
}

.chat-input-wrapper {
    display: flex;
    align-items: flex-end;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 20px;
    padding: 8px 12px;
    transition: all 0.2s ease;
}

.chat-input-wrapper:focus-within {
    border-color: #3b82f6;
    background: white;
}

.chat-popup-input-field {
    flex: 1;
    border: none;
    background: transparent;
    padding: 4px 8px;
    font-size: 0.9rem;
    outline: none;
    resize: none;
    font-family: 'Futura', sans-serif;
    max-height: 80px;
    min-height: 20px;
    line-height: 1.4;
    color: #1a1a1a;
}

.chat-popup-input-field::placeholder {
    color: #9ca3af;
    font-style: italic;
}

.chat-popup-send {
    background: #3b82f6;
    border: none;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-left: 8px;
    flex-shrink: 0;
}

.chat-popup-send:hover:not(:disabled) {
    background: #2563eb;
    transform: scale(1.05);
}

.chat-popup-send:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background: #d1d5db;
}

.chat-popup-send i {
    font-size: 12px;
    margin-left: 1px;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .chat-button-container {
        bottom: 20px;
        right: 20px;
    }
    
    .chat-button {
        width: 56px;
        height: 56px;
    }
    
    .chat-button-avatar {
        width: 32px;
        height: 32px;
    }
    
    .chat-popup {
        bottom: 90px;
        right: 20px;
        width: calc(100vw - 40px);
        max-width: 320px;
        height: 450px;
    }
}

@media (max-width: 480px) {
    .chat-popup {
        bottom: 90px;
        right: 10px;
        left: 10px;
        width: auto;
        height: 400px;
    }
}