.ai-assistant-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    font-family: 'Press Start 2P', monospace;
    image-rendering: pixelated;
}

.ai-assistant-avatar {
    width: 64px;
    height: 64px;
    cursor: pointer;
    margin-top: 10px;
    background: url('/static/images/quintus-8bit.svg') no-repeat center center;
    background-size: contain;
    filter: drop-shadow(0 0 5px rgba(74, 144, 226, 0.5));
    animation: float 4s ease-in-out infinite;
    transform-origin: center center;
    transition: filter 0.3s ease;
    image-rendering: pixelated;
}

.ai-assistant-avatar:hover {
    animation: pixel-spin 0.8s steps(8) 1;
    filter: drop-shadow(0 0 10px rgba(74, 144, 226, 0.8));
}

.ai-assistant-avatar.active {
    animation: float 2s ease-in-out infinite;
}

.ai-assistant-chatbox {
    width: 320px;
    max-height: 450px;
    background: #1a1a1a;
    border: 4px solid #4a90e2;
    box-shadow: 8px 8px 0 rgba(0, 0, 0, 0.3);
    margin-bottom: 10px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transform-origin: bottom right;
    animation: popup 0.3s steps(3);
}

@keyframes popup {
    0% { transform: scale(0); }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); }
}

.ai-assistant-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px;
    background: #4a90e2;
    border-bottom: 4px solid #357abd;
}

.controls-title {
    color: #fff;
    font-size: 12px;
    text-shadow: 2px 2px #357abd;
}

.controls-buttons {
    display: flex;
    gap: 4px;
}

.ai-assistant-minimize,
.ai-assistant-close {
    width: 24px;
    height: 24px;
    border: 2px solid #357abd;
    background: #1a1a1a;
    color: #4a90e2;
    font-size: 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s steps(2);
}

.ai-assistant-minimize:hover,
.ai-assistant-close:hover {
    background: #4a90e2;
    color: #1a1a1a;
    transform: translate(-2px, -2px);
    box-shadow: 2px 2px 0 #357abd;
}

.ai-assistant-messages {
    flex-grow: 1;
    overflow-y: auto;
    padding: 15px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    background: #1a1a1a;
    font-size: 12px;
    line-height: 1.6;
}

.ai-assistant-message {
    max-width: 85%;
    padding: 12px;
    border: 2px solid #4a90e2;
    position: relative;
    animation: message-pop 0.3s steps(3);
}

@keyframes message-pop {
    0% { transform: scale(0.8); opacity: 0; }
    100% { transform: scale(1); opacity: 1; }
}

.user-message {
    align-self: flex-end;
    background: #2a2a2a;
    color: #fff;
    border-color: #357abd;
}

.assistant-message {
    align-self: flex-start;
    background: #2a2a2a;
    color: #fff;
    padding-left: 40px;
}

.assistant-message::before {
    content: '';
    position: absolute;
    left: 5px;
    top: 50%;
    transform: translateY(-50%);
    width: 25px;
    height: 25px;
    background: url('/static/images/quintus-8bit.svg') no-repeat center center;
    background-size: contain;
    animation: float 2s ease-in-out infinite;
}

.thinking.assistant-message {
    color: #4a90e2;
    border-style: dashed;
    animation: blink 1s steps(2) infinite;
}

.ai-assistant-input-area {
    display: flex;
    padding: 12px;
    background: #2a2a2a;
    border-top: 4px solid #4a90e2;
}

.ai-assistant-input {
    flex-grow: 1;
    padding: 8px 12px;
    border: 2px solid #4a90e2;
    background: #1a1a1a;
    color: #fff;
    font-family: 'Press Start 2P', monospace;
    font-size: 12px;
    margin-right: 8px;
    outline: none;
    transition: all 0.2s steps(2);
}

.ai-assistant-input:focus {
    transform: translate(-2px, -2px);
    box-shadow: 2px 2px 0 #357abd;
}

.ai-assistant-send {
    width: 36px;
    height: 36px;
    background: #4a90e2;
    border: none;
    color: #fff;
    font-size: 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s steps(2);
}

.ai-assistant-send:hover {
    transform: translate(-2px, -2px);
    box-shadow: 2px 2px 0 #357abd;
    background: #357abd;
}

.ai-assistant-bubble {
    position: relative;
    background: #1a1a1a;
    border: 2px solid #4a90e2;
    color: #fff;
    padding: 12px;
    margin-bottom: 10px;
    max-width: 200px;
    font-size: 12px;
    line-height: 1.4;
    animation: bubble-pop 0.3s steps(3);
}

@keyframes bubble-pop {
    0% { transform: scale(0) translateY(20px); opacity: 0; }
    100% { transform: scale(1) translateY(0); opacity: 1; }
}

.ai-assistant-bubble::after {
    content: '';
    position: absolute;
    bottom: -10px;
    right: 20px;
    border-width: 10px 10px 0;
    border-style: solid;
    border-color: #4a90e2 transparent transparent;
}

/* Custom scrollbar */
.ai-assistant-messages::-webkit-scrollbar {
    width: 8px;
    background: #1a1a1a;
}

.ai-assistant-messages::-webkit-scrollbar-track {
    background: #2a2a2a;
    border: 2px solid #4a90e2;
}

.ai-assistant-messages::-webkit-scrollbar-thumb {
    background: #4a90e2;
    border: 2px solid #357abd;
    border-radius: 4px;
}

.ai-assistant-messages::-webkit-scrollbar-thumb:hover {
    background: #357abd;
}

/* Message emphasis styling */
.ai-assistant-message em {
    font-style: italic;
    color: #4a90e2;
}

@keyframes float {
    0%, 100% { transform: translateY(0) rotate(0); }
    25% { transform: translateY(-5px) rotate(-5deg); }
    75% { transform: translateY(-5px) rotate(5deg); }
}

@keyframes pixel-spin {
    0% { transform: rotate(0deg) scale(1); }
    50% { transform: rotate(180deg) scale(1.1); }
    100% { transform: rotate(360deg) scale(1); }
}

@keyframes blink {
    0%, 89%, 100% { opacity: 1; }
    90%, 99% { opacity: 0; }
}
