/* Chatbot Toggle Button */
.chat-toggle-btn {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, #6b7280 0%, #60a5fa 100%);
    border-radius: 50%;
    color: white;
    box-shadow: 0 4px 15px rgba(96, 165, 250, 0.4);
    cursor: pointer;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.chat-toggle-btn:hover {
    transform: scale(1.1);
}

/* Chat Container */
.chat-container {
    position: fixed;
    bottom: 100px;
    right: 30px;
    width: 350px;
    height: 500px;
    background: white;
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    display: flex;
    /* Changed from none to flex via JS */
    flex-direction: column;
    overflow: hidden;
    z-index: 9999;
    transform-origin: bottom right;
    transform: scale(0);
    /* Hidden state */
    opacity: 0;
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275), opacity 0.3s ease;
}

.chat-container.active {
    transform: scale(1);
    opacity: 1;
}

/* Header */
.chat-header {
    background: linear-gradient(135deg, #6b7280 0%, #60a5fa 100%);
    color: white;
    padding: 15px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.bot-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.bot-avatar {
    width: 35px;
    height: 35px;
    background: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #60a5fa;
    font-size: 18px;
}

/* Messages Area */
.chat-messages {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    background-color: #f9fafb;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.message {
    max-width: 80%;
    padding: 10px 15px;
    border-radius: 12px;
    font-size: 14px;
    line-height: 1.4;
    position: relative;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.message.bot {
    align-self: flex-start;
    background: white;
    color: #374151;
    border-bottom-left-radius: 2px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

.message.user {
    align-self: flex-end;
    background: linear-gradient(135deg, #6b7280 0%, #60a5fa 100%);
    color: white;
    border-bottom-right-radius: 2px;
}

/* Typing Indicator */
.typing-indicator {
    padding: 10px 15px;
    background: white;
    border-radius: 12px;
    align-self: flex-start;
    border-bottom-left-radius: 2px;
    display: none;
    /* toggled via JS */
    gap: 5px;
}

.dot {
    width: 6px;
    height: 6px;
    background: #9ca3af;
    border-radius: 50%;
    animation: bounce 1.4s infinite ease-in-out;
}

.dot:nth-child(1) {
    animation-delay: -0.32s;
}

.dot:nth-child(2) {
    animation-delay: -0.16s;
}

@keyframes bounce {

    0%,
    80%,
    100% {
        transform: scale(0);
    }

    40% {
        transform: scale(1);
    }
}

/* Input Area */
.chat-input-area {
    padding: 15px;
    background: white;
    border-top: 1px solid #e5e7eb;
    display: flex;
    gap: 10px;
}

.chat-input {
    flex: 1;
    border: 1px solid #e5e7eb;
    border-radius: 20px;
    padding: 10px 15px;
    outline: none;
    font-size: 14px;
    transition: border-color 0.2s;
}

.chat-input:focus {
    border-color: #60a5fa;
}

.send-btn {
    background: none;
    border: none;
    color: #60a5fa;
    font-size: 20px;
    cursor: pointer;
    transition: transform 0.2s;
}

.send-btn:hover {
    transform: scale(1.1);
}

/* Suggestion Chips */
.suggestion-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 5px;
    animation: fadeIn 0.3s ease;
}

.chip {
    background: #f3f4f6;
    border: 1px solid #e5e7eb;
    border-radius: 16px;
    padding: 6px 12px;
    font-size: 13px;
    color: #4b5563;
    cursor: pointer;
    transition: all 0.2s;
}

.chip:hover {
    background: #e0e7ff;
    color: #3b82f6;
    border-color: #60a5fa;
    transform: translateY(-1px);
}

/* Mobile Responsive *//* Mobile Responsive */
@media (max-width: 480px) {
    .chat-container {
        width: 100%;
        /* Full width */
        height: 100%;
        /* Full screen */
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        border-radius: 0;
        transform-origin: center;
    }

    .chat-header {
        padding-top: 20px;
        /* Safe area */
    }

    .close-btn {
        font-size: 1.5rem;
    }
}