@property --rotation {
    syntax: '<angle>';
    inherits: false;
    initial-value: 0deg;
}

:root {
    --nc-accent-1: #4285f4;
    --nc-accent-2: #9b72cb;
    --nc-accent-3: #d96570;
    --nc-accent-4: #4285f4;
    --nc-bg: rgba(10, 10, 15, 0.95);
    --nc-border: rgba(255, 255, 255, 0.1);
}

/* Floating AI Bubble */
.neural-core-trigger {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    cursor: pointer;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.neural-core-trigger:hover {
    transform: scale(1.1);
}

.neural-core-trigger .glow {
    position: absolute;
    inset: -5px;
    border-radius: 50%;
    background: conic-gradient(from var(--rotation),
            var(--nc-accent-1),
            var(--nc-accent-2),
            var(--nc-accent-3),
            var(--nc-accent-4));
    filter: blur(12px);
    animation: nc-rotate 4s linear infinite;
    opacity: 0.8;
}

.neural-core-trigger .inner {
    position: relative;
    width: 100%;
    height: 100%;
    background: var(--nc-bg);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--nc-border);
    box-shadow: inset 0 0 10px rgba(0, 255, 255, 0.1);
    overflow: hidden;
}

.neural-core-trigger .inner svg {
    width: 30px;
    height: 30px;
    fill: white;
    z-index: 2;
}

/* Chat Container */
.neural-chat {
    position: fixed;
    bottom: 100px;
    right: 30px;
    width: 380px;
    height: 500px;
    background: var(--nc-bg);
    border: 1px solid var(--nc-border);
    border-radius: 12px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.6), 0 0 20px rgba(66, 133, 244, 0.1);
    backdrop-filter: blur(20px);
    transform: translateY(20px);
    opacity: 0;
    pointer-events: none;
    transition: all 0.4s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.neural-chat.active {
    transform: translateY(0);
    opacity: 1;
    pointer-events: all;
}

.chat-header {
    padding: 15px 20px;
    background: rgba(255, 255, 255, 0.03);
    border-bottom: 1px solid var(--nc-border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.chat-header h3 {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.75rem;
    letter-spacing: 2px;
    color: var(--nc-accent-1);
}

.chat-messages {
    flex-grow: 1;
    padding: 20px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 15px;
    font-family: 'Inter', sans-serif;
    font-size: 0.9rem;
}

.msg {
    padding: 10px 15px;
    border-radius: 8px;
    max-width: 85%;
    line-height: 1.4;
}

.msg-ai {
    background: rgba(255, 255, 255, 0.05);
    align-self: flex-start;
    border-bottom-left-radius: 2px;
    border: 1px solid rgba(66, 133, 244, 0.2);
}

.msg-user {
    background: var(--nc-accent-1);
    color: white;
    align-self: flex-end;
    border-bottom-right-radius: 2px;
    box-shadow: 0 4px 15px rgba(66, 133, 244, 0.3);
}

.msg-ai strong {
    color: var(--nc-accent-1);
}

.msg-ai code {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.85rem;
}

/* Loading State */
.msg-loading {
    display: flex;
    gap: 4px;
    padding: 10px 15px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    align-self: flex-start;
}

.dot-pulse {
    width: 6px;
    height: 6px;
    background: var(--nc-accent-1);
    border-radius: 50%;
    animation: dot-pulse 1.5s infinite ease-in-out;
}

.dot-pulse:nth-child(2) {
    animation-delay: 0.2s;
}

.dot-pulse:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes dot-pulse {

    0%,
    100% {
        opacity: 0.3;
        transform: scale(0.8);
    }

    50% {
        opacity: 1;
        transform: scale(1.2);
    }
}

.chat-input-area {
    padding: 15px;
    border-top: 1px solid var(--nc-border);
    display: flex;
    gap: 10px;
}

.chat-input {
    flex-grow: 1;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--nc-border);
    border-radius: 20px;
    padding: 8px 15px;
    color: white;
    outline: none;
    font-family: inherit;
}

.chat-input:focus {
    border-color: var(--nc-accent-1);
}

@keyframes nc-rotate {
    from {
        --rotation: 0deg;
    }

    to {
        --rotation: 360deg;
    }
}

/* Scrollbar */
.chat-messages::-webkit-scrollbar {
    width: 4px;
}

.chat-messages::-webkit-scrollbar-track {
    background: transparent;
}

.chat-messages::-webkit-scrollbar-thumb {
    background: var(--nc-border);
    border-radius: 10px;
}

/* Fullscreen Mode */
.neural-chat.fullscreen {
    width: 90vw;
    height: 90vh;
    bottom: 5vh;
    right: 5vw;
    border-radius: 20px;
    z-index: 10000;
}

@media (max-width: 600px) {
    .neural-chat.fullscreen {
        width: 100vw;
        height: 100vh;
        bottom: 0;
        right: 0;
        border-radius: 0;
    }
}