/* Neural Logic Assistant - Premium Styles */

#neural-assistant-widget {
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 9999;
    font-family: 'Inter', sans-serif;
}

/* Bubble Icon */
.assistant-bubble {
    width: 60px;
    height: 60px;
    background: #000;
    border: 1px solid var(--accent);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 0 20px var(--accent-glow);
    transition: all 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    position: relative;
}

.assistant-bubble:hover {
    transform: scale(1.1) rotate(5deg);
    box-shadow: 0 0 30px var(--accent-glow);
}

.assistant-bubble.hidden {
    opacity: 0;
    transform: scale(0) rotate(-45deg);
    pointer-events: none;
}

.bubble-ring {
    position: absolute;
    width: 75px;
    height: 75px;
    border: 1px solid var(--accent);
    border-radius: 50%;
    opacity: 0.2;
    animation: pulseRing 4s infinite linear;
}

@keyframes pulseRing {
    0% {
        transform: scale(0.8);
        opacity: 0.3;
    }

    50% {
        transform: scale(1.2);
        opacity: 0.1;
    }

    100% {
        transform: scale(0.8);
        opacity: 0.3;
    }
}

.assistant-bubble svg {
    color: var(--accent);
    filter: drop-shadow(0 0 8px var(--accent));
    transition: transform 0.3s ease;
}

.assistant-bubble:hover svg {
    transform: scale(1.1);
    filter: drop-shadow(0 0 12px var(--accent));
}

/* Tooltip Phrase */
.bubble-tooltip {
    position: absolute;
    right: 85px;
    background: rgba(10, 10, 10, 0.9);
    color: white;
    padding: 10px 18px;
    border-radius: 12px;
    font-size: 0.85rem;
    font-weight: 600;
    white-space: nowrap;
    border: 1px solid rgba(255, 102, 0, 0.3);
    backdrop-filter: blur(10px);
    pointer-events: none;
    opacity: 0;
    transform: translateX(10px);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

.assistant-bubble:hover .bubble-tooltip {
    opacity: 1;
    transform: translateX(0);
}

.bubble-tooltip::after {
    content: '';
    position: absolute;
    right: -6px;
    top: 50%;
    transform: translateY(-50%) rotate(45deg);
    width: 10px;
    height: 10px;
    background: rgba(10, 10, 10, 0.9);
    border-right: 1px solid rgba(255, 102, 0, 0.3);
    border-top: 1px solid rgba(255, 102, 0, 0.3);
}

/* Assistant Window */
.assistant-window {
    position: absolute;
    bottom: 0;
    right: 0;
    width: 400px;
    height: 650px;
    background: rgba(10, 10, 10, 0.85);
    backdrop-filter: blur(25px);
    -webkit-backdrop-filter: blur(25px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 28px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transform: translateY(30px) scale(0.95);
    opacity: 0;
    pointer-events: none;
    transition: all 0.6s cubic-bezier(0.23, 1, 0.32, 1);
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.8);
}

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

.assistant-header {
    padding: 25px;
    background: linear-gradient(to bottom, rgba(255, 102, 0, 0.08), transparent);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.assistant-header-title {
    display: flex;
    flex-direction: column;
}

.assistant-header-title .glitch-text {
    font-family: 'Planet Kosmos', sans-serif;
    color: var(--accent);
    font-size: 1.3rem;
    letter-spacing: 3px;
    text-transform: uppercase;
}

.assistant-header-title small {
    color: rgba(255, 255, 255, 0.4);
    font-size: 0.65rem;
    letter-spacing: 2px;
    margin-top: 4px;
    text-transform: uppercase;
    font-weight: 700;
}

.assistant-close {
    cursor: pointer;
    font-size: 2rem;
    color: rgba(255, 255, 255, 0.5);
    transition: all 0.3s;
    line-height: 1;
}

.assistant-close:hover {
    color: var(--accent);
    transform: rotate(90deg);
}

/* Chat History */
.assistant-messages {
    flex: 1;
    padding: 25px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 18px;
    scroll-behavior: smooth;
}

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

.assistant-messages::-webkit-scrollbar-track {
    background: transparent;
}

.assistant-messages::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
}

.message {
    max-width: 85%;
    padding: 14px 20px;
    border-radius: 20px;
    font-size: 0.95rem;
    line-height: 1.6;
    animation: messageFadeIn 0.4s cubic-bezier(0.23, 1, 0.32, 1) forwards;
}

@keyframes messageFadeIn {
    from {
        opacity: 0;
        transform: translateY(15px);
    }

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

.message.bot {
    align-self: flex-start;
    background: rgba(255, 255, 255, 0.04);
    color: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-bottom-left-radius: 4px;
}

.message.user {
    align-self: flex-end;
    background: var(--accent);
    color: #000;
    font-weight: 600;
    border-bottom-right-radius: 4px;
    box-shadow: 0 10px 20px var(--accent-glow);
}

.message ul {
    margin: 10px 0;
    padding-left: 15px;
    list-style: none;
}

.message li {
    position: relative;
    margin-bottom: 5px;
}

.message li::before {
    content: "•";
    color: var(--accent);
    position: absolute;
    left: -15px;
}

.assistant-link {
    display: inline-flex;
    align-items: center;
    background: rgba(255, 102, 0, 0.15);
    color: var(--accent);
    padding: 8px 16px;
    border-radius: 50px;
    text-decoration: none;
    margin-top: 12px;
    font-weight: 700;
    border: 1px solid var(--accent);
    font-size: 0.85rem;
    transition: all 0.3s;
}

.assistant-link:hover {
    background: var(--accent);
    color: #000;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px var(--accent-glow);
}

/* Typing Indicator */
.assistant-typing {
    padding: 0 25px 15px;
}

.typing-indicator {
    display: flex;
    gap: 5px;
    background: rgba(255, 255, 255, 0.03);
    padding: 10px 15px;
    width: fit-content;
    border-radius: 15px;
}

.typing-indicator span {
    width: 6px;
    height: 6px;
    background: var(--accent);
    border-radius: 50%;
    animation: typingBlink 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;
}

@keyframes typingBlink {

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

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

/* Input Area */
.assistant-input-container {
    padding: 25px;
    background: rgba(0, 0, 0, 0.3);
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    display: flex;
    gap: 15px;
    align-items: center;
}

#assistant-input {
    flex: 1;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 18px;
    padding: 12px 18px;
    color: white;
    outline: none;
    font-size: 0.95rem;
    transition: border-color 0.3s;
}

#assistant-input:focus {
    border-color: var(--accent);
}

.assistant-send-btn,
.assistant-mic-btn {
    background: rgba(255, 255, 255, 0.05);
    border: none;
    width: 45px;
    height: 45px;
    border-radius: 50%;
    color: rgba(255, 255, 255, 0.7);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
}

.assistant-send-btn:hover {
    background: var(--accent);
    color: #000;
    transform: scale(1.1);
}

.assistant-mic-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: white;
    transform: scale(1.1);
}

.assistant-mic-btn.recording {
    background: #ff3b30;
    color: white;
    box-shadow: 0 0 15px rgba(255, 59, 48, 0.5);
    animation: recordingPulse 1s infinite alternate;
}

@keyframes recordingPulse {
    from {
        transform: scale(1.1);
    }

    to {
        transform: scale(1);
    }
}

/* Responsive */
@media (max-width: 480px) {
    #neural-assistant-widget {
        bottom: 15px;
        right: 15px;
    }

    .assistant-window {
        width: calc(100vw - 30px);
        height: 75vh;
        border-radius: 20px;
        bottom: 60px;
    }

    .assistant-header {
        padding: 15px 20px;
    }

    .assistant-header-title .glitch-text {
        font-size: 1rem;
        letter-spacing: 2px;
    }

    .assistant-header-title small {
        font-size: 0.55rem;
    }

    .assistant-close {
        font-size: 1.5rem;
    }

    .assistant-input-container {
        padding: 10px;
        gap: 8px;
    }

    #assistant-input {
        padding: 10px 12px;
        font-size: 0.9rem;
        flex: 1;
        min-width: 0;
    }

    .assistant-bubble {
        width: 50px;
        height: 50px;
    }

    .bubble-ring {
        width: 60px;
        height: 60px;
    }

    .bubble-tooltip {
        display: none !important;
    }

    .assistant-bubble svg {
        width: 26px;
        height: 26px;
    }

    .assistant-send-btn,
    .assistant-mic-btn {
        width: 40px;
        height: 40px;
        min-width: 40px;
        flex-shrink: 0;
    }
}

/* Light theme */
html[data-theme="light"] .assistant-bubble {
    background: rgba(255, 255, 255, 0.9);
    box-shadow: 0 14px 34px rgba(58, 45, 31, 0.16), 0 0 20px var(--accent-glow);
}

html[data-theme="light"] .bubble-tooltip {
    background: rgba(255, 255, 255, 0.92);
    color: #171717;
    box-shadow: 0 10px 30px rgba(58, 45, 31, 0.14);
}

html[data-theme="light"] .bubble-tooltip::after {
    background: rgba(255, 255, 255, 0.92);
}

html[data-theme="light"] .assistant-window {
    background: rgba(250, 248, 244, 0.9);
    border-color: rgba(20, 20, 20, 0.12);
    box-shadow: 0 30px 60px rgba(58, 45, 31, 0.2);
}

html[data-theme="light"] .assistant-header {
    border-bottom-color: rgba(20, 20, 20, 0.08);
}

html[data-theme="light"] .assistant-header-title small,
html[data-theme="light"] .assistant-close {
    color: rgba(23, 23, 23, 0.52);
}

html[data-theme="light"] .assistant-messages::-webkit-scrollbar-thumb {
    background: rgba(20, 20, 20, 0.14);
}

html[data-theme="light"] .message.bot {
    background: rgba(20, 20, 20, 0.045);
    color: rgba(23, 23, 23, 0.88);
    border-color: rgba(20, 20, 20, 0.08);
}

html[data-theme="light"] .typing-indicator {
    background: rgba(20, 20, 20, 0.045);
}

html[data-theme="light"] .assistant-input-container {
    background: rgba(224, 216, 205, 0.46);
    border-top-color: rgba(20, 20, 20, 0.08);
}

html[data-theme="light"] #assistant-input {
    background: rgba(255, 255, 255, 0.68);
    border-color: rgba(20, 20, 20, 0.12);
    color: #171717;
}

html[data-theme="light"] #assistant-input::placeholder {
    color: rgba(23, 23, 23, 0.45);
}

html[data-theme="light"] .assistant-send-btn,
html[data-theme="light"] .assistant-mic-btn {
    background: rgba(20, 20, 20, 0.055);
    color: rgba(23, 23, 23, 0.72);
}

html[data-theme="light"] .assistant-mic-btn:hover {
    background: rgba(20, 20, 20, 0.1);
    color: #171717;
}
