/* Cyberpunk Chatbot CSS */
:root {
    --chat-bg: rgba(15, 23, 42, 0.95);
    --chat-border: rgba(14, 165, 233, 0.3);
    --chat-primary: #0ea5e9;
    --chat-text: #f8fafc;
    --chat-user-bg: #0ea5e9;
    --chat-bot-bg: #1e293b;
}

/* Floating Action Button (Root Console Icon) */
:root {
    --root-width: 180px;
    --root-height: 60px;
    --root-color: #0ea5e9;
    --root-bg: #0f172a;
}

.chat-fab {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: var(--root-width);
    height: var(--root-height);
    background: transparent;
    border: none;
    padding: 0;
    cursor: pointer;
    z-index: 2000;
    transition: transform 0.3s;
}

.chat-fab:hover {
    transform: scale(1.05);
    /* Gentle lift */
}

.root-terminal-box {
    width: 100%;
    height: 100%;
    background-color: var(--root-bg);
    border: 2px solid var(--root-color);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    padding: 0 15px;

    /* Neon Glow (Box Shadow) */
    box-shadow: 0 0 10px var(--root-color), inset 0 0 15px rgba(14, 165, 233, 0.3);

    /* Breathing Animation */
    animation: root-pulse-glow 3s infinite ease-in-out;
}

.root-cursor {
    animation: root-blink 1s step-end infinite;
    margin-left: 2px;
}

.root-cursor {
    animation: root-blink 1s step-end infinite;
}

@keyframes root-blink {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0;
    }
}

@keyframes root-pulse-glow {
    0% {
        box-shadow: 0 0 10px var(--root-color), inset 0 0 10px rgba(14, 165, 233, 0.3);
    }

    50% {
        box-shadow: 0 0 25px var(--root-color), inset 0 0 20px rgba(14, 165, 233, 0.5);
    }

    100% {
        box-shadow: 0 0 10px var(--root-color), inset 0 0 10px rgba(14, 165, 233, 0.3);
    }
}

/* Chat Window */
.chat-window {
    position: fixed;
    bottom: 100px;
    right: 30px;
    width: 350px;
    height: 500px;
    background: var(--chat-bg);
    border: 1px solid var(--chat-border);
    border-radius: 12px;
    backdrop-filter: blur(10px);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transform: translateY(20px) scale(0.95);
    opacity: 0;
    pointer-events: none;
    transition: all 0.3s ease;
    z-index: 2000;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
}

.chat-window.active {
    transform: translateY(0) scale(1);
    opacity: 1;
    pointer-events: all;
}

/* Header */
.chat-header {
    background: rgba(14, 165, 233, 0.1);
    padding: 15px;
    border-bottom: 1px solid var(--chat-border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

#chatClose {
    opacity: 0.7;
    transition: all 0.2s;
}

#chatClose:hover {
    opacity: 1;
    color: #ef4444 !important;
    /* Red Neon */
    transform: rotate(90deg);
}

.chat-title {
    font-family: 'JetBrains Mono', monospace;
    font-weight: 700;
    color: var(--chat-primary);
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

.status-dot {
    width: 8px;
    height: 8px;
    background: #10b981;
    border-radius: 50%;
    box-shadow: 0 0 5px #10b981;
}

/* Body */
.chat-body {
    flex: 1;
    padding: 15px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 15px;
    scroll-behavior: smooth;
}

/* Messages */
.message {
    max-width: 85%;
    padding: 10px 14px;
    border-radius: 10px;
    font-size: 0.9rem;
    line-height: 1.4;
    position: relative;
    font-family: 'Inter', sans-serif;
}

.message.bot {
    align-self: flex-start;
    background: var(--chat-bot-bg);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-bottom-left-radius: 2px;
    color: var(--chat-text);
}

.message.user {
    align-self: flex-end;
    background: var(--chat-user-bg);
    color: white;
    border-bottom-right-radius: 2px;
    box-shadow: 0 4px 10px rgba(14, 165, 233, 0.2);
}

/* Typing Indicator */
.typing-indicator {
    padding: 8px 12px;
    background: var(--chat-bot-bg);
    align-self: flex-start;
    border-radius: 10px;
    display: none;
}

.typing-indicator.active {
    display: block;
}

.typing-dots span {
    display: inline-block;
    width: 5px;
    height: 5px;
    background: #aaa;
    border-radius: 50%;
    animation: typing 1.4s infinite ease-in-out both;
    margin: 0 2px;
}

.typing-dots span:nth-child(1) {
    animation-delay: -0.32s;
}

.typing-dots span:nth-child(2) {
    animation-delay: -0.16s;
}

@keyframes typing {

    0%,
    80%,
    100% {
        transform: scale(0);
    }

    40% {
        transform: scale(1);
    }
}

/* Input Area */
.chat-footer {
    padding: 15px;
    border-top: 1px solid var(--chat-border);
    background: rgba(0, 0, 0, 0.2);
}

.chat-input-group {
    display: flex;
    gap: 10px;
}

.chat-input {
    flex: 1;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    padding: 8px 15px;
    color: white;
    font-family: 'Inter', sans-serif;
    outline: none;
    transition: all 0.3s;
}

.chat-input:focus {
    border-color: var(--chat-primary);
    background: rgba(255, 255, 255, 0.1);
}

.btn-send {
    background: transparent;
    border: none;
    color: var(--chat-primary);
    font-size: 1.2rem;
    cursor: pointer;
    transition: transform 0.2s;
}

.btn-send:hover {
    transform: scale(1.1);
    color: white;
}

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