@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

:root {
    --chat-primary: #9ACD32; /* Lime Green */
    --chat-primary-glow: rgba(154, 205, 50, 0.3);
    --chat-bg-dark: #0F172A;
    --chat-surface: #1E293B;
    --chat-surface-light: #334155;
    --chat-text-main: #F8FAFC;
    --chat-text-dim: #94A3B8;
    --chat-border: rgba(255, 255, 255, 0.1);
    --chat-radius-lg: 24px;
    --chat-radius-md: 16px;
    --chat-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.3), 0 8px 10px -6px rgba(0, 0, 0, 0.3);
}

.chat-widget * {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Chat Widget Container */
.chat-widget {
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 1000;
    font-family: 'Inter', sans-serif;
}

/* Trigger Button */
.chat-trigger {
    width: 65px;
    height: 65px;
    border-radius: 50%;
    background: var(--chat-primary);
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 15px var(--chat-primary-glow);
    display: flex;
    justify-content: center;
    align-items: center;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    position: relative;
    z-index: 1001;
    overflow: hidden;
    padding: 0;
}

.chat-trigger:hover {
    transform: scale(1.05) rotate(5deg);
    box-shadow: 0 8px 25px var(--chat-primary-glow);
}

/* Tooltip */
.chat-tooltip {
    position: absolute;
    bottom: 80px;
    right: 0;
    background: var(--chat-surface);
    color: var(--chat-text-main);
    padding: 12px 20px;
    border-radius: 15px;
    font-size: 0.9rem;
    white-space: nowrap;
    box-shadow: var(--chat-shadow);
    border: 1px solid var(--chat-border);
    animation: bounceIn 0.5s ease-out;
    pointer-events: none;
}

@keyframes bounceIn {
    0% { transform: scale(0.3); opacity: 0; }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); opacity: 1; }
}

/* Chat Window */
.chat-window {
    position: absolute;
    bottom: 85px;
    right: 0;
    width: 380px;
    height: 600px;
    background: var(--chat-surface);
    border-radius: var(--chat-radius-lg);
    box-shadow: var(--chat-shadow);
    border: 1px solid var(--chat-border);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transform: translateY(20px) scale(0.95);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.chat-window.active {
    transform: translateY(0) scale(1);
    opacity: 1;
    visibility: visible;
}

/* Header */
.chat-header {
    padding: 24px;
    background: var(--chat-bg-dark);
    display: flex;
    align-items: center;
    gap: 15px;
    border-bottom: 1px solid var(--chat-border);
}

.bot-avatar {
    width: 45px;
    height: 45px;
    background: var(--chat-primary);
    border-radius: 12px;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-shrink: 0;
}

.bot-avatar img {
    width: 100%;
    height: 100%;
    border-radius: 12px;
    object-fit: cover;
}

.header-info h2 {
    font-size: 1.1rem;
    font-weight: 700;
    margin: 0;
    margin-bottom: 2px;
    color: var(--chat-text-main);
}

.status {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.75rem;
    color: var(--chat-text-dim);
}

.status-dot {
    width: 8px;
    height: 8px;
    background: #10B981;
    border-radius: 50%;
    box-shadow: 0 0 8px rgba(16, 185, 129, 0.5);
    animation: pulse 2s infinite;
}

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

/* Messages Area */
.chat-body {
    flex: 1;
    overflow-y: auto;
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 20px;
    scroll-behavior: smooth;
    background: transparent;
}

/* Custom Scrollbar */
.chat-body::-webkit-scrollbar {
    width: 6px;
}
.chat-body::-webkit-scrollbar-thumb {
    background: var(--chat-surface-light);
    border-radius: 10px;
}

/* Message Bubbles */
.message {
    max-width: 80%;
    padding: 14px 18px;
    font-size: 0.95rem;
    position: relative;
    animation: fadeIn 0.3s ease-out forwards;
}

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

.bot-msg {
    align-self: flex-start;
    background: var(--chat-surface-light);
    color: var(--chat-text-main);
    border-radius: 2px 20px 20px 20px;
}

.user-msg {
    align-self: flex-end;
    background: var(--chat-primary);
    color: #000;
    font-weight: 500;
    border-radius: 20px 20px 2px 20px;
}

/* Quick Actions */
.quick-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
}

.action-btn {
    background: transparent;
    border: 1px solid var(--chat-primary);
    color: var(--chat-primary);
    padding: 8px 16px;
    border-radius: 50px;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s;
    font-weight: 500;
}

.action-btn:hover {
    background: var(--chat-primary);
    color: #000;
}

/* Input Area */
.chat-footer {
    padding: 20px;
    background: var(--chat-surface);
    border-top: 1px solid var(--chat-border);
}

.input-container {
    display: flex;
    align-items: center;
    background: var(--chat-surface-light);
    padding: 8px 8px 8px 20px;
    border-radius: 50px;
    transition: all 0.2s;
    border: 1px solid transparent;
}

.input-container:focus-within {
    border-color: var(--chat-primary);
    box-shadow: 0 0 10px var(--chat-primary-glow);
}

.input-container input {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    color: var(--chat-text-main);
    font-family: inherit;
    font-size: 0.95rem;
    padding: 0;
}

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

.send-btn:hover {
    transform: scale(1.05);
}

.send-btn svg {
    width: 20px;
    height: 20px;
    fill: #000;
}

/* Typing Indicator */
.typing {
    display: flex;
    gap: 4px;
    padding: 8px 12px;
    background: var(--chat-surface-light);
    border-radius: 20px;
    width: fit-content;
    margin-bottom: 10px;
}

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

.dot:nth-child(2) { animation-delay: 0.2s; }
.dot:nth-child(3) { animation-delay: 0.4s; }

@keyframes bounce {
    0%, 80%, 100% { transform: scale(0); }
    40% { transform: scale(1); }
}

/* Hide elements */
.hidden {
    display: none !important;
}

@media (max-width: 480px) {
    .chat-window {
        width: calc(100vw - 40px);
        height: calc(100vh - 120px);
        bottom: 80px;
    }
}
