.ai-widget {
    position: fixed;
    bottom: 25px;
    right: 25px;
    z-index: 99999;
    font-family: 'Plus Jakarta Sans', sans-serif;
}

.ai-trigger-btn {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, #a855f7, #6366f1);
    border: none;
    border-radius: 50%;
    color: #ffffff;
    font-size: 24px;
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(168, 85, 247, 0.4);
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.ai-trigger-btn:hover {
    transform: scale(1.08) rotate(10deg);
}

.ai-panel {
    position: absolute;
    bottom: 75px;
    right: 0;
    width: 360px;
    background-color: #121016;
    border: 1px solid rgba(168, 85, 247, 0.25);
    border-radius: 20px;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.6);
    overflow: hidden;
    transition: all 0.3s ease;
}

.ai-panel.hidden {
    display: none;
}

.ai-panel-header {
    background: #1e1b29;
    padding: 16px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(168, 85, 247, 0.15);
}

.ai-panel-header h3 {
    margin: 0;
    font-size: 16px;
    color: #f3e8ff;
    font-weight: 600;
}

#ai-close-btn {
    background: none;
    border: none;
    color: #c084fc;
    font-size: 26px;
    cursor: pointer;
}

.ai-response-box {
    padding: 22px;
    max-height: 280px;
    overflow-y: auto;
    font-size: 14.5px;
    color: #ffffff;
    line-height: 1.6;
    background-color: #121016;
}

.chat-message {
    margin-bottom: 12px;
    white-space: pre-wrap;
    word-break: break-word;
}

.chat-message.user {
    color: #ffffff;
    background: rgba(168, 85, 247, 0.22);
    border: 1px solid rgba(168, 85, 247, 0.35);
    border-radius: 14px 14px 4px 14px;
    padding: 10px 12px;
    margin-left: 28px;
}

.chat-message.assistant {
    color: #f3e8ff;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 14px 14px 14px 4px;
    padding: 10px 12px;
    margin-right: 28px;
}

.ai-panel-controls {
    padding: 15px;
    background: #1e1b29;
    border-top: 1px solid rgba(168, 85, 247, 0.1);
}

.ai-input-group {
    display: flex;
    gap: 8px;
    align-items: center;
    margin-bottom: 8px;
}

#chat-input {
    flex: 1;
    min-width: 0;
    background-color: #121016;
    border: 1px solid #a855f7;
    border-radius: 20px;
    padding: 12px 15px;
    color: #ffffff;
    font-size: 14px;
    outline: none;
    transition: all 0.3s ease;
}

#chat-input:focus {
    box-shadow: 0 0 10px rgba(168, 85, 247, 0.3);
}

#chat-input::placeholder {
    color: #9ca3af;
}

.ai-action-btn {
    width: 45px;
    height: 45px;
    background-color: #2e2a3f;
    border: 2px solid #a855f7;
    border-radius: 50%;
    color: #e9d5ff;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-shrink: 0;
}

.ai-action-btn:hover {
    background-color: #a855f7;
    color: #ffffff;
    box-shadow: 0 0 15px rgba(168, 85, 247, 0.5);
}

.ai-mic-btn.listening,
.ai-mic-btn.recording {
    background-color: #ef4444;
    border-color: #ef4444;
    color: #ffffff;
    animation: ai-pulse-purple 1.5s infinite;
}

#ai-status-text {
    text-align: center;
    margin: 10px 0 0 0;
    font-size: 12px;
    color: #c084fc;
    font-weight: 500;
}

@keyframes ai-pulse-purple {
    0% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.7); }
    70% { box-shadow: 0 0 0 12px rgba(239, 68, 68, 0); }
    100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0); }
}

@media (max-width: 480px) {
    .ai-widget {
        bottom: 15px;
        right: 15px;
    }

    .ai-panel {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        width: 100%;
        height: 80vh;
        border-radius: 24px 24px 0 0;
        border: none;
        border-top: 2px solid #a855f7;
    }

    .ai-response-box {
        height: calc(100% - 140px);
        max-height: none;
    }
}