/* Chatbot floating widget styles */
:root {
    --chat-primary: #818cf8;
    --chat-primary-hover: #4f46e5;
    --chat-bg: rgba(15, 23, 42, 0.8);
    --chat-glass-border: rgba(255, 255, 255, 0.08);
    --chat-text: #f8fafc;
    --chat-text-muted: #94a3b8;
}

/* Float button */
.chatbot-toggle {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    border: none;
    color: white;
    font-size: 1.8rem;
    cursor: pointer;
    box-shadow: 0 8px 32px rgba(99, 102, 241, 0.4);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275), box-shadow 0.3s;
}

.chatbot-toggle:hover {
    transform: scale(1.1) rotate(5deg);
    box-shadow: 0 12px 36px rgba(99, 102, 241, 0.6);
}

.chatbot-toggle:active {
    transform: scale(0.95);
}

/* Chat container */
.chatbot-container {
    position: fixed;
    bottom: 7rem;
    right: 2rem;
    width: 400px;
    height: 550px;
    background: rgba(15, 23, 42, 0.9);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--chat-glass-border);
    border-radius: 24px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
    z-index: 1000;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transform: translateY(20px) scale(0.95);
    opacity: 0;
    pointer-events: none;
    transition: all 0.3s cubic-bezier(0.165, 0.84, 0.44, 1);
}

.chatbot-container.open {
    transform: translateY(0) scale(1);
    opacity: 1;
    pointer-events: auto;
}

/* Chat Header */
.chat-header {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.15), rgba(139, 92, 246, 0.15));
    border-bottom: 1px solid var(--chat-glass-border);
    padding: 1.25rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

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

.chat-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, #72e960, #818cf8);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    color: white;
    font-size: 1.1rem;
    box-shadow: 0 0 15px rgba(114, 233, 96, 0.3);
}

.chat-title-container {
    display: flex;
    flex-direction: column;
}

.chat-title {
    font-weight: 700;
    color: var(--chat-text);
    font-size: 1rem;
}

.chat-subtitle {
    font-size: 0.78rem;
    color: #72e960;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.chat-subtitle::before {
    content: '';
    width: 6px;
    height: 6px;
    background-color: #72e960;
    border-radius: 50%;
    display: inline-block;
    box-shadow: 0 0 8px #72e960;
}

.chat-close {
    background: transparent;
    border: none;
    color: var(--chat-text-muted);
    font-size: 1.5rem;
    cursor: pointer;
    transition: color 0.2s;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.chat-close:hover {
    color: var(--chat-text);
    background: rgba(255, 255, 255, 0.05);
}

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

/* Scrollbar */
.chat-messages::-webkit-scrollbar {
    width: 6px;
}
.chat-messages::-webkit-scrollbar-track {
    background: transparent;
}
.chat-messages::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 99px;
}

.chat-bubble {
    max-width: 80%;
    padding: 0.85rem 1.1rem;
    border-radius: 18px;
    font-size: 0.9rem;
    line-height: 1.45;
    animation: bubbleAppear 0.3s cubic-bezier(0.1, 0.8, 0.3, 1) forwards;
}

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

.chat-bubble.bot {
    align-self: flex-start;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--chat-glass-border);
    color: var(--chat-text);
    border-bottom-left-radius: 4px;
}

.chat-bubble.user {
    align-self: flex-end;
    background: linear-gradient(135deg, #4f46e5, #6366f1);
    color: white;
    border-bottom-right-radius: 4px;
}

/* Options / Action Buttons */
.chat-options-container {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.chat-option-btn {
    background: rgba(99, 102, 241, 0.12);
    border: 1px solid rgba(99, 102, 241, 0.3);
    color: #a5b4fc;
    padding: 0.5rem 1rem;
    border-radius: 99px;
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.chat-option-btn:hover {
    background: var(--chat-primary);
    color: white;
    border-color: var(--chat-primary);
    transform: translateY(-1px);
}

/* Chat Input Footer */
.chat-footer {
    padding: 1rem;
    border-top: 1px solid var(--chat-glass-border);
    display: flex;
    gap: 0.5rem;
    background: rgba(10, 15, 30, 0.5);
}

.chat-input {
    flex: 1;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--chat-glass-border);
    border-radius: 12px;
    padding: 0.75rem 1rem;
    color: var(--chat-text);
    font-size: 0.9rem;
    outline: none;
    transition: border-color 0.2s;
}

.chat-input:focus {
    border-color: var(--chat-primary);
}

.chat-send-btn {
    background: var(--chat-primary);
    border: none;
    color: white;
    width: 42px;
    height: 42px;
    border-radius: 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.chat-send-btn:hover {
    background: var(--chat-primary-hover);
}

/* Responsive adjustment */
@media (max-width: 480px) {
    .chatbot-container {
        width: calc(100vw - 2rem);
        height: calc(100vh - 10rem);
        right: 1rem;
        bottom: 6rem;
    }
    .chatbot-toggle {
        right: 1rem;
        bottom: 1rem;
    }
}
