/* Elite AI Chatbot Styles */
:root {
    --chat-red: #ff0000;
    --chat-dark: #0a0a0a;
    --chat-glass: rgba(20, 20, 20, 0.85);
    --chat-text: #ffffff;
}

/* Floating Toggle Button */
.chat-toggle {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 60px;
    height: 60px;
    background: var(--chat-red);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 0 20px rgba(255, 0, 0, 0.6);
    z-index: 2147483647;
    /* Standard max z-index */
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    animation: pulse-red 2s infinite;
}

.chat-toggle:hover {
    transform: scale(1.1);
    box-shadow: 0 0 30px rgba(255, 0, 0, 0.6);
}

.chat-toggle i {
    font-size: 28px;
    color: white;
    transition: transform 0.3s ease;
}

.chat-toggle.open i {
    transform: rotate(45deg);
    /* Turn message icon into X */
}

/* Chat Window Container */
.chat-window {
    position: fixed;
    bottom: 100px;
    right: 30px;
    width: 350px;
    height: 480px;
    background: var(--chat-glass);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    z-index: 9998;

    /* Animation State: Hidden */
    opacity: 0;
    transform: translateY(20px) scale(0.95);
    pointer-events: none;
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.chat-window.active {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: all;
}

/* Header */
.chat-header {
    padding: 15px 20px;
    background: linear-gradient(135deg, rgba(255, 0, 0, 0.1), transparent);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    display: flex;
    align-items: center;
    gap: 12px;
}

.chat-avatar {
    width: 40px;
    height: 40px;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.chat-avatar-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    animation: float 3s ease-in-out infinite;
}

.chat-status-dot {
    position: absolute;
    bottom: 2px;
    right: 2px;
    width: 10px;
    height: 10px;
    background: #00ff00;
    border-radius: 50%;
    border: 2px solid #1a1a1a;
}

/* Messages Area */
.chat-body {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 15px;
    scrollbar-width: thin;
    scrollbar-color: #333 transparent;
}

.chat-body::-webkit-scrollbar {
    width: 6px;
}

.chat-body::-webkit-scrollbar-thumb {
    background: #333;
    border-radius: 3px;
}

.message {
    max-width: 85%;
    padding: 10px 14px;
    border-radius: 12px;
    font-size: 14px;
    line-height: 1.5;
    position: relative;
    animation: msg-slide 0.3s ease-out;
}

.message.bot {
    background: rgba(255, 255, 255, 0.05);
    color: #eee;
    border-bottom-left-radius: 2px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.message.user {
    background: var(--chat-red);
    color: white;
    align-self: flex-end;
    border-bottom-right-radius: 2px;
}

/* Quick Replies */
.chat-options {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 5px;
}

.chat-option-btn {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
    padding: 8px 12px;
    border-radius: 20px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s;
}

.chat-option-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: white;
}

/* Typing Indicator */
.typing-indicator {
    display: flex;
    gap: 4px;
    padding: 12px 16px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    width: fit-content;
    display: none;
    /* Hidden by default */
}

.typing-indicator span {
    width: 6px;
    height: 6px;
    background: #888;
    border-radius: 50%;
    animation: typing 1.4s infinite ease-in-out both;
}

.typing-indicator span:nth-child(1) {
    animation-delay: -0.32s;
}

.typing-indicator span:nth-child(2) {
    animation-delay: -0.16s;
}

/* Animations */
@keyframes float {
    0% {
        transform: translateY(0px);
    }

    50% {
        transform: translateY(-5px);
    }

    100% {
        transform: translateY(0px);
    }
}

@keyframes pulse-red {
    0% {
        box-shadow: 0 0 0 0 rgba(255, 0, 0, 0.4);
    }

    70% {
        box-shadow: 0 0 0 10px rgba(255, 0, 0, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(255, 0, 0, 0);
    }
}

@keyframes msg-slide {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes typing {

    0%,
    80%,
    100% {
        transform: scale(0);
    }

    40% {
        transform: scale(1);
    }
}

/* Mobile Responsive */
@media (max-width: 480px) {
    .chat-window {
        width: 100%;
        height: 100%;
        bottom: 0;
        right: 0;
        border-radius: 0;
    }

    .chat-toggle {
        bottom: 20px;
        right: 20px;
    }
}