/* Chatbot Widget Styles */

.chatbot-container {
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 9999;
    font-family: var(--font-body);
}

/* Chat Toggle Button */
.chat-toggle {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: var(--primary);
    color: #fff;
    border: none;
    cursor: pointer;
    box-shadow: 0 5px 20px rgba(255, 77, 0, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    position: relative;
}

.chat-toggle i {
    width: 24px;
    height: 24px;
}

.chat-toggle:hover {
    transform: scale(1.1);
}

.pulse-ring::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: var(--primary);
    border-radius: 50%;
    z-index: -1;
    animation: pulse-ring 2s cubic-bezier(0.215, 0.61, 0.355, 1) infinite;
}

/* Chat Window */
.chat-window {
    position: absolute;
    bottom: 80px;
    right: 0;
    width: 350px;
    height: 500px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--border-radius);
    box-shadow: 0 10px 40px rgba(0,0,0,0.5);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transform-origin: bottom right;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.chat-window.hidden {
    transform: scale(0);
    opacity: 0;
    pointer-events: none;
}

/* Header */
.chat-header {
    background: var(--bg-elevated);
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.chat-title {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.online-indicator {
    width: 10px;
    height: 10px;
    background-color: var(--success);
    border-radius: 50%;
    box-shadow: 0 0 5px var(--success);
}

.chat-title h4 {
    margin: 0;
    font-size: 1rem;
    text-transform: none;
}

.chat-title span {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.close-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    transition: var(--transition);
}

.close-btn:hover {
    color: var(--primary);
}

/* Messages Area */
.chat-messages {
    flex: 1;
    padding: 1.5rem;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    scroll-behavior: smooth;
}

.chat-messages::-webkit-scrollbar {
    width: 6px;
}
.chat-messages::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 3px;
}

.message {
    max-width: 85%;
    padding: 0.75rem 1rem;
    border-radius: 12px;
    font-size: 0.9rem;
    line-height: 1.4;
    animation: fadeIn 0.3s ease forwards;
}

.message.bot {
    align-self: flex-start;
    background: var(--bg-elevated);
    border-bottom-left-radius: 4px;
    color: var(--text-primary);
}

.message.user {
    align-self: flex-end;
    background: var(--primary);
    color: #fff;
    border-bottom-right-radius: 4px;
}

/* Typing Indicator */
.typing-indicator {
    display: flex;
    gap: 4px;
    padding: 1rem;
    background: var(--bg-elevated);
    border-radius: 12px;
    border-bottom-left-radius: 4px;
    align-self: flex-start;
    width: fit-content;
}

.typing-dot {
    width: 6px;
    height: 6px;
    background: var(--text-secondary);
    border-radius: 50%;
    animation: typing 1.4s infinite ease-in-out both;
}

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

/* Input Area */
.chat-input-area {
    background: var(--bg-elevated);
    padding: 1rem;
    border-top: 1px solid var(--border);
}

.quick-replies {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

.quick-reply-btn {
    background: transparent;
    border: 1px solid var(--primary);
    color: var(--primary);
    padding: 0.4rem 0.8rem;
    border-radius: 50px;
    font-size: 0.8rem;
    cursor: pointer;
    transition: var(--transition);
}

.quick-reply-btn:hover {
    background: var(--primary);
    color: #fff;
}

.input-group {
    display: flex;
    gap: 0.5rem;
    background: var(--bg-dark);
    padding: 0.5rem;
    border-radius: 50px;
    border: 1px solid var(--border);
}

.input-group input {
    flex: 1;
    background: transparent;
    border: none;
    color: var(--text-primary);
    padding: 0 0.5rem;
    font-family: var(--font-body);
}

.input-group input:focus {
    outline: none;
}

.input-group button {
    background: var(--primary);
    color: #fff;
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition);
}

.input-group button:hover {
    background: #e64500;
}

.input-group button i {
    width: 16px;
    height: 16px;
    margin-left: -2px; /* optical center */
}

@media (max-width: 480px) {
    .chatbot-container {
        bottom: 20px;
        right: 20px;
    }
    .chat-window {
        width: calc(100vw - 40px);
        height: 60vh;
    }
}
