:root {
    --chat-bg: #0a0a0a;
    --chat-header-bg: rgba(20, 20, 20, 0.95);
    --chat-border: rgba(245, 158, 11, 0.3);
    --chat-primary: #f59e0b;
    --chat-text: #e0e0e0;
    --chat-user-msg: #f59e0b;
    --chat-bot-msg: #262626;
}
.chat-toggle-btn {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 60px;
    height: 60px;
    background: var(--chat-primary);
    border-radius: 50%;
    box-shadow: 0 4px 20px rgba(245, 158, 11, 0.4);
    border: none;
    cursor: pointer;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
.chat-toggle-btn:hover {
    transform: scale(1.1);
}
.chat-toggle-btn svg {
    width: 30px;
    height: 30px;
    color: #000;
    fill: currentColor;
}
.chat-window {
    position: fixed;
    bottom: 7rem;
    right: 2rem;
    width: 380px;
    height: 500px;
    max-height: 70vh;
    background: var(--chat-bg);
    border: 1px solid var(--chat-border);
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    z-index: 1001;
    opacity: 0;
    transform: translateY(20px) scale(0.95);
    pointer-events: none;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    backdrop-filter: blur(10px);
}
.chat-window.active {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: all;
}
.chat-header {
    background: var(--chat-header-bg);
    padding: 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}
.chat-title {
    font-family: 'Orbitron', sans-serif;
    color: #fff;
    font-size: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.chat-status {
    width: 8px;
    height: 8px;
    background: #10b981;
    border-radius: 50%;
    box-shadow: 0 0 8px #10b981;
}
.chat-close {
    background: transparent;
    border: none;
    color: #888;
    cursor: pointer;
    padding: 0.25rem;
}
.chat-close:hover {
    color: #fff;
}
.chat-messages {
    flex: 1;
    padding: 1rem;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    scroll-behavior: smooth;
}
.message {
    max-width: 80%;
    padding: 0.8rem 1rem;
    border-radius: 12px;
    font-size: 0.9rem;
    line-height: 1.5;
    position: relative;
    animation: messageSlide 0.3s ease-out;
}
@keyframes messageSlide {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}
.message.bot {
    align-self: flex-start;
    background: var(--chat-bot-msg);
    color: #ddd;
    border-bottom-left-radius: 2px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}
.message.user {
    align-self: flex-end;
    background: var(--chat-user-msg);
    color: #000;
    border-bottom-right-radius: 2px;
    font-weight: 500;
}
.chat-input-area {
    padding: 1rem;
    background: rgba(255, 255, 255, 0.02);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    gap: 0.5rem;
}
.chat-input {
    flex: 1;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    padding: 0.6rem 1rem;
    color: #fff;
    font-family: inherit;
    font-size: 0.9rem;
    outline: none;
    transition: border-color 0.2s;
}
.chat-input:focus {
    border-color: var(--chat-primary);
}
.chat-send {
    background: var(--chat-primary);
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #000;
    transition: all 0.2s;
}
.chat-send:active {
    transform: scale(0.95);
}
.typing-indicator {
    display: flex;
    gap: 4px;
    padding: 0.5rem 0.8rem;
    background: var(--chat-bot-msg);
    border-radius: 12px;
    width: fit-content;
    border-bottom-left-radius: 2px;
}
.dot {
    width: 6px;
    height: 6px;
    background: #888;
    border-radius: 50%;
    animation: bounce 1.4s infinite ease-in-out both;
}
.dot:nth-child(1) {
    animation-delay: -0.32s;
}
.dot:nth-child(2) {
    animation-delay: -0.16s;
}
@keyframes bounce {
    0%,
    80%,
    100% {
        transform: scale(0);
    }
    40% {
        transform: scale(1);
    }
}
@media (max-width: 480px) {
    .chat-window {
        width: 100%;
        height: 100dvh;
        max-height: 100dvh;
        bottom: 0;
        right: 0;
        border-radius: 0;
        padding-bottom: env(safe-area-inset-bottom);
    }
}
.chat-notification {
    position: absolute;
    top: -5px;
    right: -5px;
    background: #ef4444;
    color: white;
    font-size: 11px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    border: 2px solid #fff;
    transform: scale(0);
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    z-index: 1002;
    pointer-events: none;
}
.chat-notification.show {
    transform: scale(1);
    animation: pulseBadge 2s infinite;
}
@keyframes pulseBadge {
    0% {
        box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.7);
    }
    70% {
        box-shadow: 0 0 0 6px rgba(239, 68, 68, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(239, 68, 68, 0);
    }
}