.ai-assistant {
    position: fixed;
    bottom: 80px;
    right: -400px;
    width: 380px;
    height: 500px;
    background: linear-gradient(135deg, #1a1a1a 0%, #2a2a2a 100%);
    border: 2px solid #66d9ef;
    border-radius: 15px;
    transition: right 0.3s ease;
    display: flex;
    flex-direction: column;
    z-index: 1000;
    box-shadow: -5px 5px 30px rgba(0,0,0,0.3);
}

.ai-assistant.open {
    right: 20px;
}

.ai-toggle {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: linear-gradient(135deg, #66d9ef, #a6e22e);
    border: none;
    color: #0e0e0e;
    font-size: 1.5rem;
    cursor: pointer;
    z-index: 1000;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(102, 217, 239, 0.3);
}

.ai-toggle:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(102, 217, 239, 0.5);
}

.ai-toggle.open {
    background: #a6e22e;
}

.ai-chat-header {
    padding: 15px 20px;
    border-bottom: 2px solid #333;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.ai-chat-header h3 {
    margin: 0;
    color: #66d9ef;
    font-size: 1.2rem;
}

.ai-close {
    background: none;
    border: none;
    color: #666;
    font-size: 1.8rem;
    cursor: pointer;
    padding: 0;
    line-height: 1;
    transition: color 0.3s ease;
}

.ai-close:hover {
    color: #a6e22e;
}

.ai-chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.ai-message {
    max-width: 85%;
    margin-bottom: 10px;
}

.ai-message.user {
    align-self: flex-end;
}

.ai-message.assistant {
    align-self: flex-start;
}

.ai-message-content {
    padding: 12px 15px;
    border-radius: 15px;
    position: relative;
    line-height: 1.4;
    font-size: 0.95rem;
}

.ai-message.user .ai-message-content {
    background: #66d9ef;
    color: #0e0e0e;
    border-bottom-right-radius: 5px;
}

.ai-message.assistant .ai-message-content {
    background: #2a2a2a;
    color: #f0f0f0;
    border-bottom-left-radius: 5px;
}

.ai-message-icon {
    font-size: 1.2rem;
    margin-left: 8px;
    vertical-align: middle;
}

.ai-chat-input {
    padding: 15px;
    border-top: 2px solid #333;
    display: flex;
    gap: 10px;
}

.ai-chat-input textarea {
    flex: 1;
    background: #2a2a2a;
    border: none;
    border-radius: 8px;
    padding: 10px 15px;
    color: #f0f0f0;
    resize: none;
    max-height: 100px;
    font-family: inherit;
    font-size: 0.95rem;
    line-height: 1.4;
}

.ai-chat-input textarea:focus {
    outline: none;
    box-shadow: 0 0 0 2px rgba(102, 217, 239, 0.5);
}

.ai-send {
    background: #a6e22e;
    border: none;
    border-radius: 8px;
    color: #0e0e0e;
    padding: 0 20px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
}

.ai-send:hover {
    background: #8ac926;
    transform: translateY(-2px);
}

/* Typing indicator */
.typing-indicator {
    display: flex;
    gap: 4px;
    padding: 12px 15px;
    background: #2a2a2a;
    border-radius: 15px;
    border-bottom-left-radius: 5px;
}

.typing-indicator span {
    width: 8px;
    height: 8px;
    background: #66d9ef;
    border-radius: 50%;
    animation: typing 1s infinite;
}

.typing-indicator span:nth-child(2) { animation-delay: 0.2s; }
.typing-indicator span:nth-child(3) { animation-delay: 0.4s; }

@keyframes typing {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-4px); }
}

/* Code formatting in messages */
.ai-message-text code {
    background: rgba(102, 217, 239, 0.1);
    padding: 2px 6px;
    border-radius: 4px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.9em;
}

.ai-message-text a {
    color: #66d9ef;
    text-decoration: none;
}

.ai-message-text a:hover {
    text-decoration: underline;
}

/* Scrollbar styling */
.ai-chat-messages::-webkit-scrollbar {
    width: 6px;
}

.ai-chat-messages::-webkit-scrollbar-track {
    background: #1a1a1a;
}

.ai-chat-messages::-webkit-scrollbar-thumb {
    background: #333;
    border-radius: 3px;
}

.ai-chat-messages::-webkit-scrollbar-thumb:hover {
    background: #444;
}

/* Mobile responsiveness */
@media (max-width: 768px) {
    .ai-assistant {
        width: calc(100% - 40px);
        height: 60vh;
        bottom: -100vh;
        right: 20px;
        transition: bottom 0.3s ease;
    }
    
    .ai-assistant.open {
        bottom: 80px;
        right: 20px;
    }
}
