/* Chatbot Container */
#chatbot-widget {
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 9999;
    font-family: 'Inter', system-ui, sans-serif;
}

/* Toggle Button (Floating Action Button) */
.chat-toggle-btn {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--deep-navy) 0%, #0f172a 100%);
    border: 1px solid var(--cyan-glow);
    box-shadow: 0 4px 20px rgba(6, 182, 212, 0.4);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    position: relative;
    overflow: hidden;
}

.chat-toggle-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 8px 30px rgba(6, 182, 212, 0.6);
}

.chat-toggle-btn svg {
    width: 28px;
    height: 28px;
    fill: none;
    stroke: white;
    stroke-width: 2;
    transition: all 0.3s ease;
}

/* Notification Pulse */
.chat-pulse {
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: var(--cyan-glow);
    opacity: 0.4;
    animation: pulse-ring 2s infinite;
    z-index: -1;
}

@keyframes pulse-ring {
    0% {
        transform: scale(0.8);
        opacity: 0.5;
    }

    100% {
        transform: scale(1.5);
        opacity: 0;
    }
}

/* Chat Interface Window */
.chat-window {
    position: absolute;
    bottom: 80px;
    right: 0;
    width: 380px;
    height: 600px;
    max-height: 80vh;
    background: rgba(15, 23, 42, 0.95);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transform-origin: bottom right;
    transform: scale(0);
    opacity: 0;
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    visibility: hidden;
}

.chat-window.open {
    transform: scale(1);
    opacity: 1;
    visibility: visible;
}

/* Header */
.chat-header {
    background: linear-gradient(to right, rgba(6, 182, 212, 0.1), transparent);
    padding: 1.2rem;
    display: flex;
    align-items: center;
    border-bottom: 1px solid var(--glass-border);
}

.bot-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--cyan-glow);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 12px;
    box-shadow: 0 0 10px rgba(6, 182, 212, 0.3);
}

.bot-info h3 {
    font-size: 1rem;
    font-weight: 600;
    color: white;
    margin: 0;
}

.bot-info span {
    font-size: 0.75rem;
    color: #10b981;
    /* Green status */
    display: flex;
    align-items: center;
    gap: 4px;
}

.bot-info span::before {
    content: '';
    width: 6px;
    height: 6px;
    background: #10b981;
    border-radius: 50%;
    display: block;
}

/* Messages Area */
.chat-messages {
    flex: 1;
    padding: 1.2rem;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    background: rgba(0, 0, 0, 0.2);
    /* Custom Scrollbar */
    scrollbar-width: thin;
    scrollbar-color: var(--glass-border) transparent;
}

.message {
    max-width: 85%;
    padding: 0.8rem 1rem;
    font-size: 0.9rem;
    line-height: 1.4;
    position: relative;
    animation: slide-up 0.3s ease-out;
}

@keyframes slide-up {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.message.bot {
    align-self: flex-start;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid var(--glass-border);
    border-radius: 12px 12px 12px 2px;
    color: var(--text-light);
}

.message.user {
    align-self: flex-end;
    background: linear-gradient(135deg, var(--cyan-glow), #0891b2);
    border-radius: 12px 12px 2px 12px;
    color: white;
    box-shadow: 0 2px 10px rgba(6, 182, 212, 0.2);
}

.message .time {
    display: block;
    font-size: 0.65rem;
    opacity: 0.7;
    margin-top: 4px;
    text-align: right;
}

/* Typing Indicator */
.typing-indicator {
    padding: 0.8rem 1rem;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    align-self: flex-start;
    display: none;
    /* Toggled by JS */
    align-items: center;
    gap: 4px;
    width: fit-content;
}

.typing-dot {
    width: 6px;
    height: 6px;
    background: var(--text-dim);
    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;
}

@keyframes typing {

    0%,
    80%,
    100% {
        transform: scale(0);
    }

    40% {
        transform: scale(1);
    }
}

/* Quick Actions */
.quick-actions {
    padding: 0 1.2rem 1rem;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    background: rgba(0, 0, 0, 0.2);
}

.action-chip {
    background: rgba(6, 182, 212, 0.1);
    border: 1px solid var(--glass-border);
    color: var(--cyan-glow);
    padding: 0.4rem 0.8rem;
    border-radius: 20px;
    font-size: 0.75rem;
    cursor: pointer;
    transition: all 0.2s;
}

.action-chip:hover {
    background: var(--cyan-glow);
    color: white;
}

/* Input Area */
.chat-input-area {
    padding: 1rem;
    background: rgba(15, 23, 42, 0.95);
    border-top: 1px solid var(--glass-border);
    display: flex;
    gap: 10px;
    align-items: center;
}

.chat-input {
    flex: 1;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    padding: 0.8rem 1.2rem;
    color: white;
    font-family: inherit;
    font-size: 0.9rem;
    outline: none;
    transition: all 0.3s;
}

.chat-input:focus {
    border-color: var(--cyan-glow);
    background: rgba(255, 255, 255, 0.1);
}

.send-btn {
    background: transparent;
    border: none;
    color: var(--cyan-glow);
    cursor: pointer;
    padding: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s;
}

.send-btn:hover {
    transform: translateX(3px);
    color: white;
}

/* Mobile Responsive */
@media (max-width: 480px) {
    .chat-window {
        width: calc(100vw - 40px);
        bottom: 100px;
        right: 20px;
        left: 20px;
        height: 70vh;
    }
}