/* Chatbot CSS - Cyberpunk / Void Theme */
:root {
    --chat-bg: rgba(0, 10, 5, 0.95);
    --chat-border: var(--neon-green, #00ff88);
    --chat-text: #fff;
    --chat-bot-msg: rgba(0, 255, 136, 0.1);
    --chat-user-msg: rgba(0, 217, 255, 0.1);
    --chat-header-bg: rgba(0, 20, 10, 0.95);
}

/* Chat Hint/Popup */
.chat-hint {
    position: fixed;
    bottom: 100px;
    right: 30px;
    background: rgba(0, 10, 5, 0.95);
    border: 1px solid var(--chat-border);
    color: #fff;
    padding: 12px 16px;
    border-radius: 4px;
    font-family: 'Rajdhani', sans-serif;
    font-size: 0.9rem;
    line-height: 1.4;
    z-index: 9998;
    box-shadow: 0 0 15px rgba(0, 255, 136, 0.3);
    pointer-events: none;
    /* animation: fadeIn 1s ease-out, float 3s ease-in-out infinite; */
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.8s ease-out, transform 0.8s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    text-align: right;
    width: max-content;
    max-width: 200px;
}

.chat-hint strong {
    color: var(--chat-border);
    font-weight: 700;
}

/* Arrow for the tooltip */
.chat-hint::after {
    content: '';
    position: absolute;
    bottom: -8px;
    right: 24px;
    width: 0;
    height: 0;
    border-left: 8px solid transparent;
    border-right: 8px solid transparent;
    border-top: 8px solid var(--chat-border);
}

/* Floating Action Button */
.chat-fab {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 60px;
    height: 60px;
    background: #000;
    border: 2px solid var(--chat-border);
    border-radius: 50%;
    cursor: pointer;
    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: 0 0 20px rgba(0, 255, 136, 0.4);
    transition: all 0.3s ease;
    animation: pulse-green 3s infinite;
    transform: scale(0);
    opacity: 0;
}

.chat-fab:hover {
    transform: scale(1.1);
    box-shadow: 0 0 30px rgba(0, 255, 136, 0.8);
    background: rgba(0, 255, 136, 0.1);
}

.chat-fab svg {
    width: 30px;
    height: 30px;
    fill: var(--chat-border);
}

/* Chat Window */
.chat-window {
    position: fixed;
    bottom: 100px;
    right: 30px;
    width: 350px;
    height: 500px;
    background: var(--chat-bg);
    border: 1px solid var(--chat-border);
    backdrop-filter: blur(10px);
    display: none;
    /* Hidden by default */
    flex-direction: column;
    z-index: 9999;
    box-shadow: 0 0 30px rgba(0, 0, 0, 0.8);
    clip-path: margin-box;
    /* Corner acccents */
    background-image:
        linear-gradient(var(--chat-border), var(--chat-border)),
        linear-gradient(var(--chat-border), var(--chat-border)),
        linear-gradient(var(--chat-border), var(--chat-border)),
        linear-gradient(var(--chat-border), var(--chat-border));
    background-repeat: no-repeat;
    background-size: 2px 20px, 20px 2px;
    background-position: top left, top left, bottom right, bottom right;
    animation: slideUp 0.3s cubic-bezier(0.165, 0.84, 0.44, 1);
}

/* Open State */
.chat-window.active {
    display: flex;
}

/* Header */
.chat-header {
    padding: 15px;
    background: var(--chat-header-bg);
    border-bottom: 1px solid rgba(0, 255, 136, 0.3);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.chat-title {
    font-family: 'Orbitron', sans-serif;
    color: var(--chat-border);
    font-weight: 700;
    letter-spacing: 2px;
    text-transform: uppercase;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

.status-dot {
    width: 8px;
    height: 8px;
    background: var(--chat-border);
    border-radius: 50%;
    animation: blink 2s infinite;
}

.close-chat {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.7);
    cursor: pointer;
    font-size: 1.2rem;
    transition: color 0.3s;
}

.close-chat:hover {
    color: var(--doom-red, #ff0033);
}

/* Messages Area */
.chat-messages {
    flex: 1;
    padding: 15px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 15px;
    font-family: 'Rajdhani', sans-serif;
    scrollbar-width: thin;
    scrollbar-color: var(--chat-border) #000;
}

.chat-messages::-webkit-scrollbar {
    width: 5px;
}

.chat-messages::-webkit-scrollbar-thumb {
    background: var(--chat-border);
}

.message {
    max-width: 85%;
    padding: 10px 15px;
    border-radius: 4px;
    font-size: 0.95rem;
    line-height: 1.4;
    position: relative;
    word-wrap: break-word;
}

.bot-message {
    align-self: flex-start;
    background: var(--chat-bot-msg);
    border-left: 2px solid var(--chat-border);
    color: #e0e0e0;
}

.user-message {
    align-self: flex-end;
    background: var(--chat-user-msg);
    border-right: 2px solid var(--arc-blue, #00d9ff);
    color: #fff;
    text-align: right;
}


/* Typing Indicator */
.typing {
    font-size: 0.8rem;
    color: var(--chat-border);
    margin-bottom: 10px;
    opacity: 0.7;
    animation: blink 1s infinite;
}

/* Input Area */
.chat-input-area {
    padding: 15px;
    background: rgba(0, 0, 0, 0.8);
    border-top: 1px solid rgba(0, 255, 136, 0.2);
    display: flex;
    gap: 10px;
}

#chatInput {
    flex: 1;
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.2);
    padding: 10px;
    color: #fff;
    font-family: 'Rajdhani', sans-serif;
    font-size: 1rem;
    outline: none;
    transition: border-color 0.3s;
}

#chatInput:focus {
    border-color: var(--chat-border);
}

#sendBtn {
    background: var(--chat-border);
    color: #000;
    border: none;
    padding: 0 15px;
    cursor: pointer;
    font-family: 'Orbitron', sans-serif;
    font-weight: 700;
    transition: all 0.3s;
}

#sendBtn:hover {
    background: #fff;
    box-shadow: 0 0 10px #fff;
}

/* Animations */
@keyframes pulse-green {
    0% {
        box-shadow: 0 0 0 0 rgba(0, 255, 136, 0.4);
    }

    70% {
        box-shadow: 0 0 0 10px rgba(0, 255, 136, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(0, 255, 136, 0);
    }
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes blink {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.3;
    }
}

/* Mobile Responsive */
@media (max-width: 480px) {
    .chat-window {
        width: 100%;
        height: 100%;
        bottom: 0;
        right: 0;
        left: 0;
        top: 0;
    }

    .chat-fab {
        bottom: 20px;
        right: 20px;
    }

    .chat-hint {
        right: 20px;
        bottom: 90px;
        font-size: 0.8rem;
    }
}

/* JARVIS Customizations */
.fab-text {
    font-family: 'Orbitron', sans-serif;
    font-weight: 900;
    font-size: 12px;
    color: var(--chat-border);
    letter-spacing: 1px;
    animation: blink 3s infinite;
}

.options-container {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 15px;
    padding: 0 2px;
}

.chat-option-btn {
    background: rgba(0, 255, 136, 0.05);
    border: 1px solid rgba(0, 255, 136, 0.2);
    color: #ccc;
    padding: 10px 12px;
    text-align: left;
    font-family: 'Rajdhani', sans-serif;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.3s ease;
    border-radius: 2px;
    position: relative;
    overflow: hidden;
}

.chat-option-btn:hover {
    background: rgba(0, 255, 136, 0.15);
    border-color: var(--chat-border);
    color: #fff;
    padding-left: 20px;
}

.chat-option-btn::before {
    content: '>';
    position: absolute;
    left: 5px;
    top: 50%;
    transform: translateY(-50%);
    opacity: 0;
    transition: all 0.3s;
    color: var(--chat-border);
    font-weight: bold;
}

.chat-option-btn:hover::before {
    opacity: 1;
    left: 8px;
}

/* Visibility State for Pop-up */
.chat-fab.is-visible {
    animation: bounceIn 0.8s cubic-bezier(0.68, -0.55, 0.265, 1.55) forwards, pulse-green 3s infinite 1s;
    opacity: 1;
}

.chat-hint.is-visible {
    opacity: 1;
    transform: translateY(0);
    animation: float 3s ease-in-out infinite;
    animation-delay: 1s;
    /* Delay floating until after pop-in */
}


/* Missing Keyframes */
@keyframes float {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-10px);
    }
}

@keyframes bounceIn {
    0% {
        opacity: 0;
        transform: scale(0);
    }

    60% {
        opacity: 1;
        transform: scale(1.1);
    }

    100% {
        opacity: 1;
        transform: scale(1);
    }
}